Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/print-cfm.c
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | static const struct tok cfm_tlv_senderid_chassisid_values[] = { | ||||
{ CFM_CHASSIS_ID_INTERFACE_NAME, "Interface name"}, | { CFM_CHASSIS_ID_INTERFACE_NAME, "Interface name"}, | ||||
{ CFM_CHASSIS_ID_LOCAL, "Locally assigned"}, | { CFM_CHASSIS_ID_LOCAL, "Locally assigned"}, | ||||
{ 0, NULL} | { 0, NULL} | ||||
}; | }; | ||||
static int | static int | ||||
cfm_mgmt_addr_print(netdissect_options *ndo, | cfm_mgmt_addr_print(netdissect_options *ndo, | ||||
register const u_char *tptr) { | register const u_char *tptr) | ||||
{ | |||||
u_int mgmt_addr_type; | u_int mgmt_addr_type; | ||||
u_int hexdump = FALSE; | u_int hexdump = FALSE; | ||||
/* | /* | ||||
* Altough AFIs are tpically 2 octects wide, | * Altough AFIs are tpically 2 octects wide, | ||||
* 802.1ab specifies that this field width | * 802.1ab specifies that this field width | ||||
* is only once octet | * is only once octet | ||||
*/ | */ | ||||
Show All 23 Lines | #endif | ||||
return hexdump; | return hexdump; | ||||
} | } | ||||
/* | /* | ||||
* The egress-ID string is a 16-Bit string plus a MAC address. | * The egress-ID string is a 16-Bit string plus a MAC address. | ||||
*/ | */ | ||||
static const char * | static const char * | ||||
cfm_egress_id_string(netdissect_options *ndo, register const u_char *tptr) { | cfm_egress_id_string(netdissect_options *ndo, register const u_char *tptr) | ||||
{ | |||||
static char egress_id_buffer[80]; | static char egress_id_buffer[80]; | ||||
snprintf(egress_id_buffer, sizeof(egress_id_buffer), | snprintf(egress_id_buffer, sizeof(egress_id_buffer), | ||||
"MAC 0x%4x-%s", | "MAC 0x%4x-%s", | ||||
EXTRACT_16BITS(tptr), | EXTRACT_16BITS(tptr), | ||||
etheraddr_string(ndo, tptr+2)); | etheraddr_string(ndo, tptr+2)); | ||||
return egress_id_buffer; | return egress_id_buffer; | ||||
} | } | ||||
void | void | ||||
cfm_print(netdissect_options *ndo, | cfm_print(netdissect_options *ndo, | ||||
register const u_char *pptr, register u_int length) { | register const u_char *pptr, register u_int length) | ||||
{ | |||||
const struct cfm_common_header_t *cfm_common_header; | const struct cfm_common_header_t *cfm_common_header; | ||||
const struct cfm_tlv_header_t *cfm_tlv_header; | const struct cfm_tlv_header_t *cfm_tlv_header; | ||||
const uint8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength; | const uint8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength; | ||||
u_int hexdump, tlen, cfm_tlv_len, cfm_tlv_type, ccm_interval; | u_int hexdump, tlen, cfm_tlv_len, cfm_tlv_type, ccm_interval; | ||||
union { | union { | ||||
const struct cfm_ccm_t *cfm_ccm; | const struct cfm_ccm_t *cfm_ccm; | ||||
▲ Show 20 Lines • Show All 343 Lines • Show Last 20 Lines |