AM_CPPFLAGS = $(LLDP_CPPFLAGS)
AM_LDFLAGS = $(LLDP_LDFLAGS) $(LLDP_BIN_LDFLAGS)
-if HAVE_CHECK
+check_PROGRAMS = decode
+
+decode_SOURCES = decode.c \
+ $(top_srcdir)/src/daemon/lldpd.h \
+ pcap-hdr.h
-TESTS = check_marshal check_pattern check_bitmap check_fixedpoint \
- check_lldp check_cdp check_sonmp check_edp
-AM_CFLAGS += @check_CFLAGS@
LDADD = $(top_builddir)/src/daemon/liblldpd.la @check_LIBS@ @libevent_LDFLAGS@
if ENABLE_SYSTEMTAP
LDADD += $(top_builddir)/src/daemon/probes.o
endif
+if USE_SNMP
+LDADD += @NETSNMP_LIBS@
+endif
+
+if HAVE_CHECK
+
+TESTS = check_marshal check_pattern check_bitmap check_fixedpoint \
+ check_lldp check_cdp check_sonmp check_edp
+AM_CFLAGS += @check_CFLAGS@
+LDADD += @check_LIBS@
check_marshal_SOURCES = check_marshal.c \
$(top_srcdir)/src/marshal.h \
check_lldp_SOURCES = check_lldp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c check-compat.h
+ common.h common.c check-compat.h pcap-hdr.h
check_cdp_SOURCES = check_cdp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c check-compat.h
+ common.h common.c check-compat.h pcap-hdr.h
check_sonmp_SOURCES = check_sonmp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c check-compat.h
+ common.h common.c check-compat.h pcap-hdr.h
check_edp_SOURCES = check_edp.c \
$(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c check-compat.h
+ common.h common.c check-compat.h pcap-hdr.h
check_fixedpoint_SOURCES = check_fixedpoint.c
check_fixedpoint_LDADD = $(top_builddir)/src/lib/libfixedpoint.la $(LDADD)
check_snmp_SOURCES = check_snmp.c \
$(top_srcdir)/src/daemon/lldpd.h \
$(top_srcdir)/src/daemon/agent.h
-LDADD += @NETSNMP_LIBS@
endif
-check_PROGRAMS = $(TESTS) decode
-decode_SOURCES = decode.c \
- $(top_srcdir)/src/daemon/lldpd.h \
- common.h common.c
+check_PROGRAMS += $(TESTS)
endif
#define _COMMON_H
#include "check-compat.h"
+#include "pcap-hdr.h"
#include "../src/daemon/lldpd.h"
-/* See:
- * http://wiki.wireshark.org/Development/LibpcapFileFormat
- */
-struct pcap_hdr {
- u_int32_t magic_number; /* magic number */
- u_int16_t version_major; /* major version number */
- u_int16_t version_minor; /* minor version number */
- u_int32_t thiszone; /* GMT to local correction */
- u_int32_t sigfigs; /* accuracy of timestamps */
- u_int32_t snaplen; /* max length of captured packets, in octets */
- u_int32_t network; /* data link type */
-};
-struct pcaprec_hdr {
- u_int32_t ts_sec; /* timestamp seconds */
- u_int32_t ts_usec; /* timestamp microseconds */
- u_int32_t incl_len; /* number of octets of packet saved in file */
- u_int32_t orig_len; /* actual length of packet */
-};
-
struct packet {
TAILQ_ENTRY(packet) next;
int size;
--- /dev/null
+#ifndef _PCAP_HDR_H
+#define _PCAP_HDR_H
+
+#include <stdint.h>
+
+/* See:
+ * http://wiki.wireshark.org/Development/LibpcapFileFormat
+ */
+struct pcap_hdr {
+ uint32_t magic_number; /* magic number */
+ uint16_t version_major; /* major version number */
+ uint16_t version_minor; /* minor version number */
+ uint32_t thiszone; /* GMT to local correction */
+ uint32_t sigfigs; /* accuracy of timestamps */
+ uint32_t snaplen; /* max length of captured packets, in octets */
+ uint32_t network; /* data link type */
+};
+struct pcaprec_hdr {
+ uint32_t ts_sec; /* timestamp seconds */
+ uint32_t ts_usec; /* timestamp microseconds */
+ uint32_t incl_len; /* number of octets of packet saved in file */
+ uint32_t orig_len; /* actual length of packet */
+};
+
+#endif