-static void pimv2_print(netdissect_options *, register const u_char *bp, register u_int len, const u_char *);
+static void pimv2_print(netdissect_options *, const u_char *bp, u_int len, const u_char *);
{
int ngroups, njoin, nprune;
int njp;
/* If it's a single group and a single source, use 1-line output. */
{
int ngroups, njoin, nprune;
int njp;
/* If it's a single group and a single source, use 1-line output. */
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n"));
ND_PRINT((ndo, " Upstream Nbr: %s", ipaddr_string(ndo, bp)));
if (ndo->ndo_vflag > 1)
ND_PRINT((ndo, "\n"));
ND_PRINT((ndo, " Upstream Nbr: %s", ipaddr_string(ndo, bp)));
ND_PRINT((ndo, "\n\tGroup: %s", ipaddr_string(ndo, bp)));
bp += 4;
len -= 4;
if (len < 4)
goto trunc;
ND_PRINT((ndo, "\n\tGroup: %s", ipaddr_string(ndo, bp)));
bp += 4;
len -= 4;
if (len < 4)
goto trunc;
if (EXTRACT_BE_U_4(bp) != 0xffffffff)
ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp)));
bp += 4;
if (EXTRACT_BE_U_4(bp) != 0xffffffff)
ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp)));
bp += 4;
ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type)));
switch (type) {
case PIMV1_TYPE_QUERY:
ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type)));
switch (type) {
case PIMV1_TYPE_QUERY:
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 20),
ipaddr_string(ndo, bp + 24)));
break;
case PIMV1_TYPE_REGISTER_STOP:
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 20),
ipaddr_string(ndo, bp + 24)));
break;
case PIMV1_TYPE_REGISTER_STOP:
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 8),
ipaddr_string(ndo, bp + 12)));
break;
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 8),
ipaddr_string(ndo, bp + 12)));
break;
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 16),
ipaddr_string(ndo, bp + 8)));
if (EXTRACT_BE_U_4(bp + 12) != 0xffffffff)
ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 16),
ipaddr_string(ndo, bp + 8)));
if (EXTRACT_BE_U_4(bp + 12) != 0xffffffff)
case 0: ND_PRINT((ndo, " PIMv?"));
break;
case 1: ND_PRINT((ndo, " PIMv1"));
case 0: ND_PRINT((ndo, " PIMv?"));
break;
case 1: ND_PRINT((ndo, " PIMv1"));
ND_TCHECK_6(bp);
ND_PRINT((ndo, "%c%s%s/%d", s, EXTRACT_U_1(bp) & 1 ? "!" : "",
ipaddr_string(ndo, bp + 2), EXTRACT_U_1(bp + 1)));
ND_TCHECK_6(bp);
ND_PRINT((ndo, "%c%s%s/%d", s, EXTRACT_U_1(bp) & 1 ? "!" : "",
ipaddr_string(ndo, bp + 2), EXTRACT_U_1(bp + 1)));
if (af == AF_INET) {
if (!silent)
ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp)));
if (af == AF_INET) {
if (!silent)
ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp)));
if (af == AF_INET) {
if (!silent) {
ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp + 2)));
if (af == AF_INET) {
if (!silent) {
ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp + 2)));
ND_PRINT((ndo, "/%u", EXTRACT_U_1(bp + 1)));
}
}
else if (af == AF_INET6) {
if (!silent) {
ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp + 2)));
ND_PRINT((ndo, "/%u", EXTRACT_U_1(bp + 1)));
}
}
else if (af == AF_INET6) {
if (!silent) {
ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp + 2)));
EXTRACT_U_1(bp) & 0x04 ? "S" : "",
EXTRACT_U_1(bp) & 0x02 ? "W" : "",
EXTRACT_U_1(bp) & 0x01 ? "R" : ""));
EXTRACT_U_1(bp) & 0x04 ? "S" : "",
EXTRACT_U_1(bp) & 0x02 ? "W" : "",
EXTRACT_U_1(bp) & 0x01 ? "R" : ""));
ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen));
} else {
ND_PRINT((ndo, "v%d", EXTRACT_U_1(bp)));
ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen));
} else {
ND_PRINT((ndo, "v%d", EXTRACT_U_1(bp)));
}
if (EXTRACT_BE_U_2(bp + 2) != 0) {
ND_PRINT((ndo, " ?0x%04x?", EXTRACT_BE_U_2(bp + 2)));
}
if (EXTRACT_BE_U_2(bp + 2) != 0) {
ND_PRINT((ndo, " ?0x%04x?", EXTRACT_BE_U_2(bp + 2)));
ND_PRINT((ndo, ", Flags [ %s ]\n\t",
tok2str(pimv2_register_flag_values,
ND_PRINT((ndo, ", Flags [ %s ]\n\t",
tok2str(pimv2_register_flag_values,
holdtime = EXTRACT_BE_U_2(bp + 2);
ND_PRINT((ndo, "\n\t %u group(s)", ngroup));
if (PIM_TYPE(pim->pim_typever) != 7) { /*not for Graft-ACK*/
holdtime = EXTRACT_BE_U_2(bp + 2);
ND_PRINT((ndo, "\n\t %u group(s)", ngroup));
if (PIM_TYPE(pim->pim_typever) != 7) { /*not for Graft-ACK*/
ND_PRINT((ndo, ",prio=%d", EXTRACT_U_1(bp + 2)));
if (len < 4)
goto trunc;
ND_PRINT((ndo, ",prio=%d", EXTRACT_U_1(bp + 2)));
if (len < 4)
goto trunc;
ND_PRINT((ndo, " RPT"));
ND_PRINT((ndo, " pref=%u", EXTRACT_BE_U_4(bp) & 0x7fffffff));
ND_PRINT((ndo, " metric=%u", EXTRACT_BE_U_4(bp + 4)));
ND_PRINT((ndo, " RPT"));
ND_PRINT((ndo, " pref=%u", EXTRACT_BE_U_4(bp) & 0x7fffffff));
ND_PRINT((ndo, " metric=%u", EXTRACT_BE_U_4(bp + 4)));