From: Francois-Xavier Le Bail Date: Fri, 11 Sep 2015 11:22:56 +0000 (+0200) Subject: libnetdissect code must include 'netdissect.h', not 'interface.h' X-Git-Tag: tcpdump-4.8.0~151 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/f5fe14663d9ed32b7a995ed0924c04e705f74237 libnetdissect code must include 'netdissect.h', not 'interface.h' Moreover: Remove netdissect.h include in interface.h Move thiszone declaration in netdissect.h Update a comment --- diff --git a/addrtoname.c b/addrtoname.c index 527f4055..3f04479c 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -57,7 +57,7 @@ extern int ether_ntohost(char *, const struct ether_addr *); #include #include -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" #include "llc.h" #include "setsignal.h" diff --git a/af.c b/af.c index cfa0648e..539ede52 100644 --- a/af.c +++ b/af.c @@ -20,7 +20,7 @@ #endif #include -#include "interface.h" +#include "netdissect.h" #include "af.h" const struct tok af_values[] = { diff --git a/bpf_dump.c b/bpf_dump.c index b7d649a1..9bad38d3 100644 --- a/bpf_dump.c +++ b/bpf_dump.c @@ -27,7 +27,7 @@ #include -#include "interface.h" +#include "netdissect.h" void bpf_dump(const struct bpf_program *p, int option) diff --git a/checksum.c b/checksum.c index 9f6bb24d..0829fbe6 100644 --- a/checksum.c +++ b/checksum.c @@ -28,7 +28,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" /* * CRC-10 table generated using the following Python snippet: diff --git a/gmpls.c b/gmpls.c index 463a21de..23515e98 100644 --- a/gmpls.c +++ b/gmpls.c @@ -19,7 +19,7 @@ #include -#include "interface.h" +#include "netdissect.h" #include "gmpls.h" /* rfc3471 */ diff --git a/in_cksum.c b/in_cksum.c index caf4b6af..8ceaf104 100644 --- a/in_cksum.c +++ b/in_cksum.c @@ -41,7 +41,7 @@ #include -#include "interface.h" +#include "netdissect.h" /* * Checksum routine for Internet Protocol family headers (Portable Version). diff --git a/interface.h b/interface.h index 1a67eb39..01de9ea2 100644 --- a/interface.h +++ b/interface.h @@ -69,8 +69,6 @@ extern char *strsep(char **, const char *); extern char *program_name; /* used to generate self-identifying messages */ -extern int32_t thiszone; /* seconds offset from gmt to local time */ - extern void error(const char *, ...) __attribute__((noreturn)) #ifdef __ATTRIBUTE___FORMAT_OK @@ -94,5 +92,3 @@ struct bpf_program; extern void bpf_dump(const struct bpf_program *, int); #endif - -#include "netdissect.h" diff --git a/ipproto.c b/ipproto.c index eeece52b..bcf2cedc 100644 --- a/ipproto.c +++ b/ipproto.c @@ -19,7 +19,7 @@ #include -#include "interface.h" +#include "netdissect.h" #include "ipproto.h" const struct tok ipproto_values[] = { diff --git a/l2vpn.c b/l2vpn.c index be47dbd7..b870e890 100644 --- a/l2vpn.c +++ b/l2vpn.c @@ -18,7 +18,7 @@ #endif #include -#include "interface.h" +#include "netdissect.h" #include "l2vpn.h" /* draft-ietf-pwe3-iana-allocation-04 */ diff --git a/missing/snprintf.c b/missing/snprintf.c index 21d235d2..921b74c1 100644 --- a/missing/snprintf.c +++ b/missing/snprintf.c @@ -42,7 +42,7 @@ #include #include -#include +#include "netdissect.h" enum format_flags { minus_flag = 1, diff --git a/missing/strdup.c b/missing/strdup.c index 9fca7529..9cbf35ae 100644 --- a/missing/strdup.c +++ b/missing/strdup.c @@ -35,7 +35,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" char * strdup(str) diff --git a/missing/strlcat.c b/missing/strlcat.c index a953034b..40549354 100644 --- a/missing/strlcat.c +++ b/missing/strlcat.c @@ -36,7 +36,7 @@ #include -#include "interface.h" +#include "netdissect.h" /* * Appends src to string dst of size siz (unlike strncat, siz is the diff --git a/missing/strlcpy.c b/missing/strlcpy.c index 0999ba30..24dcca67 100644 --- a/missing/strlcpy.c +++ b/missing/strlcpy.c @@ -36,7 +36,7 @@ #include -#include "interface.h" +#include "netdissect.h" /* * Copy src to string dst of size siz. At most siz-1 characters diff --git a/missing/strsep.c b/missing/strsep.c index 91ef72f6..2c17275f 100644 --- a/missing/strsep.c +++ b/missing/strsep.c @@ -39,7 +39,7 @@ #include -#include "interface.h" +#include "netdissect.h" /* * Get next token from string *stringp, where tokens are possibly-empty diff --git a/netdissect.h b/netdissect.h index 861957d8..552d46a9 100644 --- a/netdissect.h +++ b/netdissect.h @@ -40,6 +40,8 @@ #include "ip.h" /* struct ip for nextproto4_cksum() */ +extern int32_t thiszone; /* seconds offset from gmt to local time */ + #if !defined(HAVE_SNPRINTF) int snprintf (char *str, size_t sz, const char *format, ...) #ifdef __ATTRIBUTE___FORMAT_OK diff --git a/nlpid.c b/nlpid.c index 14efb0b1..4b44ee1c 100644 --- a/nlpid.c +++ b/nlpid.c @@ -18,7 +18,7 @@ #endif #include -#include "interface.h" +#include "netdissect.h" #include "nlpid.h" const struct tok nlpid_values[] = { diff --git a/oui.c b/oui.c index a0645693..d00e7c5b 100644 --- a/oui.c +++ b/oui.c @@ -18,7 +18,7 @@ #endif #include -#include "interface.h" +#include "netdissect.h" #include "oui.h" /* FIXME complete OUI list using a script */ diff --git a/parsenfsfh.c b/parsenfsfh.c index e7805063..a2bfc1c4 100644 --- a/parsenfsfh.c +++ b/parsenfsfh.c @@ -49,7 +49,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" #include "nfsfh.h" /* diff --git a/print.c b/print.c index c055e3c7..8f68bae3 100644 --- a/print.c +++ b/print.c @@ -35,7 +35,6 @@ #include #include "netdissect.h" -#include "interface.h" #include "addrtoname.h" #include "print.h" diff --git a/signature.c b/signature.c index f27a6a52..18449fc2 100644 --- a/signature.c +++ b/signature.c @@ -23,7 +23,7 @@ #include -#include "interface.h" +#include "netdissect.h" #include "signature.h" #ifdef HAVE_LIBCRYPTO diff --git a/smbutil.c b/smbutil.c index 8e5e5087..e6114fa3 100644 --- a/smbutil.c +++ b/smbutil.c @@ -16,7 +16,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" #include "extract.h" #include "smb.h" diff --git a/util-print.c b/util-print.c index 5b6e3731..469b8261 100644 --- a/util-print.c +++ b/util-print.c @@ -51,7 +51,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" #include "ascii_strcasecmp.h" #include "timeval-operations.h" @@ -475,7 +475,7 @@ bittok2str(register const struct tok *lp, register const char *fmt, /* * Convert a value to a string using an array; the macro - * tok2strary() in is the public interface to + * tok2strary() in is the public interface to * this function and ensures that the second argument is * correct for bounds-checking. */ diff --git a/vfprintf.c b/vfprintf.c index 6f3e15f7..ae28bcfd 100644 --- a/vfprintf.c +++ b/vfprintf.c @@ -30,7 +30,7 @@ #include #include -#include "interface.h" +#include "netdissect.h" /* * Stock 4.3 doesn't have vfprintf. diff --git a/win32/src/ether_ntohost.c b/win32/src/ether_ntohost.c index 0217b195..4a58cfcb 100644 --- a/win32/src/ether_ntohost.c +++ b/win32/src/ether_ntohost.c @@ -30,7 +30,7 @@ #include #include "ether.h" -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" typedef struct ether_addr {