]> The Tcpdump Group git mirrors - tcpdump/blob - print-ldp.c
c73022b576627167fc1a845ae019b076b38bf7ba
[tcpdump] / print-ldp.c
1 /*
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that: (1) source code
4 * distributions retain the above copyright notice and this paragraph
5 * in its entirety, and (2) distributions including binary code include
6 * the above copyright notice and this paragraph in its entirety in
7 * the documentation or other materials provided with the distribution.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11 * FOR A PARTICULAR PURPOSE.
12 *
13 * Original code by Hannes Gredler (hannes@juniper.net)
14 * and Steinar Haug (sthaug@nethelp.no)
15 */
16
17 #ifndef lint
18 static const char rcsid[] _U_ =
19 "@(#) $Header: /tcpdump/master/tcpdump/print-ldp.c,v 1.7 2004-05-27 21:20:50 guy Exp $";
20 #endif
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <tcpdump-stdinc.h>
27
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31
32 #include "interface.h"
33 #include "decode_prefix.h"
34 #include "extract.h"
35 #include "addrtoname.h"
36
37 /*
38 * ldp common header
39 *
40 * 0 1 2 3
41 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
42 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * | Version | PDU Length |
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * | LDP Identifier |
46 * + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * | |
48 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 *
50 */
51
52 struct ldp_common_header {
53 u_int8_t version[2];
54 u_int8_t pdu_length[2];
55 u_int8_t lsr_id[4];
56 u_int8_t label_space[2];
57 };
58
59 #define LDP_VERSION 1
60
61 /*
62 * ldp message header
63 *
64 * 0 1 2 3
65 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
66 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 * |U| Message Type | Message Length |
68 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69 * | Message ID |
70 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
71 * | |
72 * + +
73 * | Mandatory Parameters |
74 * + +
75 * | |
76 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77 * | |
78 * + +
79 * | Optional Parameters |
80 * + +
81 * | |
82 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
83 */
84
85 struct ldp_msg_header {
86 u_int8_t type[2];
87 u_int8_t length[2];
88 u_int8_t id[4];
89 };
90
91 #define LDP_MASK_MSG_TYPE(x) ((x)&0x7fff)
92 #define LDP_MASK_U_BIT(x) ((x)&0x8000)
93
94 #define LDP_MSG_NOTIF 0x0001
95 #define LDP_MSG_HELLO 0x0100
96 #define LDP_MSG_INIT 0x0200
97 #define LDP_MSG_KEEPALIVE 0x0201
98 #define LDP_MSG_ADDRESS 0x0300
99 #define LDP_MSG_ADDRESS_WITHDRAW 0x0301
100 #define LDP_MSG_LABEL_MAPPING 0x0400
101 #define LDP_MSG_LABEL_REQUEST 0x0401
102 #define LDP_MSG_LABEL_WITHDRAW 0x0402
103 #define LDP_MSG_LABEL_RELEASE 0x0403
104 #define LDP_MSG_LABEL_ABORT_REQUEST 0x0404
105
106 #define LDP_VENDOR_PRIVATE_MIN 0x3e00
107 #define LDP_VENDOR_PRIVATE_MAX 0x3eff
108 #define LDP_EXPERIMENTAL_MIN 0x3f00
109 #define LDP_EXPERIMENTAL_MAX 0x3fff
110
111 static const struct tok ldp_msg_values[] = {
112 { LDP_MSG_NOTIF, "Notification" },
113 { LDP_MSG_HELLO, "Hello" },
114 { LDP_MSG_INIT, "Initialization" },
115 { LDP_MSG_KEEPALIVE, "Keepalive" },
116 { LDP_MSG_ADDRESS, "Address" },
117 { LDP_MSG_ADDRESS_WITHDRAW, "Address Widthdraw" },
118 { LDP_MSG_LABEL_MAPPING, "Label Mapping" },
119 { LDP_MSG_LABEL_REQUEST, "Label Request" },
120 { LDP_MSG_LABEL_WITHDRAW, "Label Withdraw" },
121 { LDP_MSG_LABEL_RELEASE, "Label Release" },
122 { LDP_MSG_LABEL_ABORT_REQUEST, "Label Abort Request" },
123 { 0, NULL}
124 };
125
126 #define LDP_MASK_TLV_TYPE(x) ((x)&0x3fff)
127 #define LDP_MASK_F_BIT(x) ((x)&0x4000)
128
129 #define LDP_TLV_FEC 0x0100
130 #define LDP_TLV_ADDRESS_LIST 0x0101
131 #define LDP_TLV_HOP_COUNT 0x0103
132 #define LDP_TLV_PATH_VECTOR 0x0104
133 #define LDP_TLV_GENERIC_LABEL 0x0200
134 #define LDP_TLV_ATM_LABEL 0x0201
135 #define LDP_TLV_FR_LABEL 0x0202
136 #define LDP_TLV_STATUS 0x0300
137 #define LDP_TLV_EXTD_STATUS 0x0301
138 #define LDP_TLV_RETURNED_PDU 0x0302
139 #define LDP_TLV_RETURNED_MSG 0x0303
140 #define LDP_TLV_COMMON_HELLO 0x0400
141 #define LDP_TLV_IPV4_TRANSPORT_ADDR 0x0401
142 #define LDP_TLV_CONFIG_SEQ_NUMBER 0x0402
143 #define LDP_TLV_IPV6_TRANSPORT_ADDR 0x0403
144 #define LDP_TLV_COMMON_SESSION 0x0500
145 #define LDP_TLV_ATM_SESSION_PARM 0x0501
146 #define LDP_TLV_FR_SESSION_PARM 0x0502
147 #define LDP_TLV_FT_SESSION 0x0503
148 #define LDP_TLV_LABEL_REQUEST_MSG_ID 0x0600
149
150 static const struct tok ldp_tlv_values[] = {
151 { LDP_TLV_FEC, "FEC" },
152 { LDP_TLV_ADDRESS_LIST, "Address List" },
153 { LDP_TLV_HOP_COUNT, "Hop Count" },
154 { LDP_TLV_PATH_VECTOR, "Path Vector" },
155 { LDP_TLV_GENERIC_LABEL, "Generic Label" },
156 { LDP_TLV_ATM_LABEL, "ATM Label" },
157 { LDP_TLV_FR_LABEL, "Frame-Relay Label" },
158 { LDP_TLV_STATUS, "Status" },
159 { LDP_TLV_EXTD_STATUS, "Extended Status" },
160 { LDP_TLV_RETURNED_PDU, "Returned PDU" },
161 { LDP_TLV_RETURNED_MSG, "Returned Message" },
162 { LDP_TLV_COMMON_HELLO, "Common Hello Parameters" },
163 { LDP_TLV_IPV4_TRANSPORT_ADDR, "IPv4 Transport Address" },
164 { LDP_TLV_CONFIG_SEQ_NUMBER, "Configuration Sequence Number" },
165 { LDP_TLV_IPV6_TRANSPORT_ADDR, "IPv6 Transport Address" },
166 { LDP_TLV_COMMON_SESSION, "Common Session Parameters" },
167 { LDP_TLV_ATM_SESSION_PARM, "ATM Session Parameters" },
168 { LDP_TLV_FR_SESSION_PARM, "Frame-Relay Session Parameters" },
169 { LDP_TLV_FT_SESSION, "Fault-Tolerant Session Parameters" },
170 { LDP_TLV_LABEL_REQUEST_MSG_ID, "Label Request Message ID" },
171 { 0, NULL}
172 };
173
174 #define LDP_FEC_WILDCARD 0x01
175 #define LDP_FEC_PREFIX 0x02
176 #define LDP_FEC_HOSTADDRESS 0x03
177 /* From draft-martini-l2circuit-trans-mpls-13.txt */
178 #define LDP_FEC_MARTINI_VC 0x80
179
180 static const struct tok ldp_fec_values[] = {
181 { LDP_FEC_WILDCARD, "Wildcard" },
182 { LDP_FEC_PREFIX, "Prefix" },
183 { LDP_FEC_HOSTADDRESS, "Host address" },
184 { LDP_FEC_MARTINI_VC, "Martini VC" },
185 { 0, NULL}
186 };
187
188 /* From draft-martini-l2circuit-trans-mpls-13.txt */
189 #define LDP_MARTINI_VCTYPE_FR_DLCI 0x0001
190 #define LDP_MARTINI_VCTYPE_ATM_AAL5 0x0002
191 #define LDP_MARTINI_VCTYPE_ATM_CELL 0x0003
192 #define LDP_MARTINI_VCTYPE_ETH_VLAN 0x0004
193 #define LDP_MARTINI_VCTYPE_ETHERNET 0x0005
194 #define LDP_MARTINI_VCTYPE_HDLC 0x0006
195 #define LDP_MARTINI_VCTYPE_PPP 0x0007
196 #define LDP_MARTINI_VCTYPE_CEM 0x0008
197 #define LDP_MARTINI_VCTYPE_ATM_VCC 0x0009
198 #define LDP_MARTINI_VCTYPE_ATM_VPC 0x000A
199
200 /* Overlaps print-bgp.c bgp_l2vpn_encaps_values */
201 static const struct tok ldp_vctype_values[] = {
202 { LDP_MARTINI_VCTYPE_FR_DLCI, "Frame Relay DLCI" },
203 { LDP_MARTINI_VCTYPE_ATM_AAL5, "ATM AAL5 VCC transport" },
204 { LDP_MARTINI_VCTYPE_ATM_CELL, "ATM transparent cell transport" },
205 { LDP_MARTINI_VCTYPE_ETH_VLAN, "Ethernet VLAN" },
206 { LDP_MARTINI_VCTYPE_ETHERNET, "Ethernet" },
207 { LDP_MARTINI_VCTYPE_HDLC, "HDLC" },
208 { LDP_MARTINI_VCTYPE_PPP, "PPP" },
209 { LDP_MARTINI_VCTYPE_CEM, "SONET/SDH Circuit Emulation Service" },
210 { LDP_MARTINI_VCTYPE_ATM_VCC, "ATM VCC cell transport" },
211 { LDP_MARTINI_VCTYPE_ATM_VPC, "ATM VPC cell transport" },
212 { 0, NULL}
213 };
214
215 /* RFC1700 address family numbers, same definition in print-bgp.c */
216 #define AFNUM_INET 1
217 #define AFNUM_INET6 2
218
219 #define FALSE 0
220 #define TRUE 1
221
222 int ldp_tlv_print(register const u_char *);
223
224 /*
225 * ldp tlv header
226 *
227 * 0 1 2 3
228 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
229 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
230 * |U|F| Type | Length |
231 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
232 * | |
233 * | Value |
234 * ~ ~
235 * | |
236 * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
237 * | |
238 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
239 */
240
241 int
242 ldp_tlv_print(register const u_char *tptr) {
243
244 struct ldp_tlv_header {
245 u_int8_t type[2];
246 u_int8_t length[2];
247 };
248
249 const struct ldp_tlv_header *ldp_tlv_header;
250 u_short tlv_type,tlv_len,tlv_tlen,af,ft_flags;
251 u_char fec_type;
252 u_int ui;
253 char buf[100];
254 int i;
255
256 ldp_tlv_header = (const struct ldp_tlv_header *)tptr;
257 tlv_len=EXTRACT_16BITS(ldp_tlv_header->length);
258 tlv_tlen=tlv_len;
259 tlv_type=LDP_MASK_TLV_TYPE(EXTRACT_16BITS(ldp_tlv_header->type));
260
261 /* FIXME vendor private / experimental check */
262 printf("\n\t %s TLV (0x%04x), length: %u, Flags: [%s and %s forward if unknown]",
263 tok2str(ldp_tlv_values,
264 "Unknown",
265 tlv_type),
266 tlv_type,
267 tlv_len,
268 LDP_MASK_U_BIT(EXTRACT_16BITS(&ldp_tlv_header->type)) ? "continue processing" : "ignore",
269 LDP_MASK_F_BIT(EXTRACT_16BITS(&ldp_tlv_header->type)) ? "do" : "don't");
270
271 tptr+=sizeof(struct ldp_tlv_header);
272
273 switch(tlv_type) {
274
275 case LDP_TLV_COMMON_HELLO:
276 printf("\n\t Hold Time: %us, Flags: [%s Hello%s]",
277 EXTRACT_16BITS(tptr),
278 (EXTRACT_16BITS(tptr+2)&0x8000) ? "Targeted" : "Link",
279 (EXTRACT_16BITS(tptr+2)&0x4000) ? ", Request for targeted Hellos" : "");
280 break;
281
282 case LDP_TLV_IPV4_TRANSPORT_ADDR:
283 printf("\n\t IPv4 Transport Address: %s", ipaddr_string(tptr));
284 break;
285 #ifdef INET6
286 case LDP_TLV_IPV6_TRANSPORT_ADDR:
287 printf("\n\t IPv6 Transport Address: %s", ip6addr_string(tptr));
288 break;
289 #endif
290 case LDP_TLV_CONFIG_SEQ_NUMBER:
291 printf("\n\t Sequence Number: %u", EXTRACT_32BITS(tptr));
292 break;
293
294 case LDP_TLV_ADDRESS_LIST:
295 af = EXTRACT_16BITS(tptr);
296 tptr+=2;
297 printf("\n\t Adress Family: ");
298 if (af == AFNUM_INET) {
299 printf("IPv4, addresses:");
300 for (i=0; i<(tlv_tlen-2)/4; i++) {
301 printf(" %s",ipaddr_string(tptr));
302 tptr+=4;
303 }
304 }
305 #ifdef INET6
306 else if (af == AFNUM_INET6) {
307 printf("IPv6, addresses:");
308 for (i=0; i<(tlv_tlen-2)/16; i++) {
309 printf(" %s",ip6addr_string(tptr));
310 tptr+=16;
311 }
312 }
313 #endif
314 break;
315
316 case LDP_TLV_COMMON_SESSION:
317 printf("\n\t Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]",
318 EXTRACT_16BITS(tptr), EXTRACT_16BITS(tptr+2),
319 (EXTRACT_16BITS(tptr+6)&0x8000) ? "On Demand" : "Unsolicited",
320 (EXTRACT_16BITS(tptr+6)&0x4000) ? "Enabled" : "Disabled"
321 );
322 break;
323
324 case LDP_TLV_FEC:
325 fec_type = *tptr;
326 printf("\n\t %s FEC (0x%02x)",
327 tok2str(ldp_fec_values, "Unknown", fec_type),
328 fec_type);
329
330 tptr+=1;
331 switch(fec_type) {
332
333 case LDP_FEC_WILDCARD:
334 break;
335 case LDP_FEC_PREFIX:
336 af = EXTRACT_16BITS(tptr);
337 tptr+=2;
338 if (af == AFNUM_INET) {
339 i=decode_prefix4(tptr,buf,sizeof(buf));
340 printf(": IPv4 prefix %s",buf);
341 }
342 #ifdef INET6
343 else if (af == AFNUM_INET6) {
344 i=decode_prefix6(tptr,buf,sizeof(buf));
345 printf(": IPv6 prefix %s",buf);
346 }
347 #endif
348 break;
349 case LDP_FEC_HOSTADDRESS:
350 break;
351 case LDP_FEC_MARTINI_VC:
352 printf(": %s, %scontrol word, VC %u",
353 tok2str(ldp_vctype_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff),
354 EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ",
355 EXTRACT_32BITS(tptr+7));
356 break;
357 }
358
359 break;
360
361 case LDP_TLV_GENERIC_LABEL:
362 printf("\n\t Label: %u", EXTRACT_32BITS(tptr) & 0xfffff);
363 break;
364
365 case LDP_TLV_STATUS:
366 ui = EXTRACT_32BITS(tptr);
367 tptr+=4;
368 printf("\n\t Status: 0x%02x, Flags: [%s and %s forward]",
369 ui&0x3fffffff,
370 ui&0x80000000 ? "Fatal error" : "Advisory Notification",
371 ui&0x40000000 ? "do" : "don't");
372 ui = EXTRACT_32BITS(tptr);
373 tptr+=4;
374 if (ui)
375 printf(", causing Message ID: 0x%08x", ui);
376 break;
377
378 case LDP_TLV_FT_SESSION:
379 ft_flags = EXTRACT_16BITS(tptr);
380 printf("\n\t Flags: [%sReconnect, %sSave State, %sAll-Label Protection, %s Checkpoint, %sRe-Learn State]",
381 ft_flags&0x8000 ? "" : "No ",
382 ft_flags&0x8 ? "" : "Don't ",
383 ft_flags&0x4 ? "" : "No ",
384 ft_flags&0x2 ? "Sequence Numbered Label" : "All Labels",
385 ft_flags&0x1 ? "" : "Don't ");
386 tptr+=4;
387 ui = EXTRACT_32BITS(tptr);
388 if (ui)
389 printf(", Reconnect Timeout: %ums", ui);
390 tptr+=4;
391 ui = EXTRACT_32BITS(tptr);
392 if (ui)
393 printf(", Recovery Time: %ums", ui);
394 break;
395
396
397 /*
398 * FIXME those are the defined TLVs that lack a decoder
399 * you are welcome to contribute code ;-)
400 */
401
402 case LDP_TLV_HOP_COUNT:
403 case LDP_TLV_PATH_VECTOR:
404 case LDP_TLV_ATM_LABEL:
405 case LDP_TLV_FR_LABEL:
406 case LDP_TLV_EXTD_STATUS:
407 case LDP_TLV_RETURNED_PDU:
408 case LDP_TLV_RETURNED_MSG:
409 case LDP_TLV_ATM_SESSION_PARM:
410 case LDP_TLV_FR_SESSION_PARM:
411 case LDP_TLV_LABEL_REQUEST_MSG_ID:
412
413 default:
414 if (vflag <= 1)
415 print_unknown_data(tptr,"\n\t ",tlv_tlen);
416 break;
417 }
418 return(tlv_len+4); /* Type & Length fields not included */
419 }
420
421 void
422 ldp_print(register const u_char *pptr, register u_int len) {
423
424 const struct ldp_common_header *ldp_com_header;
425 const struct ldp_msg_header *ldp_msg_header;
426 const u_char *tptr,*msg_tptr;
427 u_short tlen;
428 u_short msg_len,msg_type,msg_tlen;
429 int hexdump,processed;
430
431 tptr=pptr;
432 ldp_com_header = (const struct ldp_common_header *)pptr;
433 TCHECK(*ldp_com_header);
434
435 /*
436 * Sanity checking of the header.
437 */
438 if (EXTRACT_16BITS(&ldp_com_header->version) != LDP_VERSION) {
439 printf("LDP version %u packet not supported",
440 EXTRACT_16BITS(&ldp_com_header->version));
441 return;
442 }
443
444 /* print the LSR-ID, label-space & length */
445 printf("%sLDP, Label-Space-ID: %s:%u, length: %u",
446 (vflag < 1) ? "" : "\n\t",
447 ipaddr_string(&ldp_com_header->lsr_id),
448 EXTRACT_16BITS(&ldp_com_header->label_space),
449 len);
450
451 /* bail out if non-verbose */
452 if (vflag < 1)
453 return;
454
455 /* ok they seem to want to know everything - lets fully decode it */
456 tlen=EXTRACT_16BITS(ldp_com_header->pdu_length);
457
458 tptr += sizeof(const struct ldp_common_header);
459 tlen -= sizeof(const struct ldp_common_header)-4; /* Type & Length fields not included */
460
461 while(tlen>0) {
462 /* did we capture enough for fully decoding the msg header ? */
463 if (!TTEST2(*tptr, sizeof(struct ldp_msg_header)))
464 goto trunc;
465
466 ldp_msg_header = (const struct ldp_msg_header *)tptr;
467 msg_len=EXTRACT_16BITS(ldp_msg_header->length);
468 msg_type=LDP_MASK_MSG_TYPE(EXTRACT_16BITS(ldp_msg_header->type));
469
470 /* FIXME vendor private / experimental check */
471 printf("\n\t %s Message (0x%04x), length: %u, Message ID: 0x%08x, Flags: [%s if unknown]",
472 tok2str(ldp_msg_values,
473 "Unknown",
474 msg_type),
475 msg_type,
476 msg_len,
477 EXTRACT_32BITS(&ldp_msg_header->id),
478 LDP_MASK_U_BIT(EXTRACT_16BITS(&ldp_msg_header->type)) ? "continue processing" : "ignore");
479
480 msg_tptr=tptr+sizeof(struct ldp_msg_header);
481 msg_tlen=msg_len-sizeof(struct ldp_msg_header)+4; /* Type & Length fields not included */
482
483 /* did we capture enough for fully decoding the message ? */
484 if (!TTEST2(*tptr, msg_len))
485 goto trunc;
486 hexdump=FALSE;
487
488 switch(msg_type) {
489
490 case LDP_MSG_NOTIF:
491 case LDP_MSG_HELLO:
492 case LDP_MSG_INIT:
493 case LDP_MSG_KEEPALIVE:
494 case LDP_MSG_ADDRESS:
495 case LDP_MSG_LABEL_MAPPING:
496 while(msg_tlen >= 4) {
497 processed = ldp_tlv_print(msg_tptr);
498 if (processed == 0)
499 break;
500 msg_tlen-=processed;
501 msg_tptr+=processed;
502 }
503 break;
504
505 /*
506 * FIXME those are the defined messages that lack a decoder
507 * you are welcome to contribute code ;-)
508 */
509
510 case LDP_MSG_ADDRESS_WITHDRAW:
511 case LDP_MSG_LABEL_REQUEST:
512 case LDP_MSG_LABEL_WITHDRAW:
513 case LDP_MSG_LABEL_RELEASE:
514 case LDP_MSG_LABEL_ABORT_REQUEST:
515
516 default:
517 if (vflag <= 1)
518 print_unknown_data(msg_tptr,"\n\t ",msg_tlen);
519 break;
520 }
521 /* do we want to see an additionally hexdump ? */
522 if (vflag > 1 || hexdump==TRUE)
523 print_unknown_data(tptr+sizeof(sizeof(struct ldp_msg_header)),"\n\t ",
524 msg_len);
525
526 tptr += msg_len+4;
527 tlen -= msg_len+4;
528 }
529 return;
530 trunc:
531 printf("\n\t\t packet exceeded snapshot");
532 }
533