diff options
Diffstat (limited to 'epan/dissectors/packet-snmp.c')
-rw-r--r-- | epan/dissectors/packet-snmp.c | 692 |
1 files changed, 349 insertions, 343 deletions
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index d7c8379225..43760fa368 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -70,6 +70,7 @@ #include <epan/emem.h> #include <epan/next_tvb.h> #include <epan/uat.h> +#include <epan/asn1.h> #include "packet-ipx.h" #include "packet-hpext.h" @@ -325,7 +326,7 @@ static int hf_snmp_priority = -1; /* INTEGER_M1_2147483647 */ static int hf_snmp_operation = -1; /* T_operation */ /*--- End of included file: packet-snmp-hf.c ---*/ -#line 233 "packet-snmp-template.c" +#line 234 "packet-snmp-template.c" static int hf_smux_version = -1; static int hf_smux_pdutype = -1; @@ -369,11 +370,11 @@ static gint ett_snmp_SimpleOpen = -1; static gint ett_snmp_RReqPDU = -1; /*--- End of included file: packet-snmp-ett.c ---*/ -#line 248 "packet-snmp-template.c" +#line 249 "packet-snmp-template.c" -static int dissect_snmp_IpAddressIpv6(gboolean, tvbuff_t* ,int , packet_info*, proto_tree*, int); -static int dissect_snmp_IpAddressOther(gboolean, tvbuff_t* ,int , packet_info*, proto_tree*, int); +static int dissect_snmp_IpAddressIpv6(gboolean, tvbuff_t* ,int , asn1_ctx_t* , proto_tree*, int); +static int dissect_snmp_IpAddressOther(gboolean, tvbuff_t* ,int , asn1_ctx_t* , proto_tree*, int); static const true_false_string auth_flags = { "OK", @@ -1642,89 +1643,89 @@ gboolean check_ScopedPdu(tvbuff_t* tvb) { static int -dissect_snmp_ObjectName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, &oid_tvb); +dissect_snmp_ObjectName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &oid_tvb); return offset; } -static int dissect_name(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ObjectName(FALSE, tvb, offset, pinfo, tree, hf_snmp_name); +static int dissect_name(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ObjectName(FALSE, tvb, offset, actx, tree, hf_snmp_name); } -static int dissect_subtree(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ObjectName(FALSE, tvb, offset, pinfo, tree, hf_snmp_subtree); +static int dissect_subtree(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ObjectName(FALSE, tvb, offset, actx, tree, hf_snmp_subtree); } static int -dissect_snmp_Integer_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_Integer_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 343 "snmp.cnf" guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; return offset; } -static int dissect_integer_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Integer_value(FALSE, tvb, offset, pinfo, tree, hf_snmp_integer_value); +static int dissect_integer_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Integer_value(FALSE, tvb, offset, actx, tree, hf_snmp_integer_value); } static int -dissect_snmp_String_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_String_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 337 "snmp.cnf" guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, &value_tvb); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, &value_tvb); offset = offset + length; return offset; } -static int dissect_string_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_String_value(FALSE, tvb, offset, pinfo, tree, hf_snmp_string_value); +static int dissect_string_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_String_value(FALSE, tvb, offset, actx, tree, hf_snmp_string_value); } static int -dissect_snmp_ObjectID_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_ObjectID_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 349 "snmp.cnf" guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; return offset; } -static int dissect_objectID_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ObjectID_value(FALSE, tvb, offset, pinfo, tree, hf_snmp_objectID_value); +static int dissect_objectID_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ObjectID_value(FALSE, tvb, offset, actx, tree, hf_snmp_objectID_value); } static int -dissect_snmp_Empty(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_Empty(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 355 "snmp.cnf" guint length; - snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL); + snmp_variable_decode(tvb, tree, actx->pinfo, oid_tvb, offset, &length, NULL); offset = offset + length; return offset; } -static int dissect_empty(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Empty(FALSE, tvb, offset, pinfo, tree, hf_snmp_empty); +static int dissect_empty(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Empty(FALSE, tvb, offset, actx, tree, hf_snmp_empty); } @@ -1745,96 +1746,96 @@ static const ber_choice_t SimpleSyntax_choice[] = { }; static int -dissect_snmp_SimpleSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_SimpleSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, SimpleSyntax_choice, hf_index, ett_snmp_SimpleSyntax, NULL); return offset; } -static int dissect_simple(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_SimpleSyntax(FALSE, tvb, offset, pinfo, tree, hf_snmp_simple); +static int dissect_simple(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_SimpleSyntax(FALSE, tvb, offset, actx, tree, hf_snmp_simple); } static int -dissect_snmp_IpAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_IpAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_ipAddress_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_IpAddress(FALSE, tvb, offset, pinfo, tree, hf_snmp_ipAddress_value); +static int dissect_ipAddress_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_IpAddress(FALSE, tvb, offset, actx, tree, hf_snmp_ipAddress_value); } static int -dissect_snmp_Counter32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Counter32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_counter_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Counter32(FALSE, tvb, offset, pinfo, tree, hf_snmp_counter_value); +static int dissect_counter_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Counter32(FALSE, tvb, offset, actx, tree, hf_snmp_counter_value); } static int -dissect_snmp_TimeTicks(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_TimeTicks(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_timeticks_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_TimeTicks(FALSE, tvb, offset, pinfo, tree, hf_snmp_timeticks_value); +static int dissect_timeticks_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_TimeTicks(FALSE, tvb, offset, actx, tree, hf_snmp_timeticks_value); } -static int dissect_time_stamp(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_TimeTicks(FALSE, tvb, offset, pinfo, tree, hf_snmp_time_stamp); +static int dissect_time_stamp(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_TimeTicks(FALSE, tvb, offset, actx, tree, hf_snmp_time_stamp); } static int -dissect_snmp_Opaque(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Opaque(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_arbitrary_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Opaque(FALSE, tvb, offset, pinfo, tree, hf_snmp_arbitrary_value); +static int dissect_arbitrary_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Opaque(FALSE, tvb, offset, actx, tree, hf_snmp_arbitrary_value); } static int -dissect_snmp_Counter64(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Counter64(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_big_counter_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Counter64(FALSE, tvb, offset, pinfo, tree, hf_snmp_big_counter_value); +static int dissect_big_counter_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Counter64(FALSE, tvb, offset, actx, tree, hf_snmp_big_counter_value); } static int -dissect_snmp_Unsigned32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Unsigned32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_unsigned_integer_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Unsigned32(FALSE, tvb, offset, pinfo, tree, hf_snmp_unsigned_integer_value); +static int dissect_unsigned_integer_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Unsigned32(FALSE, tvb, offset, actx, tree, hf_snmp_unsigned_integer_value); } @@ -1859,15 +1860,15 @@ static const ber_choice_t ApplicationSyntax_choice[] = { }; static int -dissect_snmp_ApplicationSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_ApplicationSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, ApplicationSyntax_choice, hf_index, ett_snmp_ApplicationSyntax, NULL); return offset; } -static int dissect_application_wide(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ApplicationSyntax(FALSE, tvb, offset, pinfo, tree, hf_snmp_application_wide); +static int dissect_application_wide(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ApplicationSyntax(FALSE, tvb, offset, actx, tree, hf_snmp_application_wide); } @@ -1884,34 +1885,34 @@ static const ber_choice_t ObjectSyntax_choice[] = { }; static int -dissect_snmp_ObjectSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_ObjectSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, ObjectSyntax_choice, hf_index, ett_snmp_ObjectSyntax, NULL); return offset; } -static int dissect_value(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ObjectSyntax(FALSE, tvb, offset, pinfo, tree, hf_snmp_value); +static int dissect_value(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ObjectSyntax(FALSE, tvb, offset, actx, tree, hf_snmp_value); } static int -dissect_snmp_Integer32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Integer32(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_bulkPDU_request_id(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Integer32(FALSE, tvb, offset, pinfo, tree, hf_snmp_bulkPDU_request_id); +static int dissect_bulkPDU_request_id(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Integer32(FALSE, tvb, offset, actx, tree, hf_snmp_bulkPDU_request_id); } static int -dissect_snmp_T_internet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_internet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 361 "snmp.cnf" /* see http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1125 */ guint32 len; @@ -1921,9 +1922,9 @@ dissect_snmp_T_internet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset get_ber_length(NULL, tvb, cur_offset, &len, NULL); switch (len) { - case 4: offset = dissect_snmp_IpAddress(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet); break; - case 16: offset = dissect_snmp_IpAddressIpv6(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet_ipv6); break; - default: offset = dissect_snmp_IpAddressOther(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet_other); break; + case 4: offset = dissect_snmp_IpAddress(FALSE, tvb, offset, actx, tree, hf_snmp_internet); break; + case 16: offset = dissect_snmp_IpAddressIpv6(FALSE, tvb, offset, actx, tree, hf_snmp_internet_ipv6); break; + default: offset = dissect_snmp_IpAddressOther(FALSE, tvb, offset, actx, tree, hf_snmp_internet_other); break; } if (len != 4) { @@ -1939,7 +1940,7 @@ dissect_snmp_T_internet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset "The host that generated this packet is violating" "the SNMP protocol definition and sends corrupt and invalid packets"); PROTO_ITEM_SET_GENERATED(pi); - expert_add_info_format( pinfo, pi, PI_MALFORMED, PI_ERROR, + expert_add_info_format( actx->pinfo, pi, PI_MALFORMED, PI_ERROR, "Corrupt and Invalid packet" ); } @@ -1948,8 +1949,8 @@ dissect_snmp_T_internet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset return offset; } -static int dissect_internet(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_internet(FALSE, tvb, offset, pinfo, tree, hf_snmp_internet); +static int dissect_internet(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_internet(FALSE, tvb, offset, actx, tree, hf_snmp_internet); } @@ -1964,22 +1965,22 @@ static const ber_choice_t NetworkAddress_choice[] = { }; static int -dissect_snmp_NetworkAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_NetworkAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, NetworkAddress_choice, hf_index, ett_snmp_NetworkAddress, NULL); return offset; } -static int dissect_agent_addr(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_NetworkAddress(FALSE, tvb, offset, pinfo, tree, hf_snmp_agent_addr); +static int dissect_agent_addr(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_NetworkAddress(FALSE, tvb, offset, actx, tree, hf_snmp_agent_addr); } static int -dissect_snmp_IpAddressIpv6(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_IpAddressIpv6(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; @@ -1988,8 +1989,8 @@ dissect_snmp_IpAddressIpv6(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int -dissect_snmp_IpAddressOther(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_IpAddressOther(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; @@ -2007,64 +2008,64 @@ static const value_string snmp_Version_vals[] = { static int -dissect_snmp_Version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_Version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_version(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Version(FALSE, tvb, offset, pinfo, tree, hf_snmp_version); +static int dissect_version(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Version(FALSE, tvb, offset, actx, tree, hf_snmp_version); } -static int dissect_msgVersion(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_Version(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgVersion); +static int dissect_msgVersion(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_Version(FALSE, tvb, offset, actx, tree, hf_snmp_msgVersion); } static int -dissect_snmp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_community(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_community); +static int dissect_community(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_community); } -static int dissect_parameters(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_parameters); +static int dissect_parameters(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_parameters); } -static int dissect_encrypted(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_encrypted); +static int dissect_encrypted(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_encrypted); } -static int dissect_contextEngineID(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_contextEngineID); +static int dissect_contextEngineID(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_contextEngineID); } -static int dissect_contextName(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_contextName); +static int dissect_contextName(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_contextName); } -static int dissect_password(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_snmp_password); +static int dissect_password(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_snmp_password); } static int -dissect_snmp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_request_id(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_snmp_request_id); +static int dissect_request_id(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER(FALSE, tvb, offset, actx, tree, hf_snmp_request_id); } -static int dissect_error_index(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_snmp_error_index); +static int dissect_error_index(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER(FALSE, tvb, offset, actx, tree, hf_snmp_error_index); } -static int dissect_specific_trap(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_snmp_specific_trap); +static int dissect_specific_trap(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER(FALSE, tvb, offset, actx, tree, hf_snmp_specific_trap); } @@ -2093,35 +2094,35 @@ static const value_string snmp_T_error_status_vals[] = { static int -dissect_snmp_T_error_status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_error_status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_error_status(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_error_status(FALSE, tvb, offset, pinfo, tree, hf_snmp_error_status); +static int dissect_error_status(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_error_status(FALSE, tvb, offset, actx, tree, hf_snmp_error_status); } static int -dissect_snmp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index); +dissect_snmp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_null(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index); return offset; } -static int dissect_unSpecified(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_NULL(FALSE, tvb, offset, pinfo, tree, hf_snmp_unSpecified); +static int dissect_unSpecified(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_NULL(FALSE, tvb, offset, actx, tree, hf_snmp_unSpecified); } -static int dissect_noSuchObject_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_NULL(TRUE, tvb, offset, pinfo, tree, hf_snmp_noSuchObject); +static int dissect_noSuchObject_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_NULL(TRUE, tvb, offset, actx, tree, hf_snmp_noSuchObject); } -static int dissect_noSuchInstance_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_NULL(TRUE, tvb, offset, pinfo, tree, hf_snmp_noSuchInstance); +static int dissect_noSuchInstance_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_NULL(TRUE, tvb, offset, actx, tree, hf_snmp_noSuchInstance); } -static int dissect_endOfMibView_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_NULL(TRUE, tvb, offset, pinfo, tree, hf_snmp_endOfMibView); +static int dissect_endOfMibView_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_NULL(TRUE, tvb, offset, actx, tree, hf_snmp_endOfMibView); } @@ -2144,15 +2145,15 @@ static const ber_choice_t ValueType_choice[] = { }; static int -dissect_snmp_ValueType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_ValueType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, ValueType_choice, hf_index, ett_snmp_ValueType, NULL); return offset; } -static int dissect_valueType(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ValueType(FALSE, tvb, offset, pinfo, tree, hf_snmp_valueType); +static int dissect_valueType(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ValueType(FALSE, tvb, offset, actx, tree, hf_snmp_valueType); } @@ -2163,11 +2164,11 @@ static const ber_sequence_t VarBind_sequence[] = { }; static int -dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 323 "snmp.cnf" oid_tvb = NULL; value_tvb = NULL; - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, VarBind_sequence, hf_index, ett_snmp_VarBind); if (oid_tvb && value_tvb) { @@ -2180,8 +2181,8 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U return offset; } -static int dissect_VarBindList_item(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_VarBind(FALSE, tvb, offset, pinfo, tree, hf_snmp_VarBindList_item); +static int dissect_VarBindList_item(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_VarBind(FALSE, tvb, offset, actx, tree, hf_snmp_VarBindList_item); } @@ -2190,14 +2191,14 @@ static const ber_sequence_t VarBindList_sequence_of[1] = { }; static int -dissect_snmp_VarBindList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_VarBindList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, VarBindList_sequence_of, hf_index, ett_snmp_VarBindList); return offset; } -static int dissect_variable_bindings(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_VarBindList(FALSE, tvb, offset, pinfo, tree, hf_snmp_variable_bindings); +static int dissect_variable_bindings(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_VarBindList(FALSE, tvb, offset, actx, tree, hf_snmp_variable_bindings); } @@ -2210,8 +2211,8 @@ static const ber_sequence_t PDU_sequence[] = { }; static int -dissect_snmp_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, PDU_sequence, hf_index, ett_snmp_PDU); return offset; @@ -2221,7 +2222,7 @@ dissect_snmp_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, p static int -dissect_snmp_T_get_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_get_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 37 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2235,21 +2236,21 @@ dissect_snmp_T_get_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_get_request(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_get_request(FALSE, tvb, offset, pinfo, tree, hf_snmp_get_request); +static int dissect_get_request(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_get_request(FALSE, tvb, offset, actx, tree, hf_snmp_get_request); } static int -dissect_snmp_T_get_next_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_get_next_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 52 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2263,21 +2264,21 @@ dissect_snmp_T_get_next_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_get_next_request(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_get_next_request(FALSE, tvb, offset, pinfo, tree, hf_snmp_get_next_request); +static int dissect_get_next_request(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_get_next_request(FALSE, tvb, offset, actx, tree, hf_snmp_get_next_request); } static int -dissect_snmp_T_get_response(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_get_response(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 67 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2291,21 +2292,21 @@ dissect_snmp_T_get_response(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_get_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_get_response(FALSE, tvb, offset, pinfo, tree, hf_snmp_get_response); +static int dissect_get_response(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_get_response(FALSE, tvb, offset, actx, tree, hf_snmp_get_response); } static int -dissect_snmp_T_set_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_set_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 82 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2319,30 +2320,30 @@ dissect_snmp_T_set_request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_set_request(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_set_request(FALSE, tvb, offset, pinfo, tree, hf_snmp_set_request); +static int dissect_set_request(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_set_request(FALSE, tvb, offset, actx, tree, hf_snmp_set_request); } static int -dissect_snmp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); +dissect_snmp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_enterprise(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_snmp_enterprise); +static int dissect_enterprise(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OBJECT_IDENTIFIER(FALSE, tvb, offset, actx, tree, hf_snmp_enterprise); } -static int dissect_identity(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_snmp_identity); +static int dissect_identity(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OBJECT_IDENTIFIER(FALSE, tvb, offset, actx, tree, hf_snmp_identity); } @@ -2359,14 +2360,14 @@ static const value_string snmp_T_generic_trap_vals[] = { static int -dissect_snmp_T_generic_trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_generic_trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_generic_trap(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_generic_trap(FALSE, tvb, offset, pinfo, tree, hf_snmp_generic_trap); +static int dissect_generic_trap(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_generic_trap(FALSE, tvb, offset, actx, tree, hf_snmp_generic_trap); } @@ -2381,8 +2382,8 @@ static const ber_sequence_t Trap_PDU_sequence[] = { }; static int -dissect_snmp_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, Trap_PDU_sequence, hf_index, ett_snmp_Trap_PDU); return offset; @@ -2391,7 +2392,7 @@ dissect_snmp_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ static int -dissect_snmp_T_trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 98 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2405,33 +2406,33 @@ dissect_snmp_T_trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_trap(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_trap(FALSE, tvb, offset, pinfo, tree, hf_snmp_trap); +static int dissect_trap(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_trap(FALSE, tvb, offset, actx, tree, hf_snmp_trap); } static int -dissect_snmp_INTEGER_0_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_INTEGER_0_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_msgID(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgID); +static int dissect_msgID(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, actx, tree, hf_snmp_msgID); } -static int dissect_non_repeaters(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, pinfo, tree, hf_snmp_non_repeaters); +static int dissect_non_repeaters(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, actx, tree, hf_snmp_non_repeaters); } -static int dissect_max_repetitions(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, pinfo, tree, hf_snmp_max_repetitions); +static int dissect_max_repetitions(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER_0_2147483647(FALSE, tvb, offset, actx, tree, hf_snmp_max_repetitions); } @@ -2444,8 +2445,8 @@ static const ber_sequence_t BulkPDU_sequence[] = { }; static int -dissect_snmp_BulkPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_BulkPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, BulkPDU_sequence, hf_index, ett_snmp_BulkPDU); return offset; @@ -2454,8 +2455,8 @@ dissect_snmp_BulkPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int -dissect_snmp_GetBulkRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_snmp_BulkPDU(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_snmp_GetBulkRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_snmp_BulkPDU(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } @@ -2463,7 +2464,7 @@ dissect_snmp_GetBulkRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int -dissect_snmp_T_getBulkRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_getBulkRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 113 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2477,21 +2478,21 @@ dissect_snmp_T_getBulkRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_GetBulkRequest_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_GetBulkRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_getBulkRequest(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_getBulkRequest(FALSE, tvb, offset, pinfo, tree, hf_snmp_getBulkRequest); +static int dissect_getBulkRequest(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_getBulkRequest(FALSE, tvb, offset, actx, tree, hf_snmp_getBulkRequest); } static int -dissect_snmp_InformRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_snmp_PDU(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_snmp_InformRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_snmp_PDU(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } @@ -2499,7 +2500,7 @@ dissect_snmp_InformRequest_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int -dissect_snmp_T_informRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_informRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 128 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2513,21 +2514,21 @@ dissect_snmp_T_informRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_InformRequest_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_InformRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_informRequest(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_informRequest(FALSE, tvb, offset, pinfo, tree, hf_snmp_informRequest); +static int dissect_informRequest(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_informRequest(FALSE, tvb, offset, actx, tree, hf_snmp_informRequest); } static int -dissect_snmp_SNMPv2_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_snmp_PDU(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_snmp_SNMPv2_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_snmp_PDU(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } @@ -2535,7 +2536,7 @@ dissect_snmp_SNMPv2_Trap_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int -dissect_snmp_T_sNMPv2_Trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_sNMPv2_Trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 143 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2549,21 +2550,21 @@ dissect_snmp_T_sNMPv2_Trap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_SNMPv2_Trap_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_SNMPv2_Trap_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_sNMPv2_Trap(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_sNMPv2_Trap(FALSE, tvb, offset, pinfo, tree, hf_snmp_sNMPv2_Trap); +static int dissect_sNMPv2_Trap(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_sNMPv2_Trap(FALSE, tvb, offset, actx, tree, hf_snmp_sNMPv2_Trap); } static int -dissect_snmp_Report_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_snmp_PDU(implicit_tag, tvb, offset, pinfo, tree, hf_index); +dissect_snmp_Report_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_snmp_PDU(implicit_tag, tvb, offset, actx, tree, hf_index); return offset; } @@ -2571,7 +2572,7 @@ dissect_snmp_Report_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int -dissect_snmp_T_report(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_report(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 158 "snmp.cnf" gint8 class; gboolean pc, ind_field; @@ -2585,14 +2586,14 @@ dissect_snmp_T_report(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len1, &ind_field); } - offset = dissect_snmp_Report_PDU(TRUE, tvb, offset, pinfo, tree, hf_index); + offset = dissect_snmp_Report_PDU(TRUE, tvb, offset, actx, tree, hf_index); return offset; } -static int dissect_report(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_report(FALSE, tvb, offset, pinfo, tree, hf_snmp_report); +static int dissect_report(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_report(FALSE, tvb, offset, actx, tree, hf_snmp_report); } @@ -2623,29 +2624,29 @@ static const ber_choice_t PDUs_choice[] = { }; static int -dissect_snmp_PDUs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_PDUs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 30 "snmp.cnf" gint pdu_type; - offset = dissect_ber_choice(pinfo, tree, tvb, offset, + offset = dissect_ber_choice(actx, tree, tvb, offset, PDUs_choice, hf_index, ett_snmp_PDUs, &pdu_type); - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, val_to_str(pdu_type, snmp_PDUs_vals,"Unknown PDU type (%u)")); + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, val_to_str(pdu_type, snmp_PDUs_vals,"Unknown PDU type (%u)")); return offset; } -static int dissect_data(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_PDUs(FALSE, tvb, offset, pinfo, tree, hf_snmp_data); +static int dissect_data(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_PDUs(FALSE, tvb, offset, actx, tree, hf_snmp_data); } -static int dissect_v2u_plaintext(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_PDUs(FALSE, tvb, offset, pinfo, tree, hf_snmp_v2u_plaintext); +static int dissect_v2u_plaintext(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_PDUs(FALSE, tvb, offset, actx, tree, hf_snmp_v2u_plaintext); } -static int dissect_pDUs(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_PDUs(FALSE, tvb, offset, pinfo, tree, hf_snmp_pDUs); +static int dissect_pDUs(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_PDUs(FALSE, tvb, offset, actx, tree, hf_snmp_pDUs); } @@ -2657,8 +2658,8 @@ static const ber_sequence_t Message_sequence[] = { }; static int -dissect_snmp_Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, Message_sequence, hf_index, ett_snmp_Message); return offset; @@ -2678,15 +2679,15 @@ static const ber_choice_t T_datav2u_choice[] = { }; static int -dissect_snmp_T_datav2u(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_T_datav2u(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, T_datav2u_choice, hf_index, ett_snmp_T_datav2u, NULL); return offset; } -static int dissect_datav2u(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_datav2u(FALSE, tvb, offset, pinfo, tree, hf_snmp_datav2u); +static int dissect_datav2u(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_datav2u(FALSE, tvb, offset, actx, tree, hf_snmp_datav2u); } @@ -2698,8 +2699,8 @@ static const ber_sequence_t Messagev2u_sequence[] = { }; static int -dissect_snmp_Messagev2u(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_Messagev2u(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, Messagev2u_sequence, hf_index, ett_snmp_Messagev2u); return offset; @@ -2709,11 +2710,11 @@ dissect_snmp_Messagev2u(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int -dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 185 "snmp.cnf" tvbuff_t *parameter_tvb = NULL; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.engine_tvb); if (parameter_tvb) { proto_tree* engine_tree = proto_item_add_subtree(get_ber_last_created_item(),ett_engineid); @@ -2724,55 +2725,55 @@ dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb return offset; } -static int dissect_msgAuthoritativeEngineID(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgAuthoritativeEngineID(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgAuthoritativeEngineID); +static int dissect_msgAuthoritativeEngineID(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgAuthoritativeEngineID(FALSE, tvb, offset, actx, tree, hf_snmp_msgAuthoritativeEngineID); } static int -dissect_snmp_T_msgAuthoritativeEngineBoots(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_msgAuthoritativeEngineBoots(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.boots); return offset; } -static int dissect_msgAuthoritativeEngineBoots(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgAuthoritativeEngineBoots(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgAuthoritativeEngineBoots); +static int dissect_msgAuthoritativeEngineBoots(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgAuthoritativeEngineBoots(FALSE, tvb, offset, actx, tree, hf_snmp_msgAuthoritativeEngineBoots); } static int -dissect_snmp_T_msgAuthoritativeEngineTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_msgAuthoritativeEngineTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.time); return offset; } -static int dissect_msgAuthoritativeEngineTime(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgAuthoritativeEngineTime(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgAuthoritativeEngineTime); +static int dissect_msgAuthoritativeEngineTime(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgAuthoritativeEngineTime(FALSE, tvb, offset, actx, tree, hf_snmp_msgAuthoritativeEngineTime); } static int -dissect_snmp_T_msgUserName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_msgUserName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.user_tvb); return offset; } -static int dissect_msgUserName(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgUserName(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgUserName); +static int dissect_msgUserName(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgUserName(FALSE, tvb, offset, actx, tree, hf_snmp_msgUserName); } static int -dissect_snmp_T_msgAuthenticationParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_msgAuthenticationParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 198 "snmp.cnf" - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &usm_p.auth_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.auth_tvb); if (usm_p.auth_tvb) { usm_p.auth_item = get_ber_last_created_item(); usm_p.auth_offset = offset_from_real_beginning(usm_p.auth_tvb,0); @@ -2781,21 +2782,21 @@ dissect_snmp_T_msgAuthenticationParameters(gboolean implicit_tag _U_, tvbuff_t * return offset; } -static int dissect_msgAuthenticationParameters(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgAuthenticationParameters(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgAuthenticationParameters); +static int dissect_msgAuthenticationParameters(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgAuthenticationParameters(FALSE, tvb, offset, actx, tree, hf_snmp_msgAuthenticationParameters); } static int -dissect_snmp_T_msgPrivacyParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_msgPrivacyParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &usm_p.priv_tvb); return offset; } -static int dissect_msgPrivacyParameters(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgPrivacyParameters(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgPrivacyParameters); +static int dissect_msgPrivacyParameters(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgPrivacyParameters(FALSE, tvb, offset, actx, tree, hf_snmp_msgPrivacyParameters); } @@ -2810,8 +2811,8 @@ static const ber_sequence_t UsmSecurityParameters_sequence[] = { }; static int -dissect_snmp_UsmSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_UsmSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, UsmSecurityParameters_sequence, hf_index, ett_snmp_UsmSecurityParameters); return offset; @@ -2820,24 +2821,24 @@ dissect_snmp_UsmSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int -dissect_snmp_INTEGER_484_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_INTEGER_484_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_msgMaxSize(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER_484_2147483647(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgMaxSize); +static int dissect_msgMaxSize(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER_484_2147483647(FALSE, tvb, offset, actx, tree, hf_snmp_msgMaxSize); } static int -dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 307 "snmp.cnf" tvbuff_t *parameter_tvb = NULL; - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, ¶meter_tvb); if (parameter_tvb){ @@ -2856,21 +2857,21 @@ dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset return offset; } -static int dissect_msgFlags(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgFlags(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgFlags); +static int dissect_msgFlags(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgFlags(FALSE, tvb, offset, actx, tree, hf_snmp_msgFlags); } static int -dissect_snmp_T_msgSecurityModel(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_msgSecurityModel(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, &MsgSecurityModel); return offset; } -static int dissect_msgSecurityModel(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgSecurityModel(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgSecurityModel); +static int dissect_msgSecurityModel(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgSecurityModel(FALSE, tvb, offset, actx, tree, hf_snmp_msgSecurityModel); } @@ -2883,32 +2884,32 @@ static const ber_sequence_t HeaderData_sequence[] = { }; static int -dissect_snmp_HeaderData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_HeaderData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, HeaderData_sequence, hf_index, ett_snmp_HeaderData); return offset; } -static int dissect_msgGlobalData(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_HeaderData(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgGlobalData); +static int dissect_msgGlobalData(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_HeaderData(FALSE, tvb, offset, actx, tree, hf_snmp_msgGlobalData); } static int -dissect_snmp_T_msgSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_msgSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 250 "snmp.cnf" switch(MsgSecurityModel){ case SNMP_SEC_USM: /* 3 */ - offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, pinfo, tree, -1); + offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, actx, tree, -1); usm_p.user_assoc = get_user_assoc(usm_p.engine_tvb, usm_p.user_tvb); break; case SNMP_SEC_ANY: /* 0 */ case SNMP_SEC_V1: /* 1 */ case SNMP_SEC_V2C: /* 2 */ default: - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); break; @@ -2918,8 +2919,8 @@ dissect_snmp_T_msgSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U return offset; } -static int dissect_msgSecurityParameters(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_msgSecurityParameters(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgSecurityParameters); +static int dissect_msgSecurityParameters(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_msgSecurityParameters(FALSE, tvb, offset, actx, tree, hf_snmp_msgSecurityParameters); } @@ -2931,23 +2932,23 @@ static const ber_sequence_t ScopedPDU_sequence[] = { }; static int -dissect_snmp_ScopedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_ScopedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, ScopedPDU_sequence, hf_index, ett_snmp_ScopedPDU); return offset; } -static int dissect_plaintext(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ScopedPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_plaintext); +static int dissect_plaintext(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ScopedPDU(FALSE, tvb, offset, actx, tree, hf_snmp_plaintext); } static int -dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { +dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 207 "snmp.cnf" tvbuff_t* crypt_tvb; - offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_snmp_encryptedPDU, &crypt_tvb); + offset = dissect_ber_octet_string(FALSE, actx->pinfo, tree, tvb, offset, hf_snmp_encryptedPDU, &crypt_tvb); if( usm_p.encrypted && crypt_tvb && usm_p.user_assoc @@ -2961,7 +2962,7 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of proto_item* cause = proto_tree_add_text(encryptedpdu_tree, cleartext_tvb, 0, -1, "Failed to decrypt encryptedPDU: %s", error); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU: %s", error); return offset; @@ -2973,18 +2974,18 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of proto_item* cause = proto_tree_add_text(encryptedpdu_tree, cleartext_tvb, 0, -1, "Decrypted data not formated as expected, wrong key?"); - expert_add_info_format(pinfo, cause, PI_MALFORMED, PI_WARN, + expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Decrypted data not formated as expected"); return offset; } - add_new_data_source(pinfo, cleartext_tvb, "Decrypted ScopedPDU"); + add_new_data_source(actx->pinfo, cleartext_tvb, "Decrypted ScopedPDU"); tvb_set_child_real_data_tvbuff(tvb, cleartext_tvb); decrypted_item = proto_tree_add_item(encryptedpdu_tree, hf_snmp_decryptedPDU,cleartext_tvb,0,-1,FALSE); decrypted_tree = proto_item_add_subtree(decrypted_item,ett_decrypted); - dissect_snmp_ScopedPDU(FALSE, cleartext_tvb, 0, pinfo, decrypted_tree, -1); + dissect_snmp_ScopedPDU(FALSE, cleartext_tvb, 0, actx, decrypted_tree, -1); } } @@ -2992,8 +2993,8 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of return offset; } -static int dissect_encryptedPDU(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_encryptedPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_encryptedPDU); +static int dissect_encryptedPDU(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_encryptedPDU(FALSE, tvb, offset, actx, tree, hf_snmp_encryptedPDU); } @@ -3010,15 +3011,15 @@ static const ber_choice_t ScopedPduData_choice[] = { }; static int -dissect_snmp_ScopedPduData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_ScopedPduData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, ScopedPduData_choice, hf_index, ett_snmp_ScopedPduData, NULL); return offset; } -static int dissect_msgData(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ScopedPduData(FALSE, tvb, offset, pinfo, tree, hf_snmp_msgData); +static int dissect_msgData(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ScopedPduData(FALSE, tvb, offset, actx, tree, hf_snmp_msgData); } @@ -3031,8 +3032,8 @@ static const ber_sequence_t SNMPv3Message_sequence[] = { }; static int -dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SNMPv3Message_sequence, hf_index, ett_snmp_SNMPv3Message); #line 265 "snmp.cnf" @@ -3051,7 +3052,7 @@ dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off if (error) { authen_item = proto_tree_add_text(authen_tree,tvb,0,0,"Error while verifying Messsage authenticity: %s", error); PROTO_ITEM_SET_GENERATED(authen_item); - expert_add_info_format( pinfo, authen_item, PI_MALFORMED, PI_ERROR, "Error while verifying Messsage authenticity: %s", error ); + expert_add_info_format( actx->pinfo, authen_item, PI_MALFORMED, PI_ERROR, "Error while verifying Messsage authenticity: %s", error ); } else { int severity; gchar* fmt; @@ -3069,7 +3070,7 @@ dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off severity = PI_WARN; } - expert_add_info_format( pinfo, authen_item, PI_CHECKSUM, severity, fmt ); + expert_add_info_format( actx->pinfo, authen_item, PI_CHECKSUM, severity, fmt ); } } @@ -3085,27 +3086,27 @@ static const value_string snmp_T_smux_version_vals[] = { static int -dissect_snmp_T_smux_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_smux_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_smux_version(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_smux_version(FALSE, tvb, offset, pinfo, tree, hf_snmp_smux_version); +static int dissect_smux_version(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_smux_version(FALSE, tvb, offset, actx, tree, hf_snmp_smux_version); } static int -dissect_snmp_DisplayString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_DisplayString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_description(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_DisplayString(FALSE, tvb, offset, pinfo, tree, hf_snmp_description); +static int dissect_description(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_DisplayString(FALSE, tvb, offset, actx, tree, hf_snmp_description); } @@ -3118,14 +3119,14 @@ static const ber_sequence_t SimpleOpen_sequence[] = { }; static int -dissect_snmp_SimpleOpen(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_SimpleOpen(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SimpleOpen_sequence, hf_index, ett_snmp_SimpleOpen); return offset; } -static int dissect_smux_simple(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_SimpleOpen(FALSE, tvb, offset, pinfo, tree, hf_snmp_smux_simple); +static int dissect_smux_simple(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_SimpleOpen(FALSE, tvb, offset, actx, tree, hf_snmp_smux_simple); } @@ -3140,15 +3141,15 @@ static const ber_choice_t OpenPDU_choice[] = { }; static int -dissect_snmp_OpenPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_OpenPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, OpenPDU_choice, hf_index, ett_snmp_OpenPDU, NULL); return offset; } -static int dissect_open(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_OpenPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_open); +static int dissect_open(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_OpenPDU(FALSE, tvb, offset, actx, tree, hf_snmp_open); } @@ -3164,27 +3165,27 @@ static const value_string snmp_ClosePDU_vals[] = { static int -dissect_snmp_ClosePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_ClosePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_close(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_ClosePDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_close); +static int dissect_close(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_ClosePDU(FALSE, tvb, offset, actx, tree, hf_snmp_close); } static int -dissect_snmp_INTEGER_M1_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_INTEGER_M1_2147483647(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_priority(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_INTEGER_M1_2147483647(FALSE, tvb, offset, pinfo, tree, hf_snmp_priority); +static int dissect_priority(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_INTEGER_M1_2147483647(FALSE, tvb, offset, actx, tree, hf_snmp_priority); } @@ -3197,14 +3198,14 @@ static const value_string snmp_T_operation_vals[] = { static int -dissect_snmp_T_operation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_T_operation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_operation(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_T_operation(FALSE, tvb, offset, pinfo, tree, hf_snmp_operation); +static int dissect_operation(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_T_operation(FALSE, tvb, offset, actx, tree, hf_snmp_operation); } @@ -3216,14 +3217,14 @@ static const ber_sequence_t RReqPDU_sequence[] = { }; static int -dissect_snmp_RReqPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, +dissect_snmp_RReqPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, RReqPDU_sequence, hf_index, ett_snmp_RReqPDU); return offset; } -static int dissect_registerRequest(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_RReqPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_registerRequest); +static int dissect_registerRequest(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_RReqPDU(FALSE, tvb, offset, actx, tree, hf_snmp_registerRequest); } @@ -3234,14 +3235,14 @@ static const value_string snmp_RRspPDU_vals[] = { static int -dissect_snmp_RRspPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_RRspPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_rRspPDU(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_RRspPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_rRspPDU); +static int dissect_rRspPDU(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_RRspPDU(FALSE, tvb, offset, actx, tree, hf_snmp_rRspPDU); } @@ -3258,15 +3259,15 @@ static const ber_choice_t RegisterResponse_choice[] = { }; static int -dissect_snmp_RegisterResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_RegisterResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, RegisterResponse_choice, hf_index, ett_snmp_RegisterResponse, NULL); return offset; } -static int dissect_registerResponse(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_RegisterResponse(FALSE, tvb, offset, pinfo, tree, hf_snmp_registerResponse); +static int dissect_registerResponse(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_RegisterResponse(FALSE, tvb, offset, actx, tree, hf_snmp_registerResponse); } @@ -3278,14 +3279,14 @@ static const value_string snmp_SOutPDU_vals[] = { static int -dissect_snmp_SOutPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, +dissect_snmp_SOutPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, actx->pinfo, tree, tvb, offset, hf_index, NULL); return offset; } -static int dissect_commitOrRollback(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { - return dissect_snmp_SOutPDU(FALSE, tvb, offset, pinfo, tree, hf_snmp_commitOrRollback); +static int dissect_commitOrRollback(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) { + return dissect_snmp_SOutPDU(FALSE, tvb, offset, actx, tree, hf_snmp_commitOrRollback); } @@ -3308,8 +3309,8 @@ static const ber_choice_t SMUX_PDUs_choice[] = { }; static int -dissect_snmp_SMUX_PDUs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_choice(pinfo, tree, tvb, offset, +dissect_snmp_SMUX_PDUs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_choice(actx, tree, tvb, offset, SMUX_PDUs_choice, hf_index, ett_snmp_SMUX_PDUs, NULL); @@ -3319,12 +3320,14 @@ dissect_snmp_SMUX_PDUs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset /*--- PDUs ---*/ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) { - dissect_snmp_SMUX_PDUs(FALSE, tvb, 0, pinfo, tree, hf_snmp_SMUX_PDUs_PDU); + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + dissect_snmp_SMUX_PDUs(FALSE, tvb, 0, &asn1_ctx, tree, hf_snmp_SMUX_PDUs_PDU); } /*--- End of included file: packet-snmp-fn.c ---*/ -#line 1512 "packet-snmp-template.c" +#line 1513 "packet-snmp-template.c" guint @@ -3343,6 +3346,9 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *snmp_tree = NULL; proto_item *item = NULL; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); + usm_p.msg_tvb = tvb; usm_p.start_offset = offset_from_real_beginning(tvb,0) ; @@ -3457,14 +3463,14 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, switch (version){ case 0: /* v1 */ case 1: /* v2c */ - offset = dissect_snmp_Message(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_Message(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; case 2: /* v2u */ - offset = dissect_snmp_Messagev2u(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_Messagev2u(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; /* v3 */ case 3: - offset = dissect_snmp_SNMPv3Message(FALSE , tvb, start_offset, pinfo, snmp_tree, -1); + offset = dissect_snmp_SNMPv3Message(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1); break; default: /* @@ -4218,7 +4224,7 @@ void proto_register_snmp(void) { "snmp.T_operation", HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 2069 "packet-snmp-template.c" +#line 2073 "packet-snmp-template.c" }; /* List of subtrees */ @@ -4260,7 +4266,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 2082 "packet-snmp-template.c" +#line 2086 "packet-snmp-template.c" }; module_t *snmp_module; static uat_field_t fields[] = { |