2 * Copyright (c) 1998-2006 The TCPDUMP project
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in
9 * the documentation or other materials provided with the distribution.
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
11 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
12 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
15 * Original code by Hannes Gredler (hannes@gredler.at)
18 /* \summary: IEEE 802.1ag Connectivity Fault Management (CFM) protocols printer */
24 #include <netdissect-stdinc.h>
28 #include "netdissect.h"
30 #include "addrtoname.h"
34 struct cfm_common_header_t
{
35 uint8_t mdlevel_version
;
38 uint8_t first_tlv_offset
;
42 #define CFM_EXTRACT_VERSION(x) (((x)&0x1f))
43 #define CFM_EXTRACT_MD_LEVEL(x) (((x)&0xe0)>>5)
45 #define CFM_OPCODE_CCM 1
46 #define CFM_OPCODE_LBR 2
47 #define CFM_OPCODE_LBM 3
48 #define CFM_OPCODE_LTR 4
49 #define CFM_OPCODE_LTM 5
51 static const struct tok cfm_opcode_values
[] = {
52 { CFM_OPCODE_CCM
, "Continuity Check Message"},
53 { CFM_OPCODE_LBR
, "Loopback Reply"},
54 { CFM_OPCODE_LBM
, "Loopback Message"},
55 { CFM_OPCODE_LTR
, "Linktrace Reply"},
56 { CFM_OPCODE_LTM
, "Linktrace Message"},
67 uint8_t itu_t_y_1731
[16];
71 * Timer Bases for the CCM Interval field.
72 * Expressed in units of seconds.
74 static const float ccm_interval_base
[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600};
75 #define CCM_INTERVAL_MIN_MULTIPLIER 3.25
76 #define CCM_INTERVAL_MAX_MULTIPLIER 3.5
78 #define CFM_CCM_RDI_FLAG 0x80
79 #define CFM_EXTRACT_CCM_INTERVAL(x) (((x)&0x07))
81 #define CFM_CCM_MD_FORMAT_8021 0
82 #define CFM_CCM_MD_FORMAT_NONE 1
83 #define CFM_CCM_MD_FORMAT_DNS 2
84 #define CFM_CCM_MD_FORMAT_MAC 3
85 #define CFM_CCM_MD_FORMAT_CHAR 4
87 static const struct tok cfm_md_nameformat_values
[] = {
88 { CFM_CCM_MD_FORMAT_8021
, "IEEE 802.1"},
89 { CFM_CCM_MD_FORMAT_NONE
, "No MD Name present"},
90 { CFM_CCM_MD_FORMAT_DNS
, "DNS string"},
91 { CFM_CCM_MD_FORMAT_MAC
, "MAC + 16Bit Integer"},
92 { CFM_CCM_MD_FORMAT_CHAR
, "Character string"},
96 #define CFM_CCM_MA_FORMAT_8021 0
97 #define CFM_CCM_MA_FORMAT_VID 1
98 #define CFM_CCM_MA_FORMAT_CHAR 2
99 #define CFM_CCM_MA_FORMAT_INT 3
100 #define CFM_CCM_MA_FORMAT_VPN 4
102 static const struct tok cfm_ma_nameformat_values
[] = {
103 { CFM_CCM_MA_FORMAT_8021
, "IEEE 802.1"},
104 { CFM_CCM_MA_FORMAT_VID
, "Primary VID"},
105 { CFM_CCM_MA_FORMAT_CHAR
, "Character string"},
106 { CFM_CCM_MA_FORMAT_INT
, "16Bit Integer"},
107 { CFM_CCM_MA_FORMAT_VPN
, "RFC2685 VPN-ID"},
112 uint8_t transaction_id
[4];
116 uint8_t transaction_id
[4];
118 nd_mac_addr original_mac
;
119 nd_mac_addr target_mac
;
122 static const struct tok cfm_ltm_flag_values
[] = {
123 { 0x80, "Use Forwarding-DB only"},
128 uint8_t transaction_id
[4];
130 uint8_t replay_action
;
133 static const struct tok cfm_ltr_flag_values
[] = {
134 { 0x80, "UseFDB Only"},
136 { 0x20, "Terminal MEP"},
140 static const struct tok cfm_ltr_replay_action_values
[] = {
142 { 2, "Filtering DB"},
148 #define CFM_TLV_END 0
149 #define CFM_TLV_SENDER_ID 1
150 #define CFM_TLV_PORT_STATUS 2
151 #define CFM_TLV_INTERFACE_STATUS 3
152 #define CFM_TLV_DATA 4
153 #define CFM_TLV_REPLY_INGRESS 5
154 #define CFM_TLV_REPLY_EGRESS 6
155 #define CFM_TLV_PRIVATE 31
157 static const struct tok cfm_tlv_values
[] = {
158 { CFM_TLV_END
, "End"},
159 { CFM_TLV_SENDER_ID
, "Sender ID"},
160 { CFM_TLV_PORT_STATUS
, "Port status"},
161 { CFM_TLV_INTERFACE_STATUS
, "Interface status"},
162 { CFM_TLV_DATA
, "Data"},
163 { CFM_TLV_REPLY_INGRESS
, "Reply Ingress"},
164 { CFM_TLV_REPLY_EGRESS
, "Reply Egress"},
165 { CFM_TLV_PRIVATE
, "Organization Specific"},
173 struct cfm_tlv_header_t
{
178 /* FIXME define TLV formats */
180 static const struct tok cfm_tlv_port_status_values
[] = {
186 static const struct tok cfm_tlv_interface_status_values
[] = {
192 { 7, "lower Layer down"},
196 #define CFM_CHASSIS_ID_CHASSIS_COMPONENT 1
197 #define CFM_CHASSIS_ID_INTERFACE_ALIAS 2
198 #define CFM_CHASSIS_ID_PORT_COMPONENT 3
199 #define CFM_CHASSIS_ID_MAC_ADDRESS 4
200 #define CFM_CHASSIS_ID_NETWORK_ADDRESS 5
201 #define CFM_CHASSIS_ID_INTERFACE_NAME 6
202 #define CFM_CHASSIS_ID_LOCAL 7
204 static const struct tok cfm_tlv_senderid_chassisid_values
[] = {
206 { CFM_CHASSIS_ID_CHASSIS_COMPONENT
, "Chassis component"},
207 { CFM_CHASSIS_ID_INTERFACE_ALIAS
, "Interface alias"},
208 { CFM_CHASSIS_ID_PORT_COMPONENT
, "Port component"},
209 { CFM_CHASSIS_ID_MAC_ADDRESS
, "MAC address"},
210 { CFM_CHASSIS_ID_NETWORK_ADDRESS
, "Network address"},
211 { CFM_CHASSIS_ID_INTERFACE_NAME
, "Interface name"},
212 { CFM_CHASSIS_ID_LOCAL
, "Locally assigned"},
218 cfm_network_addr_print(netdissect_options
*ndo
,
219 register const u_char
*tptr
, const u_int length
)
221 u_int network_addr_type
;
222 u_int hexdump
= FALSE
;
225 * Although AFIs are typically 2 octects wide,
226 * 802.1ab specifies that this field width
230 ND_PRINT((ndo
, "\n\t Network Address Type (invalid, no data"));
233 /* The calling function must make any due ND_TCHECK calls. */
234 network_addr_type
= EXTRACT_U_1(tptr
);
235 ND_PRINT((ndo
, "\n\t Network Address Type %s (%u)",
236 tok2str(af_values
, "Unknown", network_addr_type
),
240 * Resolve the passed in Address.
242 switch(network_addr_type
) {
244 if (length
!= 1 + 4) {
245 ND_PRINT((ndo
, "(invalid IPv4 address length %u)", length
- 1));
249 ND_PRINT((ndo
, ", %s", ipaddr_string(ndo
, tptr
+ 1)));
253 if (length
!= 1 + 16) {
254 ND_PRINT((ndo
, "(invalid IPv6 address length %u)", length
- 1));
258 ND_PRINT((ndo
, ", %s", ip6addr_string(ndo
, tptr
+ 1)));
270 cfm_print(netdissect_options
*ndo
,
271 register const u_char
*pptr
, register u_int length
)
273 const struct cfm_common_header_t
*cfm_common_header
;
274 const struct cfm_tlv_header_t
*cfm_tlv_header
;
275 const uint8_t *tptr
, *tlv_ptr
;
276 const uint8_t *namesp
;
277 u_int names_data_remaining
;
278 uint8_t md_nameformat
, md_namelength
;
279 const uint8_t *md_name
;
280 uint8_t ma_nameformat
, ma_namelength
;
281 const uint8_t *ma_name
;
282 u_int hexdump
, tlen
, cfm_tlv_len
, cfm_tlv_type
, ccm_interval
;
286 const struct cfm_ccm_t
*cfm_ccm
;
287 const struct cfm_lbm_t
*cfm_lbm
;
288 const struct cfm_ltm_t
*cfm_ltm
;
289 const struct cfm_ltr_t
*cfm_ltr
;
293 cfm_common_header
= (const struct cfm_common_header_t
*)pptr
;
294 if (length
< sizeof(*cfm_common_header
))
296 ND_TCHECK(*cfm_common_header
);
299 * Sanity checking of the header.
301 if (CFM_EXTRACT_VERSION(cfm_common_header
->mdlevel_version
) != CFM_VERSION
) {
302 ND_PRINT((ndo
, "CFMv%u not supported, length %u",
303 CFM_EXTRACT_VERSION(cfm_common_header
->mdlevel_version
), length
));
307 ND_PRINT((ndo
, "CFMv%u %s, MD Level %u, length %u",
308 CFM_EXTRACT_VERSION(cfm_common_header
->mdlevel_version
),
309 tok2str(cfm_opcode_values
, "unknown (%u)", cfm_common_header
->opcode
),
310 CFM_EXTRACT_MD_LEVEL(cfm_common_header
->mdlevel_version
),
314 * In non-verbose mode just print the opcode and md-level.
316 if (ndo
->ndo_vflag
< 1) {
320 ND_PRINT((ndo
, "\n\tFirst TLV offset %u", cfm_common_header
->first_tlv_offset
));
322 tptr
+= sizeof(struct cfm_common_header_t
);
323 tlen
= length
- sizeof(struct cfm_common_header_t
);
326 * Sanity check the first TLV offset.
328 if (cfm_common_header
->first_tlv_offset
> tlen
) {
329 ND_PRINT((ndo
, " (too large, must be <= %u)", tlen
));
333 switch (cfm_common_header
->opcode
) {
335 msg_ptr
.cfm_ccm
= (const struct cfm_ccm_t
*)tptr
;
336 if (cfm_common_header
->first_tlv_offset
< sizeof(*msg_ptr
.cfm_ccm
)) {
337 ND_PRINT((ndo
, " (too small 1, must be >= %lu)",
338 (unsigned long) sizeof(*msg_ptr
.cfm_ccm
)));
341 if (tlen
< sizeof(*msg_ptr
.cfm_ccm
))
343 ND_TCHECK(*msg_ptr
.cfm_ccm
);
345 ccm_interval
= CFM_EXTRACT_CCM_INTERVAL(cfm_common_header
->flags
);
346 ND_PRINT((ndo
, ", Flags [CCM Interval %u%s]",
348 cfm_common_header
->flags
& CFM_CCM_RDI_FLAG
?
352 * Resolve the CCM interval field.
355 ND_PRINT((ndo
, "\n\t CCM Interval %.3fs"
356 ", min CCM Lifetime %.3fs, max CCM Lifetime %.3fs",
357 ccm_interval_base
[ccm_interval
],
358 ccm_interval_base
[ccm_interval
] * CCM_INTERVAL_MIN_MULTIPLIER
,
359 ccm_interval_base
[ccm_interval
] * CCM_INTERVAL_MAX_MULTIPLIER
));
362 ND_PRINT((ndo
, "\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x",
363 EXTRACT_BE_U_4(msg_ptr
.cfm_ccm
->sequence
),
364 EXTRACT_BE_U_2(msg_ptr
.cfm_ccm
->ma_epi
)));
366 namesp
= msg_ptr
.cfm_ccm
->names
;
367 names_data_remaining
= sizeof(msg_ptr
.cfm_ccm
->names
);
370 * Resolve the MD fields.
372 md_nameformat
= EXTRACT_U_1(namesp
);
374 names_data_remaining
--; /* We know this is != 0 */
375 if (md_nameformat
!= CFM_CCM_MD_FORMAT_NONE
) {
376 md_namelength
= EXTRACT_U_1(namesp
);
378 names_data_remaining
--; /* We know this is !=0 */
379 ND_PRINT((ndo
, "\n\t MD Name Format %s (%u), MD Name length %u",
380 tok2str(cfm_md_nameformat_values
, "Unknown",
386 * -3 for the MA short name format and length and one byte
389 if (md_namelength
> names_data_remaining
- 3) {
390 ND_PRINT((ndo
, " (too large, must be <= %u)", names_data_remaining
- 2));
395 ND_PRINT((ndo
, "\n\t MD Name: "));
396 switch (md_nameformat
) {
397 case CFM_CCM_MD_FORMAT_DNS
:
398 case CFM_CCM_MD_FORMAT_CHAR
:
399 safeputs(ndo
, md_name
, md_namelength
);
402 case CFM_CCM_MD_FORMAT_MAC
:
403 if (md_namelength
== 6) {
404 ND_PRINT((ndo
, "\n\t MAC %s", etheraddr_string(ndo
,
407 ND_PRINT((ndo
, "\n\t MAC (length invalid)"));
411 /* FIXME add printers for those MD formats - hexdump for now */
412 case CFM_CCM_MA_FORMAT_8021
:
414 print_unknown_data(ndo
, md_name
, "\n\t ",
417 namesp
+= md_namelength
;
418 names_data_remaining
-= md_namelength
;
420 ND_PRINT((ndo
, "\n\t MD Name Format %s (%u)",
421 tok2str(cfm_md_nameformat_values
, "Unknown",
428 * Resolve the MA fields.
430 ma_nameformat
= EXTRACT_U_1(namesp
);
432 names_data_remaining
--; /* We know this is != 0 */
433 ma_namelength
= EXTRACT_U_1(namesp
);
435 names_data_remaining
--; /* We know this is != 0 */
436 ND_PRINT((ndo
, "\n\t MA Name-Format %s (%u), MA name length %u",
437 tok2str(cfm_ma_nameformat_values
, "Unknown",
442 if (ma_namelength
> names_data_remaining
) {
443 ND_PRINT((ndo
, " (too large, must be <= %u)", names_data_remaining
));
448 ND_PRINT((ndo
, "\n\t MA Name: "));
449 switch (ma_nameformat
) {
450 case CFM_CCM_MA_FORMAT_CHAR
:
451 safeputs(ndo
, ma_name
, ma_namelength
);
454 /* FIXME add printers for those MA formats - hexdump for now */
455 case CFM_CCM_MA_FORMAT_8021
:
456 case CFM_CCM_MA_FORMAT_VID
:
457 case CFM_CCM_MA_FORMAT_INT
:
458 case CFM_CCM_MA_FORMAT_VPN
:
460 print_unknown_data(ndo
, ma_name
, "\n\t ", ma_namelength
);
465 msg_ptr
.cfm_ltm
= (const struct cfm_ltm_t
*)tptr
;
466 if (cfm_common_header
->first_tlv_offset
< sizeof(*msg_ptr
.cfm_ltm
)) {
467 ND_PRINT((ndo
, " (too small 4, must be >= %lu)",
468 (unsigned long) sizeof(*msg_ptr
.cfm_ltm
)));
471 if (tlen
< sizeof(*msg_ptr
.cfm_ltm
))
473 ND_TCHECK(*msg_ptr
.cfm_ltm
);
475 ND_PRINT((ndo
, ", Flags [%s]",
476 bittok2str(cfm_ltm_flag_values
, "none", cfm_common_header
->flags
)));
478 ND_PRINT((ndo
, "\n\t Transaction-ID 0x%08x, ttl %u",
479 EXTRACT_BE_U_4(msg_ptr
.cfm_ltm
->transaction_id
),
480 msg_ptr
.cfm_ltm
->ttl
));
482 ND_PRINT((ndo
, "\n\t Original-MAC %s, Target-MAC %s",
483 etheraddr_string(ndo
, msg_ptr
.cfm_ltm
->original_mac
),
484 etheraddr_string(ndo
, msg_ptr
.cfm_ltm
->target_mac
)));
488 msg_ptr
.cfm_ltr
= (const struct cfm_ltr_t
*)tptr
;
489 if (cfm_common_header
->first_tlv_offset
< sizeof(*msg_ptr
.cfm_ltr
)) {
490 ND_PRINT((ndo
, " (too small 5, must be >= %lu)",
491 (unsigned long) sizeof(*msg_ptr
.cfm_ltr
)));
494 if (tlen
< sizeof(*msg_ptr
.cfm_ltr
))
496 ND_TCHECK(*msg_ptr
.cfm_ltr
);
498 ND_PRINT((ndo
, ", Flags [%s]",
499 bittok2str(cfm_ltr_flag_values
, "none", cfm_common_header
->flags
)));
501 ND_PRINT((ndo
, "\n\t Transaction-ID 0x%08x, ttl %u",
502 EXTRACT_BE_U_4(msg_ptr
.cfm_ltr
->transaction_id
),
503 msg_ptr
.cfm_ltr
->ttl
));
505 ND_PRINT((ndo
, "\n\t Replay-Action %s (%u)",
506 tok2str(cfm_ltr_replay_action_values
,
508 msg_ptr
.cfm_ltr
->replay_action
),
509 msg_ptr
.cfm_ltr
->replay_action
));
513 * No message decoder yet.
514 * Hexdump everything up until the start of the TLVs
519 print_unknown_data(ndo
, tptr
, "\n\t ",
520 tlen
- cfm_common_header
->first_tlv_offset
);
524 tptr
+= cfm_common_header
->first_tlv_offset
;
525 tlen
-= cfm_common_header
->first_tlv_offset
;
528 cfm_tlv_header
= (const struct cfm_tlv_header_t
*)tptr
;
530 /* Enough to read the tlv type ? */
532 cfm_tlv_type
=cfm_tlv_header
->type
;
534 ND_PRINT((ndo
, "\n\t%s TLV (0x%02x)",
535 tok2str(cfm_tlv_values
, "Unknown", cfm_tlv_type
),
538 if (cfm_tlv_type
== CFM_TLV_END
) {
539 /* Length is "Not present if the Type field is 0." */
543 /* do we have the full tlv header ? */
544 if (tlen
< sizeof(struct cfm_tlv_header_t
))
546 ND_TCHECK_LEN(tptr
, sizeof(struct cfm_tlv_header_t
));
547 cfm_tlv_len
=EXTRACT_BE_U_2(&cfm_tlv_header
->length
);
549 ND_PRINT((ndo
, ", length %u", cfm_tlv_len
));
551 tptr
+= sizeof(struct cfm_tlv_header_t
);
552 tlen
-= sizeof(struct cfm_tlv_header_t
);
555 /* do we have the full tlv ? */
556 if (tlen
< cfm_tlv_len
)
558 ND_TCHECK_LEN(tptr
, cfm_tlv_len
);
561 switch(cfm_tlv_type
) {
562 case CFM_TLV_PORT_STATUS
:
563 if (cfm_tlv_len
< 1) {
564 ND_PRINT((ndo
, " (too short, must be >= 1)"));
567 ND_PRINT((ndo
, ", Status: %s (%u)",
568 tok2str(cfm_tlv_port_status_values
, "Unknown", EXTRACT_U_1(tptr
)),
572 case CFM_TLV_INTERFACE_STATUS
:
573 if (cfm_tlv_len
< 1) {
574 ND_PRINT((ndo
, " (too short, must be >= 1)"));
577 ND_PRINT((ndo
, ", Status: %s (%u)",
578 tok2str(cfm_tlv_interface_status_values
, "Unknown", EXTRACT_U_1(tptr
)),
582 case CFM_TLV_PRIVATE
:
583 if (cfm_tlv_len
< 4) {
584 ND_PRINT((ndo
, " (too short, must be >= 4)"));
587 ND_PRINT((ndo
, ", Vendor: %s (%u), Sub-Type %u",
588 tok2str(oui_values
,"Unknown", EXTRACT_BE_U_3(tptr
)),
589 EXTRACT_BE_U_3(tptr
),
590 EXTRACT_U_1(tptr
+ 3)));
594 case CFM_TLV_SENDER_ID
:
596 u_int chassis_id_type
, chassis_id_length
;
597 u_int mgmt_addr_length
;
599 if (cfm_tlv_len
< 1) {
600 ND_PRINT((ndo
, " (too short, must be >= 1)"));
605 * Get the Chassis ID length and check it.
606 * IEEE 802.1Q-2014 Section 21.5.3.1
608 chassis_id_length
= EXTRACT_U_1(tptr
);
613 if (chassis_id_length
) {
615 * IEEE 802.1Q-2014 Section 21.5.3.2: Chassis ID Subtype, references
616 * IEEE 802.1AB-2005 Section 9.5.2.2, subsequently
617 * IEEE 802.1AB-2016 Section 8.5.2.2: chassis ID subtype
619 if (cfm_tlv_len
< 1) {
620 ND_PRINT((ndo
, "\n\t (TLV too short)"));
623 chassis_id_type
= EXTRACT_U_1(tptr
);
625 ND_PRINT((ndo
, "\n\t Chassis-ID Type %s (%u), Chassis-ID length %u",
626 tok2str(cfm_tlv_senderid_chassisid_values
,
632 if (cfm_tlv_len
< chassis_id_length
) {
633 ND_PRINT((ndo
, "\n\t (TLV too short)"));
637 /* IEEE 802.1Q-2014 Section 21.5.3.3: Chassis ID */
638 switch (chassis_id_type
) {
639 case CFM_CHASSIS_ID_MAC_ADDRESS
:
640 if (chassis_id_length
!= MAC_ADDR_LEN
) {
641 ND_PRINT((ndo
, " (invalid MAC address length)"));
645 ND_PRINT((ndo
, "\n\t MAC %s", etheraddr_string(ndo
, tptr
+ 1)));
648 case CFM_CHASSIS_ID_NETWORK_ADDRESS
:
649 hexdump
|= cfm_network_addr_print(ndo
, tptr
+ 1, chassis_id_length
);
652 case CFM_CHASSIS_ID_INTERFACE_NAME
: /* fall through */
653 case CFM_CHASSIS_ID_INTERFACE_ALIAS
:
654 case CFM_CHASSIS_ID_LOCAL
:
655 case CFM_CHASSIS_ID_CHASSIS_COMPONENT
:
656 case CFM_CHASSIS_ID_PORT_COMPONENT
:
657 safeputs(ndo
, tptr
+ 1, chassis_id_length
);
664 cfm_tlv_len
-= chassis_id_length
;
666 tptr
+= 1 + chassis_id_length
;
667 tlen
-= 1 + chassis_id_length
;
671 * Check if there is a Management Address.
672 * IEEE 802.1Q-2014 Section 21.5.3.4: Management Address Domain Length
673 * This and all subsequent fields are not present if the TLV length
674 * allows only the above fields.
676 if (cfm_tlv_len
== 0) {
677 /* No, there isn't; we're done. */
681 /* Here mgmt_addr_length stands for the management domain length. */
682 mgmt_addr_length
= EXTRACT_U_1(tptr
);
686 ND_PRINT((ndo
, "\n\t Management Address Domain Length %u", mgmt_addr_length
));
687 if (mgmt_addr_length
) {
688 /* IEEE 802.1Q-2014 Section 21.5.3.5: Management Address Domain */
689 if (cfm_tlv_len
< mgmt_addr_length
) {
690 ND_PRINT((ndo
, "\n\t (TLV too short)"));
693 cfm_tlv_len
-= mgmt_addr_length
;
695 * XXX - this is an OID; print it as such.
697 hex_print(ndo
, "\n\t Management Address Domain: ", tptr
, mgmt_addr_length
);
698 tptr
+= mgmt_addr_length
;
699 tlen
-= mgmt_addr_length
;
702 * IEEE 802.1Q-2014 Section 21.5.3.6: Management Address Length
703 * This field is present if Management Address Domain Length is not 0.
705 if (cfm_tlv_len
< 1) {
706 ND_PRINT((ndo
, " (Management Address Length is missing)"));
711 /* Here mgmt_addr_length stands for the management address length. */
712 mgmt_addr_length
= EXTRACT_U_1(tptr
);
716 ND_PRINT((ndo
, "\n\t Management Address Length %u", mgmt_addr_length
));
717 if (mgmt_addr_length
) {
718 /* IEEE 802.1Q-2014 Section 21.5.3.7: Management Address */
719 if (cfm_tlv_len
< mgmt_addr_length
) {
720 ND_PRINT((ndo
, "\n\t (TLV too short)"));
723 cfm_tlv_len
-= mgmt_addr_length
;
725 * XXX - this is a TransportDomain; print it as such.
727 hex_print(ndo
, "\n\t Management Address: ", tptr
, mgmt_addr_length
);
728 tptr
+= mgmt_addr_length
;
729 tlen
-= mgmt_addr_length
;
736 * FIXME those are the defined TLVs that lack a decoder
737 * you are welcome to contribute code ;-)
741 case CFM_TLV_REPLY_INGRESS
:
742 case CFM_TLV_REPLY_EGRESS
:
747 /* do we want to see an additional hexdump ? */
748 if (hexdump
|| ndo
->ndo_vflag
> 1)
749 print_unknown_data(ndo
, tlv_ptr
, "\n\t ", cfm_tlv_len
);
758 ND_PRINT((ndo
, "\n\t\t packet is too short"));
762 ND_PRINT((ndo
, "\n\t\t packet exceeded snapshot"));