else if (0 == strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm))
else if (0 == strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm))
- goto corrupt;
- TCHECK2(*cp, 5);
- printf("%s%s/%u", sep, ipaddr_string(cp), *(cp + 4));
+ goto invalid;
+ ND_TCHECK_5(cp);
+ ND_PRINT("%s%s/%u", sep, ipaddr_string(ndo, cp), EXTRACT_U_1(cp + 4));
/* [AHCP1_OPT_PAD] = */ NULL,
/* [AHCP1_OPT_MANDATORY] = */ NULL,
/* [AHCP1_OPT_ORIGIN_TIME] = */ ahcp_time_print,
/* [AHCP1_OPT_PAD] = */ NULL,
/* [AHCP1_OPT_MANDATORY] = */ NULL,
/* [AHCP1_OPT_ORIGIN_TIME] = */ ahcp_time_print,
- printf("\n\t %s", tok2str(ahcp1_opt_str, "Unknown-%u", option_no));
+ ND_PRINT("\n\t %s", tok2str(ahcp1_opt_str, "Unknown-%u", option_no));
- printf(" (Length %u)", option_len);
- TCHECK2(*cp, option_len);
+ ND_PRINT(" (Length %u)", option_len);
+ ND_TCHECK_LEN(cp, option_len);
- if (vflag) {
- printf("\n\t%s", tok2str(ahcp1_msg_str, "Unknown-%u", type));
+ if (ndo->ndo_vflag) {
+ ND_PRINT("\n\t%s", tok2str(ahcp1_msg_str, "Unknown-%u", type));
- printf(", MBZ %u", mbz);
- printf(", Length %u", body_len);
+ ND_PRINT(", MBZ %u", mbz);
+ ND_PRINT(", Length %u", body_len);
- if (vflag >= 2)
- ahcp1_options_print(cp, cp + body_len); /* not ep (ignore extra data) */
+ if (ndo->ndo_vflag >= 2)
+ ahcp1_options_print(ndo, cp, cp + body_len); /* not ep (ignore extra data) */
-ahcp_print(const u_char *cp, const u_int len) {
- const u_char *ep = cp + len;
+ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
+{
+ const u_char *ep = ndo->ndo_snapend;
- TCHECK2(*cp, 8);
- printf(", Source Id %s", linkaddr_string(cp, 0, 8));
+ ND_TCHECK_8(cp);
+ ND_PRINT(", Source Id %s", linkaddr_string(ndo, cp, 0, 8));
- TCHECK2(*cp, 8);
- printf(", Destination Id %s", linkaddr_string(cp, 0, 8));
+ ND_TCHECK_8(cp);
+ ND_PRINT(", Destination Id %s", linkaddr_string(ndo, cp, 0, 8));