static void dissect_getnext_pdu(tvbuff_t *tvb, proto_tree *tree,int offset,int len, char flags) { proto_item* item; proto_tree* subtree; item = proto_tree_add_text(tree, tvb, offset, len, "GetNext-PDU"); subtree = proto_item_add_subtree(item, ett_getnext); if(flags & NON_DEFAULT_CONTEXT) { /* show context */ offset += dissect_octet_string(tvb, subtree, offset, flags); } while(len > offset) { offset += dissect_search_range(tvb, subtree, offset, flags); } }
static void dissect_get_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint8 flags) { proto_tree* subtree; subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_get, NULL, "Get-PDU"); if(flags & NON_DEFAULT_CONTEXT) { /* show context */ offset += dissect_octet_string(tvb, subtree, offset, flags); } len += PDU_HDR_LEN; while(len > offset) { offset += dissect_search_range(tvb, subtree, offset, flags, AGENTX_GET_PDU); } }
static void dissect_getbulk_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint8 flags) { proto_tree* subtree; guint encoding = (flags & NETWORK_BYTE_ORDER) ? ENC_BIG_ENDIAN : ENC_LITTLE_ENDIAN; subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_getbulk, NULL, "GetBulk-PDU"); if(flags & NON_DEFAULT_CONTEXT) { /* show context */ offset += dissect_octet_string(tvb, subtree, offset, flags); } proto_tree_add_item(subtree, hf_gbulk_nrepeat, tvb, offset, 2, encoding); proto_tree_add_item(subtree, hf_gbulk_mrepeat, tvb, offset + 2, 2, encoding); offset+=4; while(len >= offset) { offset += dissect_search_range(tvb, subtree, offset, flags, 0); } }
static void dissect_getbulk_pdu(tvbuff_t *tvb, proto_tree *tree,int offset,int len, char flags) { proto_item* item; proto_tree* subtree; gboolean little_endian = !(flags & NETWORK_BYTE_ORDER); item = proto_tree_add_text(tree, tvb, offset, len, "GetBulk-PDU"); subtree = proto_item_add_subtree(item, ett_getbulk); if(flags & NON_DEFAULT_CONTEXT) { /* show context */ offset += dissect_octet_string(tvb, subtree, offset, flags); } proto_tree_add_item(subtree, hf_gbulk_nrepeat, tvb, offset, 2, little_endian); proto_tree_add_item(subtree, hf_gbulk_mrepeat, tvb, offset + 2, 2, little_endian); offset+=4; while(len >= offset) { offset += dissect_search_range(tvb, subtree, offset, flags); } }