aboutsummaryrefslogtreecommitdiff
path: root/print-decnet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-20 01:07:48 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-20 01:07:48 -0800
commitb347189ca62c553b60c53c3b6978ebd354c1c88b (patch)
tree945fc78450c36df7190d47fa18a19ef173e0638f /print-decnet.c
parentacbfc682d6c3ced52b76062d37d5d6a08caa8e78 (diff)
downloadtcpdump-b347189ca62c553b60c53c3b6978ebd354c1c88b.tar.gz
Add EXTRACT_ macros/functions for IPv4 addresses, get rid of structure wrappers.
Add EXTRACT_IPV4_TO_HOST_ORDER() and EXTRACT_IPV4_TO_NETWORK_ORDER(); the former extracts a possibly-unaligned IPv4 address, in network byte order, returning a uint32_t in host byte order, and the latter extracts a possibly-unaligned IPv4 address, in network byte order, returning a uint32_t in *network* byte order. Some APIs take an address in network byte order, and some operations are more easily done in host byte order, so both are useful. Remove the structure wrappers around nd_ipv4 and nd_ipv6; that makes it easier to pass variables of those types to functions/macros that take a byte pointer as an argument (because they might be used either with pointers to structure members or raw buffer pointers), and the structure probably wouldn't do much to prevent people from using EXTRACT_BE_U_4() when they really want to extract the value in *network* byte order; using the above EXTRACT_IPV4_ calls should do more to encourage that.
Diffstat (limited to 'print-decnet.c')
-rw-r--r--print-decnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print-decnet.c b/print-decnet.c
index b86bd889..4ac74e11 100644
--- a/print-decnet.c
+++ b/print-decnet.c
@@ -38,8 +38,8 @@ struct rtentry;
#include <stdlib.h>
#include <string.h>
-#include "extract.h"
#include "netdissect.h"
+#include "extract.h"
#include "addrtoname.h"
static const char tstr[] = "[|decnet]";