]> The Tcpdump Group git mirrors - tcpdump/commitdiff
MAC-48, not MAC-64.
authorGuy Harris <[email protected]>
Fri, 14 Jul 2023 07:35:08 +0000 (00:35 -0700)
committerGuy Harris <[email protected]>
Fri, 14 Jul 2023 07:35:08 +0000 (00:35 -0700)
addrtoname.c
addrtoname.h
print-802_11.c
print-ether.c
print-fddi.c
print-ipfc.c
print-lldp.c
print-token.c

index 56ed0ab33d2ca723e52099496caa5cf0aa475310..588a863c03f74289453ee2b1a6dcbef883bbfb9f 100644 (file)
@@ -589,7 +589,7 @@ lookup_protoid(netdissect_options *ndo, const u_char *pi)
 }
 
 const char *
-mac64_string(netdissect_options *ndo, const uint8_t *ep)
+mac48_string(netdissect_options *ndo, const uint8_t *ep)
 {
        int i;
        char *cp;
@@ -691,7 +691,7 @@ linkaddr_string(netdissect_options *ndo, const uint8_t *ep,
                return ("<empty>");
 
        if (type == LINKADDR_MAC48 && len == MAC48_LEN)
-               return (mac64_string(ndo, ep));
+               return (mac48_string(ndo, ep));
 
        if (type == LINKADDR_FRELAY)
                return (q922_string(ndo, ep, len));
@@ -949,7 +949,7 @@ static const struct etherlist {
  * Initialize the ethers hash table.  We take two different approaches
  * depending on whether or not the system provides the ethers name
  * service.  If it does, we just wire in a few names at startup,
- * and mac64_string() fills in the table on demand.  If it doesn't,
+ * and mac48_string() fills in the table on demand.  If it doesn't,
  * then we suck in the entire /etc/ethers file at startup.  The idea
  * is that parsing the local file will be fast, but spinning through
  * all the ethers entries via NIS & next_etherent might be very slow.
@@ -995,7 +995,7 @@ init_etherarray(netdissect_options *ndo)
                /*
                 * Use YP/NIS version of name if available.
                 */
-               /* Same workaround as in mac64_string(). */
+               /* Same workaround as in mac48_string(). */
                struct ether_addr ea;
                memcpy (&ea, el->addr, MAC48_LEN);
                if (ether_ntohost(name, &ea) == 0) {
index f965c03e73bb25bd8a1f49ff40ebadab7f67c87a..e17a1f4b6af02922d83a20efcca581a4a49e1799 100644 (file)
@@ -47,7 +47,7 @@ enum {
 #define BUFSIZE 128
 
 extern const char *linkaddr_string(netdissect_options *, const uint8_t *, const unsigned int, const unsigned int);
-extern const char *mac64_string(netdissect_options *, const uint8_t *);
+extern const char *mac48_string(netdissect_options *, const uint8_t *);
 extern const char *eui64_string(netdissect_options *, const uint8_t *);
 extern const char *eui64le_string(netdissect_options *, const uint8_t *);
 extern const char *tcpport_string(netdissect_options *, u_short);
@@ -79,11 +79,11 @@ get_linkaddr_string(netdissect_options *ndo, const uint8_t *p,
 }
 
 static inline const char *
-get_mac64_string(netdissect_options *ndo, const uint8_t *p)
+get_mac48_string(netdissect_options *ndo, const uint8_t *p)
 {
         if (!ND_TTEST_LEN(p, MAC48_LEN))
                 nd_trunc_longjmp(ndo);
-        return mac64_string(ndo, p);
+        return mac48_string(ndo, p);
 }
 
 static inline const char *
@@ -128,7 +128,7 @@ get_ip6addr_string(netdissect_options *ndo, const u_char *p)
 }
 
 #define GET_LINKADDR_STRING(p, type, len) get_linkaddr_string(ndo, (const u_char *)(p), type, len)
-#define GET_MAC48_STRING(p) get_mac64_string(ndo, (const u_char *)(p))
+#define GET_MAC48_STRING(p) get_mac48_string(ndo, (const u_char *)(p))
 #define GET_EUI64_STRING(p) get_eui64_string(ndo, (const u_char *)(p))
 #define GET_EUI64LE_STRING(p) get_eui64le_string(ndo, (const u_char *)(p))
 #define GET_ISONSAP_STRING(nsap, nsap_length) get_isonsap_string(ndo, (const u_char *)(nsap), nsap_length)
index 2cd378f82c420b8b08fc330b4effa815961cf24a..25cacfde0ad9645989f315120ec9bc12e3a93db3 100644 (file)
@@ -1534,7 +1534,7 @@ handle_reassoc_request(netdissect_options *ndo,
        ret = parse_elements(ndo, &pbody, p, offset, length);
 
        PRINT_SSID(pbody);
-       ND_PRINT(" AP : %s", mac64_string(ndo,  pbody.ap ));
+       ND_PRINT(" AP : %s", mac48_string(ndo,  pbody.ap ));
 
        return ret;
 trunc:
@@ -2272,8 +2272,8 @@ ieee802_11_print(netdissect_options *ndo,
        caplen -= hdrlen;
        p += hdrlen;
 
-       src.addr_string = mac64_string;
-       dst.addr_string = mac64_string;
+       src.addr_string = mac48_string;
+       dst.addr_string = mac48_string;
        switch (FC_TYPE(fc)) {
        case T_MGMT:
                get_mgmt_src_dst_mac(p - hdrlen, &src.addr, &dst.addr);
index f910a780f20ac971aba6fb8870b07c10cff12866..d1d4aeca4d54d4fd74888797afe1862c3db4508b 100644 (file)
@@ -171,9 +171,9 @@ ether_common_print(netdissect_options *ndo, const u_char *p, u_int length,
         */
        ehp = (const struct ether_header *)p;
        src.addr = ehp->ether_shost;
-       src.addr_string = mac64_string;
+       src.addr_string = mac48_string;
        dst.addr = ehp->ether_dhost;
-       dst.addr_string = mac64_string;
+       dst.addr_string = mac48_string;
 
        length -= 2*MAC48_LEN;
        caplen -= 2*MAC48_LEN;
index c883db232d2c02df4f6a8758502f95c0f573ba3e..e8e84ba6eb48842e24f4a2c5debffc8896a82d4e 100644 (file)
@@ -256,8 +256,8 @@ fddi_hdr_print(netdissect_options *ndo,
 {
        const char *srcname, *dstname;
 
-       srcname = mac64_string(ndo, fsrc);
-       dstname = mac64_string(ndo, fdst);
+       srcname = mac48_string(ndo, fsrc);
+       dstname = mac48_string(ndo, fdst);
 
        if (!ndo->ndo_qflag)
                print_fddi_fc(ndo, GET_U_1(fddip->fddi_fc));
@@ -298,9 +298,9 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
                fddi_hdr_print(ndo, fddip, length, srcmac, dstmac);
 
        src.addr = srcmac;
-       src.addr_string = mac64_string;
+       src.addr_string = mac48_string;
        dst.addr = dstmac;
-       dst.addr_string = mac64_string;
+       dst.addr_string = mac48_string;
 
        /* Skip over FDDI MAC header */
        length -= FDDI_HDRLEN;
index 585c91c5db0c4ad9c4b9c48591201209f8955959..7b203ee75d772426eb0e2c7a409cdcf9e4e9cc89 100644 (file)
@@ -66,8 +66,8 @@ ipfc_hdr_print(netdissect_options *ndo,
 {
        const char *srcname, *dstname;
 
-       srcname = mac64_string(ndo, ipfcsrc);
-       dstname = mac64_string(ndo, ipfcdst);
+       srcname = mac48_string(ndo, ipfcsrc);
+       dstname = mac48_string(ndo, ipfcdst);
 
        /*
         * XXX - should we show the upper 16 bits of the addresses?
@@ -106,9 +106,9 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
                ipfc_hdr_print(ndo, ipfcp, length, srcmac, dstmac);
 
        src.addr = srcmac;
-       src.addr_string = mac64_string;
+       src.addr_string = mac48_string;
        dst.addr = dstmac;
-       dst.addr_string = mac64_string;
+       dst.addr_string = mac48_string;
 
        /* Skip over Network_Header */
        length -= IPFC_HDRLEN;
index 22f10685feda5d4abff50723233075554ceba9d6..461b82f468177672b83bb519f9ab8faa98a3af40 100644 (file)
@@ -1362,7 +1362,7 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len)
     case AFNUM_802:
         if (len < MAC48_LEN)
           return NULL;
-        pfunc = mac64_string;
+        pfunc = mac48_string;
         break;
     default:
         pfunc = NULL;
index a2132353e99f295140d51559a6b51af7c6a9bfde..a46003091bd786096e37452fa95e8130c97e2e08 100644 (file)
@@ -108,8 +108,8 @@ token_hdr_print(netdissect_options *ndo,
 {
        const char *srcname, *dstname;
 
-       srcname = mac64_string(ndo, fsrc);
-       dstname = mac64_string(ndo, fdst);
+       srcname = mac48_string(ndo, fsrc);
+       dstname = mac48_string(ndo, fdst);
 
        if (!ndo->ndo_qflag)
                ND_PRINT("%02x %02x ",
@@ -204,9 +204,9 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
        }
 
        src.addr = srcmac;
-       src.addr_string = mac64_string;
+       src.addr_string = mac48_string;
        dst.addr = dstmac;
-       dst.addr_string = mac64_string;
+       dst.addr_string = mac48_string;
 
        /* Skip over token ring MAC header and routing information */
        length -= hdr_len;