- printf(" %s", tok2str(ns_type2str, "Type%d",
- ntohs(grbn->rdtype)));
- if (ntohs(grbn->rdclass) != C_IN);
- printf(" %s", tok2str(ns_class2str, "Class%d",
- ntohs(grbn->rdclass)));
- printf(" TTL ");
- relts_print(ntohl(grbn->ttl));
- printf(" %u/%u", ntohs(grbn->nrdatas),
- ntohs(grbn->nsigs));
-
- /* XXX grbn points to packed struct */
- s = (const char *)&grbn->nsigs+ sizeof(grbn->nsigs);
-
- advance = lwres_printnamelen(s);
- if (advance < 0)
- goto trunc;
+ ND_PRINT(" %s", tok2str(ns_type2str, "Type%u",
+ GET_BE_U_2(grbn->rdtype)));
+ if (GET_BE_U_2(grbn->rdclass) != C_IN) {
+ ND_PRINT(" %s", tok2str(ns_class2str, "Class%u",
+ GET_BE_U_2(grbn->rdclass)));
+ }
+ ND_PRINT(" TTL ");
+ unsigned_relts_print(ndo,
+ GET_BE_U_4(grbn->ttl));
+ ND_PRINT(" %u/%u", GET_BE_U_2(grbn->nrdatas),
+ GET_BE_U_2(grbn->nsigs));
+
+ s = p + LWRES_GRBNRESPONSE_LEN;
+ advance = lwres_printnamelen(ndo, s);