X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e2982e7f6f0b624a773ec5a58885ee80fab46d34..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-pflog.c diff --git a/print-pflog.c b/print-pflog.c index 94164e98..7cd96b2e 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -22,7 +22,7 @@ /* \summary: OpenBSD packet filter log file printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif #ifndef HAVE_NET_PFVAR_H @@ -34,12 +34,11 @@ #include #include -#include +#include "netdissect-stdinc.h" #include "netdissect.h" #include "extract.h" -static const char tstr[] = "[|pflog]"; static const struct tok pf_reasons[] = { { 0, "0(match)" }, @@ -90,6 +89,7 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) { uint32_t rulenr, subrulenr; + ndo->ndo_protocol = "pflog"; rulenr = EXTRACT_BE_U_4(&hdr->rulenr); subrulenr = EXTRACT_BE_U_4(&hdr->subrulenr); if (subrulenr == (uint32_t)-1) @@ -114,9 +114,10 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const struct pfloghdr *hdr; uint8_t af; + ndo->ndo_protocol = "pflog_if"; /* check length */ if (caplen < sizeof(uint8_t)) { - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); return (caplen); } @@ -129,7 +130,7 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, hdrlen = BPF_WORDALIGN(hdr->length); if (caplen < hdrlen) { - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); return (hdrlen); /* XXX: true? */ } @@ -173,13 +174,6 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, return (hdrlen); trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); return (hdrlen); } - -/* - * Local Variables: - * c-style: whitesmith - * c-basic-offset: 8 - * End: - */