summaryrefslogtreecommitdiff
path: root/addrtoname.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-16 19:52:35 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-16 19:52:35 -0800
commita08e63fd7a8f5bfeb6b6f47adf580cd7f9af3dec (patch)
tree6b644e8d5f201345bf4e544be50ce27aa9b697d4 /addrtoname.c
parent41dbcba30b824744612ff4ee3b151083464b4000 (diff)
downloadtcpdump-a08e63fd7a8f5bfeb6b6f47adf580cd7f9af3dec.tar.gz
Move NTOH and HTON macros into addrname.c
We don't want to encourage people to use them in code that pulls data out of packets, as we want that code to use the EXTRACT_ macros.
Diffstat (limited to 'addrtoname.c')
-rw-r--r--addrtoname.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/addrtoname.c b/addrtoname.c
index 9d5c88cc..b08253a3 100644
--- a/addrtoname.c
+++ b/addrtoname.c
@@ -33,6 +33,13 @@
#include <netdissect-stdinc.h>
+#ifndef NTOHL
+#define NTOHL(x) (x) = ntohl(x)
+#define NTOHS(x) (x) = ntohs(x)
+#define HTONL(x) (x) = htonl(x)
+#define HTONS(x) (x) = htons(x)
+#endif
+
#ifdef USE_ETHER_NTOHOST
#ifdef HAVE_NETINET_IF_ETHER_H
struct mbuf; /* Squelch compiler warnings on some platforms for */