From b9590eab931f5488bfb4c5d0e5d06701db0bd520 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Thu, 8 Oct 2009 17:54:24 +0200 Subject: src: make symbols used only in file scope static Signed-off-by: Hannes Eder Signed-off-by: Pablo Neira Ayuso --- src/conntrack/build.c | 92 ++++++++++++++++++++-------------------- src/conntrack/objopt.c | 4 +- src/conntrack/snprintf_default.c | 58 +++++++++++++------------ 3 files changed, 78 insertions(+), 76 deletions(-) (limited to 'src/conntrack') diff --git a/src/conntrack/build.c b/src/conntrack/build.c index 623774f..91eca7d 100644 --- a/src/conntrack/build.c +++ b/src/conntrack/build.c @@ -7,9 +7,9 @@ #include "internal/internal.h" -void __build_tuple_ip(struct nfnlhdr *req, - size_t size, - const struct __nfct_tuple *t) +static void __build_tuple_ip(struct nfnlhdr *req, + size_t size, + const struct __nfct_tuple *t) { struct nfattr *nest; @@ -35,9 +35,9 @@ void __build_tuple_ip(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_tuple_proto(struct nfnlhdr *req, - size_t size, - const struct __nfct_tuple *t) +static void __build_tuple_proto(struct nfnlhdr *req, + size_t size, + const struct __nfct_tuple *t) { struct nfattr *nest; @@ -214,10 +214,10 @@ __build_nat_seq_adj(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_protonat(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct, - const struct __nfct_nat *nat) +static void __build_protonat(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct, + const struct __nfct_nat *nat) { struct nfattr *nest; @@ -235,17 +235,17 @@ void __build_protonat(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_nat(struct nfnlhdr *req, - size_t size, - const struct __nfct_nat *nat) +static void __build_nat(struct nfnlhdr *req, + size_t size, + const struct __nfct_nat *nat) { nfnl_addattr_l(&req->nlh, size, CTA_NAT_MINIP, &nat->min_ip, sizeof(u_int32_t)); } -void __build_snat(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_snat(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -255,9 +255,9 @@ void __build_snat(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_snat_ipv4(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_snat_ipv4(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -266,9 +266,9 @@ void __build_snat_ipv4(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_snat_port(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_snat_port(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -277,9 +277,9 @@ void __build_snat_port(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_dnat(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_dnat(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -289,9 +289,9 @@ void __build_dnat(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_dnat_ipv4(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_dnat_ipv4(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -300,9 +300,9 @@ void __build_dnat_ipv4(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_dnat_port(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_dnat_port(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; @@ -311,38 +311,38 @@ void __build_dnat_port(struct nfnlhdr *req, nfnl_nest_end(&req->nlh, nest); } -void __build_status(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_status(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { nfnl_addattr32(&req->nlh, size, CTA_STATUS, htonl(ct->status | IPS_CONFIRMED)); } -void __build_timeout(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_timeout(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { nfnl_addattr32(&req->nlh, size, CTA_TIMEOUT, htonl(ct->timeout)); } -void __build_mark(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_mark(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { nfnl_addattr32(&req->nlh, size, CTA_MARK, htonl(ct->mark)); } -void __build_secmark(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_secmark(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { nfnl_addattr32(&req->nlh, size, CTA_SECMARK, htonl(ct->secmark)); } -void __build_helper_name(struct nfnlhdr *req, - size_t size, - const struct nf_conntrack *ct) +static void __build_helper_name(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) { struct nfattr *nest; diff --git a/src/conntrack/objopt.c b/src/conntrack/objopt.c index d678f2d..4b36817 100644 --- a/src/conntrack/objopt.c +++ b/src/conntrack/objopt.c @@ -72,7 +72,7 @@ static void setobjopt_setup_repl(struct nf_conntrack *ct) __autocomplete(ct, __DIR_REPL); } -setobjopt setobjopt_array[__NFCT_SOPT_MAX] = { +static const setobjopt setobjopt_array[__NFCT_SOPT_MAX] = { [NFCT_SOPT_UNDO_SNAT] = setobjopt_undo_snat, [NFCT_SOPT_UNDO_DNAT] = setobjopt_undo_dnat, [NFCT_SOPT_UNDO_SPAT] = setobjopt_undo_spat, @@ -122,7 +122,7 @@ static int getobjopt_is_dpat(const struct nf_conntrack *ct) ct->tuple[__DIR_ORIG].l4dst.tcp.port); } -getobjopt getobjopt_array[__NFCT_GOPT_MAX] = { +static const getobjopt getobjopt_array[__NFCT_GOPT_MAX] = { [NFCT_GOPT_IS_SNAT] = getobjopt_is_snat, [NFCT_GOPT_IS_DNAT] = getobjopt_is_dnat, [NFCT_GOPT_IS_SPAT] = getobjopt_is_spat, diff --git a/src/conntrack/snprintf_default.c b/src/conntrack/snprintf_default.c index 6749738..c89cce5 100644 --- a/src/conntrack/snprintf_default.c +++ b/src/conntrack/snprintf_default.c @@ -27,34 +27,36 @@ int __snprintf_protocol(char *buf, ct->tuple[__DIR_ORIG].protonum)); } -int __snprintf_timeout(char *buf, - unsigned int len, - const struct nf_conntrack *ct) +static int __snprintf_timeout(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { return snprintf(buf, len, "%u ", ct->timeout); } -int __snprintf_protoinfo(char *buf, - unsigned int len, - const struct nf_conntrack *ct) +static int __snprintf_protoinfo(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { return snprintf(buf, len, "%s ", ct->protoinfo.tcp.state < TCP_CONNTRACK_MAX ? states[ct->protoinfo.tcp.state] : states[TCP_CONNTRACK_NONE]); } -int __snprintf_protoinfo_sctp(char *buf, - unsigned int len, - const struct nf_conntrack *ct) + +static int __snprintf_protoinfo_sctp(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { return snprintf(buf, len, "%s ", ct->protoinfo.sctp.state < SCTP_CONNTRACK_MAX ? sctp_states[ct->protoinfo.sctp.state] : sctp_states[SCTP_CONNTRACK_NONE]); } -int __snprintf_protoinfo_dccp(char *buf, - unsigned int len, - const struct nf_conntrack *ct) + +static int __snprintf_protoinfo_dccp(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { return snprintf(buf, len, "%s ", ct->protoinfo.dccp.state < DCCP_CONNTRACK_MAX ? @@ -62,9 +64,9 @@ int __snprintf_protoinfo_dccp(char *buf, sctp_states[DCCP_CONNTRACK_NONE]); } -int __snprintf_address_ipv4(char *buf, - unsigned int len, - const struct __nfct_tuple *tuple) +static int __snprintf_address_ipv4(char *buf, + unsigned int len, + const struct __nfct_tuple *tuple) { int ret, size = 0, offset = 0; struct in_addr src = { .s_addr = tuple->src.v4 }; @@ -79,9 +81,9 @@ int __snprintf_address_ipv4(char *buf, return size; } -int __snprintf_address_ipv6(char *buf, - unsigned int len, - const struct __nfct_tuple *tuple) +static int __snprintf_address_ipv6(char *buf, + unsigned int len, + const struct __nfct_tuple *tuple) { int ret, size = 0, offset = 0; struct in6_addr src; @@ -159,9 +161,9 @@ int __snprintf_proto(char *buf, return size; } -int __snprintf_status_assured(char *buf, - unsigned int len, - const struct nf_conntrack *ct) +static int __snprintf_status_assured(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { int size = 0; @@ -171,9 +173,9 @@ int __snprintf_status_assured(char *buf, return size; } -int __snprintf_status_not_seen_reply(char *buf, - unsigned int len, - const struct nf_conntrack *ct) +static int __snprintf_status_not_seen_reply(char *buf, + unsigned int len, + const struct nf_conntrack *ct) { int size = 0; @@ -183,10 +185,10 @@ int __snprintf_status_not_seen_reply(char *buf, return size; } -int __snprintf_counters(char *buf, - unsigned int len, - const struct nf_conntrack *ct, - int dir) +static int __snprintf_counters(char *buf, + unsigned int len, + const struct nf_conntrack *ct, + int dir) { return (snprintf(buf, len, "packets=%llu bytes=%llu ", (unsigned long long) ct->counters[dir].packets, -- cgit v1.2.3