]> The Tcpdump Group git mirrors - tcpdump/blob - print-cfm.c
remove tcpdump's own CVS keywords
[tcpdump] / print-cfm.c
1 /*
2 * Copyright (c) 1998-2006 The TCPDUMP project
3 *
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.
14 *
15 * Support for the IEEE Connectivity Fault Management Protocols as per 802.1ag.
16 *
17 * Original code by Hannes Gredler (hannes@juniper.net)
18 */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <tcpdump-stdinc.h>
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include "interface.h"
31 #include "extract.h"
32 #include "ether.h"
33 #include "addrtoname.h"
34 #include "oui.h"
35 #include "af.h"
36
37 /*
38 * Prototypes
39 */
40 const char * cfm_egress_id_string(register const u_char *);
41 int cfm_mgmt_addr_print(register const u_char *);
42
43 struct cfm_common_header_t {
44 u_int8_t mdlevel_version;
45 u_int8_t opcode;
46 u_int8_t flags;
47 u_int8_t first_tlv_offset;
48 };
49
50 #define CFM_VERSION 0
51 #define CFM_EXTRACT_VERSION(x) (((x)&0x1f))
52 #define CFM_EXTRACT_MD_LEVEL(x) (((x)&0xe0)>>5)
53
54 #define CFM_OPCODE_CCM 1
55 #define CFM_OPCODE_LBR 2
56 #define CFM_OPCODE_LBM 3
57 #define CFM_OPCODE_LTR 4
58 #define CFM_OPCODE_LTM 5
59
60 static const struct tok cfm_opcode_values[] = {
61 { CFM_OPCODE_CCM, "Continouity Check Message"},
62 { CFM_OPCODE_LBR, "Loopback Reply"},
63 { CFM_OPCODE_LBM, "Loopback Message"},
64 { CFM_OPCODE_LTR, "Linktrace Reply"},
65 { CFM_OPCODE_LTM, "Linktrace Message"},
66 { 0, NULL}
67 };
68
69 /*
70 * Message Formats.
71 */
72 struct cfm_ccm_t {
73 u_int8_t sequence[4];
74 u_int8_t ma_epi[2];
75 u_int8_t md_nameformat;
76 u_int8_t md_namelength;
77 u_int8_t md_name[46]; /* md name and short ma name */
78 u_int8_t reserved_itu[16];
79 u_int8_t reserved[6];
80 };
81
82 /*
83 * Timer Bases for the CCM Interval field.
84 * Expressed in units of seconds.
85 */
86 const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600};
87 #define CCM_INTERVAL_MIN_MULTIPLIER 3.25
88 #define CCM_INTERVAL_MAX_MULTIPLIER 3.5
89
90 #define CFM_CCM_RDI_FLAG 0x80
91 #define CFM_EXTRACT_CCM_INTERVAL(x) (((x)&0x07))
92
93 #define CFM_CCM_MD_FORMAT_8021 0
94 #define CFM_CCM_MD_FORMAT_NONE 1
95 #define CFM_CCM_MD_FORMAT_DNS 2
96 #define CFM_CCM_MD_FORMAT_MAC 3
97 #define CFM_CCM_MD_FORMAT_CHAR 4
98
99 static const struct tok cfm_md_nameformat_values[] = {
100 { CFM_CCM_MD_FORMAT_8021, "IEEE 802.1"},
101 { CFM_CCM_MD_FORMAT_NONE, "No MD Name present"},
102 { CFM_CCM_MD_FORMAT_DNS, "DNS string"},
103 { CFM_CCM_MD_FORMAT_MAC, "MAC + 16Bit Integer"},
104 { CFM_CCM_MD_FORMAT_CHAR, "Character string"},
105 { 0, NULL}
106 };
107
108 #define CFM_CCM_MA_FORMAT_8021 0
109 #define CFM_CCM_MA_FORMAT_VID 1
110 #define CFM_CCM_MA_FORMAT_CHAR 2
111 #define CFM_CCM_MA_FORMAT_INT 3
112 #define CFM_CCM_MA_FORMAT_VPN 4
113
114 static const struct tok cfm_ma_nameformat_values[] = {
115 { CFM_CCM_MA_FORMAT_8021, "IEEE 802.1"},
116 { CFM_CCM_MA_FORMAT_VID, "Primary VID"},
117 { CFM_CCM_MA_FORMAT_CHAR, "Character string"},
118 { CFM_CCM_MA_FORMAT_INT, "16Bit Integer"},
119 { CFM_CCM_MA_FORMAT_VPN, "RFC2685 VPN-ID"},
120 { 0, NULL}
121 };
122
123 struct cfm_lbm_t {
124 u_int8_t transaction_id[4];
125 u_int8_t reserved[4];
126 };
127
128 struct cfm_ltm_t {
129 u_int8_t transaction_id[4];
130 u_int8_t egress_id[8];
131 u_int8_t ttl;
132 u_int8_t original_mac[ETHER_ADDR_LEN];
133 u_int8_t target_mac[ETHER_ADDR_LEN];
134 u_int8_t reserved[3];
135 };
136
137 static const struct tok cfm_ltm_flag_values[] = {
138 { 0x80, "Use Forwarding-DB only"},
139 { 0, NULL}
140 };
141
142 struct cfm_ltr_t {
143 u_int8_t transaction_id[4];
144 u_int8_t last_egress_id[8];
145 u_int8_t next_egress_id[8];
146 u_int8_t ttl;
147 u_int8_t replay_action;
148 u_int8_t reserved[6];
149 };
150
151 static const struct tok cfm_ltr_flag_values[] = {
152 { 0x80, "Forwarded"},
153 { 0x40, "Terminal MEP"},
154 { 0, NULL}
155 };
156
157 static const struct tok cfm_ltr_replay_action_values[] = {
158 { 1, "Exact Match"},
159 { 2, "Filtering DB"},
160 { 3, "MIP CCM DB"},
161 { 0, NULL}
162 };
163
164
165 #define CFM_TLV_END 0
166 #define CFM_TLV_SENDER_ID 1
167 #define CFM_TLV_PORT_STATUS 2
168 #define CFM_TLV_INTERFACE_STATUS 3
169 #define CFM_TLV_DATA 4
170 #define CFM_TLV_REPLY_INGRESS 5
171 #define CFM_TLV_REPLY_EGRESS 6
172 #define CFM_TLV_PRIVATE 31
173
174 static const struct tok cfm_tlv_values[] = {
175 { CFM_TLV_END, "End"},
176 { CFM_TLV_SENDER_ID, "Sender ID"},
177 { CFM_TLV_PORT_STATUS, "Port status"},
178 { CFM_TLV_INTERFACE_STATUS, "Interface status"},
179 { CFM_TLV_DATA, "Data"},
180 { CFM_TLV_REPLY_INGRESS, "Reply Ingress"},
181 { CFM_TLV_REPLY_EGRESS, "Reply Egress"},
182 { CFM_TLV_PRIVATE, "Organization Specific"},
183 { 0, NULL}
184 };
185
186 /*
187 * TLVs
188 */
189
190 struct cfm_tlv_header_t {
191 u_int8_t type;
192 u_int8_t length[2];
193 };
194
195 /* FIXME define TLV formats */
196
197 static const struct tok cfm_tlv_port_status_values[] = {
198 { 1, "Blocked"},
199 { 2, "Up"},
200 { 0, NULL}
201 };
202
203 static const struct tok cfm_tlv_interface_status_values[] = {
204 { 1, "Up"},
205 { 2, "Down"},
206 { 3, "Testing"},
207 { 5, "Dormant"},
208 { 6, "not present"},
209 { 7, "lower Layer down"},
210 { 0, NULL}
211 };
212
213 #define CFM_CHASSIS_ID_CHASSIS_COMPONENT 1
214 #define CFM_CHASSIS_ID_INTERFACE_ALIAS 2
215 #define CFM_CHASSIS_ID_PORT_COMPONENT 3
216 #define CFM_CHASSIS_ID_MAC_ADDRESS 4
217 #define CFM_CHASSIS_ID_NETWORK_ADDRESS 5
218 #define CFM_CHASSIS_ID_INTERFACE_NAME 6
219 #define CFM_CHASSIS_ID_LOCAL 7
220
221 static const struct tok cfm_tlv_senderid_chassisid_values[] = {
222 { 0, "Reserved"},
223 { CFM_CHASSIS_ID_CHASSIS_COMPONENT, "Chassis component"},
224 { CFM_CHASSIS_ID_INTERFACE_ALIAS, "Interface alias"},
225 { CFM_CHASSIS_ID_PORT_COMPONENT, "Port component"},
226 { CFM_CHASSIS_ID_MAC_ADDRESS, "MAC address"},
227 { CFM_CHASSIS_ID_NETWORK_ADDRESS, "Network address"},
228 { CFM_CHASSIS_ID_INTERFACE_NAME, "Interface name"},
229 { CFM_CHASSIS_ID_LOCAL, "Locally assigned"},
230 { 0, NULL}
231 };
232
233
234 int
235 cfm_mgmt_addr_print(register const u_char *tptr) {
236
237 u_int mgmt_addr_type;
238 u_int hexdump = FALSE;
239
240 /*
241 * Altough AFIs are tpically 2 octects wide,
242 * 802.1ab specifies that this field width
243 * is only once octet
244 */
245 mgmt_addr_type = *tptr;
246 printf("\n\t Management Address Type %s (%u)",
247 tok2str(af_values, "Unknown", mgmt_addr_type),
248 mgmt_addr_type);
249
250 /*
251 * Resolve the passed in Address.
252 */
253 switch(mgmt_addr_type) {
254 case AFNUM_INET:
255 printf(", %s", ipaddr_string(tptr + 1));
256 break;
257
258 #ifdef INET6
259 case AFNUM_INET6:
260 printf(", %s", ip6addr_string(tptr + 1));
261 break;
262 #endif
263
264 default:
265 hexdump = TRUE;
266 break;
267 }
268
269 return hexdump;
270 }
271
272 /*
273 * The egress-ID string is a 16-Bit string plus a MAC address.
274 */
275 const char *
276 cfm_egress_id_string(register const u_char *tptr) {
277 static char egress_id_buffer[80];
278
279 snprintf(egress_id_buffer, sizeof(egress_id_buffer),
280 "MAC 0x%4x-%s",
281 EXTRACT_16BITS(tptr),
282 etheraddr_string(tptr+2));
283
284 return egress_id_buffer;
285 }
286
287 void
288 cfm_print(register const u_char *pptr, register u_int length) {
289
290 const struct cfm_common_header_t *cfm_common_header;
291 const struct cfm_tlv_header_t *cfm_tlv_header;
292 const u_int8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength;
293 u_int hexdump, tlen, cfm_tlv_len, cfm_tlv_type, ccm_interval;
294
295
296 union {
297 const struct cfm_ccm_t *cfm_ccm;
298 const struct cfm_lbm_t *cfm_lbm;
299 const struct cfm_ltm_t *cfm_ltm;
300 const struct cfm_ltr_t *cfm_ltr;
301 } msg_ptr;
302
303 tptr=pptr;
304 cfm_common_header = (const struct cfm_common_header_t *)pptr;
305 TCHECK(*cfm_common_header);
306
307 /*
308 * Sanity checking of the header.
309 */
310 if (CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version) != CFM_VERSION) {
311 printf("CFMv%u not supported, length %u",
312 CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version), length);
313 return;
314 }
315
316 printf("CFMv%u %s, MD Level %u, length %u",
317 CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version),
318 tok2str(cfm_opcode_values, "unknown (%u)", cfm_common_header->opcode),
319 CFM_EXTRACT_MD_LEVEL(cfm_common_header->mdlevel_version),
320 length);
321
322 /*
323 * In non-verbose mode just print the opcode and md-level.
324 */
325 if (vflag < 1) {
326 return;
327 }
328
329 printf("\n\tFirst TLV offset %u", cfm_common_header->first_tlv_offset);
330
331 tptr += sizeof(const struct cfm_common_header_t);
332 tlen = length - sizeof(struct cfm_common_header_t);
333
334 switch (cfm_common_header->opcode) {
335 case CFM_OPCODE_CCM:
336 msg_ptr.cfm_ccm = (const struct cfm_ccm_t *)tptr;
337
338 ccm_interval = CFM_EXTRACT_CCM_INTERVAL(cfm_common_header->flags);
339 printf(", Flags [CCM Interval %u%s]",
340 ccm_interval,
341 cfm_common_header->flags & CFM_CCM_RDI_FLAG ?
342 ", RDI" : "");
343
344 /*
345 * Resolve the CCM interval field.
346 */
347 if (ccm_interval) {
348 printf("\n\t CCM Interval %.3fs"
349 ", min CCM Lifetime %.3fs, max CCM Lifetime %.3fs",
350 ccm_interval_base[ccm_interval],
351 ccm_interval_base[ccm_interval] * CCM_INTERVAL_MIN_MULTIPLIER,
352 ccm_interval_base[ccm_interval] * CCM_INTERVAL_MAX_MULTIPLIER);
353 }
354
355 printf("\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x",
356 EXTRACT_32BITS(msg_ptr.cfm_ccm->sequence),
357 EXTRACT_16BITS(msg_ptr.cfm_ccm->ma_epi));
358
359
360 /*
361 * Resolve the MD fields.
362 */
363 printf("\n\t MD Name Format %s (%u), MD Name length %u",
364 tok2str(cfm_md_nameformat_values, "Unknown",
365 msg_ptr.cfm_ccm->md_nameformat),
366 msg_ptr.cfm_ccm->md_nameformat,
367 msg_ptr.cfm_ccm->md_namelength);
368
369 if (msg_ptr.cfm_ccm->md_nameformat != CFM_CCM_MD_FORMAT_NONE) {
370 printf("\n\t MD Name: ");
371 switch (msg_ptr.cfm_ccm->md_nameformat) {
372 case CFM_CCM_MD_FORMAT_DNS:
373 case CFM_CCM_MD_FORMAT_CHAR:
374 safeputs((const char *)msg_ptr.cfm_ccm->md_name, msg_ptr.cfm_ccm->md_namelength);
375 break;
376
377 case CFM_CCM_MD_FORMAT_MAC:
378 printf("\n\t MAC %s", etheraddr_string(
379 msg_ptr.cfm_ccm->md_name));
380 break;
381
382 /* FIXME add printers for those MD formats - hexdump for now */
383 case CFM_CCM_MA_FORMAT_8021:
384 default:
385 print_unknown_data(gndo,msg_ptr.cfm_ccm->md_name, "\n\t ",
386 msg_ptr.cfm_ccm->md_namelength);
387 }
388 }
389
390
391 /*
392 * Resolve the MA fields.
393 */
394 ma_nameformat = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength;
395 ma_namelength = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength + 1;
396 ma_name = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength + 2;
397
398 printf("\n\t MA Name-Format %s (%u), MA name length %u",
399 tok2str(cfm_ma_nameformat_values, "Unknown",
400 *ma_nameformat),
401 *ma_nameformat,
402 *ma_namelength);
403
404 printf("\n\t MA Name: ");
405 switch (*ma_nameformat) {
406 case CFM_CCM_MA_FORMAT_CHAR:
407 safeputs((const char *)ma_name, *ma_namelength);
408 break;
409
410 /* FIXME add printers for those MA formats - hexdump for now */
411 case CFM_CCM_MA_FORMAT_8021:
412 case CFM_CCM_MA_FORMAT_VID:
413 case CFM_CCM_MA_FORMAT_INT:
414 case CFM_CCM_MA_FORMAT_VPN:
415 default:
416 print_unknown_data(gndo,ma_name, "\n\t ", *ma_namelength);
417 }
418 break;
419
420 case CFM_OPCODE_LTM:
421 msg_ptr.cfm_ltm = (const struct cfm_ltm_t *)tptr;
422
423 printf(", Flags [%s]",
424 bittok2str(cfm_ltm_flag_values, "none", cfm_common_header->flags));
425
426 printf("\n\t Transaction-ID 0x%08x, Egress-ID %s, ttl %u",
427 EXTRACT_32BITS(msg_ptr.cfm_ltm->transaction_id),
428 cfm_egress_id_string(msg_ptr.cfm_ltm->egress_id),
429 msg_ptr.cfm_ltm->ttl);
430
431 printf("\n\t Original-MAC %s, Target-MAC %s",
432 etheraddr_string(msg_ptr.cfm_ltm->original_mac),
433 etheraddr_string(msg_ptr.cfm_ltm->target_mac));
434 break;
435
436 case CFM_OPCODE_LTR:
437 msg_ptr.cfm_ltr = (const struct cfm_ltr_t *)tptr;
438
439 printf(", Flags [%s]",
440 bittok2str(cfm_ltr_flag_values, "none", cfm_common_header->flags));
441
442 printf("\n\t Transaction-ID 0x%08x, Last-Egress-ID %s",
443 EXTRACT_32BITS(msg_ptr.cfm_ltr->transaction_id),
444 cfm_egress_id_string(msg_ptr.cfm_ltr->last_egress_id));
445
446 printf("\n\t Next-Egress-ID %s, ttl %u",
447 cfm_egress_id_string(msg_ptr.cfm_ltr->next_egress_id),
448 msg_ptr.cfm_ltr->ttl);
449
450 printf("\n\t Replay-Action %s (%u)",
451 tok2str(cfm_ltr_replay_action_values,
452 "Unknown",
453 msg_ptr.cfm_ltr->replay_action),
454 msg_ptr.cfm_ltr->replay_action);
455 break;
456
457 /*
458 * No message decoder yet.
459 * Hexdump everything up until the start of the TLVs
460 */
461 case CFM_OPCODE_LBR:
462 case CFM_OPCODE_LBM:
463 default:
464 if (tlen > cfm_common_header->first_tlv_offset) {
465 print_unknown_data(gndo,tptr, "\n\t ",
466 tlen - cfm_common_header->first_tlv_offset);
467 }
468 break;
469 }
470
471 /*
472 * Sanity check for not walking off.
473 */
474 if (tlen <= cfm_common_header->first_tlv_offset) {
475 return;
476 }
477
478 tptr += cfm_common_header->first_tlv_offset;
479 tlen -= cfm_common_header->first_tlv_offset;
480
481 while (tlen > 0) {
482 cfm_tlv_header = (const struct cfm_tlv_header_t *)tptr;
483
484 /* Enough to read the tlv type ? */
485 TCHECK2(*tptr, 1);
486 cfm_tlv_type=cfm_tlv_header->type;
487
488 if (cfm_tlv_type != CFM_TLV_END) {
489 /* did we capture enough for fully decoding the object header ? */
490 TCHECK2(*tptr, sizeof(struct cfm_tlv_header_t));
491 cfm_tlv_len=EXTRACT_16BITS(&cfm_tlv_header->length);
492 } else {
493 cfm_tlv_len = 0;
494 }
495
496 printf("\n\t%s TLV (0x%02x), length %u",
497 tok2str(cfm_tlv_values, "Unknown", cfm_tlv_type),
498 cfm_tlv_type,
499 cfm_tlv_len);
500
501 /* sanity check for not walking off and infinite loop check. */
502 if ((cfm_tlv_type != CFM_TLV_END) &&
503 ((cfm_tlv_len + sizeof(struct cfm_tlv_header_t) > tlen) ||
504 (!cfm_tlv_len))) {
505 print_unknown_data(gndo,tptr,"\n\t ",tlen);
506 return;
507 }
508
509 tptr += sizeof(struct cfm_tlv_header_t);
510 tlen -= sizeof(struct cfm_tlv_header_t);
511 tlv_ptr = tptr;
512
513 /* did we capture enough for fully decoding the object ? */
514 if (cfm_tlv_type != CFM_TLV_END) {
515 TCHECK2(*tptr, cfm_tlv_len);
516 }
517 hexdump = FALSE;
518
519 switch(cfm_tlv_type) {
520 case CFM_TLV_END:
521 /* we are done - bail out */
522 return;
523
524 case CFM_TLV_PORT_STATUS:
525 printf(", Status: %s (%u)",
526 tok2str(cfm_tlv_port_status_values, "Unknown", *tptr),
527 *tptr);
528 break;
529
530 case CFM_TLV_INTERFACE_STATUS:
531 printf(", Status: %s (%u)",
532 tok2str(cfm_tlv_interface_status_values, "Unknown", *tptr),
533 *tptr);
534 break;
535
536 case CFM_TLV_PRIVATE:
537 printf(", Vendor: %s (%u), Sub-Type %u",
538 tok2str(oui_values,"Unknown", EXTRACT_24BITS(tptr)),
539 EXTRACT_24BITS(tptr),
540 *(tptr+3));
541 hexdump = TRUE;
542 break;
543
544 case CFM_TLV_SENDER_ID:
545 {
546 u_int chassis_id_type, chassis_id_length;
547 u_int mgmt_addr_length;
548
549 /*
550 * Check if there is a Chassis-ID.
551 */
552 chassis_id_length = *tptr;
553 if (chassis_id_length > tlen) {
554 hexdump = TRUE;
555 break;
556 }
557
558 tptr++;
559 tlen--;
560
561 if (chassis_id_length) {
562 chassis_id_type = *tptr;
563 printf("\n\t Chassis-ID Type %s (%u), Chassis-ID length %u",
564 tok2str(cfm_tlv_senderid_chassisid_values,
565 "Unknown",
566 chassis_id_type),
567 chassis_id_type,
568 chassis_id_length);
569
570 switch (chassis_id_type) {
571 case CFM_CHASSIS_ID_MAC_ADDRESS:
572 printf("\n\t MAC %s", etheraddr_string(tptr+1));
573 break;
574
575 case CFM_CHASSIS_ID_NETWORK_ADDRESS:
576 hexdump |= cfm_mgmt_addr_print(tptr);
577 break;
578
579 case CFM_CHASSIS_ID_INTERFACE_NAME: /* fall through */
580 case CFM_CHASSIS_ID_INTERFACE_ALIAS:
581 case CFM_CHASSIS_ID_LOCAL:
582 case CFM_CHASSIS_ID_CHASSIS_COMPONENT:
583 case CFM_CHASSIS_ID_PORT_COMPONENT:
584 safeputs((const char *)tptr+1, chassis_id_length);
585 break;
586
587 default:
588 hexdump = TRUE;
589 break;
590 }
591 }
592
593 tptr += chassis_id_length;
594 tlen -= chassis_id_length;
595
596 /*
597 * Check if there is a Management Address.
598 */
599 mgmt_addr_length = *tptr;
600 if (mgmt_addr_length > tlen) {
601 hexdump = TRUE;
602 break;
603 }
604
605 tptr++;
606 tlen--;
607
608 if (mgmt_addr_length) {
609 hexdump |= cfm_mgmt_addr_print(tptr);
610 }
611
612 tptr += mgmt_addr_length;
613 tlen -= mgmt_addr_length;
614
615 }
616 break;
617
618 /*
619 * FIXME those are the defined TLVs that lack a decoder
620 * you are welcome to contribute code ;-)
621 */
622
623 case CFM_TLV_DATA:
624 case CFM_TLV_REPLY_INGRESS:
625 case CFM_TLV_REPLY_EGRESS:
626 default:
627 hexdump = TRUE;
628 break;
629 }
630 /* do we want to see an additional hexdump ? */
631 if (hexdump || vflag > 1)
632 print_unknown_data(gndo,tlv_ptr, "\n\t ", cfm_tlv_len);
633
634 tptr+=cfm_tlv_len;
635 tlen-=cfm_tlv_len;
636 }
637 return;
638 trunc:
639 printf("\n\t\t packet exceeded snapshot");
640 }