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