Skip to content

Commit 7865163

Browse files
committed
Speak of MAC-48s rather than MAC or Ethernet addresses.
Not all MAC-48s are Ethernet addresses; a lot of them are IEEE 802.11 addresses, for example. Use the IEEE term.
1 parent 77694ea commit 7865163

29 files changed

+186
-186
lines changed

addrtoname.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#else /* HAVE_STRUCT_ETHER_ADDR */
7272
struct ether_addr {
7373
/* Beware FreeBSD calls this "octet". */
74-
unsigned char ether_addr_octet[MAC_ADDR_LEN];
74+
unsigned char ether_addr_octet[MAC48_LEN];
7575
};
7676
#endif /* HAVE_STRUCT_ETHER_ADDR */
7777
#endif /* what declares ether_ntohost() */
@@ -589,7 +589,7 @@ lookup_protoid(netdissect_options *ndo, const u_char *pi)
589589
}
590590

591591
const char *
592-
etheraddr_string(netdissect_options *ndo, const uint8_t *ep)
592+
mac64_string(netdissect_options *ndo, const uint8_t *ep)
593593
{
594594
int i;
595595
char *cp;
@@ -610,7 +610,7 @@ etheraddr_string(netdissect_options *ndo, const uint8_t *ep)
610610
*/
611611
struct ether_addr ea;
612612

613-
memcpy (&ea, ep, MAC_ADDR_LEN);
613+
memcpy (&ea, ep, MAC48_LEN);
614614
if (ether_ntohost(buf2, &ea) == 0) {
615615
tp->e_name = strdup(buf2);
616616
if (tp->e_name == NULL)
@@ -690,8 +690,8 @@ linkaddr_string(netdissect_options *ndo, const uint8_t *ep,
690690
if (len == 0)
691691
return ("<empty>");
692692

693-
if (type == LINKADDR_ETHER && len == MAC_ADDR_LEN)
694-
return (etheraddr_string(ndo, ep));
693+
if (type == LINKADDR_MAC48 && len == MAC48_LEN)
694+
return (mac64_string(ndo, ep));
695695

696696
if (type == LINKADDR_FRELAY)
697697
return (q922_string(ndo, ep, len));
@@ -938,7 +938,7 @@ init_protoidarray(netdissect_options *ndo)
938938
}
939939

940940
static const struct etherlist {
941-
const nd_mac_addr addr;
941+
const nd_mac48 addr;
942942
const char *name;
943943
} etherlist[] = {
944944
{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, "Broadcast" },
@@ -949,7 +949,7 @@ static const struct etherlist {
949949
* Initialize the ethers hash table. We take two different approaches
950950
* depending on whether or not the system provides the ethers name
951951
* service. If it does, we just wire in a few names at startup,
952-
* and etheraddr_string() fills in the table on demand. If it doesn't,
952+
* and mac64_string() fills in the table on demand. If it doesn't,
953953
* then we suck in the entire /etc/ethers file at startup. The idea
954954
* is that parsing the local file will be fast, but spinning through
955955
* all the ethers entries via NIS & next_etherent might be very slow.
@@ -995,9 +995,9 @@ init_etherarray(netdissect_options *ndo)
995995
/*
996996
* Use YP/NIS version of name if available.
997997
*/
998-
/* Same workaround as in etheraddr_string(). */
998+
/* Same workaround as in mac64_string(). */
999999
struct ether_addr ea;
1000-
memcpy (&ea, el->addr, MAC_ADDR_LEN);
1000+
memcpy (&ea, el->addr, MAC48_LEN);
10011001
if (ether_ntohost(name, &ea) == 0) {
10021002
tp->e_name = strdup(name);
10031003
if (tp->e_name == NULL)

addrtoname.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern cap_channel_t *capdns;
3737
/* Name to address translation routines. */
3838

3939
enum {
40-
LINKADDR_ETHER,
40+
LINKADDR_MAC48,
4141
LINKADDR_FRELAY,
4242
LINKADDR_EUI64,
4343
LINKADDR_ATM,
@@ -47,7 +47,7 @@ enum {
4747
#define BUFSIZE 128
4848

4949
extern const char *linkaddr_string(netdissect_options *, const uint8_t *, const unsigned int, const unsigned int);
50-
extern const char *etheraddr_string(netdissect_options *, const uint8_t *);
50+
extern const char *mac64_string(netdissect_options *, const uint8_t *);
5151
extern const char *eui64_string(netdissect_options *, const uint8_t *);
5252
extern const char *eui64le_string(netdissect_options *, const uint8_t *);
5353
extern const char *tcpport_string(netdissect_options *, u_short);
@@ -79,11 +79,11 @@ get_linkaddr_string(netdissect_options *ndo, const uint8_t *p,
7979
}
8080

8181
static inline const char *
82-
get_etheraddr_string(netdissect_options *ndo, const uint8_t *p)
82+
get_mac64_string(netdissect_options *ndo, const uint8_t *p)
8383
{
84-
if (!ND_TTEST_LEN(p, MAC_ADDR_LEN))
84+
if (!ND_TTEST_LEN(p, MAC48_LEN))
8585
nd_trunc_longjmp(ndo);
86-
return etheraddr_string(ndo, p);
86+
return mac64_string(ndo, p);
8787
}
8888

8989
static inline const char *
@@ -128,7 +128,7 @@ get_ip6addr_string(netdissect_options *ndo, const u_char *p)
128128
}
129129

130130
#define GET_LINKADDR_STRING(p, type, len) get_linkaddr_string(ndo, (const u_char *)(p), type, len)
131-
#define GET_ETHERADDR_STRING(p) get_etheraddr_string(ndo, (const u_char *)(p))
131+
#define GET_MAC48_STRING(p) get_mac64_string(ndo, (const u_char *)(p))
132132
#define GET_EUI64_STRING(p) get_eui64_string(ndo, (const u_char *)(p))
133133
#define GET_EUI64LE_STRING(p) get_eui64le_string(ndo, (const u_char *)(p))
134134
#define GET_ISONSAP_STRING(nsap, nsap_length) get_isonsap_string(ndo, (const u_char *)(nsap), nsap_length)

netdissect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ typedef unsigned char nd_ipv6[16];
102102
/*
103103
* Use this for MAC addresses.
104104
*/
105-
#define MAC_ADDR_LEN 6U /* length of MAC addresses */
106-
typedef unsigned char nd_mac_addr[MAC_ADDR_LEN];
105+
#define MAC48_LEN 6U /* length of MAC addresses */
106+
typedef unsigned char nd_mac48[MAC48_LEN];
107107

108108
/*
109109
* Use this for EUI64s.

0 commit comments

Comments
 (0)