]>
The Tcpdump Group git mirrors - tcpdump/blob - print-msdp.c
2 * Copyright (c) 2001 William C. Fenner.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code
7 * distributions retain the above copyright notice and this paragraph
8 * in its entirety, and (2) distributions including binary code include
9 * the above copyright notice and this paragraph in its entirety in
10 * the documentation or other materials provided with the distribution.
11 * The name of William C. Fenner may not be used to endorse or
12 * promote products derived from this software without specific prior
13 * written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND
14 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
15 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
16 * FOR A PARTICULAR PURPOSE.
19 static const char rcsid
[] =
20 "@(#) $Header: /tcpdump/master/tcpdump/print-msdp.c,v 1.1 2001-09-17 20:06:18 fenner Exp $";
29 #include "interface.h"
30 #include "addrtoname.h"
33 #define MSDP_TYPE_MAX 7
36 msdp_print(const unsigned char *sp
, u_int length
)
38 unsigned int type
, len
;
41 /* See if we think we're at the beginning of a compound packet */
43 len
= EXTRACT_16BITS(sp
+ 1);
44 if (len
> 1500 || len
< 3 || type
== 0 || type
> MSDP_TYPE_MAX
)
45 goto trunc
; /* not really truncated, but still not decodable */
46 (void)printf(" msdp:");
50 len
= EXTRACT_16BITS(sp
+ 1);
51 if (len
> 1400 || vflag
)
52 printf(" [len %d]", len
);
58 case 1: /* IPv4 Source-Active */
59 case 3: /* IPv4 Source-Active Response */
63 (void)printf(" SA-Response");
65 (void)printf(" %d entries", *sp
);
66 if (*sp
* 12 + 8 < len
) {
67 (void)printf(" [w/data]");
70 ip_print(sp
+ *sp
* 12 + 8 - 3,
71 len
- (*sp
* 12 + 8));
76 (void)printf(" SA-Request");
78 (void)printf(" for %s", ipaddr_string(sp
+ 1));
81 (void)printf(" Keepalive");
83 (void)printf("[len=%d] ", len
);
86 (void)printf(" Notification");
89 (void)printf(" [type=%d len=%d]", type
, len
);
97 (void)printf(" [|msdp]");