+/*
+ * Structure of an NFLOG header and TLV parts, as described at
+ * https://www.tcpdump.org/linktypes/LINKTYPE_NFLOG.html
+ *
+ * The NFLOG header is big-endian.
+ *
+ * The TLV length and type are in host byte order. The value is either
+ * big-endian or is an array of bytes in some externally-specified byte
+ * order (text string, link-layer address, link-layer header, packet
+ * data, etc.).
+ */
+typedef struct nflog_hdr {
+ nd_uint8_t nflog_family; /* address family */
+ nd_uint8_t nflog_version; /* version */
+ nd_uint16_t nflog_rid; /* resource ID */
+} nflog_hdr_t;
+
+#define NFLOG_HDR_LEN sizeof(nflog_hdr_t)
+
+typedef struct nflog_tlv {
+ nd_uint16_t tlv_length; /* tlv length */
+ nd_uint16_t tlv_type; /* tlv type */
+ /* value follows this */
+} nflog_tlv_t;
+
+#define NFLOG_TLV_LEN sizeof(nflog_tlv_t)
+
+typedef struct nflog_packet_hdr {
+ nd_uint16_t hw_protocol; /* hw protocol */
+ nd_uint8_t hook; /* netfilter hook */
+ nd_byte pad[1]; /* padding to 32 bits */
+} nflog_packet_hdr_t;
+
+typedef struct nflog_hwaddr {
+ nd_uint16_t hw_addrlen; /* address length */
+ nd_byte pad[2]; /* padding to 32-bit boundary */
+ nd_byte hw_addr[8]; /* address, up to 8 bytes */
+} nflog_hwaddr_t;
+
+typedef struct nflog_timestamp {
+ nd_uint64_t sec;
+ nd_uint64_t usec;
+} nflog_timestamp_t;