#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.42 2004-03-18 14:12:18 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.45.2.3 2005-07-11 20:24:34 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
return;
}
- TCHECK2(bp[0], 4);
+ TCHECK2(bp[0], sizeof(struct in_addr));
if (vflag > 1)
(void)printf("\n");
(void)printf(" Upstream Nbr: %s", ipaddr_string(bp));
bp += 4;
len -= 4;
while (ngroups--) {
- TCHECK2(bp[0], 4);
+ /*
+ * XXX - does the address have length "addrlen" and the
+ * mask length "maddrlen"?
+ */
+ TCHECK2(bp[0], sizeof(struct in_addr));
(void)printf("\n\tGroup: %s", ipaddr_string(bp));
+ TCHECK2(bp[4], sizeof(struct in_addr));
if (EXTRACT_32BITS(&bp[4]) != 0xffffffff)
(void)printf("/%s", ipaddr_string(&bp[4]));
TCHECK2(bp[8], 4);
break;
case 2:
(void)printf(" Register-Stop");
- TCHECK2(bp[12], 4);
+ TCHECK2(bp[12], sizeof(struct in_addr));
(void)printf(" for %s > %s", ipaddr_string(&bp[8]),
ipaddr_string(&bp[12]));
break;
break;
case 5:
(void)printf(" Assert");
- TCHECK2(bp[16], 4);
+ TCHECK2(bp[16], sizeof(struct in_addr));
(void)printf(" for %s > %s", ipaddr_string(&bp[16]),
ipaddr_string(&bp[8]));
if (EXTRACT_32BITS(&bp[12]) != 0xffffffff)
switch (PIM_VER(pim->pim_typever)) {
case 2:
if (!vflag) {
- printf("PIMv%u, %s (%u), length: %u",
+ printf("PIMv%u, %s, length: %u",
PIM_VER(pim->pim_typever),
tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever)),
- PIM_TYPE(pim->pim_typever),
len);
return;
} else {
- printf("PIMv%u, length: %u\n\t%s (%u)",
+ printf("PIMv%u, length: %u\n\t%s",
PIM_VER(pim->pim_typever),
len,
- tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever)),
- PIM_TYPE(pim->pim_typever));
+ tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever)));
pimv2_print(bp, len);
}
break;
pimv2_addr_print(const u_char *bp, enum pimv2_addrtype at, int silent)
{
int af;
- const char *afstr;
int len, hdrlen;
TCHECK(bp[0]);
switch (bp[0]) {
case 1:
af = AF_INET;
- afstr = "IPv4";
- len = 4;
+ len = sizeof(struct in_addr);
break;
#ifdef INET6
case 2:
af = AF_INET6;
- afstr = "IPv6";
- len = 16;
+ len = sizeof(struct in6_addr);
break;
#endif
default:
hdrlen = 2;
} else {
switch (pimv2_addr_len) {
- case 4:
+ case sizeof(struct in_addr):
af = AF_INET;
- afstr = "IPv4";
break;
#ifdef INET6
- case 16:
+ case sizeof(struct in6_addr):
af = AF_INET6;
- afstr = "IPv6";
break;
#endif
default:
switch (IP_V(ip)) {
case 4: /* IPv4 */
printf(" ");
- ip_print(bp, len);
+ ip_print(gndo, bp, len);
break;
#ifdef INET6
case 6: /* IPv6 */
trunc:
(void)printf("[|pim]");
}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */