X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1fe6e66ecec3fb7a7cc729038012cbb264542331..refs/pull/433/head:/print-vqp.c diff --git a/print-vqp.c b/print-vqp.c index bf25bf7a..ce3572ac 100644 --- a/print-vqp.c +++ b/print-vqp.c @@ -44,16 +44,16 @@ */ struct vqp_common_header_t { - u_int8_t version; - u_int8_t msg_type; - u_int8_t error_code; - u_int8_t nitems; - u_int8_t sequence[4]; + uint8_t version; + uint8_t msg_type; + uint8_t error_code; + uint8_t nitems; + uint8_t sequence[4]; }; struct vqp_obj_tlv_t { - u_int8_t obj_type[4]; - u_int8_t obj_length[2]; + uint8_t obj_type[4]; + uint8_t obj_length[2]; }; #define VQP_OBJ_REQ_JOIN_PORT 0x01 @@ -104,10 +104,10 @@ vqp_print(netdissect_options *ndo, register const u_char *pptr, register u_int l const struct vqp_obj_tlv_t *vqp_obj_tlv; const u_char *tptr; - u_int16_t vqp_obj_len; - u_int32_t vqp_obj_type; + uint16_t vqp_obj_len; + uint32_t vqp_obj_type; int tlen; - u_int8_t nitems; + uint8_t nitems; tptr=pptr; tlen = len; @@ -167,24 +167,23 @@ vqp_print(netdissect_options *ndo, register const u_char *pptr, register u_int l } /* did we capture enough for fully decoding the object ? */ - if (!ND_TTEST2(*tptr, vqp_obj_len)) - goto trunc; + ND_TCHECK2(*tptr, vqp_obj_len); switch(vqp_obj_type) { case VQP_OBJ_IP_ADDRESS: - ND_PRINT((ndo, "%s (0x%08x)", ipaddr_string(tptr), EXTRACT_32BITS(tptr))); + ND_PRINT((ndo, "%s (0x%08x)", ipaddr_string(ndo, tptr), EXTRACT_32BITS(tptr))); break; /* those objects have similar semantics - fall through */ case VQP_OBJ_PORT_NAME: case VQP_OBJ_VLAN_NAME: case VQP_OBJ_VTP_DOMAIN: case VQP_OBJ_ETHERNET_PKT: - safeputs((const char *)tptr, vqp_obj_len); + safeputs(ndo, tptr, vqp_obj_len); break; /* those objects have similar semantics - fall through */ case VQP_OBJ_MAC_ADDRESS: case VQP_OBJ_MAC_NULL: - ND_PRINT((ndo, "%s", etheraddr_string(tptr))); + ND_PRINT((ndo, "%s", etheraddr_string(ndo, tptr))); break; default: if (ndo->ndo_vflag <= 1)