]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use nd_ipv4 rather than struct in_addr
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 10 Jun 2019 12:14:46 +0000 (14:14 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 10 Jun 2019 12:14:46 +0000 (14:14 +0200)
print-bgp.c
print-esp.c
print-hncp.c
print-isakmp.c
print-rx.c
print-tcp.c

index 88ade46d96c3bd342151d978817b04a51cb38381..94de6757c0c3b7271f2b0b6013e756f35cbe975b 100644 (file)
@@ -537,7 +537,7 @@ int
 decode_prefix4(netdissect_options *ndo,
                const u_char *pptr, u_int itemlen, char *buf, size_t buflen)
 {
-    struct in_addr addr;
+    nd_ipv4 addr;
     u_int plen, plenbytes;
 
     ND_TCHECK_1(pptr);
@@ -570,7 +570,7 @@ decode_labeled_prefix4(netdissect_options *ndo,
                        const u_char *pptr, u_int itemlen, char *buf,
                        size_t buflen)
 {
-    struct in_addr addr;
+    nd_ipv4 addr;
     u_int plen, plenbytes;
 
     /* prefix length and label = 4 bytes */
@@ -904,7 +904,7 @@ static int
 decode_labeled_vpn_prefix4(netdissect_options *ndo,
                            const u_char *pptr, char *buf, size_t buflen)
 {
-    struct in_addr addr;
+    nd_ipv4 addr;
     u_int plen;
 
     ND_TCHECK_1(pptr);
index c91b04ed7dc8ea4e069e0089eb75bf6170d5293e..f30563aa39fea61264491a31d16cf3e5dc29821b 100644 (file)
@@ -99,7 +99,7 @@ struct newesp {
 
 #ifdef HAVE_LIBCRYPTO
 union inaddr_u {
-       struct in_addr in4;
+       nd_ipv4 in4;
        struct in6_addr in6;
 };
 struct sa_list {
index 3a3c01ea2fa2d01ec3ba4d71eb79e3ab7892ef05..60a7ca9bd2de0b6171040b3d02d1e22dda4b6535 100644 (file)
@@ -210,7 +210,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length)
 
     if (GET_U_1(prefix) >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 &&
         is_ipv4_mapped_address(prefix + 1)) {
-        struct in_addr addr;
+        nd_ipv4 addr;
         u_int plen;
 
         plen = GET_U_1(prefix) - 96;
index 18102ebce9fea081b1740c68e9c62d80d1e13416..664966669503418c7a423421b6c875d5552185e0 100644 (file)
@@ -635,7 +635,7 @@ ikev1_print(netdissect_options *ndo,
 #define MAXINITIATORS  20
 static int ninitiator = 0;
 union inaddr_u {
-       struct in_addr in4;
+       nd_ipv4 in4;
        struct in6_addr in6;
 };
 static struct {
index 1464fa395860d504c59327a19e5d432fcb576ff3..49e7a8cb87c04b99e01448ecee09b4eb298fa999 100644 (file)
@@ -480,8 +480,8 @@ static const struct tok rx_ack_reasons[] = {
 
 struct rx_cache_entry {
        uint32_t        callnum;        /* Call number (net order) */
-       struct in_addr  client;         /* client IP address (net order) */
-       struct in_addr  server;         /* server IP address (net order) */
+       nd_ipv4 client;                 /* client IP address (net order) */
+       nd_ipv4 server;                 /* server IP address (net order) */
        u_int           dport;          /* server port (host order) */
        uint16_t        serviceId;      /* Service identifier (net order) */
        uint32_t        opcode;         /* RX opcode (host order) */
@@ -730,8 +730,8 @@ rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh,
        do {
                rxent = &rx_cache[i];
                if (rxent->callnum == GET_BE_U_4(rxh->callNumber) &&
-                   rxent->client.s_addr == clip &&
-                   rxent->server.s_addr == sip &&
+                   GET_IPV4_TO_NETWORK_ORDER(rxent->client) == clip &&
+                   GET_IPV4_TO_NETWORK_ORDER(rxent->server) == sip &&
                    rxent->serviceId == GET_BE_U_2(rxh->serviceId) &&
                    rxent->dport == sport) {
 
index c0a21b9861eb5e28e90c2ff15c187aa69dce4a7e..58e1aef66da5fd3cfbd95df885ad905589738f6f 100644 (file)
@@ -68,8 +68,8 @@ static void print_tcp_fastopen_option(netdissect_options *ndo, const u_char *cp,
 
 
 struct tha {
-        struct in_addr src;
-        struct in_addr dst;
+        nd_ipv4 src;
+        nd_ipv4 dst;
         u_int port;
 };