diff --git a/print-ldp.c b/print-ldp.c index 60fe01053..22e2bdb8b 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -145,6 +145,7 @@ static const struct tok ldp_msg_values[] = { #define LDP_TLV_LABEL_REQUEST_MSG_ID 0x0600 #define LDP_TLV_MTU 0x0601 /* rfc 3988 */ #define LDP_TLV_DUAL_STACK_CAP 0x0701 /* rfc 7552 */ +#define LDP_TLV_PW_STATUS 0x096a /* rfc 8077 */ static const struct tok ldp_tlv_values[] = { { LDP_TLV_FEC, "FEC" }, @@ -170,6 +171,7 @@ static const struct tok ldp_tlv_values[] = { { LDP_TLV_LABEL_REQUEST_MSG_ID, "Label Request Message ID" }, { LDP_TLV_MTU, "MTU" }, { LDP_TLV_DUAL_STACK_CAP, "Dual-Stack Capability" }, + { LDP_TLV_PW_STATUS, "PW Status" }, { 0, NULL} }; @@ -255,6 +257,19 @@ static const struct tok ldp_dual_stack_transport_pref_values[] = { { 0, NULL} }; +static const struct tok ldp_pw_status_flags[] = { + /* rfc 8077 */ + { 0x01, "NF" }, /* Pseudowire Not Forwarding */ + { 0x02, "AC-RF" }, /* Local Attachment Circuit (ingress) Receive Fault */ + { 0x04, "AC-TF" }, /* Local Attachment Circuit (egress) Transmit Fault */ + { 0x08, "PSN-RF" }, /* Local PSN-facing PW (ingress) Receive Fault */ + { 0x10, "PSN-TF" }, /* Local PSN-facing PW (egress) Transmit Fault */ + /* rfc 6870 */ + { 0x20, "PF" }, /* PW Preferential Forwarding Status */ + { 0x40, "RS" }, /* PW Request Switchover Status */ + { 0, NULL} +}; + static u_int ldp_pdu_print(netdissect_options *, const u_char *); /* @@ -589,6 +604,13 @@ ldp_tlv_print(netdissect_options *ndo, transport_pref)); break; + case LDP_TLV_PW_STATUS: + ND_ICHECKMSG_U("tlv length", tlv_tlen, <, 4); + ND_PRINT("\n\t PW Status: 0x%02x [%s]", + GET_BE_U_4(tptr), + bittok2str(ldp_pw_status_flags, "none", GET_BE_U_4(tptr))); + break; + /* * FIXME those are the defined TLVs that lack a decoder * you are welcome to contribute code ;-) diff --git a/tests/TESTLIST b/tests/TESTLIST index 6ba1f53c9..8678aa9ea 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -121,6 +121,7 @@ lmp lmp.pcap lmp.out -T lmp mpls-ldp-hello mpls-ldp-hello.pcap mpls-ldp-hello.out -v ldp-common-session ldp-common-session.pcap ldp-common-session.out -v ldp_infloop ldp-infinite-loop.pcap ldp_infloop.out +ldp-pw-status ldp-pw-status.pcap ldp-pw-status.out -v lspping-fec-ldp lspping-fec-ldp.pcap lspping-fec-ldp.out lspping-fec-ldp-v lspping-fec-ldp.pcap lspping-fec-ldp-v.out -v lspping-fec-ldp-vv lspping-fec-ldp.pcap lspping-fec-ldp-vv.out -vv diff --git a/tests/ldp-pw-status.out b/tests/ldp-pw-status.out new file mode 100644 index 000000000..f023051cf --- /dev/null +++ b/tests/ldp-pw-status.out @@ -0,0 +1,10 @@ + 1 00:30:47.522169 IP (tos 0xc0, ttl 64, id 944, offset 0, flags [DF], proto TCP (6), length 108) + 2.2.2.2.45781 > 1.1.1.1.646: Flags [P.], cksum 0xd2d9 (correct), seq 4026114102:4026114158, ack 1839823399, win 128, options [nop,nop,TS val 2533630089 ecr 3448755034], length 56 + LDP, Label-Space-ID: 2.2.2.2:0, pdu-length: 52 + Notification Message (0x0001), length: 42, Message ID: 0x0000002d, Flags: [ignore if unknown] + Status TLV (0x0300), length: 10, Flags: [ignore and don't forward if unknown] + Status Code: Unknown, Flags: [Advisory Notification and don't forward] + PW Status TLV (0x096a), length: 4, Flags: [continue processing and don't forward if unknown] + PW Status: 0x06 [AC-RF, AC-TF] + FEC TLV (0x0100), length: 12, Flags: [ignore and don't forward if unknown] + Martini VC FEC (0x80): Ethernet, no control word, group-ID 0, VC-ID 1, VC-info-length: 4 diff --git a/tests/ldp-pw-status.pcap b/tests/ldp-pw-status.pcap new file mode 100644 index 000000000..4945beae0 Binary files /dev/null and b/tests/ldp-pw-status.pcap differ