From e70e915c9e7f9418e483b87ae72176e4b2562bb6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 14 Apr 2014 22:17:37 +0200 Subject: [PATCH] dissector: Get rid of header dependency on pcap_io.h The dissector only needs the LINKTYPE_* #defines from pcap_io.h. Instead of pulling in this rather large header just for this, move the LINKTYPE_* #defines to an own header and include it where needed. Signed-off-by: Tobias Klauser --- dissector.c | 1 + dissector.h | 1 - linktype.h | 33 +++++++++++++++++++++++++++++++++ pcap_io.h | 24 +----------------------- 4 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 linktype.h diff --git a/dissector.c b/dissector.c index ed6c4dea..a412999a 100644 --- a/dissector.c +++ b/dissector.c @@ -15,6 +15,7 @@ #include "dissector.h" #include "dissector_eth.h" #include "dissector_80211.h" +#include "linktype.h" int dissector_set_print_type(void *ptr, int type) { diff --git a/dissector.h b/dissector.h index c86a51d6..c6a22e67 100644 --- a/dissector.h +++ b/dissector.h @@ -15,7 +15,6 @@ #include "ring.h" #include "tprintf.h" -#include "pcap_io.h" #include "built_in.h" #define PRINT_NORM 0 diff --git a/linktype.h b/linktype.h new file mode 100644 index 00000000..8caa6977 --- /dev/null +++ b/linktype.h @@ -0,0 +1,33 @@ +/* + * netsniff-ng - the packet sniffing beast + * Copyright 2009 - 2013 Daniel Borkmann. + * Subject to the GPL, version 2. + */ + +#ifndef LINKTYPE_H +#define LINKTYPE_H + +#define LINKTYPE_NULL 0 +#define LINKTYPE_EN10MB 1 +#define LINKTYPE_EN3MB 2 +#define LINKTYPE_AX25 3 +#define LINKTYPE_PRONET 4 +#define LINKTYPE_CHAOS 5 +#define LINKTYPE_IEEE802 6 +#define LINKTYPE_SLIP 8 +#define LINKTYPE_PPP 9 +#define LINKTYPE_FDDI 10 +#define LINKTYPE_ATM_CLIP 19 +#define LINKTYPE_C_HDLC 104 +#define LINKTYPE_IEEE802_11 105 +#define LINKTYPE_FRELAY 107 +#define LINKTYPE_ECONET 115 +#define LINKTYPE_ARCNET_LINUX 129 +#define LINKTYPE_LINUX_IRDA 144 +#define LINKTYPE_CAN20B 190 +#define LINKTYPE_IEEE802_15_4_LINUX 191 +#define LINKTYPE_INFINIBAND 247 +#define LINKTYPE_NETLINK 253 +#define LINKTYPE_MAX 254 + +#endif diff --git a/pcap_io.h b/pcap_io.h index 41fe4706..061c2147 100644 --- a/pcap_io.h +++ b/pcap_io.h @@ -22,6 +22,7 @@ #include "die.h" #include "dev.h" #include "ioops.h" +#include "linktype.h" #define TCPDUMP_MAGIC 0xa1b2c3d4 #define ORIGINAL_TCPDUMP_MAGIC TCPDUMP_MAGIC @@ -37,29 +38,6 @@ #define PCAP_TSOURCE_SYS_HARDWARE 2 #define PCAP_TSOURCE_RAW_HARDWARE 3 -#define LINKTYPE_NULL 0 -#define LINKTYPE_EN10MB 1 -#define LINKTYPE_EN3MB 2 -#define LINKTYPE_AX25 3 -#define LINKTYPE_PRONET 4 -#define LINKTYPE_CHAOS 5 -#define LINKTYPE_IEEE802 6 -#define LINKTYPE_SLIP 8 -#define LINKTYPE_PPP 9 -#define LINKTYPE_FDDI 10 -#define LINKTYPE_ATM_CLIP 19 -#define LINKTYPE_C_HDLC 104 -#define LINKTYPE_IEEE802_11 105 -#define LINKTYPE_FRELAY 107 -#define LINKTYPE_ECONET 115 -#define LINKTYPE_ARCNET_LINUX 129 -#define LINKTYPE_LINUX_IRDA 144 -#define LINKTYPE_CAN20B 190 -#define LINKTYPE_IEEE802_15_4_LINUX 191 -#define LINKTYPE_INFINIBAND 247 -#define LINKTYPE_NETLINK 253 -#define LINKTYPE_MAX 254 - struct pcap_filehdr { uint32_t magic; uint16_t version_major; -- 2.11.4.GIT