+static int
+isnonzero(netdissect_options *ndo, const u_char *a, size_t len)
+{
+ while (len != 0) {
+ if (GET_U_1(a) != 0)
+ return (1);
+ a++;
+ len--;
+ }
+ return (0);
+}
+
+static void
+tpaddr_print_ip(netdissect_options *ndo,
+ const struct arp_pkthdr *ap, u_short pro)
+{
+ if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL)
+ ND_PRINT("<wrong proto type>");
+ else if (PROTO_LEN(ap) != 4)
+ ND_PRINT("<wrong len>");
+ else
+ ND_PRINT("%s", GET_IPADDR_STRING(TPA(ap)));
+}
+
+static void
+spaddr_print_ip(netdissect_options *ndo,
+ const struct arp_pkthdr *ap, u_short pro)
+{
+ if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL)
+ ND_PRINT("<wrong proto type>");
+ else if (PROTO_LEN(ap) != 4)
+ ND_PRINT("<wrong len>");
+ else
+ ND_PRINT("%s", GET_IPADDR_STRING(SPA(ap)));
+}
+
+static void
+atmarp_addr_print(netdissect_options *ndo,
+ const u_char *ha, u_int ha_len, const u_char *srca,
+ u_int srca_len)
+{
+ if (ha_len == 0)
+ ND_PRINT("<No address>");
+ else {
+ ND_PRINT("%s", GET_LINKADDR_STRING(ha, LINKADDR_ATM, ha_len));
+ if (srca_len != 0)
+ ND_PRINT(",%s",
+ GET_LINKADDR_STRING(srca, LINKADDR_ATM, srca_len));
+ }
+}
+
+static void
+atmarp_tpaddr_print(netdissect_options *ndo,
+ const struct atmarp_pkthdr *ap, u_short pro)
+{
+ if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL)
+ ND_PRINT("<wrong proto type>");
+ else if (ATMTPROTO_LEN(ap) != 4)
+ ND_PRINT("<wrong tplen>");
+ else
+ ND_PRINT("%s", GET_IPADDR_STRING(ATMTPA(ap)));
+}