summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-802_15_4.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-01-07 19:55:18 +0000
committerdelphij <delphij@FreeBSD.org>2015-01-07 19:55:18 +0000
commitf49c5d523af9076a4a59e8dd664f9a897108432e (patch)
treee268839e08c106e178b33bd461d8d0a9c6fb5ad9 /contrib/tcpdump/print-802_15_4.c
parentc371846049d370ab78d943e60e789cdffe0aad3d (diff)
parent08263d19579d35a7a65e0c8bcb768504ce76d04e (diff)
downloadFreeBSD-src-f49c5d523af9076a4a59e8dd664f9a897108432e.zip
FreeBSD-src-f49c5d523af9076a4a59e8dd664f9a897108432e.tar.gz
MFV r276761: tcpdump 4.6.2.
MFC after: 1 month
Diffstat (limited to 'contrib/tcpdump/print-802_15_4.c')
-rw-r--r--contrib/tcpdump/print-802_15_4.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/contrib/tcpdump/print-802_15_4.c b/contrib/tcpdump/print-802_15_4.c
index 2016552..26c28ee 100644
--- a/contrib/tcpdump/print-802_15_4.c
+++ b/contrib/tcpdump/print-802_15_4.c
@@ -20,16 +20,13 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-#include <pcap.h>
-#include <string.h>
-
#include "interface.h"
#include "addrtoname.h"
@@ -47,7 +44,7 @@ static const char *ftypes[] = {
};
static int
-extract_header_length(u_int16_t fc)
+extract_header_length(uint16_t fc)
{
int len = 0;
@@ -90,13 +87,13 @@ extract_header_length(u_int16_t fc)
u_int
-ieee802_15_4_if_print(struct netdissect_options *ndo,
+ieee802_15_4_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
int hdrlen;
- u_int16_t fc;
- u_int8_t seq;
+ uint16_t fc;
+ uint8_t seq;
if (caplen < 3) {
ND_PRINT((ndo, "[|802.15.4] %x", caplen));
@@ -112,7 +109,7 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
caplen -= 3;
ND_PRINT((ndo,"IEEE 802.15.4 %s packet ", ftypes[fc & 0x7]));
- if (vflag)
+ if (ndo->ndo_vflag)
ND_PRINT((ndo,"seq %02x ", seq));
if (hdrlen == -1) {
ND_PRINT((ndo,"malformed! "));
@@ -120,11 +117,11 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
}
- if (!vflag) {
+ if (!ndo->ndo_vflag) {
p+= hdrlen;
caplen -= hdrlen;
} else {
- u_int16_t panid = 0;
+ uint16_t panid = 0;
switch ((fc >> 10) & 0x3) {
case 0x00:
@@ -146,7 +143,7 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
p += 8;
break;
}
- ND_PRINT((ndo,"< ");
+ ND_PRINT((ndo,"< "));
switch ((fc >> 14) & 0x3) {
case 0x00:
@@ -168,7 +165,7 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
panid = EXTRACT_LE_16BITS(p);
p += 2;
}
- ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(p))));
+ ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(p)));
p += 8;
break;
}
@@ -176,8 +173,8 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
caplen -= hdrlen;
}
- if (!suppress_default_print)
- (ndo->ndo_default_print)(ndo, p, caplen);
+ if (!ndo->ndo_suppress_default_print)
+ ND_DEFAULTPRINT(p, caplen);
return 0;
}
OpenPOWER on IntegriCloud