mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-27 03:53:53 +08:00
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.
This commit is contained in:
parent
77694ea04d
commit
7865163989
18
addrtoname.c
18
addrtoname.c
@ -71,7 +71,7 @@
|
||||
#else /* HAVE_STRUCT_ETHER_ADDR */
|
||||
struct ether_addr {
|
||||
/* Beware FreeBSD calls this "octet". */
|
||||
unsigned char ether_addr_octet[MAC_ADDR_LEN];
|
||||
unsigned char ether_addr_octet[MAC48_LEN];
|
||||
};
|
||||
#endif /* HAVE_STRUCT_ETHER_ADDR */
|
||||
#endif /* what declares ether_ntohost() */
|
||||
@ -589,7 +589,7 @@ lookup_protoid(netdissect_options *ndo, const u_char *pi)
|
||||
}
|
||||
|
||||
const char *
|
||||
etheraddr_string(netdissect_options *ndo, const uint8_t *ep)
|
||||
mac64_string(netdissect_options *ndo, const uint8_t *ep)
|
||||
{
|
||||
int i;
|
||||
char *cp;
|
||||
@ -610,7 +610,7 @@ etheraddr_string(netdissect_options *ndo, const uint8_t *ep)
|
||||
*/
|
||||
struct ether_addr ea;
|
||||
|
||||
memcpy (&ea, ep, MAC_ADDR_LEN);
|
||||
memcpy (&ea, ep, MAC48_LEN);
|
||||
if (ether_ntohost(buf2, &ea) == 0) {
|
||||
tp->e_name = strdup(buf2);
|
||||
if (tp->e_name == NULL)
|
||||
@ -690,8 +690,8 @@ linkaddr_string(netdissect_options *ndo, const uint8_t *ep,
|
||||
if (len == 0)
|
||||
return ("<empty>");
|
||||
|
||||
if (type == LINKADDR_ETHER && len == MAC_ADDR_LEN)
|
||||
return (etheraddr_string(ndo, ep));
|
||||
if (type == LINKADDR_MAC48 && len == MAC48_LEN)
|
||||
return (mac64_string(ndo, ep));
|
||||
|
||||
if (type == LINKADDR_FRELAY)
|
||||
return (q922_string(ndo, ep, len));
|
||||
@ -938,7 +938,7 @@ init_protoidarray(netdissect_options *ndo)
|
||||
}
|
||||
|
||||
static const struct etherlist {
|
||||
const nd_mac_addr addr;
|
||||
const nd_mac48 addr;
|
||||
const char *name;
|
||||
} etherlist[] = {
|
||||
{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, "Broadcast" },
|
||||
@ -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 etheraddr_string() fills in the table on demand. If it doesn't,
|
||||
* and mac64_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,9 +995,9 @@ init_etherarray(netdissect_options *ndo)
|
||||
/*
|
||||
* Use YP/NIS version of name if available.
|
||||
*/
|
||||
/* Same workaround as in etheraddr_string(). */
|
||||
/* Same workaround as in mac64_string(). */
|
||||
struct ether_addr ea;
|
||||
memcpy (&ea, el->addr, MAC_ADDR_LEN);
|
||||
memcpy (&ea, el->addr, MAC48_LEN);
|
||||
if (ether_ntohost(name, &ea) == 0) {
|
||||
tp->e_name = strdup(name);
|
||||
if (tp->e_name == NULL)
|
||||
|
12
addrtoname.h
12
addrtoname.h
@ -37,7 +37,7 @@ extern cap_channel_t *capdns;
|
||||
/* Name to address translation routines. */
|
||||
|
||||
enum {
|
||||
LINKADDR_ETHER,
|
||||
LINKADDR_MAC48,
|
||||
LINKADDR_FRELAY,
|
||||
LINKADDR_EUI64,
|
||||
LINKADDR_ATM,
|
||||
@ -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 *etheraddr_string(netdissect_options *, const uint8_t *);
|
||||
extern const char *mac64_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_etheraddr_string(netdissect_options *ndo, const uint8_t *p)
|
||||
get_mac64_string(netdissect_options *ndo, const uint8_t *p)
|
||||
{
|
||||
if (!ND_TTEST_LEN(p, MAC_ADDR_LEN))
|
||||
if (!ND_TTEST_LEN(p, MAC48_LEN))
|
||||
nd_trunc_longjmp(ndo);
|
||||
return etheraddr_string(ndo, p);
|
||||
return mac64_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_ETHERADDR_STRING(p) get_etheraddr_string(ndo, (const u_char *)(p))
|
||||
#define GET_MAC48_STRING(p) get_mac64_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)
|
||||
|
@ -102,8 +102,8 @@ typedef unsigned char nd_ipv6[16];
|
||||
/*
|
||||
* Use this for MAC addresses.
|
||||
*/
|
||||
#define MAC_ADDR_LEN 6U /* length of MAC addresses */
|
||||
typedef unsigned char nd_mac_addr[MAC_ADDR_LEN];
|
||||
#define MAC48_LEN 6U /* length of MAC addresses */
|
||||
typedef unsigned char nd_mac48[MAC48_LEN];
|
||||
|
||||
/*
|
||||
* Use this for EUI64s.
|
||||
|
122
print-802_11.c
122
print-802_11.c
@ -176,9 +176,9 @@ static const struct tok ctrl_str[] = {
|
||||
struct mgmt_header_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr da;
|
||||
nd_mac_addr sa;
|
||||
nd_mac_addr bssid;
|
||||
nd_mac48 da;
|
||||
nd_mac48 sa;
|
||||
nd_mac48 bssid;
|
||||
nd_uint16_t seq_ctrl;
|
||||
};
|
||||
|
||||
@ -300,7 +300,7 @@ struct mgmt_body_t {
|
||||
struct ctrl_control_wrapper_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr addr1;
|
||||
nd_mac48 addr1;
|
||||
nd_uint16_t carried_fc[IEEE802_11_CARRIED_FC_LEN];
|
||||
nd_uint16_t ht_control[IEEE802_11_HT_CONTROL_LEN];
|
||||
};
|
||||
@ -313,8 +313,8 @@ struct ctrl_control_wrapper_hdr_t {
|
||||
struct ctrl_rts_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac_addr ta;
|
||||
nd_mac48 ra;
|
||||
nd_mac48 ta;
|
||||
};
|
||||
|
||||
#define CTRL_RTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
|
||||
@ -323,7 +323,7 @@ struct ctrl_rts_hdr_t {
|
||||
struct ctrl_cts_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac48 ra;
|
||||
};
|
||||
|
||||
#define CTRL_CTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
|
||||
@ -331,7 +331,7 @@ struct ctrl_cts_hdr_t {
|
||||
struct ctrl_ack_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac48 ra;
|
||||
};
|
||||
|
||||
#define CTRL_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
|
||||
@ -339,8 +339,8 @@ struct ctrl_ack_hdr_t {
|
||||
struct ctrl_ps_poll_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t aid;
|
||||
nd_mac_addr bssid;
|
||||
nd_mac_addr ta;
|
||||
nd_mac48 bssid;
|
||||
nd_mac48 ta;
|
||||
};
|
||||
|
||||
#define CTRL_PS_POLL_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_AID_LEN+\
|
||||
@ -349,8 +349,8 @@ struct ctrl_ps_poll_hdr_t {
|
||||
struct ctrl_end_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac_addr bssid;
|
||||
nd_mac48 ra;
|
||||
nd_mac48 bssid;
|
||||
};
|
||||
|
||||
#define CTRL_END_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
|
||||
@ -359,8 +359,8 @@ struct ctrl_end_hdr_t {
|
||||
struct ctrl_end_ack_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac_addr bssid;
|
||||
nd_mac48 ra;
|
||||
nd_mac48 bssid;
|
||||
};
|
||||
|
||||
#define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
|
||||
@ -369,8 +369,8 @@ struct ctrl_end_ack_hdr_t {
|
||||
struct ctrl_ba_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t duration;
|
||||
nd_mac_addr ra;
|
||||
nd_mac_addr ta;
|
||||
nd_mac48 ra;
|
||||
nd_mac48 ta;
|
||||
};
|
||||
|
||||
#define CTRL_BA_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
|
||||
@ -379,8 +379,8 @@ struct ctrl_ba_hdr_t {
|
||||
struct ctrl_bar_hdr_t {
|
||||
nd_uint16_t fc;
|
||||
nd_uint16_t dur;
|
||||
nd_mac_addr ra;
|
||||
nd_mac_addr ta;
|
||||
nd_mac48 ra;
|
||||
nd_mac48 ta;
|
||||
nd_uint16_t ctl;
|
||||
nd_uint16_t seq;
|
||||
};
|
||||
@ -393,9 +393,9 @@ struct meshcntl_t {
|
||||
nd_uint8_t flags;
|
||||
nd_uint8_t ttl;
|
||||
nd_uint32_t seq;
|
||||
nd_mac_addr addr4;
|
||||
nd_mac_addr addr5;
|
||||
nd_mac_addr addr6;
|
||||
nd_mac48 addr4;
|
||||
nd_mac48 addr5;
|
||||
nd_mac48 addr6;
|
||||
};
|
||||
|
||||
#define IV_IV(iv) ((iv) & 0xFFFFFF)
|
||||
@ -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", etheraddr_string(ndo, pbody.ap ));
|
||||
ND_PRINT(" AP : %s", mac64_string(ndo, pbody.ap ));
|
||||
|
||||
return ret;
|
||||
trunc:
|
||||
@ -1710,7 +1710,7 @@ handle_deauth(netdissect_options *ndo,
|
||||
if (ndo->ndo_eflag) {
|
||||
ND_PRINT(": %s", reason);
|
||||
} else {
|
||||
ND_PRINT(" (%s): %s", GET_ETHERADDR_STRING(src), reason);
|
||||
ND_PRINT(" (%s): %s", GET_MAC48_STRING(src), reason);
|
||||
}
|
||||
return 1;
|
||||
trunc:
|
||||
@ -1795,7 +1795,7 @@ handle_action(netdissect_options *ndo,
|
||||
if (ndo->ndo_eflag) {
|
||||
ND_PRINT(": ");
|
||||
} else {
|
||||
ND_PRINT(" (%s): ", GET_ETHERADDR_STRING(src));
|
||||
ND_PRINT(" (%s): ", GET_MAC48_STRING(src));
|
||||
}
|
||||
category = GET_U_1(p);
|
||||
ND_PRINT("%s ", tok2str(category_str, "Reserved(%u)", category));
|
||||
@ -1874,8 +1874,8 @@ ctrl_body_print(netdissect_options *ndo,
|
||||
ND_TCHECK_LEN(p, CTRL_BAR_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s TA:%s CTL(%x) SEQ(%u) ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_bar_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_bar_hdr_t *)p)->ta),
|
||||
GET_MAC48_STRING(((const struct ctrl_bar_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_bar_hdr_t *)p)->ta),
|
||||
GET_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->ctl),
|
||||
GET_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq));
|
||||
break;
|
||||
@ -1883,7 +1883,7 @@ ctrl_body_print(netdissect_options *ndo,
|
||||
ND_TCHECK_LEN(p, CTRL_BA_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ba_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_ba_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_PS_POLL:
|
||||
ND_TCHECK_LEN(p, CTRL_PS_POLL_HDRLEN);
|
||||
@ -1894,31 +1894,31 @@ ctrl_body_print(netdissect_options *ndo,
|
||||
ND_TCHECK_LEN(p, CTRL_RTS_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" TA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_rts_hdr_t *)p)->ta));
|
||||
GET_MAC48_STRING(((const struct ctrl_rts_hdr_t *)p)->ta));
|
||||
break;
|
||||
case CTRL_CTS:
|
||||
ND_TCHECK_LEN(p, CTRL_CTS_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_cts_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_cts_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_ACK:
|
||||
ND_TCHECK_LEN(p, CTRL_ACK_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ack_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_ack_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_CF_END:
|
||||
ND_TCHECK_LEN(p, CTRL_END_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_end_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_END_ACK:
|
||||
ND_TCHECK_LEN(p, CTRL_END_ACK_HDRLEN);
|
||||
if (!ndo->ndo_eflag)
|
||||
ND_PRINT(" RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_ack_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_end_ack_hdr_t *)p)->ra));
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
@ -2020,20 +2020,20 @@ data_header_print(netdissect_options *ndo, uint16_t fc, const u_char *p)
|
||||
|
||||
if (!FC_TO_DS(fc) && !FC_FROM_DS(fc)) {
|
||||
ND_PRINT("DA:%s SA:%s BSSID:%s ",
|
||||
GET_ETHERADDR_STRING(ADDR1), GET_ETHERADDR_STRING(ADDR2),
|
||||
GET_ETHERADDR_STRING(ADDR3));
|
||||
GET_MAC48_STRING(ADDR1), GET_MAC48_STRING(ADDR2),
|
||||
GET_MAC48_STRING(ADDR3));
|
||||
} else if (!FC_TO_DS(fc) && FC_FROM_DS(fc)) {
|
||||
ND_PRINT("DA:%s BSSID:%s SA:%s ",
|
||||
GET_ETHERADDR_STRING(ADDR1), GET_ETHERADDR_STRING(ADDR2),
|
||||
GET_ETHERADDR_STRING(ADDR3));
|
||||
GET_MAC48_STRING(ADDR1), GET_MAC48_STRING(ADDR2),
|
||||
GET_MAC48_STRING(ADDR3));
|
||||
} else if (FC_TO_DS(fc) && !FC_FROM_DS(fc)) {
|
||||
ND_PRINT("BSSID:%s SA:%s DA:%s ",
|
||||
GET_ETHERADDR_STRING(ADDR1), GET_ETHERADDR_STRING(ADDR2),
|
||||
GET_ETHERADDR_STRING(ADDR3));
|
||||
GET_MAC48_STRING(ADDR1), GET_MAC48_STRING(ADDR2),
|
||||
GET_MAC48_STRING(ADDR3));
|
||||
} else if (FC_TO_DS(fc) && FC_FROM_DS(fc)) {
|
||||
ND_PRINT("RA:%s TA:%s DA:%s SA:%s ",
|
||||
GET_ETHERADDR_STRING(ADDR1), GET_ETHERADDR_STRING(ADDR2),
|
||||
GET_ETHERADDR_STRING(ADDR3), GET_ETHERADDR_STRING(ADDR4));
|
||||
GET_MAC48_STRING(ADDR1), GET_MAC48_STRING(ADDR2),
|
||||
GET_MAC48_STRING(ADDR3), GET_MAC48_STRING(ADDR4));
|
||||
}
|
||||
|
||||
#undef ADDR1
|
||||
@ -2048,8 +2048,8 @@ mgmt_header_print(netdissect_options *ndo, const u_char *p)
|
||||
const struct mgmt_header_t *hp = (const struct mgmt_header_t *) p;
|
||||
|
||||
ND_PRINT("BSSID:%s DA:%s SA:%s ",
|
||||
GET_ETHERADDR_STRING((hp)->bssid), GET_ETHERADDR_STRING((hp)->da),
|
||||
GET_ETHERADDR_STRING((hp)->sa));
|
||||
GET_MAC48_STRING((hp)->bssid), GET_MAC48_STRING((hp)->da),
|
||||
GET_MAC48_STRING((hp)->sa));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2058,43 +2058,43 @@ ctrl_header_print(netdissect_options *ndo, uint16_t fc, const u_char *p)
|
||||
switch (FC_SUBTYPE(fc)) {
|
||||
case CTRL_BAR:
|
||||
ND_PRINT(" RA:%s TA:%s CTL(%x) SEQ(%u) ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_bar_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_bar_hdr_t *)p)->ta),
|
||||
GET_MAC48_STRING(((const struct ctrl_bar_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_bar_hdr_t *)p)->ta),
|
||||
GET_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->ctl),
|
||||
GET_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq));
|
||||
break;
|
||||
case CTRL_BA:
|
||||
ND_PRINT("RA:%s TA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ba_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ba_hdr_t *)p)->ta));
|
||||
GET_MAC48_STRING(((const struct ctrl_ba_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_ba_hdr_t *)p)->ta));
|
||||
break;
|
||||
case CTRL_PS_POLL:
|
||||
ND_PRINT("BSSID:%s TA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ps_poll_hdr_t *)p)->bssid),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ps_poll_hdr_t *)p)->ta));
|
||||
GET_MAC48_STRING(((const struct ctrl_ps_poll_hdr_t *)p)->bssid),
|
||||
GET_MAC48_STRING(((const struct ctrl_ps_poll_hdr_t *)p)->ta));
|
||||
break;
|
||||
case CTRL_RTS:
|
||||
ND_PRINT("RA:%s TA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_rts_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_rts_hdr_t *)p)->ta));
|
||||
GET_MAC48_STRING(((const struct ctrl_rts_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_rts_hdr_t *)p)->ta));
|
||||
break;
|
||||
case CTRL_CTS:
|
||||
ND_PRINT("RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_cts_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_cts_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_ACK:
|
||||
ND_PRINT("RA:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_ack_hdr_t *)p)->ra));
|
||||
GET_MAC48_STRING(((const struct ctrl_ack_hdr_t *)p)->ra));
|
||||
break;
|
||||
case CTRL_CF_END:
|
||||
ND_PRINT("RA:%s BSSID:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_hdr_t *)p)->bssid));
|
||||
GET_MAC48_STRING(((const struct ctrl_end_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_end_hdr_t *)p)->bssid));
|
||||
break;
|
||||
case CTRL_END_ACK:
|
||||
ND_PRINT("RA:%s BSSID:%s ",
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_ack_hdr_t *)p)->ra),
|
||||
GET_ETHERADDR_STRING(((const struct ctrl_end_ack_hdr_t *)p)->bssid));
|
||||
GET_MAC48_STRING(((const struct ctrl_end_ack_hdr_t *)p)->ra),
|
||||
GET_MAC48_STRING(((const struct ctrl_end_ack_hdr_t *)p)->bssid));
|
||||
break;
|
||||
default:
|
||||
/* We shouldn't get here - we should already have quit */
|
||||
@ -2185,11 +2185,11 @@ ieee_802_11_hdr_print(netdissect_options *ndo,
|
||||
ND_PRINT("MeshData (AE %u TTL %u seq %u", ae,
|
||||
GET_U_1(mc->ttl), GET_LE_U_4(mc->seq));
|
||||
if (ae > 0)
|
||||
ND_PRINT(" A4:%s", GET_ETHERADDR_STRING(mc->addr4));
|
||||
ND_PRINT(" A4:%s", GET_MAC48_STRING(mc->addr4));
|
||||
if (ae > 1)
|
||||
ND_PRINT(" A5:%s", GET_ETHERADDR_STRING(mc->addr5));
|
||||
ND_PRINT(" A5:%s", GET_MAC48_STRING(mc->addr5));
|
||||
if (ae > 2)
|
||||
ND_PRINT(" A6:%s", GET_ETHERADDR_STRING(mc->addr6));
|
||||
ND_PRINT(" A6:%s", GET_MAC48_STRING(mc->addr6));
|
||||
ND_PRINT(") ");
|
||||
}
|
||||
|
||||
@ -2272,8 +2272,8 @@ ieee802_11_print(netdissect_options *ndo,
|
||||
caplen -= hdrlen;
|
||||
p += hdrlen;
|
||||
|
||||
src.addr_string = etheraddr_string;
|
||||
dst.addr_string = etheraddr_string;
|
||||
src.addr_string = mac64_string;
|
||||
dst.addr_string = mac64_string;
|
||||
switch (FC_TYPE(fc)) {
|
||||
case T_MGMT:
|
||||
get_mgmt_src_dst_mac(p - hdrlen, &src.addr, &dst.addr);
|
||||
|
16
print-aoe.c
16
print-aoe.c
@ -283,9 +283,9 @@ aoev1_mac_print(netdissect_options *ndo,
|
||||
cp += 1;
|
||||
len -= 1;
|
||||
/* Ethernet Address */
|
||||
ND_PRINT(", Ethernet Address: %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
len -= MAC_ADDR_LEN;
|
||||
ND_PRINT(", Ethernet Address: %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
len -= MAC48_LEN;
|
||||
}
|
||||
return;
|
||||
|
||||
@ -300,7 +300,7 @@ aoev1_reserve_print(netdissect_options *ndo,
|
||||
{
|
||||
uint8_t nmacs, i;
|
||||
|
||||
if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC_ADDR_LEN)
|
||||
if (len < AOEV1_RESERVE_ARG_LEN || (len - AOEV1_RESERVE_ARG_LEN) % MAC48_LEN)
|
||||
goto invalid;
|
||||
/* RCmd */
|
||||
ND_PRINT("\n\tRCmd: %s",
|
||||
@ -312,13 +312,13 @@ aoev1_reserve_print(netdissect_options *ndo,
|
||||
cp += 1;
|
||||
len -= 1;
|
||||
ND_PRINT(", NMacs: %u", nmacs);
|
||||
if (nmacs * MAC_ADDR_LEN != len)
|
||||
if (nmacs * MAC48_LEN != len)
|
||||
goto invalid;
|
||||
/* addresses */
|
||||
for (i = 0; i < nmacs; i++) {
|
||||
ND_PRINT("\n\tEthernet Address %u: %s", i, GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
len -= MAC_ADDR_LEN;
|
||||
ND_PRINT("\n\tEthernet Address %u: %s", i, GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
len -= MAC48_LEN;
|
||||
}
|
||||
return;
|
||||
|
||||
|
@ -373,7 +373,7 @@ arp_print(netdissect_options *ndo,
|
||||
linkaddr = LINKADDR_FRELAY;
|
||||
break;
|
||||
default:
|
||||
linkaddr = LINKADDR_ETHER;
|
||||
linkaddr = LINKADDR_MAC48;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -125,9 +125,9 @@ struct aarp {
|
||||
nd_uint16_t htype, ptype;
|
||||
nd_uint8_t halen, palen;
|
||||
nd_uint16_t op;
|
||||
nd_mac_addr hsaddr;
|
||||
nd_mac48 hsaddr;
|
||||
uint8_t psaddr[4];
|
||||
nd_mac_addr hdaddr;
|
||||
nd_mac48 hdaddr;
|
||||
uint8_t pdaddr[4];
|
||||
};
|
||||
|
||||
@ -271,7 +271,7 @@ aarp_print(netdissect_options *ndo,
|
||||
ND_TCHECK_SIZE(ap);
|
||||
if (GET_BE_U_2(ap->htype) == 1 &&
|
||||
GET_BE_U_2(ap->ptype) == ETHERTYPE_ATALK &&
|
||||
GET_U_1(ap->halen) == MAC_ADDR_LEN && GET_U_1(ap->palen) == 4)
|
||||
GET_U_1(ap->halen) == MAC48_LEN && GET_U_1(ap->palen) == 4)
|
||||
switch (GET_BE_U_2(ap->op)) {
|
||||
|
||||
case 1: /* request */
|
||||
@ -279,7 +279,7 @@ aarp_print(netdissect_options *ndo,
|
||||
return;
|
||||
|
||||
case 2: /* response */
|
||||
ND_PRINT("reply %s is-at %s", AT(psaddr), GET_ETHERADDR_STRING(ap->hsaddr));
|
||||
ND_PRINT("reply %s is-at %s", AT(psaddr), GET_MAC48_STRING(ap->hsaddr));
|
||||
return;
|
||||
|
||||
case 3: /* probe (oy!) */
|
||||
|
@ -305,8 +305,8 @@ bootp_print(netdissect_options *ndo,
|
||||
|
||||
bp_htype = GET_U_1(bp->bp_htype);
|
||||
bp_hlen = GET_U_1(bp->bp_hlen);
|
||||
if (bp_htype == 1 && bp_hlen == MAC_ADDR_LEN && bp_op == BOOTPREQUEST) {
|
||||
ND_PRINT(" from %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
|
||||
if (bp_htype == 1 && bp_hlen == MAC48_LEN && bp_op == BOOTPREQUEST) {
|
||||
ND_PRINT(" from %s", GET_MAC48_STRING(bp->bp_chaddr));
|
||||
}
|
||||
|
||||
ND_PRINT(", length %u", length);
|
||||
@ -321,7 +321,7 @@ bootp_print(netdissect_options *ndo,
|
||||
ND_PRINT(", htype %u", bp_htype);
|
||||
|
||||
/* The usual length for 10Mb Ethernet address is 6 bytes */
|
||||
if (bp_htype != 1 || bp_hlen != MAC_ADDR_LEN)
|
||||
if (bp_htype != 1 || bp_hlen != MAC48_LEN)
|
||||
ND_PRINT(", hlen %u", bp_hlen);
|
||||
|
||||
/* Only print interesting fields */
|
||||
@ -354,8 +354,8 @@ bootp_print(netdissect_options *ndo,
|
||||
ND_PRINT("\n\t Gateway-IP %s", GET_IPADDR_STRING(bp->bp_giaddr));
|
||||
|
||||
/* Client's Ethernet address */
|
||||
if (bp_htype == 1 && bp_hlen == MAC_ADDR_LEN) {
|
||||
ND_PRINT("\n\t Client-Ethernet-Address %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
|
||||
if (bp_htype == 1 && bp_hlen == MAC48_LEN) {
|
||||
ND_PRINT("\n\t Client-Ethernet-Address %s", GET_MAC48_STRING(bp->bp_chaddr));
|
||||
}
|
||||
|
||||
if (GET_U_1(bp->bp_sname)) { /* get first char only */
|
||||
|
16
print-cfm.c
16
print-cfm.c
@ -114,8 +114,8 @@ struct cfm_lbm_t {
|
||||
struct cfm_ltm_t {
|
||||
nd_uint32_t transaction_id;
|
||||
nd_uint8_t ttl;
|
||||
nd_mac_addr original_mac;
|
||||
nd_mac_addr target_mac;
|
||||
nd_mac48 original_mac;
|
||||
nd_mac48 target_mac;
|
||||
};
|
||||
|
||||
static const struct tok cfm_ltm_flag_values[] = {
|
||||
@ -405,8 +405,8 @@ cfm_print(netdissect_options *ndo,
|
||||
break;
|
||||
|
||||
case CFM_CCM_MD_FORMAT_MAC:
|
||||
if (md_namelength == MAC_ADDR_LEN) {
|
||||
ND_PRINT("\n\t MAC %s", GET_ETHERADDR_STRING(md_name));
|
||||
if (md_namelength == MAC48_LEN) {
|
||||
ND_PRINT("\n\t MAC %s", GET_MAC48_STRING(md_name));
|
||||
} else {
|
||||
ND_PRINT("\n\t MAC (length invalid)");
|
||||
}
|
||||
@ -484,8 +484,8 @@ cfm_print(netdissect_options *ndo,
|
||||
GET_U_1(msg_ptr.cfm_ltm->ttl));
|
||||
|
||||
ND_PRINT("\n\t Original-MAC %s, Target-MAC %s",
|
||||
GET_ETHERADDR_STRING(msg_ptr.cfm_ltm->original_mac),
|
||||
GET_ETHERADDR_STRING(msg_ptr.cfm_ltm->target_mac));
|
||||
GET_MAC48_STRING(msg_ptr.cfm_ltm->original_mac),
|
||||
GET_MAC48_STRING(msg_ptr.cfm_ltm->target_mac));
|
||||
break;
|
||||
|
||||
case CFM_OPCODE_LTR:
|
||||
@ -640,12 +640,12 @@ cfm_print(netdissect_options *ndo,
|
||||
/* IEEE 802.1Q-2014 Section 21.5.3.3: Chassis ID */
|
||||
switch (chassis_id_type) {
|
||||
case CFM_CHASSIS_ID_MAC_ADDRESS:
|
||||
if (chassis_id_length != MAC_ADDR_LEN) {
|
||||
if (chassis_id_length != MAC48_LEN) {
|
||||
ND_PRINT(" (invalid MAC address length)");
|
||||
hexdump = TRUE;
|
||||
break;
|
||||
}
|
||||
ND_PRINT("\n\t MAC %s", GET_ETHERADDR_STRING(tptr + 1));
|
||||
ND_PRINT("\n\t MAC %s", GET_MAC48_STRING(tptr + 1));
|
||||
break;
|
||||
|
||||
case CFM_CHASSIS_ID_NETWORK_ADDRESS:
|
||||
|
@ -52,7 +52,7 @@ typedef nd_uint32_t longword; /* 4 bytes field */
|
||||
* Definitions for DECNET Phase IV protocol headers
|
||||
*/
|
||||
typedef union {
|
||||
nd_mac_addr dne_addr; /* full Ethernet address */
|
||||
nd_mac48 dne_addr; /* full Ethernet address */
|
||||
struct {
|
||||
nd_byte dne_hiord[4]; /* DECnet HIORD prefix */
|
||||
nd_byte dne_nodeaddr[2]; /* DECnet node address */
|
||||
|
@ -104,7 +104,7 @@ dtp_print(netdissect_options *ndo, const u_char *tptr, u_int length)
|
||||
case DTP_NEIGHBOR_TLV:
|
||||
if (len != 10)
|
||||
goto invalid;
|
||||
ND_PRINT(", %s", GET_ETHERADDR_STRING(tptr+4));
|
||||
ND_PRINT(", %s", GET_MAC48_STRING(tptr+4));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -37,8 +37,8 @@
|
||||
* Structure of an Ethernet header.
|
||||
*/
|
||||
struct ether_header {
|
||||
nd_mac_addr ether_dhost;
|
||||
nd_mac_addr ether_shost;
|
||||
nd_mac48 ether_dhost;
|
||||
nd_mac48 ether_shost;
|
||||
nd_uint16_t ether_length_type;
|
||||
};
|
||||
|
||||
@ -112,7 +112,7 @@ ether_addresses_print(netdissect_options *ndo, const u_char *src,
|
||||
const u_char *dst)
|
||||
{
|
||||
ND_PRINT("%s > %s, ",
|
||||
GET_ETHERADDR_STRING(src), GET_ETHERADDR_STRING(dst));
|
||||
GET_MAC48_STRING(src), GET_MAC48_STRING(dst));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -171,14 +171,14 @@ 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 = etheraddr_string;
|
||||
src.addr_string = mac64_string;
|
||||
dst.addr = ehp->ether_dhost;
|
||||
dst.addr_string = etheraddr_string;
|
||||
dst.addr_string = mac64_string;
|
||||
|
||||
length -= 2*MAC_ADDR_LEN;
|
||||
caplen -= 2*MAC_ADDR_LEN;
|
||||
p += 2*MAC_ADDR_LEN;
|
||||
hdrlen = 2*MAC_ADDR_LEN;
|
||||
length -= 2*MAC48_LEN;
|
||||
caplen -= 2*MAC48_LEN;
|
||||
p += 2*MAC48_LEN;
|
||||
hdrlen = 2*MAC48_LEN;
|
||||
|
||||
if (ndo->ndo_eflag)
|
||||
ether_addresses_print(ndo, src.addr, dst.addr);
|
||||
|
14
print-fddi.c
14
print-fddi.c
@ -39,8 +39,8 @@
|
||||
|
||||
struct fddi_header {
|
||||
nd_uint8_t fddi_fc; /* frame control */
|
||||
nd_mac_addr fddi_dhost;
|
||||
nd_mac_addr fddi_shost;
|
||||
nd_mac48 fddi_dhost;
|
||||
nd_mac48 fddi_shost;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -256,8 +256,8 @@ fddi_hdr_print(netdissect_options *ndo,
|
||||
{
|
||||
const char *srcname, *dstname;
|
||||
|
||||
srcname = etheraddr_string(ndo, fsrc);
|
||||
dstname = etheraddr_string(ndo, fdst);
|
||||
srcname = mac64_string(ndo, fsrc);
|
||||
dstname = mac64_string(ndo, fdst);
|
||||
|
||||
if (!ndo->ndo_qflag)
|
||||
print_fddi_fc(ndo, GET_U_1(fddip->fddi_fc));
|
||||
@ -277,7 +277,7 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
|
||||
{
|
||||
const struct fddi_header *fddip = (const struct fddi_header *)p;
|
||||
uint8_t fc;
|
||||
nd_mac_addr srcmac, dstmac;
|
||||
nd_mac48 srcmac, dstmac;
|
||||
struct lladdr_info src, dst;
|
||||
int llc_hdrlen;
|
||||
|
||||
@ -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 = etheraddr_string;
|
||||
src.addr_string = mac64_string;
|
||||
dst.addr = dstmac;
|
||||
dst.addr_string = etheraddr_string;
|
||||
dst.addr_string = mac64_string;
|
||||
|
||||
/* Skip over FDDI MAC header */
|
||||
length -= FDDI_HDRLEN;
|
||||
|
18
print-ipfc.c
18
print-ipfc.c
@ -37,8 +37,8 @@
|
||||
|
||||
|
||||
struct ipfc_header {
|
||||
nd_byte ipfc_dhost[2+MAC_ADDR_LEN];
|
||||
nd_byte ipfc_shost[2+MAC_ADDR_LEN];
|
||||
nd_byte ipfc_dhost[2+MAC48_LEN];
|
||||
nd_byte ipfc_shost[2+MAC48_LEN];
|
||||
};
|
||||
|
||||
#define IPFC_HDRLEN 16
|
||||
@ -52,8 +52,8 @@ extract_ipfc_addrs(const struct ipfc_header *ipfcp, char *ipfcsrc,
|
||||
* We assume that, as per RFC 2625, the lower 48 bits of the
|
||||
* source and destination addresses are MAC addresses.
|
||||
*/
|
||||
memcpy(ipfcdst, (const char *)&ipfcp->ipfc_dhost[2], MAC_ADDR_LEN);
|
||||
memcpy(ipfcsrc, (const char *)&ipfcp->ipfc_shost[2], MAC_ADDR_LEN);
|
||||
memcpy(ipfcdst, (const char *)&ipfcp->ipfc_dhost[2], MAC48_LEN);
|
||||
memcpy(ipfcsrc, (const char *)&ipfcp->ipfc_shost[2], MAC48_LEN);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -66,8 +66,8 @@ ipfc_hdr_print(netdissect_options *ndo,
|
||||
{
|
||||
const char *srcname, *dstname;
|
||||
|
||||
srcname = etheraddr_string(ndo, ipfcsrc);
|
||||
dstname = etheraddr_string(ndo, ipfcdst);
|
||||
srcname = mac64_string(ndo, ipfcsrc);
|
||||
dstname = mac64_string(ndo, ipfcdst);
|
||||
|
||||
/*
|
||||
* XXX - should we show the upper 16 bits of the addresses?
|
||||
@ -91,7 +91,7 @@ static u_int
|
||||
ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
|
||||
{
|
||||
const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
|
||||
nd_mac_addr srcmac, dstmac;
|
||||
nd_mac48 srcmac, dstmac;
|
||||
struct lladdr_info src, dst;
|
||||
int llc_hdrlen;
|
||||
|
||||
@ -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 = etheraddr_string;
|
||||
src.addr_string = mac64_string;
|
||||
dst.addr = dstmac;
|
||||
dst.addr_string = etheraddr_string;
|
||||
dst.addr_string = mac64_string;
|
||||
|
||||
/* Skip over Network_Header */
|
||||
length -= IPFC_HDRLEN;
|
||||
|
@ -52,10 +52,10 @@ struct ipxHdr {
|
||||
nd_uint8_t tCtl; /* Transport Control (i.e. hop count) */
|
||||
nd_uint8_t pType; /* Packet Type (i.e. level 2 protocol) */
|
||||
nd_uint32_t dstNet; /* destination net */
|
||||
nd_mac_addr dstNode; /* destination node */
|
||||
nd_mac48 dstNode; /* destination node */
|
||||
nd_uint16_t dstSkt; /* destination socket */
|
||||
nd_uint32_t srcNet; /* source net */
|
||||
nd_mac_addr srcNode; /* source node */
|
||||
nd_mac48 srcNode; /* source node */
|
||||
nd_uint16_t srcSkt; /* source socket */
|
||||
};
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
* IS-IS is defined in ISO 10589. Look there for protocol definitions.
|
||||
*/
|
||||
|
||||
#define SYSTEM_ID_LEN MAC_ADDR_LEN
|
||||
#define SYSTEM_ID_LEN MAC48_LEN
|
||||
#define NODE_ID_LEN (SYSTEM_ID_LEN+1)
|
||||
#define LSP_ID_LEN (SYSTEM_ID_LEN+2)
|
||||
|
||||
@ -1300,10 +1300,10 @@ esis_print(netdissect_options *ndo,
|
||||
pptr += netal;
|
||||
li -= netal;
|
||||
|
||||
if (snpal == MAC_ADDR_LEN)
|
||||
if (snpal == MAC48_LEN)
|
||||
ND_PRINT("\n\t SNPA (length: %u): %s",
|
||||
snpal,
|
||||
GET_ETHERADDR_STRING(snpa));
|
||||
GET_MAC48_STRING(snpa));
|
||||
else
|
||||
ND_PRINT("\n\t SNPA (length: %u): %s",
|
||||
snpal,
|
||||
@ -2889,12 +2889,12 @@ isis_print(netdissect_options *ndo,
|
||||
break;
|
||||
case ISIS_TLV_ISNEIGH:
|
||||
while (tlen != 0) {
|
||||
if (tlen < MAC_ADDR_LEN)
|
||||
if (tlen < MAC48_LEN)
|
||||
goto tlv_trunc;
|
||||
ND_TCHECK_LEN(tptr, MAC_ADDR_LEN);
|
||||
ND_PRINT("\n\t SNPA: %s", isis_print_id(ndo, tptr, MAC_ADDR_LEN));
|
||||
tlen -= MAC_ADDR_LEN;
|
||||
tptr += MAC_ADDR_LEN;
|
||||
ND_TCHECK_LEN(tptr, MAC48_LEN);
|
||||
ND_PRINT("\n\t SNPA: %s", isis_print_id(ndo, tptr, MAC48_LEN));
|
||||
tlen -= MAC48_LEN;
|
||||
tptr += MAC48_LEN;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -34,8 +34,8 @@
|
||||
|
||||
struct lecdatahdr_8023 {
|
||||
nd_uint16_t le_header;
|
||||
nd_mac_addr h_dest;
|
||||
nd_mac_addr h_source;
|
||||
nd_mac48 h_dest;
|
||||
nd_mac48 h_source;
|
||||
nd_uint16_t h_type;
|
||||
};
|
||||
|
||||
|
@ -1360,9 +1360,9 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len)
|
||||
pfunc = ip6addr_string;
|
||||
break;
|
||||
case AFNUM_802:
|
||||
if (len < MAC_ADDR_LEN)
|
||||
if (len < MAC48_LEN)
|
||||
return NULL;
|
||||
pfunc = etheraddr_string;
|
||||
pfunc = mac64_string;
|
||||
break;
|
||||
default:
|
||||
pfunc = NULL;
|
||||
@ -1505,7 +1505,7 @@ lldp_print(netdissect_options *ndo,
|
||||
if (tlv_len < 1+6) {
|
||||
goto trunc;
|
||||
}
|
||||
ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
|
||||
ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
|
||||
break;
|
||||
|
||||
case LLDP_CHASSIS_INTF_NAME_SUBTYPE: /* fall through */
|
||||
@ -1546,7 +1546,7 @@ lldp_print(netdissect_options *ndo,
|
||||
if (tlv_len < 1+6) {
|
||||
goto trunc;
|
||||
}
|
||||
ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
|
||||
ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
|
||||
break;
|
||||
|
||||
case LLDP_PORT_INTF_NAME_SUBTYPE: /* fall through */
|
||||
|
@ -80,12 +80,12 @@ loopback_message_print(netdissect_options *ndo,
|
||||
ND_TCHECK_LEN(cp, len);
|
||||
break;
|
||||
case LOOPBACK_FWDDATA:
|
||||
if (len < MAC_ADDR_LEN)
|
||||
if (len < MAC48_LEN)
|
||||
goto invalid;
|
||||
/* forwarding address */
|
||||
ND_PRINT(", forwarding address %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
len -= MAC_ADDR_LEN;
|
||||
ND_PRINT(", forwarding address %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
len -= MAC48_LEN;
|
||||
/* data */
|
||||
ND_PRINT(", data (%u octets)", len);
|
||||
ND_TCHECK_LEN(cp, len);
|
||||
|
@ -217,7 +217,7 @@ lwapp_control_print(netdissect_options *ndo,
|
||||
tlen);
|
||||
|
||||
if (has_ap_ident) {
|
||||
ND_PRINT("\n\tAP identity: %s", GET_ETHERADDR_STRING(tptr));
|
||||
ND_PRINT("\n\tAP identity: %s", GET_MAC48_STRING(tptr));
|
||||
tptr+=sizeof(struct lwapp_transport_header)+6;
|
||||
} else {
|
||||
tptr+=sizeof(struct lwapp_transport_header);
|
||||
|
@ -179,7 +179,7 @@ static const char *
|
||||
nhrp_mac_addr_string(netdissect_options *ndo, const u_char *addr, u_int addrlen)
|
||||
{
|
||||
if (addrlen == 6)
|
||||
return (GET_ETHERADDR_STRING(addr));
|
||||
return (GET_MAC48_STRING(addr));
|
||||
else
|
||||
return (GET_LINKADDR_STRING(addr, LINKADDR_OTHER, addrlen));
|
||||
}
|
||||
|
@ -1034,8 +1034,8 @@ of10_phy_port_print(netdissect_options *ndo,
|
||||
tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
|
||||
cp += 2;
|
||||
/* hw_addr */
|
||||
ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT(", hw_addr %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* name */
|
||||
ND_PRINT(", name '");
|
||||
nd_printjnp(ndo, cp, OFP_MAX_PORT_NAME_LEN);
|
||||
@ -1205,12 +1205,12 @@ of10_match_print(netdissect_options *ndo,
|
||||
cp += 2;
|
||||
/* dl_src */
|
||||
if (! (wildcards & OFPFW_DL_SRC))
|
||||
ND_PRINT("%smatch dl_src %s", pfx, GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT("%smatch dl_src %s", pfx, GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* dl_dst */
|
||||
if (! (wildcards & OFPFW_DL_DST))
|
||||
ND_PRINT("%smatch dl_dst %s", pfx, GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT("%smatch dl_dst %s", pfx, GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* dl_vlan */
|
||||
if (! (wildcards & OFPFW_DL_VLAN))
|
||||
ND_PRINT("%smatch dl_vlan %s", pfx, vlan_str(GET_BE_U_2(cp)));
|
||||
@ -1371,8 +1371,8 @@ of10_actions_print(netdissect_options *ndo,
|
||||
case OFPAT_SET_DL_SRC:
|
||||
case OFPAT_SET_DL_DST:
|
||||
/* dl_addr */
|
||||
ND_PRINT(", dl_addr %s", GET_ETHERADDR_STRING(cp));
|
||||
OF_FWD(MAC_ADDR_LEN);
|
||||
ND_PRINT(", dl_addr %s", GET_MAC48_STRING(cp));
|
||||
OF_FWD(MAC48_LEN);
|
||||
/* pad */
|
||||
/* Sometimes the last field, check bounds. */
|
||||
OF_CHK_FWD(6);
|
||||
@ -1537,8 +1537,8 @@ of10_port_mod_print(netdissect_options *ndo,
|
||||
ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
|
||||
cp += 2;
|
||||
/* hw_addr */
|
||||
ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT(", hw_addr %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* config */
|
||||
ND_PRINT("\n\t config 0x%08x", GET_BE_U_4(cp));
|
||||
of_bitmap_print(ndo, ofppc_bm, GET_BE_U_4(cp), OFPPC_U);
|
||||
|
@ -655,8 +655,8 @@ of13_port_print(netdissect_options *ndo,
|
||||
/* pad */
|
||||
cp += 4;
|
||||
/* hw_addr */
|
||||
ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT(", hw_addr %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* pad2 */
|
||||
cp += 2;
|
||||
/* name */
|
||||
@ -812,8 +812,8 @@ of13_port_mod_print(netdissect_options *ndo,
|
||||
/* pad */
|
||||
cp += 4;
|
||||
/* hw_addr */
|
||||
ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp));
|
||||
cp += MAC_ADDR_LEN;
|
||||
ND_PRINT(", hw_addr %s", GET_MAC48_STRING(cp));
|
||||
cp += MAC48_LEN;
|
||||
/* pad2 */
|
||||
cp += 2;
|
||||
/* config */
|
||||
|
@ -736,7 +736,7 @@ print_lcp_config_options(netdissect_options *ndo,
|
||||
ND_PRINT(" (length bogus, should be = 9)");
|
||||
return 0;
|
||||
}
|
||||
ND_PRINT(": MAC %s", GET_ETHERADDR_STRING(p + 3));
|
||||
ND_PRINT(": MAC %s", GET_MAC48_STRING(p + 3));
|
||||
break;
|
||||
case MEDCLASS_MNB:
|
||||
ND_PRINT(": Magic-Num-Block"); /* XXX */
|
||||
|
@ -128,7 +128,7 @@ rrcp_print(netdissect_options *ndo,
|
||||
ND_PRINT(" downlink_port=%u, uplink_port=%u, uplink_mac=%s, vendor_id=%08x ,chip_id=%04x ",
|
||||
GET_U_1(cp + RRCP_DOWNLINK_PORT_OFFSET),
|
||||
GET_U_1(cp + RRCP_UPLINK_PORT_OFFSET),
|
||||
GET_ETHERADDR_STRING(cp + RRCP_UPLINK_MAC_OFFSET),
|
||||
GET_MAC48_STRING(cp + RRCP_UPLINK_MAC_OFFSET),
|
||||
GET_BE_U_4(cp + RRCP_VENDOR_ID_OFFSET),
|
||||
GET_BE_U_2(cp + RRCP_CHIP_ID_OFFSET));
|
||||
}else if (rrcp_opcode==RRCP_OPCODE_GET_CONFIGURATION ||
|
||||
|
@ -168,8 +168,8 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length)
|
||||
* For now, we just assume 6 means Ethernet.
|
||||
* XXX - print others as strings of hex?
|
||||
*/
|
||||
if (GET_BE_U_2(sllp->sll_halen) == MAC_ADDR_LEN)
|
||||
ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll_addr));
|
||||
if (GET_BE_U_2(sllp->sll_halen) == MAC48_LEN)
|
||||
ND_PRINT("%s ", GET_MAC48_STRING(sllp->sll_addr));
|
||||
|
||||
if (!ndo->ndo_qflag) {
|
||||
ether_type = GET_BE_U_2(sllp->sll_protocol);
|
||||
@ -351,8 +351,8 @@ sll2_print(netdissect_options *ndo, const struct sll2_header *sllp, u_int length
|
||||
* For now, we just assume 6 means Ethernet.
|
||||
* XXX - print others as strings of hex?
|
||||
*/
|
||||
if (GET_U_1(sllp->sll2_halen) == MAC_ADDR_LEN)
|
||||
ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll2_addr));
|
||||
if (GET_U_1(sllp->sll2_halen) == MAC48_LEN)
|
||||
ND_PRINT("%s ", GET_MAC48_STRING(sllp->sll2_addr));
|
||||
|
||||
if (!ndo->ndo_qflag) {
|
||||
ether_type = GET_BE_U_2(sllp->sll2_protocol);
|
||||
|
@ -203,7 +203,7 @@ static const struct tok slow_tlv_values[] = {
|
||||
|
||||
struct lacp_tlv_actor_partner_info_t {
|
||||
nd_uint16_t sys_pri;
|
||||
nd_mac_addr sys;
|
||||
nd_mac48 sys;
|
||||
nd_uint16_t key;
|
||||
nd_uint16_t port_pri;
|
||||
nd_uint16_t port;
|
||||
@ -230,7 +230,7 @@ struct lacp_tlv_collector_info_t {
|
||||
|
||||
struct marker_tlv_marker_info_t {
|
||||
nd_uint16_t req_port;
|
||||
nd_mac_addr req_sys;
|
||||
nd_mac48 req_sys;
|
||||
nd_uint32_t req_trans_id;
|
||||
nd_byte pad[2];
|
||||
};
|
||||
@ -411,7 +411,7 @@ slow_marker_lacp_print(netdissect_options *ndo,
|
||||
|
||||
ND_PRINT("\n\t System %s, System Priority %u, Key %u"
|
||||
", Port %u, Port Priority %u\n\t State Flags [%s]",
|
||||
GET_ETHERADDR_STRING(tlv_ptr.lacp_tlv_actor_partner_info->sys),
|
||||
GET_MAC48_STRING(tlv_ptr.lacp_tlv_actor_partner_info->sys),
|
||||
GET_BE_U_2(tlv_ptr.lacp_tlv_actor_partner_info->sys_pri),
|
||||
GET_BE_U_2(tlv_ptr.lacp_tlv_actor_partner_info->key),
|
||||
GET_BE_U_2(tlv_ptr.lacp_tlv_actor_partner_info->port),
|
||||
@ -448,7 +448,7 @@ slow_marker_lacp_print(netdissect_options *ndo,
|
||||
tlv_ptr.marker_tlv_marker_info = (const struct marker_tlv_marker_info_t *)tlv_tptr;
|
||||
|
||||
ND_PRINT("\n\t Request System %s, Request Port %u, Request Transaction ID 0x%08x",
|
||||
GET_ETHERADDR_STRING(tlv_ptr.marker_tlv_marker_info->req_sys),
|
||||
GET_MAC48_STRING(tlv_ptr.marker_tlv_marker_info->req_sys),
|
||||
GET_BE_U_2(tlv_ptr.marker_tlv_marker_info->req_port),
|
||||
GET_BE_U_4(tlv_ptr.marker_tlv_marker_info->req_trans_id));
|
||||
|
||||
|
@ -83,8 +83,8 @@
|
||||
struct token_header {
|
||||
nd_uint8_t token_ac;
|
||||
nd_uint8_t token_fc;
|
||||
nd_mac_addr token_dhost;
|
||||
nd_mac_addr token_shost;
|
||||
nd_mac48 token_dhost;
|
||||
nd_mac48 token_shost;
|
||||
nd_uint16_t token_rcf;
|
||||
nd_uint16_t token_rseg[ROUTING_SEGMENT_MAX];
|
||||
};
|
||||
@ -108,8 +108,8 @@ token_hdr_print(netdissect_options *ndo,
|
||||
{
|
||||
const char *srcname, *dstname;
|
||||
|
||||
srcname = etheraddr_string(ndo, fsrc);
|
||||
dstname = etheraddr_string(ndo, fdst);
|
||||
srcname = mac64_string(ndo, fsrc);
|
||||
dstname = mac64_string(ndo, fdst);
|
||||
|
||||
if (!ndo->ndo_qflag)
|
||||
ND_PRINT("%02x %02x ",
|
||||
@ -147,7 +147,7 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
|
||||
{
|
||||
const struct token_header *trp;
|
||||
int llc_hdrlen;
|
||||
nd_mac_addr srcmac, dstmac;
|
||||
nd_mac48 srcmac, dstmac;
|
||||
struct lladdr_info src, dst;
|
||||
u_int route_len = 0, hdr_len = TOKEN_HDRLEN;
|
||||
int seg;
|
||||
@ -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 = etheraddr_string;
|
||||
src.addr_string = mac64_string;
|
||||
dst.addr = dstmac;
|
||||
dst.addr_string = etheraddr_string;
|
||||
dst.addr_string = mac64_string;
|
||||
|
||||
/* Skip over token ring MAC header and routing information */
|
||||
length -= hdr_len;
|
||||
|
@ -195,9 +195,9 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
|
||||
/* those objects have similar semantics - fall through */
|
||||
case VQP_OBJ_MAC_ADDRESS:
|
||||
case VQP_OBJ_MAC_NULL:
|
||||
if (vqp_obj_len != MAC_ADDR_LEN)
|
||||
if (vqp_obj_len != MAC48_LEN)
|
||||
goto invalid;
|
||||
ND_PRINT("%s", GET_ETHERADDR_STRING(tptr));
|
||||
ND_PRINT("%s", GET_MAC48_STRING(tptr));
|
||||
break;
|
||||
default:
|
||||
if (ndo->ndo_vflag <= 1)
|
||||
|
Loading…
Reference in New Issue
Block a user