ieee_802_11_hdr_print(netdissect_options *ndo,
                      uint16_t fc, const u_char *p, u_int hdrlen,
                      u_int meshdrlen)
{
	if (ndo->ndo_vflag) {
		if (FC_MORE_DATA(fc))
			ND_PRINT((ndo, "More Data "));
		if (FC_MORE_FLAG(fc))
			ND_PRINT((ndo, "More Fragments "));
		if (FC_POWER_MGMT(fc))
			ND_PRINT((ndo, "Pwr Mgmt "));
		if (FC_RETRY(fc))
			ND_PRINT((ndo, "Retry "));
		if (FC_ORDER(fc))
			ND_PRINT((ndo, "Strictly Ordered "));
		if (FC_PROTECTED(fc))
			ND_PRINT((ndo, "Protected "));
		if (FC_TYPE(fc) != T_CTRL || FC_SUBTYPE(fc) != CTRL_PS_POLL)
			ND_PRINT((ndo, "%dus ",
			    EXTRACT_LE_16BITS(
			        &((const struct mgmt_header_t *)p)->duration)));
	}
	if (meshdrlen != 0) {
		const struct meshcntl_t *mc =
		    (const struct meshcntl_t *)&p[hdrlen - meshdrlen];
		int ae = mc->flags & 3;

		ND_PRINT((ndo, "MeshData (AE %d TTL %u seq %u", ae, mc->ttl,
		    EXTRACT_LE_32BITS(mc->seq)));
		if (ae > 0)
			ND_PRINT((ndo, " A4:%s", etheraddr_string(ndo, mc->addr4)));
		if (ae > 1)
			ND_PRINT((ndo, " A5:%s", etheraddr_string(ndo, mc->addr5)));
		if (ae > 2)
			ND_PRINT((ndo, " A6:%s", etheraddr_string(ndo, mc->addr6)));
		ND_PRINT((ndo, ") "));
	}

	switch (FC_TYPE(fc)) {
	case T_MGMT:
		mgmt_header_print(ndo, p);
		break;
	case T_CTRL:
		ctrl_header_print(ndo, fc, p);
		break;
	case T_DATA:
		data_header_print(ndo, fc, p);
		break;
	default:
		break;
	}
}
ieee_802_11_hdr_print(netdissect_options *ndo,
                      uint16_t fc, const u_char *p, u_int hdrlen,
                      u_int meshdrlen)
{
	if (ndo->ndo_vflag) {
		if (FC_MORE_DATA(fc))
			ND_PRINT((ndo, "More Data "));
		if (FC_MORE_FLAG(fc))
			ND_PRINT((ndo, "More Fragments "));
		if (FC_POWER_MGMT(fc))
			ND_PRINT((ndo, "Pwr Mgmt "));
		if (FC_RETRY(fc))
			ND_PRINT((ndo, "Retry "));
		if (FC_ORDER(fc))
			ND_PRINT((ndo, "Strictly Ordered "));
		if (FC_PROTECTED(fc))
			ND_PRINT((ndo, "Protected "));
		if (FC_TYPE(fc) != T_CTRL || FC_SUBTYPE(fc) != CTRL_PS_POLL)
			ND_PRINT((ndo, "%dus ",
			    EXTRACT_LE_16BITS(
			        &((const struct mgmt_header_t *)p)->duration)));
	}
	if (meshdrlen != 0) {
		const struct meshcntl_t *mc =
		    (const struct meshcntl_t *)&p[hdrlen - meshdrlen];
		int ae = mc->flags & 3;

		ND_PRINT((ndo, "MeshData (AE %d TTL %u seq %u", ae, mc->ttl,
		    EXTRACT_LE_32BITS(mc->seq)));
		if (ae > 0)
			ND_PRINT((ndo, " A4:%s", etheraddr_string(ndo, mc->addr4)));
		if (ae > 1)
			ND_PRINT((ndo, " A5:%s", etheraddr_string(ndo, mc->addr5)));
		if (ae > 2)
			ND_PRINT((ndo, " A6:%s", etheraddr_string(ndo, mc->addr6)));
		ND_PRINT((ndo, ") "));
	}

	switch (FC_TYPE(fc)) {
	case T_MGMT:
		mgmt_header_print(ndo, p);
		break;
	case T_CTRL:
		ctrl_header_print(ndo, fc, p);
		break;
	case T_DATA:
		data_header_print(ndo, fc, p);
		break;
	default:
		break;
	}
}