Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/print-lspping.c
Show First 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | static const struct tok lspping_tlv_downstream_addr_values[] = { | ||||
{ LSPPING_AFI_IPV4, "IPv4"}, | { LSPPING_AFI_IPV4, "IPv4"}, | ||||
{ LSPPING_AFI_IPV6, "IPv6"}, | { LSPPING_AFI_IPV6, "IPv6"}, | ||||
{ LSPPING_AFI_UNMB, "Unnumbered"}, | { LSPPING_AFI_UNMB, "Unnumbered"}, | ||||
{ 0, NULL} | { 0, NULL} | ||||
}; | }; | ||||
void | void | ||||
lspping_print(netdissect_options *ndo, | lspping_print(netdissect_options *ndo, | ||||
register const u_char *pptr, register u_int len) { | register const u_char *pptr, register u_int len) | ||||
{ | |||||
const struct lspping_common_header *lspping_com_header; | const struct lspping_common_header *lspping_com_header; | ||||
const struct lspping_tlv_header *lspping_tlv_header; | const struct lspping_tlv_header *lspping_tlv_header; | ||||
const struct lspping_tlv_header *lspping_subtlv_header; | const struct lspping_tlv_header *lspping_subtlv_header; | ||||
const u_char *tptr,*tlv_tptr,*subtlv_tptr; | const u_char *tptr,*tlv_tptr,*subtlv_tptr; | ||||
int tlen,lspping_tlv_len,lspping_tlv_type,tlv_tlen; | int tlen,lspping_tlv_len,lspping_tlv_type,tlv_tlen; | ||||
int tlv_hexdump,subtlv_hexdump; | int tlv_hexdump,subtlv_hexdump; | ||||
int lspping_subtlv_len,lspping_subtlv_type; | int lspping_subtlv_len,lspping_subtlv_type; | ||||
struct timeval timestamp; | struct timeval timestamp; | ||||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | #endif | ||||
tlv_tptr+=lspping_subtlv_len; | tlv_tptr+=lspping_subtlv_len; | ||||
tlv_tlen-=lspping_subtlv_len+sizeof(struct lspping_tlv_header); | tlv_tlen-=lspping_subtlv_len+sizeof(struct lspping_tlv_header); | ||||
} | } | ||||
break; | break; | ||||
case LSPPING_TLV_DOWNSTREAM_MAPPING: | case LSPPING_TLV_DOWNSTREAM_MAPPING: | ||||
/* that strange thing with the downstream map TLV is that until now | /* that strange thing with the downstream map TLV is that until now | ||||
* we do not know if its IPv4 or IPv6 , after we found the adress-type | * we do not know if its IPv4 or IPv6 , after we found the address-type | ||||
* lets recast the tlv_tptr and move on */ | * lets recast the tlv_tptr and move on */ | ||||
tlv_ptr.lspping_tlv_downstream_map_ipv4= \ | tlv_ptr.lspping_tlv_downstream_map_ipv4= \ | ||||
(const struct lspping_tlv_downstream_map_ipv4_t *)tlv_tptr; | (const struct lspping_tlv_downstream_map_ipv4_t *)tlv_tptr; | ||||
tlv_ptr.lspping_tlv_downstream_map_ipv6= \ | tlv_ptr.lspping_tlv_downstream_map_ipv6= \ | ||||
(const struct lspping_tlv_downstream_map_ipv6_t *)tlv_tptr; | (const struct lspping_tlv_downstream_map_ipv6_t *)tlv_tptr; | ||||
ND_PRINT((ndo, "\n\t MTU: %u, Address-Type: %s (%u)", | ND_PRINT((ndo, "\n\t MTU: %u, Address-Type: %s (%u)", | ||||
EXTRACT_16BITS(tlv_ptr.lspping_tlv_downstream_map_ipv4->mtu), | EXTRACT_16BITS(tlv_ptr.lspping_tlv_downstream_map_ipv4->mtu), | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |