Add a header guard to pcap-util.h while at it.
#include "pcap/sll.h"
#include "pcap/ipnet.h"
#include "diag-control.h"
+#include "pcap-util.h"
#include "scanner.h"
return gen_uncond(cstate, 0);
}
-/*
- * Byte-swap a 32-bit number.
- * ("htonl()" or "ntohl()" won't work - we want to byte-swap even on
- * big-endian platforms.)
- */
-#define SWAPLONG(y) \
-((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
-
/*
* Generate code to match a particular packet type.
*
* pcap-util.h - common code for various files
*/
+#ifndef pcap_util_h
+#define pcap_util_h
+
/*
* We use the "receiver-makes-right" approach to byte order;
* because time is at a premium when we are writing the file.
extern void pcapint_post_process(int linktype, int swapped,
struct pcap_pkthdr *hdr, u_char *data);
+
+#endif // pcap_util_h