static int print_probe(netdissect_options *, const u_char *, const u_char *, u_int);
static int print_report(netdissect_options *, const u_char *, const u_char *, u_int);
static int print_neighbors(netdissect_options *, const u_char *, const u_char *, u_int);
static int print_probe(netdissect_options *, const u_char *, const u_char *, u_int);
static int print_report(netdissect_options *, const u_char *, const u_char *, u_int);
static int print_neighbors(netdissect_options *, const u_char *, const u_char *, u_int);
-static int print_neighbors2(netdissect_options *, const u_char *, const u_char *, u_int);
+static int print_neighbors2(netdissect_options *, const u_char *, const u_char *, u_int, uint8_t, uint8_t);
static int print_prune(netdissect_options *, const u_char *);
static int print_graft(netdissect_options *, const u_char *);
static int print_graft_ack(netdissect_options *, const u_char *);
static int print_prune(netdissect_options *, const u_char *);
static int print_graft(netdissect_options *, const u_char *);
static int print_graft_ack(netdissect_options *, const u_char *);
if (ndo->ndo_vflag) {
if (print_probe(ndo, bp, ep, len) < 0)
goto trunc;
if (ndo->ndo_vflag) {
if (print_probe(ndo, bp, ep, len) < 0)
goto trunc;
if (ndo->ndo_vflag > 1) {
if (print_report(ndo, bp, ep, len) < 0)
goto trunc;
if (ndo->ndo_vflag > 1) {
if (print_report(ndo, bp, ep, len) < 0)
goto trunc;
if (print_neighbors(ndo, bp, ep, len) < 0)
goto trunc;
break;
case DVMRP_ASK_NEIGHBORS2:
if (print_neighbors(ndo, bp, ep, len) < 0)
goto trunc;
break;
case DVMRP_ASK_NEIGHBORS2:
- if (print_neighbors2(ndo, bp, ep, len) < 0)
+ if (print_neighbors2(ndo, bp, ep, len, major_version,
+ minor_version) < 0)
- ND_PRINT((ndo, "\n\t %s metric %d", intoa(htonl(origin)),
- metric));
+ ND_PRINT("\n\t %s metric %u", intoa(htonl(origin)),
+ metric);
- ND_PRINT((ndo, ndo->ndo_vflag > 1 ? "\n\t" : " "));
- ND_PRINT((ndo, "genid %u", genid));
+ ND_PRINT(ndo->ndo_vflag > 1 ? "\n\t" : " ");
+ ND_PRINT("genid %u", genid);
- ND_TCHECK2(bp[0], 4);
- ND_PRINT((ndo, "\n\tneighbor %s", ipaddr_string(ndo, bp)));
+ ND_TCHECK_4(bp);
+ ND_PRINT("\n\tneighbor %s", ipaddr_string(ndo, bp));
- ND_TCHECK2(bp[0], 4);
- ND_PRINT((ndo, " [%s ->", ipaddr_string(ndo, laddr)));
- ND_PRINT((ndo, " %s, (%d/%d)]",
- ipaddr_string(ndo, bp), metric, thresh));
+ ND_TCHECK_4(bp);
+ ND_PRINT(" [%s ->", ipaddr_string(ndo, laddr));
+ ND_PRINT(" %s, (%u/%u)]",
+ ipaddr_string(ndo, bp), metric, thresh);
- register const u_char *bp, register const u_char *ep,
- register u_int len)
+ const u_char *bp, const u_char *ep,
+ u_int len, uint8_t major_version,
+ uint8_t minor_version)
- ND_PRINT((ndo, " (v %d.%d):",
- (int)target_level & 0xff,
- (int)(target_level >> 8) & 0xff));
+ ND_PRINT(" (v %u.%u):", major_version, minor_version);
- ND_PRINT((ndo, " [%s -> ", ipaddr_string(ndo, laddr)));
- ND_PRINT((ndo, "%s (%d/%d", ipaddr_string(ndo, bp),
- metric, thresh));
+ ND_PRINT(" [%s -> ", ipaddr_string(ndo, laddr));
+ ND_PRINT("%s (%u/%u", ipaddr_string(ndo, bp),
+ metric, thresh);
- ND_TCHECK2(bp[0], 12);
- ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)));
+ ND_TCHECK_LEN(bp, 12);
+ ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4));
- ND_PRINT((ndo, " timer "));
- unsigned_relts_print(ndo, EXTRACT_32BITS(bp));
+ ND_PRINT(" timer ");
+ unsigned_relts_print(ndo, GET_BE_U_4(bp));
- ND_TCHECK2(bp[0], 8);
- ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)));
+ ND_TCHECK_8(bp);
+ ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4));
- ND_TCHECK2(bp[0], 8);
- ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)));
+ ND_TCHECK_8(bp);
+ ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4));