+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", ipaddr_string(ndo, 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", ipaddr_string(ndo, 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", linkaddr_string(ndo, ha, LINKADDR_ATM, ha_len));
+ if (srca_len != 0)
+ ND_PRINT(",%s",
+ linkaddr_string(ndo, 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", ipaddr_string(ndo, ATMTPA(ap)));
+}
+
+static void
+atmarp_spaddr_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 (ATMSPROTO_LEN(ap) != 4)
+ ND_PRINT("<wrong splen>");
+ else
+ ND_PRINT("%s", ipaddr_string(ndo, ATMSPA(ap)));
+}
+
+static void
+atmarp_print(netdissect_options *ndo,
+ const u_char *bp, u_int length, u_int caplen)
+{
+ const struct atmarp_pkthdr *ap;
+ u_short pro, hrd, op;
+
+ ap = (const struct atmarp_pkthdr *)bp;
+ ND_TCHECK_SIZE(ap);
+
+ hrd = ATMHRD(ap);
+ pro = ATMPRO(ap);
+ op = ATMOP(ap);
+
+ if (!ND_TTEST_LEN(aar_tpa(ap), ATMTPROTO_LEN(ap))) {
+ ND_PRINT("%s", tstr);
+ ND_DEFAULTPRINT((const u_char *)ap, length);