Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/print-ospf.c
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | |||||
static const struct tok ospf_lls_eo_options[] = { | static const struct tok ospf_lls_eo_options[] = { | ||||
{ OSPF_LLS_EO_LR, "LSDB resync" }, | { OSPF_LLS_EO_LR, "LSDB resync" }, | ||||
{ OSPF_LLS_EO_RS, "Restart" }, | { OSPF_LLS_EO_RS, "Restart" }, | ||||
{ 0, NULL } | { 0, NULL } | ||||
}; | }; | ||||
int | int | ||||
ospf_print_grace_lsa(netdissect_options *ndo, | ospf_print_grace_lsa(netdissect_options *ndo, | ||||
const uint8_t *tptr, u_int ls_length) { | const uint8_t *tptr, u_int ls_length) | ||||
{ | |||||
u_int tlv_type, tlv_length; | u_int tlv_type, tlv_length; | ||||
while (ls_length > 0) { | while (ls_length > 0) { | ||||
ND_TCHECK2(*tptr, 4); | ND_TCHECK2(*tptr, 4); | ||||
if (ls_length < 4) { | if (ls_length < 4) { | ||||
ND_PRINT((ndo, "\n\t Remaining LS length %u < 4", ls_length)); | ND_PRINT((ndo, "\n\t Remaining LS length %u < 4", ls_length)); | ||||
return -1; | return -1; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | ospf_print_grace_lsa(netdissect_options *ndo, | ||||
return 0; | return 0; | ||||
trunc: | trunc: | ||||
return -1; | return -1; | ||||
} | } | ||||
int | int | ||||
ospf_print_te_lsa(netdissect_options *ndo, | ospf_print_te_lsa(netdissect_options *ndo, | ||||
const uint8_t *tptr, u_int ls_length) { | const uint8_t *tptr, u_int ls_length) | ||||
{ | |||||
u_int tlv_type, tlv_length, subtlv_type, subtlv_length; | u_int tlv_type, tlv_length, subtlv_type, subtlv_length; | ||||
u_int priority_level, te_class, count_srlg; | u_int priority_level, te_class, count_srlg; | ||||
union { /* int to float conversion buffer for several subTLVs */ | union { /* int to float conversion buffer for several subTLVs */ | ||||
float f; | float f; | ||||
uint32_t i; | uint32_t i; | ||||
} bw; | } bw; | ||||
while (ls_length != 0) { | while (ls_length != 0) { | ||||
▲ Show 20 Lines • Show All 865 Lines • Show Last 20 Lines |