{ 0, NULL }
};
-static inline void
+static void
nflog_hdr_print(netdissect_options *ndo, const nflog_hdr_t *hdr, u_int length)
{
- ND_PRINT((ndo, "version %d, resource ID %d", hdr->nflog_version, ntohs(hdr->nflog_rid)));
+ ND_PRINT("version %u, resource ID %u",
+ GET_U_1(hdr->nflog_version), GET_BE_U_2(hdr->nflog_rid));
if (!ndo->ndo_qflag) {
- ND_PRINT((ndo,", family %s (%d)",
- tok2str(nflog_values, "Unknown",
- hdr->nflog_family),
- hdr->nflog_family));
+ ND_PRINT(", family %s (%u)",
+ tok2str(nflog_values, "Unknown",
+ GET_U_1(hdr->nflog_family)),
+ GET_U_1(hdr->nflog_family));
} else {
- ND_PRINT((ndo,", %s",
- tok2str(nflog_values,
- "Unknown NFLOG (0x%02x)",
- hdr->nflog_family)));
+ ND_PRINT(", %s",
+ tok2str(nflog_values,
+ "Unknown NFLOG (0x%02x)",
+ GET_U_1(hdr->nflog_family)));
}
- ND_PRINT((ndo, ", length %u: ", length));
+ ND_PRINT(", length %u: ", length);
}
+ static char *hook_names[] = { "PRE","IN","FWD","OUT","POST" };
+
+ static const char *hook2txt(int hook) {
+ if(hook >= sizeof(hook_names)/sizeof(hook_names[0])) return "UNK";
+ return hook_names[hook];
+ }
+
u_int
nflog_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
const nflog_hdr_t *hdr = (const nflog_hdr_t *)p;
- const nflog_tlv_t *tlv;
uint16_t size;
+ uint16_t hw_hdrlen = 0;
+ uint16_t hw_addrlen = 0;
uint16_t h_size = sizeof(nflog_hdr_t);
u_int caplen = h->caplen;
u_int length = h->len;