From e5cb42249f7fd5b730667150c9c19f10d2f215fd Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 25 Jul 2008 13:05:12 +0200 Subject: cleanup: split internal.h into several internal header files This patch cleanups the internal headers by splitting them into several logical pieces. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/api.c | 2 +- src/conntrack/bsf.c | 2 +- src/conntrack/build.c | 2 +- src/conntrack/callback.c | 2 +- src/conntrack/compare.c | 2 +- src/conntrack/copy.c | 2 +- src/conntrack/filter.c | 9 ++++++++- src/conntrack/getter.c | 2 +- src/conntrack/objopt.c | 2 +- src/conntrack/parse.c | 2 +- src/conntrack/setter.c | 2 +- src/conntrack/snprintf.c | 2 +- src/conntrack/snprintf_default.c | 2 +- src/conntrack/snprintf_xml.c | 2 +- src/deprecated.c | 7 ++----- src/deprecated/extensions/libnetfilter_conntrack_icmp.c | 3 ++- src/deprecated/extensions/libnetfilter_conntrack_sctp.c | 3 ++- src/deprecated/extensions/libnetfilter_conntrack_tcp.c | 3 ++- src/deprecated/extensions/libnetfilter_conntrack_udp.c | 3 ++- src/deprecated/l3extensions/libnetfilter_conntrack_ipv4.c | 3 ++- src/deprecated/l3extensions/libnetfilter_conntrack_ipv6.c | 3 ++- src/expect/api.c | 2 +- src/expect/build.c | 2 +- src/expect/callback.c | 2 +- src/expect/getter.c | 2 +- src/expect/parse.c | 2 +- src/expect/setter.c | 2 +- src/expect/snprintf.c | 2 +- src/expect/snprintf_default.c | 2 +- src/main.c | 2 +- 30 files changed, 44 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/conntrack/api.c b/src/conntrack/api.c index fcd3fb4..ff8b11f 100644 --- a/src/conntrack/api.c +++ b/src/conntrack/api.c @@ -10,7 +10,7 @@ #include #include -#include "internal.h" +#include "internal/internal.h" /** * nfct_conntrack_new - allocate a new conntrack diff --git a/src/conntrack/bsf.c b/src/conntrack/bsf.c index cd9e883..0d20949 100644 --- a/src/conntrack/bsf.c +++ b/src/conntrack/bsf.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" #include #ifndef SKF_AD_NLATTR diff --git a/src/conntrack/build.c b/src/conntrack/build.c index f11af42..1bc87f9 100644 --- a/src/conntrack/build.c +++ b/src/conntrack/build.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" void __build_tuple_ip(struct nfnlhdr *req, size_t size, diff --git a/src/conntrack/callback.c b/src/conntrack/callback.c index 582dfc4..7faf13a 100644 --- a/src/conntrack/callback.c +++ b/src/conntrack/callback.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" int __callback(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data) { diff --git a/src/conntrack/compare.c b/src/conntrack/compare.c index b57414b..3dd9e5b 100644 --- a/src/conntrack/compare.c +++ b/src/conntrack/compare.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static int cmp_orig(const struct nf_conntrack *ct1, const struct nf_conntrack *ct2) diff --git a/src/conntrack/copy.c b/src/conntrack/copy.c index 562f801..92866fb 100644 --- a/src/conntrack/copy.c +++ b/src/conntrack/copy.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static void copy_attr_orig_ipv4_src(struct nf_conntrack *dest, const struct nf_conntrack *orig) diff --git a/src/conntrack/filter.c b/src/conntrack/filter.c index 5ea7d5e..952cbba 100644 --- a/src/conntrack/filter.c +++ b/src/conntrack/filter.c @@ -1,4 +1,11 @@ -#include "internal.h" +/* + * (C) 2008 by Pablo Neira Ayuso + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#include "internal/internal.h" static void filter_attr_l4proto(struct nfct_filter *filter, const void *value) { diff --git a/src/conntrack/getter.c b/src/conntrack/getter.c index 8591f88..20a2a35 100644 --- a/src/conntrack/getter.c +++ b/src/conntrack/getter.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static const void *get_attr_orig_ipv4_src(const struct nf_conntrack *ct) { diff --git a/src/conntrack/objopt.c b/src/conntrack/objopt.c index f5692f4..709bd2f 100644 --- a/src/conntrack/objopt.c +++ b/src/conntrack/objopt.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static void __autocomplete(struct nf_conntrack *ct, int dir) { diff --git a/src/conntrack/parse.c b/src/conntrack/parse.c index 7b6c0c5..11cf5ff 100644 --- a/src/conntrack/parse.c +++ b/src/conntrack/parse.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static void __parse_ip(const struct nfattr *attr, struct __nfct_tuple *tuple, diff --git a/src/conntrack/setter.c b/src/conntrack/setter.c index 6ceab46..6759652 100644 --- a/src/conntrack/setter.c +++ b/src/conntrack/setter.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" #include #include diff --git a/src/conntrack/snprintf.c b/src/conntrack/snprintf.c index bcaf2db..cc68293 100644 --- a/src/conntrack/snprintf.c +++ b/src/conntrack/snprintf.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" int __snprintf_conntrack(char *buf, unsigned int len, diff --git a/src/conntrack/snprintf_default.c b/src/conntrack/snprintf_default.c index e89f2f5..7cf28f8 100644 --- a/src/conntrack/snprintf_default.c +++ b/src/conntrack/snprintf_default.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static char *proto2str[IPPROTO_MAX] = { [IPPROTO_TCP] = "tcp", diff --git a/src/conntrack/snprintf_xml.c b/src/conntrack/snprintf_xml.c index bb9bdef..9cd49cf 100644 --- a/src/conntrack/snprintf_xml.c +++ b/src/conntrack/snprintf_xml.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" /* * XML output sample: diff --git a/src/deprecated.c b/src/deprecated.c index 63a5699..84de04b 100644 --- a/src/deprecated.c +++ b/src/deprecated.c @@ -17,17 +17,14 @@ #include #include #include -#include "linux_list.h" #include #include -#include -#include -#include "internal.h" +#include "internal/linux_list.h" +#include "internal/internal.h" #define NFCT_BUFSIZE 4096 -static char *lib_dir = LIBNETFILTER_CONNTRACK_DIR; static LIST_HEAD(proto_list); static LIST_HEAD(l3proto_list); static char *proto2str[IPPROTO_MAX] = { diff --git a/src/deprecated/extensions/libnetfilter_conntrack_icmp.c b/src/deprecated/extensions/libnetfilter_conntrack_icmp.c index ae8470a..d15d7a1 100644 --- a/src/deprecated/extensions/libnetfilter_conntrack_icmp.c +++ b/src/deprecated/extensions/libnetfilter_conntrack_icmp.c @@ -14,9 +14,10 @@ #include /* For htons */ #include #include -#include #include +#include "internal/deprecated.h" + static void parse_proto(struct nfattr *cda[], struct nfct_tuple *tuple) { if (cda[CTA_PROTO_ICMP_TYPE-1]) diff --git a/src/deprecated/extensions/libnetfilter_conntrack_sctp.c b/src/deprecated/extensions/libnetfilter_conntrack_sctp.c index 6225ca1..1fa63a5 100644 --- a/src/deprecated/extensions/libnetfilter_conntrack_sctp.c +++ b/src/deprecated/extensions/libnetfilter_conntrack_sctp.c @@ -14,9 +14,10 @@ #include /* For htons */ #include #include -#include #include +#include "internal/deprecated.h" + static void parse_proto(struct nfattr *cda[], struct nfct_tuple *tuple) { if (cda[CTA_PROTO_SRC_PORT-1]) diff --git a/src/deprecated/extensions/libnetfilter_conntrack_tcp.c b/src/deprecated/extensions/libnetfilter_conntrack_tcp.c index a7ce2ce..60447fe 100644 --- a/src/deprecated/extensions/libnetfilter_conntrack_tcp.c +++ b/src/deprecated/extensions/libnetfilter_conntrack_tcp.c @@ -14,9 +14,10 @@ #include /* For htons */ #include #include -#include #include +#include "internal/deprecated.h" + static const char *states[] = { "NONE", "SYN_SENT", diff --git a/src/deprecated/extensions/libnetfilter_conntrack_udp.c b/src/deprecated/extensions/libnetfilter_conntrack_udp.c index b20ba04..522c0ae 100644 --- a/src/deprecated/extensions/libnetfilter_conntrack_udp.c +++ b/src/deprecated/extensions/libnetfilter_conntrack_udp.c @@ -14,9 +14,10 @@ #include /* For htons */ #include #include -#include #include +#include "internal/deprecated.h" + static void parse_proto(struct nfattr *cda[], struct nfct_tuple *tuple) { if (cda[CTA_PROTO_SRC_PORT-1]) diff --git a/src/deprecated/l3extensions/libnetfilter_conntrack_ipv4.c b/src/deprecated/l3extensions/libnetfilter_conntrack_ipv4.c index 8e8c681..fb84a6f 100644 --- a/src/deprecated/l3extensions/libnetfilter_conntrack_ipv4.c +++ b/src/deprecated/l3extensions/libnetfilter_conntrack_ipv4.c @@ -11,9 +11,10 @@ #include /* For htons */ #include #include -#include #include +#include "internal/deprecated.h" + static void parse_proto(struct nfattr *cda[], struct nfct_tuple *tuple) { if (cda[CTA_IP_V4_SRC-1]) diff --git a/src/deprecated/l3extensions/libnetfilter_conntrack_ipv6.c b/src/deprecated/l3extensions/libnetfilter_conntrack_ipv6.c index 1b6b909..dc13395 100644 --- a/src/deprecated/l3extensions/libnetfilter_conntrack_ipv6.c +++ b/src/deprecated/l3extensions/libnetfilter_conntrack_ipv6.c @@ -14,9 +14,10 @@ #include #include #include -#include #include +#include "internal/deprecated.h" + #ifndef HAVE_INET_NTOP_IPV6 #warning "inet_ntop does not support IPv6" #endif diff --git a/src/expect/api.c b/src/expect/api.c index ab804ca..bbf6e30 100644 --- a/src/expect/api.c +++ b/src/expect/api.c @@ -10,7 +10,7 @@ #include #include -#include "internal.h" +#include "internal/internal.h" /** * nfexp_new - allocate a new expectation diff --git a/src/expect/build.c b/src/expect/build.c index dfc5edf..2f9cb84 100644 --- a/src/expect/build.c +++ b/src/expect/build.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static void __build_timeout(struct nfnlhdr *req, size_t size, diff --git a/src/expect/callback.c b/src/expect/callback.c index df4ffe7..6a45b0e 100644 --- a/src/expect/callback.c +++ b/src/expect/callback.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" int __expect_callback(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data) { diff --git a/src/expect/getter.c b/src/expect/getter.c index 2cbebe6..2a622af 100644 --- a/src/expect/getter.c +++ b/src/expect/getter.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static const void *get_exp_attr_master(const struct nf_expect *exp) { diff --git a/src/expect/parse.c b/src/expect/parse.c index 5fe0bce..e14890d 100644 --- a/src/expect/parse.c +++ b/src/expect/parse.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" int __parse_expect_message_type(const struct nlmsghdr *nlh) { diff --git a/src/expect/setter.c b/src/expect/setter.c index ae80ca8..c962bb5 100644 --- a/src/expect/setter.c +++ b/src/expect/setter.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static void set_exp_attr_master(struct nf_expect *exp, const void *value) { diff --git a/src/expect/snprintf.c b/src/expect/snprintf.c index 64a6589..9eccfa4 100644 --- a/src/expect/snprintf.c +++ b/src/expect/snprintf.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" int __snprintf_expect(char *buf, unsigned int len, diff --git a/src/expect/snprintf_default.c b/src/expect/snprintf_default.c index 1014ef0..fec1586 100644 --- a/src/expect/snprintf_default.c +++ b/src/expect/snprintf_default.c @@ -5,7 +5,7 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include "internal.h" +#include "internal/internal.h" static int __snprintf_expect_proto(char *buf, unsigned int len, diff --git a/src/main.c b/src/main.c index 21bcafb..41e4f26 100644 --- a/src/main.c +++ b/src/main.c @@ -10,7 +10,7 @@ #include #include -#include "internal.h" +#include "internal/internal.h" struct nfct_handle *nfct_open_nfnl(struct nfnl_handle *nfnlh, u_int8_t subsys_id, -- cgit v1.2.3