- TCHECK(hp->hsrp_virtaddr);
- printf("addr=%s", ipaddr_string(&hp->hsrp_virtaddr));
- if (vflag) {
- printf(" hellotime=");
- relts_print(hp->hsrp_hellotime);
- printf(" holdtime=");
- relts_print(hp->hsrp_holdtime);
- printf(" priority=%d", hp->hsrp_priority);
- printf(" auth=\"");
- fn_printn(hp->hsrp_authdata, sizeof(hp->hsrp_authdata), NULL);
- printf("\"");
+ ND_PRINT("addr=%s", GET_IPADDR_STRING(hp->hsrp_virtaddr));
+ if (ndo->ndo_vflag) {
+ ND_PRINT(" hellotime=");
+ unsigned_relts_print(ndo, GET_U_1(hp->hsrp_hellotime));
+ ND_PRINT(" holdtime=");
+ unsigned_relts_print(ndo, GET_U_1(hp->hsrp_holdtime));
+ ND_PRINT(" priority=%u", GET_U_1(hp->hsrp_priority));
+ ND_PRINT(" auth=\"");
+ /*
+ * RFC 2281 Section 5.1 does not specify the encoding of
+ * Authentication Data explicitly, but zero padding can be
+ * inferred from the "recommended default value".
+ */
+ nd_printjnp(ndo, hp->hsrp_authdata, HSRP_AUTH_SIZE);
+ ND_PRINT("\"");