Fix various typos and spelling errors.
[obnox/wireshark/wip.git] / epan / dissectors / packet-snmp.c
index 7154747736d7b3aabd4e529aaa489f98783d874b..cd2549c9869f0d2edb30d8543e9bfa314d350d2b 100644 (file)
@@ -1,7 +1,7 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
-/* ./packet-snmp.c                                                            */
-/* ../../tools/asn2wrs.py -b -e -p snmp -c snmp.cnf -s packet-snmp-template snmp.asn */
+/* packet-snmp.c                                                              */
+/* ../../tools/asn2wrs.py -b -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . snmp.asn */
 
 /* Input file: packet-snmp-template.c */
 
@@ -23,7 +23,7 @@
  * See RFC 3414 for User-based Security Model for SNMPv3
  * See RFC 3826 for  (AES) Cipher Algorithm in the SNMP USM
  * See RFC 2578 for Structure of Management Information Version 2 (SMIv2)
- * Copyright (C) 2007 Luis E. Garcia Ontanon <luis.ontanon@gmail.com>
+ * Copyright (C) 2007 Luis E. Garcia Ontanon <luis@ontanon.org>
  *
  * $Id$
  *
@@ -58,7 +58,6 @@
 # include "config.h"
 #endif
 
-#include <stdio.h>
 #include <string.h>
 #include <ctype.h>
 
@@ -67,7 +66,7 @@
 #include <epan/packet.h>
 #include <epan/strutil.h>
 #include <epan/conversation.h>
-#include "etypes.h"
+#include <epan/etypes.h>
 #include <epan/prefs.h>
 #include <epan/sminmpec.h>
 #include <epan/emem.h>
@@ -88,9 +87,6 @@
 #include <epan/report_err.h>
 #include <epan/oids.h>
 
-#ifdef _WIN32
-#include <winposixtype.h>
-#endif /* _WIN32 */
 
 #ifdef HAVE_LIBGCRYPT
 #include <gcrypt.h>
 #define TCP_PORT_SNMP          161
 #define TCP_PORT_SNMP_TRAP     162
 #define TCP_PORT_SMUX          199
+#define UDP_PORT_SNMP_PATROL 8161
 
 /* Initialize the protocol and registered fields */
 static int proto_snmp = -1;
 static int proto_smux = -1;
 
 static gboolean display_oid = TRUE;
+static gboolean snmp_var_in_tree = TRUE;
 
 static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
 static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
@@ -132,7 +130,7 @@ static void snmp_usm_password_to_key_sha1(const guint8 *password, guint password
 static snmp_usm_auth_model_t model_md5 = {snmp_usm_password_to_key_md5, snmp_usm_auth_md5, 16};
 static snmp_usm_auth_model_t model_sha1 = {snmp_usm_password_to_key_sha1, snmp_usm_auth_sha1, 20};
 
-static value_string auth_types[] = {
+static const value_string auth_types[] = {
        {0,"MD5"},
        {1,"SHA1"},
        {0,NULL}
@@ -140,7 +138,7 @@ static value_string auth_types[] = {
 static snmp_usm_auth_model_t* auth_models[] = {&model_md5,&model_sha1};
 
 
-static value_string priv_types[] = {
+static const value_string priv_types[] = {
        {0,"DES"},
        {1,"AES"},
        {0,NULL}
@@ -149,11 +147,20 @@ static snmp_usm_decoder_t priv_protos[] = {snmp_usm_priv_des, snmp_usm_priv_aes}
 
 static snmp_ue_assoc_t* ueas = NULL;
 static guint num_ueas = 0;
-static uat_t* assocs_uat = NULL;
 static snmp_ue_assoc_t* localized_ues = NULL;
 static snmp_ue_assoc_t* unlocalized_ues = NULL;
 /****/
 
+/* Variabled used for handling enterprise spesific trap types */
+typedef struct _snmp_st_assoc_t {
+       char *enterprise;
+       guint trap;
+       char *desc;
+} snmp_st_assoc_t;
+static guint num_specific_traps = 0;
+static snmp_st_assoc_t *specific_traps = NULL;
+static const char *enterprise_oid = NULL;
+static guint generic_trap = 0;
 
 
 static snmp_usm_params_t usm_p = {FALSE,FALSE,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,FALSE};
@@ -185,6 +192,7 @@ static int hf_snmp_engineid_enterprise = -1;
 static int hf_snmp_engineid_format = -1;
 static int hf_snmp_engineid_ipv4 = -1;
 static int hf_snmp_engineid_ipv6 = -1;
+static int hf_snmp_engineid_cisco_type = -1;
 static int hf_snmp_engineid_mac = -1;
 static int hf_snmp_engineid_text = -1;
 static int hf_snmp_engineid_time = -1;
@@ -198,7 +206,7 @@ static int hf_snmp_endOfMibView = -1;
 static int hf_snmp_unSpecified = -1;
 
 static int hf_snmp_integer32_value = -1;
-static int hf_snmp_octestring_value = -1;
+static int hf_snmp_octetstring_value = -1;
 static int hf_snmp_oid_value = -1;
 static int hf_snmp_null_value = -1;
 static int hf_snmp_ipv4_value = -1;
@@ -222,7 +230,7 @@ static int hf_snmp_scalar_instance_index = -1;
 #line 1 "packet-snmp-hf.c"
 static int hf_snmp_SMUX_PDUs_PDU = -1;            /* SMUX_PDUs */
 static int hf_snmp_version = -1;                  /* Version */
-static int hf_snmp_community = -1;                /* OCTET_STRING */
+static int hf_snmp_community = -1;                /* Community */
 static int hf_snmp_data = -1;                     /* PDUs */
 static int hf_snmp_parameters = -1;               /* OCTET_STRING */
 static int hf_snmp_datav2u = -1;                  /* T_datav2u */
@@ -244,17 +252,17 @@ static int hf_snmp_msgFlags = -1;                 /* T_msgFlags */
 static int hf_snmp_msgSecurityModel = -1;         /* T_msgSecurityModel */
 static int hf_snmp_plaintext = -1;                /* ScopedPDU */
 static int hf_snmp_encryptedPDU = -1;             /* T_encryptedPDU */
-static int hf_snmp_contextEngineID = -1;          /* OCTET_STRING */
+static int hf_snmp_contextEngineID = -1;          /* SnmpEngineID */
 static int hf_snmp_contextName = -1;              /* OCTET_STRING */
-static int hf_snmp_get_request = -1;              /* T_get_request */
-static int hf_snmp_get_next_request = -1;         /* T_get_next_request */
-static int hf_snmp_get_response = -1;             /* T_get_response */
-static int hf_snmp_set_request = -1;              /* T_set_request */
-static int hf_snmp_trap = -1;                     /* T_trap */
-static int hf_snmp_getBulkRequest = -1;           /* T_getBulkRequest */
-static int hf_snmp_informRequest = -1;            /* T_informRequest */
-static int hf_snmp_sNMPv2_Trap = -1;              /* T_sNMPv2_Trap */
-static int hf_snmp_report = -1;                   /* T_report */
+static int hf_snmp_get_request = -1;              /* GetRequest_PDU */
+static int hf_snmp_get_next_request = -1;         /* GetNextRequest_PDU */
+static int hf_snmp_get_response = -1;             /* GetResponse_PDU */
+static int hf_snmp_set_request = -1;              /* SetRequest_PDU */
+static int hf_snmp_trap = -1;                     /* Trap_PDU */
+static int hf_snmp_getBulkRequest = -1;           /* GetBulkRequest_PDU */
+static int hf_snmp_informRequest = -1;            /* InformRequest_PDU */
+static int hf_snmp_sNMPv2_Trap = -1;              /* SNMPv2_Trap_PDU */
+static int hf_snmp_report = -1;                   /* Report_PDU */
 static int hf_snmp_request_id = -1;               /* INTEGER */
 static int hf_snmp_error_status = -1;             /* T_error_status */
 static int hf_snmp_error_index = -1;              /* INTEGER */
@@ -262,10 +270,10 @@ static int hf_snmp_variable_bindings = -1;        /* VarBindList */
 static int hf_snmp_bulkPDU_request_id = -1;       /* Integer32 */
 static int hf_snmp_non_repeaters = -1;            /* INTEGER_0_2147483647 */
 static int hf_snmp_max_repetitions = -1;          /* INTEGER_0_2147483647 */
-static int hf_snmp_enterprise = -1;               /* OBJECT_IDENTIFIER */
+static int hf_snmp_enterprise = -1;               /* EnterpriseOID */
 static int hf_snmp_agent_addr = -1;               /* NetworkAddress */
-static int hf_snmp_generic_trap = -1;             /* T_generic_trap */
-static int hf_snmp_specific_trap = -1;            /* INTEGER */
+static int hf_snmp_generic_trap = -1;             /* GenericTrap */
+static int hf_snmp_specific_trap = -1;            /* SpecificTrap */
 static int hf_snmp_time_stamp = -1;               /* TimeTicks */
 static int hf_snmp_name = -1;                     /* ObjectName */
 static int hf_snmp_valueType = -1;                /* NULL */
@@ -287,7 +295,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 213 "packet-snmp-template.c"
+#line 221 "packet-snmp-template.c"
 
 static int hf_smux_version = -1;
 static int hf_smux_pdutype = -1;
@@ -303,6 +311,7 @@ static gint ett_authParameters = -1;
 static gint ett_internet = -1;
 static gint ett_varbind = -1;
 static gint ett_name = -1;
+static gint ett_value = -1;
 static gint ett_decoding_error = -1;
 
 
@@ -319,37 +328,23 @@ static gint ett_snmp_ScopedPDU = -1;
 static gint ett_snmp_PDUs = -1;
 static gint ett_snmp_PDU = -1;
 static gint ett_snmp_BulkPDU = -1;
-static gint ett_snmp_Trap_PDU = -1;
+static gint ett_snmp_Trap_PDU_U = -1;
 static gint ett_snmp_VarBind = -1;
 static gint ett_snmp_VarBindList = -1;
 static gint ett_snmp_SMUX_PDUs = -1;
 static gint ett_snmp_RegisterResponse = -1;
 static gint ett_snmp_OpenPDU = -1;
-static gint ett_snmp_SimpleOpen = -1;
-static gint ett_snmp_RReqPDU = -1;
+static gint ett_snmp_SimpleOpen_U = -1;
+static gint ett_snmp_RReqPDU_U = -1;
 
 /*--- End of included file: packet-snmp-ett.c ---*/
-#line 231 "packet-snmp-template.c"
+#line 240 "packet-snmp-template.c"
 
 static const true_false_string auth_flags = {
        "OK",
        "Failed"
 };
 
-/* defined in net-SNMP; include/net-snmp/library/snmp.h */
-#undef SNMP_MSG_GET
-#undef SNMP_MSG_SET
-#undef SNMP_MSG_GETNEXT
-#undef SNMP_MSG_RESPONSE
-#undef SNMP_MSG_TRAP
-#undef SNMP_MSG_GETBULK
-#undef SNMP_MSG_INFORM
-#undef SNMP_MSG_TRAP2
-#undef SNMP_MSG_REPORT
-#undef SNMP_NOSUCHOBJECT
-#undef SNMP_NOSUCHINSTANCE
-#undef SNMP_ENDOFMIBVIEW
-
 /* Security Models */
 
 #define SNMP_SEC_ANY                   0
@@ -398,6 +393,25 @@ static const value_string smux_types[] = {
 
 dissector_table_t value_sub_dissectors_table;
 
+
+static const gchar *
+snmp_lookup_specific_trap (guint specific_trap)
+{
+       guint i;
+
+       for (i = 0; i < num_specific_traps; i++) {
+               snmp_st_assoc_t *u = &(specific_traps[i]);
+
+               if ((u->trap == specific_trap) &&
+                   (strcmp (u->enterprise, enterprise_oid) == 0))
+               {
+                       return u->desc;
+               }
+       }
+
+       return NULL;
+}
+
 /*
  *  dissect_snmp_VarBind
  *  this routine dissects variable bindings, looking for the oid information in our oid reporsitory
@@ -411,8 +425,8 @@ dissector_table_t value_sub_dissectors_table;
  * XXX: the length of this function (~400 lines) is an aberration!
  *  oid_key_t:key_type could become a series of callbacks instead of an enum
  *  the (! oid_info_is_ok) switch could be made into an array (would be slower)
- *  
-  
+ *
+
        NetworkAddress ::=  CHOICE { internet IpAddress }
        IpAddress ::= [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4))
        TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
@@ -425,7 +439,7 @@ dissector_table_t value_sub_dissectors_table;
        Integer32 ::= INTEGER (-2147483648..2147483647)
        ObjectID-value ::= OBJECT IDENTIFIER
        Empty ::= NULL
-       TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) 
+       TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
        Opaque ::= [APPLICATION 4] IMPLICIT OCTET STRING
        Counter64 ::= [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615)
 
@@ -462,15 +476,13 @@ dissector_table_t value_sub_dissectors_table;
           name ObjectName,
           valueType ValueType
        }
+
  */
 
-extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
-                                                               tvbuff_t *tvb,
-                                                               int offset,
-                                                               asn1_ctx_t *actx,
-                                                               proto_tree *tree,
-                                                               int hf_index _U_) {
+extern int
+dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
+                    asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_)
+{
        int seq_offset, name_offset, value_offset, value_start;
        guint32 seq_len, name_len, value_len;
        gint8 ber_class;
@@ -479,66 +491,68 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
        gboolean ind;
        guint32* subids;
        guint8* oid_bytes;
-       oid_info_t* oid_info;
+       oid_info_t* oid_info = NULL;
        guint oid_matched, oid_left;
        proto_item *pi_name, *pi_varbind, *pi_value = NULL;
-       proto_tree *pt, *pt_varbind, *pt_name;
+       proto_tree *pt, *pt_varbind, *pt_name, *pt_value;
        char label[ITEM_LABEL_LENGTH];
-       char* repr = NULL;
+       const char* repr = NULL;
+       const char* info_oid = NULL;
        char* valstr;
        int hfid = -1;
        int min_len = 0, max_len = 0;
        gboolean oid_info_is_ok;
-       dissector_handle_t subdissector = NULL;
-       const char* oid_string;
+       const char* oid_string = NULL;
+       enum {BER_NO_ERROR, BER_WRONG_LENGTH, BER_WRONG_TAG} format_error = BER_NO_ERROR;
+
        seq_offset = offset;
-       
+
        /* first have the VarBind's sequence header */
        offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
        offset = get_ber_length(tvb, offset, &seq_len, &ind);
-       
+
        seq_len += offset - seq_offset;
-       
+
        if (!pc && ber_class==BER_CLASS_UNI && tag==BER_UNI_TAG_SEQUENCE) {
                proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"VarBind must be an universal class sequence");
                pt = proto_item_add_subtree(pi,ett_decoding_error);
                expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "VarBind is not an universal class sequence");
                return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt);
        }
-       
-       if (ind){
+
+       if (ind) {
                proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"Indicator must be clear in VarBind");
                pt = proto_item_add_subtree(pi,ett_decoding_error);
                expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "VarBind has indicator set");
                return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt);
        }
-       
+
        /* then we have the ObjectName's header */
-       
+
        offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
        name_offset = offset = get_ber_length(tvb, offset, &name_len, &ind);
-       
+
        if (! ( !pc && ber_class==BER_CLASS_UNI && tag==BER_UNI_TAG_OID) ) {
                proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"ObjectName must be an OID in primitive encoding");
                pt = proto_item_add_subtree(pi,ett_decoding_error);
                expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "ObjectName not an OID");
                return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt);
        }
-       
-       if (ind){
+
+       if (ind) {
                proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"Indicator must be clear in ObjectName");
                pt = proto_item_add_subtree(pi,ett_decoding_error);
                expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "ObjectName has indicator set");
                return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt);
        }
-       
+
        offset += name_len;
        value_start = offset;
-       
+
        /* then we have the  value's header */
        offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
        value_offset = offset = get_ber_length(tvb, offset, &value_len, &ind);
-       
+
        if (! (!pc) ) {
                proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"the value must be in primitive encoding");
                pt = proto_item_add_subtree(pi,ett_decoding_error);
@@ -547,27 +561,47 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
        }
 
        /* Now, we know where everithing is */
-       
+
 
 
        /* we add the varbind tree root with a dummy label we'll fill later on */
        pi_varbind = proto_tree_add_text(tree,tvb,seq_offset,seq_len,"VarBind");
        pt_varbind = proto_item_add_subtree(pi_varbind,ett_varbind);
        *label = '\0';
-       
+
        pi_name = proto_tree_add_item(pt_varbind,hf_snmp_objectname,tvb,name_offset,name_len,FALSE);
        pt_name = proto_item_add_subtree(pi_name,ett_name);
-       
-       
-       
+
+       /* fetch ObjectName and its relative oid_info */
+       oid_bytes = ep_tvb_memdup(tvb, name_offset, name_len);
+       oid_info = oid_get_from_encoded(oid_bytes, name_len, &subids, &oid_matched, &oid_left);
+
+       add_oid_debug_subtree(oid_info,pt_name);
+
+       if (!subids) {
+               proto_item* pi;
+
+               repr = oid_encoded2string(oid_bytes, name_len);
+               pi = proto_tree_add_text(pt_name,tvb, 0, 0, "invalid oid: %s", repr);
+               pt = proto_item_add_subtree(pi, ett_decoding_error);
+               expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "invalid oid: %s", repr);
+               return dissect_unknown_ber(actx->pinfo, tvb, name_offset, pt);
+       }
+
+       if (oid_matched+oid_left) {
+               oid_string = oid_subid2string(subids,oid_matched+oid_left);
+       }
+
        if (ber_class == BER_CLASS_CON) {
                /* if we have an error value just add it and get out the way ASAP */
                proto_item* pi;
                const char* note;
-               
-               if (value_len != 0)
-                       goto expected_other_size; 
-               
+
+               if (value_len != 0) {
+                       min_len = max_len = 0;
+                       format_error = BER_WRONG_LENGTH;
+               }
+
                switch (tag) {
                        case SERR_NSO:
                                hfid = hf_snmp_noSuchObject;
@@ -585,30 +619,15 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
                                pi = proto_tree_add_text(pt_varbind,tvb,0,0,"Wrong tag for Error Value: expected 0, 1, or 2 but got: %d",tag);
                                pt = proto_item_add_subtree(pi,ett_decoding_error);
                                expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong tag for SNMP VarBind error value");
-                               return dissect_unknown_ber(actx->pinfo, tvb, value_start, tree);
-                       }                               
+                               return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt);
+                       }
                }
-               
+
                pi = proto_tree_add_item(pt_varbind,hfid,tvb,value_offset,value_len,FALSE);
                expert_add_info_format(actx->pinfo, pi, PI_RESPONSE_CODE, PI_NOTE, "%s",note);
+               g_strlcpy (label, note, ITEM_LABEL_LENGTH);
                goto set_label;
        }
-       
-       /* fetch ObjectName and its relative oid_info */
-       oid_bytes = ep_tvb_memdup(tvb, name_offset, name_len);
-       oid_info = oid_get_from_encoded(oid_bytes, name_len, &subids, &oid_matched, &oid_left);
-       
-       add_oid_debug_subtree(oid_info,pt_name);
-
-       if (oid_matched+oid_left) {
-               oid_string = oid_subid2string(subids,oid_matched+oid_left);
-               subdissector = dissector_get_string_handle(value_sub_dissectors_table, oid_string);
-       } else {
-               oid_string = ".";
-       }
-       
-
-
 
        /* now we'll try to figure out which are the indexing sub-oids and whether the oid we know about is the one oid we have to use */
        switch (oid_info->kind) {
@@ -648,82 +667,130 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
                                        pi_value = proto_tree_add_item(pt_varbind,hf_snmp_unSpecified,tvb,value_offset,value_len,FALSE);
                                        goto set_label;
                                }
-                               
+
                                if (k) {
                                        for (;k;k = k->next) {
+                                               guint suboid_len;
+
                                                if (key_start >= oid_matched+oid_left) {
                                                        proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"index sub-oid shorter than expected");
                                                        expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "index sub-oid shorter than expected");
                                                        oid_info_is_ok = FALSE;
                                                        goto indexing_done;
                                                }
-                                               
+
                                                switch(k->key_type) {
                                                        case OID_KEY_TYPE_WRONG: {
-                                                               proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"OID instaces not handled, if you want this implemented please contact the wireshark developpers");
+                                                               proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"OID instaces not handled, if you want this implemented please contact the wireshark developers");
                                                                expert_add_info_format(actx->pinfo, pi, PI_UNDECODED, PI_WARN, "Unimplemented instance index");
                                                                oid_info_is_ok = FALSE;
                                                                goto indexing_done;
                                                        }
                                                        case OID_KEY_TYPE_INTEGER: {
-                                                               proto_tree_add_int(pt_name,k->hfid,tvb,name_offset,name_len,(guint)subids[key_start]);
+                                                               if (IS_FT_INT(k->ft_type)) {
+                                                                       proto_tree_add_int(pt_name,k->hfid,tvb,name_offset,name_len,(guint)subids[key_start]);
+                                                               } else { /* if it's not an unsigned int let proto_tree_add_uint throw a warning */
+                                                                       proto_tree_add_uint(pt_name,k->hfid,tvb,name_offset,name_len,(guint)subids[key_start]);
+                                                               }
                                                                key_start++;
                                                                key_len--;
                                                                continue; /* k->next */
                                                        }
+                                                       case OID_KEY_TYPE_IMPLIED_OID:
+                                                               suboid_len = key_len;
+
+                                                               goto show_oid_index;
+
                                                        case OID_KEY_TYPE_OID: {
-                                                               guint suboid_len = subids[key_start++];
-                                                               guint32* suboid = &(subids[key_start]);
                                                                guint8* suboid_buf;
                                                                guint suboid_buf_len;
-                                                               
-                                                               if( suboid_len < key_len-1) {
-                                                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"index sub-oid should be longer than remaining oid size");
+                                                               guint32* suboid;
+
+                                                               suboid_len = subids[key_start++];
+                                                               key_len--;
+
+show_oid_index:
+                                                               suboid = &(subids[key_start]);
+
+                                                               if( suboid_len == 0 ) {
+                                                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"an index sub-oid OID cannot be 0 bytes long!");
+                                                                       expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "index sub-oid OID with len=0");
+                                                                       oid_info_is_ok = FALSE;
+                                                                       goto indexing_done;
+                                                               }
+
+                                                               if( key_len < suboid_len ) {
+                                                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"index sub-oid should not be longer than remaining oid size");
                                                                        expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "index sub-oid longer than remaining oid size");
                                                                        oid_info_is_ok = FALSE;
                                                                        goto indexing_done;
                                                                }
-                                                               
+
                                                                suboid_buf_len = oid_subid2encoded(suboid_len, suboid, &suboid_buf);
+
+                                                               DISSECTOR_ASSERT(suboid_buf_len);
+
                                                                proto_tree_add_oid(pt_name,k->hfid,tvb,name_offset, suboid_buf_len, suboid_buf);
-                                                               
+
                                                                key_start += suboid_len;
                                                                key_len -= suboid_len + 1;
                                                                continue; /* k->next */
                                                        }
                                                        default: {
                                                                guint8* buf;
-                                                               guint buf_len = k->num_subids;
-                                                               guint32* suboid = &(subids[key_start]);
+                                                               guint buf_len;
+                                                               guint32* suboid;
                                                                guint i;
-                                                               
-                                                               if(!buf_len) {
-                                                                       buf_len = *suboid;
-                                                                       suboid++;
+
+
+                                                               switch (k->key_type) {
+                                                                       case OID_KEY_TYPE_IPADDR:
+                                                                               suboid = &(subids[key_start]);
+                                                                               buf_len = 4;
+                                                                               break;
+                                                                       case OID_KEY_TYPE_IMPLIED_STRING:
+                                                                       case OID_KEY_TYPE_IMPLIED_BYTES:
+                                                                       case OID_KEY_TYPE_ETHER:
+                                                                               suboid = &(subids[key_start]);
+                                                                               buf_len = key_len;
+                                                                               break;
+                                                                       default:
+                                                                               buf_len = k->num_subids;
+                                                                               suboid = &(subids[key_start]);
+
+                                                                               if(!buf_len) {
+                                                                                       buf_len = *suboid++;
+                                                                                       key_len--;
+                                                                                       key_start++;
+                                                                               }
+                                                                               break;
                                                                }
-                                                               
+
                                                                if( key_len < buf_len ) {
-                                                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"index sub-oid should not be longer than remaining oid size");
-                                                                       expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "index sub-oid longer than remaining oid size");
+                                                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"index string should not be longer than remaining oid size");
+                                                                       expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "index string longer than remaining oid size");
                                                                        oid_info_is_ok = FALSE;
                                                                        goto indexing_done;
                                                                }
-                                                               
+
                                                                buf = ep_alloc(buf_len+1);
                                                                for (i = 0; i < buf_len; i++)
                                                                        buf[i] = (guint8)suboid[i];
                                                                buf[i] = '\0';
-                                                               
+
                                                                switch(k->key_type) {
                                                                        case OID_KEY_TYPE_STRING:
-                                                                       case OID_KEY_TYPE_FIXED_STRING:
+                                                                       case OID_KEY_TYPE_IMPLIED_STRING:
                                                                                proto_tree_add_string(pt_name,k->hfid,tvb,name_offset,buf_len, buf);
                                                                                break;
                                                                        case OID_KEY_TYPE_BYTES:
                                                                        case OID_KEY_TYPE_NSAP:
-                                                                       case OID_KEY_TYPE_FIXED_BYTES: 
+                                                                       case OID_KEY_TYPE_IMPLIED_BYTES:
                                                                                proto_tree_add_bytes(pt_name,k->hfid,tvb,name_offset,buf_len, buf);
                                                                                break;
+                                                                       case OID_KEY_TYPE_ETHER:
+                                                                               proto_tree_add_ether(pt_name,k->hfid,tvb,name_offset,buf_len, buf);
+                                                                               break;
                                                                        case OID_KEY_TYPE_IPADDR: {
                                                                                guint32* ipv4_p = (void*)buf;
                                                                                proto_tree_add_ipv4(pt_name,k->hfid,tvb,name_offset,buf_len, *ipv4_p);
@@ -733,7 +800,7 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
                                                                                break;
                                                                        }
                                                                }
-                                                               
+
                                                                key_start += buf_len;
                                                                key_len -= buf_len;
                                                                continue; /* k->next*/
@@ -742,7 +809,7 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
                                        }
                                        goto indexing_done;
                                } else {
-                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"we do not know how to handle this OID, if you want this implemented please contact the wireshark developers");
+                                       proto_item* pi = proto_tree_add_text(pt_name,tvb,0,0,"We do not know how to handle this OID, if you want this implemented please contact the wireshark developers");
                                        expert_add_info_format(actx->pinfo, pi, PI_UNDECODED, PI_WARN, "Unimplemented instance index");
                                        oid_info_is_ok = FALSE;
                                        goto indexing_done;
@@ -761,54 +828,67 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
                }
        }
 indexing_done:
-       
-       if (value_len > 0 && subdissector) {
-               tvbuff_t* sub_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
-               
-               call_dissector(subdissector, tvb, actx->pinfo, pt_varbind);
-               
-               return seq_offset + seq_len;
-       }
-       
-       if (oid_info_is_ok) {
+
+       if (oid_info_is_ok && oid_info->value_type) {
                if (ber_class == BER_CLASS_UNI && tag == BER_UNI_TAG_NULL) {
                        pi_value = proto_tree_add_item(pt_varbind,hf_snmp_unSpecified,tvb,value_offset,value_len,FALSE);
                }  else {
                        if ((oid_info->value_type->ber_class != BER_CLASS_ANY) &&
                                (ber_class != oid_info->value_type->ber_class))
-                               goto expected_different;
-                       
+                               format_error = BER_WRONG_TAG;
+
                        if ((oid_info->value_type->ber_tag != BER_TAG_ANY) &&
                                (tag != oid_info->value_type->ber_tag))
-                               goto expected_different;
-                       
+                               format_error = BER_WRONG_TAG;
+
                        max_len = oid_info->value_type->max_len == -1 ? 0xffffff : oid_info->value_type->max_len;
                        min_len  = oid_info->value_type->min_len;
-                       
-                       if ((int)value_len < min_len || (int)value_len > max_len)
-                               goto expected_other_size;
-                       
-                       
-                       pi_value = proto_tree_add_item(pt_varbind,oid_info->value_hfid,tvb,value_offset,value_len,FALSE);
+
+                       if ((int)value_len < min_len || (int)value_len > max_len) {
+                               format_error = BER_WRONG_LENGTH;
+                       } else {
+                               pi_value = proto_tree_add_item(pt_varbind,oid_info->value_hfid,tvb,value_offset,value_len,FALSE);
+                       }
                }
        } else {
                switch(ber_class|(tag<<4)) {
                        case BER_CLASS_UNI|(BER_UNI_TAG_INTEGER<<4):
-                               max_len = 4; min_len = 1;
-                               if (value_len > (guint)max_len && value_len < (guint)min_len) goto expected_other_size; 
-                               hfid = hf_snmp_integer32_value;
-                               break;
+                       {
+                               gint64 val=0;
+                               unsigned offset = value_offset;
+                               unsigned i;
+
+                               max_len = 5; min_len = 1;
+                               if (value_len > (guint)max_len && value_len < (guint)min_len) {
+                                       format_error = BER_WRONG_LENGTH;
+                                       break;
+                               }
+
+                               if(value_len > 0) {
+                                       /* extend sign bit */
+                                       if(tvb_get_guint8(tvb, offset)&0x80) {
+                                               val=-1;
+                                       }
+                                       for(i=0;i<value_len;i++) {
+                                               val=(val<<8)|tvb_get_guint8(tvb, offset);
+                                               offset++;
+                                       }
+                               }
+                               proto_tree_add_int64(pt_varbind, hf_snmp_integer32_value, tvb,value_offset,value_len, val);
+
+                               goto already_added;
+                       }
                        case BER_CLASS_UNI|(BER_UNI_TAG_OCTETSTRING<<4):
-                               hfid = hf_snmp_octestring_value;
+                               hfid = hf_snmp_octetstring_value;
                                break;
                        case BER_CLASS_UNI|(BER_UNI_TAG_OID<<4):
-                               max_len = -1; min_len = 2;
-                               if (value_len < (guint)min_len) goto expected_other_size; 
+                               max_len = -1; min_len = 1;
+                               if (value_len < (guint)min_len) format_error = BER_WRONG_LENGTH;
                                hfid = hf_snmp_oid_value;
                                break;
                        case BER_CLASS_UNI|(BER_UNI_TAG_NULL<<4):
                                max_len = 0; min_len = 0;
-                               if (value_len != 0) goto expected_other_size; 
+                               if (value_len != 0) format_error = BER_WRONG_LENGTH;
                                hfid = hf_snmp_null_value;
                                break;
                        case BER_CLASS_APP: /* | (SNMP_IPA<<4)*/
@@ -839,63 +919,83 @@ indexing_done:
                        case BER_CLASS_APP|(SNMP_C64<<4):
                                hfid = hf_snmp_big_counter_value;
                                break;
-                       default: 
+                       default:
                                hfid = hf_snmp_unknown_value;
                                break;
                }
-               
+
                pi_value = proto_tree_add_item(pt_varbind,hfid,tvb,value_offset,value_len,FALSE);
-               expert_add_info_format(actx->pinfo, pi_value, PI_UNDECODED, PI_NOTE, "Unresolved value, Missing MIB");
+               if (format_error != BER_NO_ERROR) {
+                       expert_add_info_format(actx->pinfo, pi_value, PI_UNDECODED, PI_NOTE, "Unresolved value, Missing MIB");
+               }
+
+already_added:
                oid_info_is_ok = FALSE;
-       } 
-               
+       }
+
+       pt_value = proto_item_add_subtree(pi_value,ett_value);
+
+       if (value_len > 0 && oid_string) {
+               tvbuff_t* sub_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
+
+               next_tvb_add_string(&var_list, sub_tvb, (snmp_var_in_tree) ? pt_value : NULL, value_sub_dissectors_table, oid_string);
+       }
+
 
 set_label:
-       if (pi_value) proto_item_fill_label(pi_value->finfo, label);
-       
-       if (oid_info->name) {
+       if (pi_value) proto_item_fill_label(PITEM_FINFO(pi_value), label);
+
+       if (oid_info && oid_info->name) {
                if (oid_left >= 1) {
-                       repr  = ep_strdup_printf("%s.%s (%s)",
-                                                                        oid_info->name,
-                                                                        oid_subid2string(&(subids[oid_matched]),oid_left),
-                                                                        oid_subid2string(subids,oid_matched+oid_left));
+                       repr  = ep_strdup_printf("%s.%s (%s)", oid_info->name,
+                                                oid_subid2string(&(subids[oid_matched]),oid_left),
+                                                oid_subid2string(subids,oid_matched+oid_left));
+                       info_oid = ep_strdup_printf("%s.%s", oid_info->name,
+                                                   oid_subid2string(&(subids[oid_matched]),oid_left));
                } else {
-                       repr  = ep_strdup_printf("%s (%s)",
-                                                                        oid_info->name,
-                                                                        oid_subid2string(subids,oid_matched));
+                       repr  = ep_strdup_printf("%s (%s)", oid_info->name,
+                                                oid_subid2string(subids,oid_matched));
+                       info_oid = oid_info->name;
                }
+       } else if (oid_string) {
+               repr  = ep_strdup(oid_string);
+               info_oid = oid_string;
        } else {
-               repr  = ep_strdup_printf("%s", oid_string);                     
+               repr  = ep_strdup("[Bad OID]");
        }
-       
+
        valstr = strstr(label,": ");
        valstr = valstr ? valstr+2 : label;
-       
+
        proto_item_set_text(pi_varbind,"%s: %s",repr,valstr);
-               
-       return seq_offset + seq_len;
 
-expected_other_size: {
-               proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"Wrong value length: %u  expecting: %u <= len <= %u",
-                                                                                        value_len,
-                                                                                        min_len,
-                                                                                        max_len == -1 ? 0xFFFFFF : max_len);
-               pt = proto_item_add_subtree(pi,ett_decoding_error);
-               expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong length for SNMP VarBind/value");
-               return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt);
+       if (display_oid && info_oid) {
+         col_append_fstr (actx->pinfo->cinfo, COL_INFO, " %s", info_oid);
        }
 
-expected_different: {
-               proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"Wrong class/tag for Value expected: %d,%d got: %d,%d",
-                                                                                        oid_info->value_type->ber_class,
-                                                                                        oid_info->value_type->ber_tag,
-                                                                                        ber_class,
-                                                                                        tag);
-               pt = proto_item_add_subtree(pi,ett_decoding_error);
-               expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong class/tag for SNMP VarBind/value");
-               return dissect_unknown_ber(actx->pinfo, tvb, value_start, tree);
+       switch (format_error) {
+               case BER_WRONG_LENGTH: {
+                       proto_tree* pt = proto_item_add_subtree(pi_value,ett_decoding_error);
+                       proto_item* pi = proto_tree_add_text(pt,tvb,0,0,"Wrong value length: %u  expecting: %u <= len <= %u",
+                                                            value_len, min_len, max_len == -1 ? 0xFFFFFF : max_len);
+                       pt = proto_item_add_subtree(pi,ett_decoding_error);
+                       expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong length for SNMP VarBind/value");
+                       return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt);
+               }
+               case BER_WRONG_TAG: {
+                       proto_tree* pt = proto_item_add_subtree(pi_value,ett_decoding_error);
+                       proto_item* pi = proto_tree_add_text(pt,tvb,0,0,"Wrong class/tag for Value expected: %d,%d got: %d,%d",
+                                                            oid_info->value_type->ber_class, oid_info->value_type->ber_tag,
+                                                            ber_class, tag);
+                       pt = proto_item_add_subtree(pi,ett_decoding_error);
+                       expert_add_info_format(actx->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong class/tag for SNMP VarBind/value");
+                       return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt);
+               }
+               default:
+                       break;
        }
 
+       return seq_offset + seq_len;
 }
 
 
@@ -923,6 +1023,15 @@ static const value_string snmp_engineid_format_vals[] = {
        { 0,    NULL }
 };
 
+#define SNMP_ENGINEID_CISCO_AGENT 0x00
+#define SNMP_ENGINEID_CISCO_MANAGER 0x01
+
+static const value_string snmp_engineid_cisco_type_vals[] = {
+       { SNMP_ENGINEID_CISCO_AGENT,    "Agent" },
+       { SNMP_ENGINEID_CISCO_MANAGER,  "Manager" },
+       { 0,    NULL }
+};
+
 /*
  * SNMP Engine ID dissection according to RFC 3411 (SnmpEngineID TC)
  * or historic RFC 1910 (AgentID)
@@ -938,7 +1047,7 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
 
     /* first bit: engine id conformance */
     if (len_remain<4) return offset;
-    conformance = ((tvb_get_guint8(tvb, offset)>>7) && 0x01);
+    conformance = ((tvb_get_guint8(tvb, offset)>>7) & 0x01);
     proto_tree_add_item(tree, hf_snmp_engineid_conform, tvb, offset, 1, FALSE);
 
     /* 4-byte enterprise number/name */
@@ -971,7 +1080,7 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
       if (len_remain<1) return offset;
       format = tvb_get_guint8(tvb, offset);
       item = proto_tree_add_uint_format(tree, hf_snmp_engineid_format, tvb, offset, 1, format, "Engine ID Format: %s (%d)",
-                         val_to_str(format, snmp_engineid_format_vals, "Reserved/Enterprise-specific"), format);
+                                       val_to_str(format, snmp_engineid_format_vals, "Reserved/Enterprise-specific"), format);
       offset+=1;
       len_remain-=1;
 
@@ -993,6 +1102,12 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
        }
        break;
       case SNMP_ENGINEID_FORMAT_MACADDRESS:
+       /* See: https://supportforums.cisco.com/message/3010617#3010617 for details. */
+       if ((enterpriseid==9)&&(len_remain==7)) {
+         proto_tree_add_item(tree, hf_snmp_engineid_cisco_type, tvb, offset, 1, FALSE);
+         offset++;
+         len_remain--;
+       }
        /* 6-byte MAC address */
        if (len_remain==6) {
          proto_tree_add_item(tree, hf_snmp_engineid_mac, tvb, offset, 6, FALSE);
@@ -1017,9 +1132,10 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
            proto_tree_add_item(tree, hf_snmp_engineid_data, tvb, offset, 4, FALSE);
            seconds = tvb_get_letohl(tvb, offset+4);
            ts.secs = seconds;
-           proto_tree_add_time_format(tree, hf_snmp_engineid_time, tvb, offset+4, 4,
-                                  &ts, "Engine ID Data: Creation Time: %s",
-                                  abs_time_secs_to_str(seconds));
+           ts.nsecs = 0;
+           proto_tree_add_time_format_value(tree, hf_snmp_engineid_time, tvb, offset+4, 4,
+                                            &ts, "%s",
+                                            abs_time_secs_to_str(seconds, ABSOLUTE_TIME_LOCAL, TRUE));
            offset+=8;
            len_remain=0;
          }
@@ -1051,21 +1167,23 @@ static void set_ue_keys(snmp_ue_assoc_t* n ) {
        n->user.authKey.data = se_alloc(key_size);
        n->user.authKey.len = key_size;
        n->user.authModel->pass2key(n->user.authPassword.data,
-                                                               n->user.authPassword.len,
-                                                               n->engine.data,
-                                                               n->engine.len,
-                                                               n->user.authKey.data);
+                                   n->user.authPassword.len,
+                                   n->engine.data,
+                                   n->engine.len,
+                                   n->user.authKey.data);
 
        n->user.privKey.data = se_alloc(key_size);
        n->user.privKey.len = key_size;
        n->user.authModel->pass2key(n->user.privPassword.data,
-                                                               n->user.privPassword.len,
-                                                               n->engine.data,
-                                                               n->engine.len,
-                                                               n->user.privKey.data);
+                                   n->user.privPassword.len,
+                                   n->engine.data,
+                                   n->engine.len,
+                                   n->user.privKey.data);
 }
 
-static snmp_ue_assoc_t* ue_se_dup(snmp_ue_assoc_t* o) {
+static snmp_ue_assoc_t*
+ue_se_dup(snmp_ue_assoc_t* o)
+{
        snmp_ue_assoc_t* d = se_memdup(o,sizeof(snmp_ue_assoc_t));
 
        d->user.authModel = o->user.authModel;
@@ -1095,13 +1213,15 @@ static snmp_ue_assoc_t* ue_se_dup(snmp_ue_assoc_t* o) {
 
 #define CACHE_INSERT(c,a) if (c) { snmp_ue_assoc_t* t = c; c = a; c->next = t; } else { c = a; a->next = NULL; }
 
-static void renew_ue_cache(void) {
+static void
+renew_ue_cache(void)
+{
+       localized_ues = NULL;
+       unlocalized_ues = NULL;
+
        if (num_ueas) {
                guint i;
 
-               localized_ues = NULL;
-               unlocalized_ues = NULL;
-
                for(i = 0; i < num_ueas; i++) {
                        snmp_ue_assoc_t* a = ue_se_dup(&(ueas[i]));
 
@@ -1113,14 +1233,13 @@ static void renew_ue_cache(void) {
                        }
 
                }
-       } else {
-               localized_ues = NULL;
-               unlocalized_ues = NULL;
        }
 }
 
 
-static snmp_ue_assoc_t* localize_ue( snmp_ue_assoc_t* o, const guint8* engine, guint engine_len ) {
+static snmp_ue_assoc_t*
+localize_ue( snmp_ue_assoc_t* o, const guint8* engine, guint engine_len )
+{
        snmp_ue_assoc_t* n = se_memdup(o,sizeof(snmp_ue_assoc_t));
 
        n->engine.data = se_memdup(engine,engine_len);
@@ -1135,13 +1254,15 @@ static snmp_ue_assoc_t* localize_ue( snmp_ue_assoc_t* o, const guint8* engine, g
 #define localized_match(a,u,ul,e,el) \
        ( a->user.userName.len == ul \
        && a->engine.len == el \
-       && memcmp( a->user.userName.data, u, (a->user.userName.len < ul) ? a->user.userName.len : ul ) == 0 \
-       && memcmp( a->engine.data,   e, (a->engine.len   < el) ? a->engine.len   : el ) == 0 )
+       && memcmp( a->user.userName.data, u, ul ) == 0 \
+       && memcmp( a->engine.data,   e,  el ) == 0 )
 
 #define unlocalized_match(a,u,l) \
-       ( a->user.userName.len == l && memcmp( a->user.userName.data, u, a->user.userName.len < l ? a->user.userName.len : l) == 0 )
+       ( a->user.userName.len == l && memcmp( a->user.userName.data, u, l) == 0 )
 
-static snmp_ue_assoc_t* get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb) {
+static snmp_ue_assoc_t*
+get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
+{
        static snmp_ue_assoc_t* a;
        guint given_username_len;
        guint8* given_username;
@@ -1174,14 +1295,16 @@ static snmp_ue_assoc_t* get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
        return NULL;
 }
 
-static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_len_p, gchar const** error) {
+static gboolean
+snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_len_p, gchar const** error)
+{
        guint msg_len;
        guint8* msg;
        guint auth_len;
        guint8* auth;
        guint8* key;
        guint key_len;
-       guint8 calc_auth[16];
+       guint8 *calc_auth;
        guint start;
        guint end;
        guint i;
@@ -1221,6 +1344,8 @@ static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, gu
                msg[i] = '\0';
        }
 
+       calc_auth = ep_alloc(16);
+
        md5_hmac(msg, msg_len, key, key_len, calc_auth);
 
        if (calc_auth_p) *calc_auth_p = calc_auth;
@@ -1230,14 +1355,16 @@ static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, gu
 }
 
 
-static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_auth_len_p,  gchar const** error _U_) {
+static gboolean
+snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_auth_len_p,  gchar const** error _U_)
+{
        guint msg_len;
        guint8* msg;
        guint auth_len;
        guint8* auth;
        guint8* key;
        guint key_len;
-       guint8 calc_auth[20];
+       guint8 *calc_auth;
        guint start;
        guint end;
        guint i;
@@ -1277,6 +1404,8 @@ static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_
                msg[i] = '\0';
        }
 
+       calc_auth = ep_alloc(20);
+
        sha1_hmac(key, key_len, msg, msg_len, calc_auth);
 
        if (calc_auth_p) *calc_auth_p = calc_auth;
@@ -1285,7 +1414,9 @@ static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_
        return ( memcmp(auth,calc_auth,12) != 0 ) ? FALSE : TRUE;
 }
 
-static tvbuff_t* snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar const** error _U_) {
+static tvbuff_t*
+snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar const** error _U_)
+{
 #ifdef HAVE_LIBGCRYPT
     gcry_error_t err;
     gcry_cipher_hd_t hd = NULL;
@@ -1332,7 +1463,7 @@ static tvbuff_t* snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encrypted
        err = gcry_cipher_open(&hd, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_CBC, 0);
        if (err != GPG_ERR_NO_ERROR) goto on_gcry_error;
 
-    err = gcry_cipher_setiv(hd, iv, 8);
+       err = gcry_cipher_setiv(hd, iv, 8);
        if (err != GPG_ERR_NO_ERROR) goto on_gcry_error;
 
        err = gcry_cipher_setkey(hd,des_key,8);
@@ -1343,7 +1474,7 @@ static tvbuff_t* snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encrypted
 
        gcry_cipher_close(hd);
 
-       clear_tvb = tvb_new_real_data(cleartext, cryptgrm_len, cryptgrm_len);
+       clear_tvb = tvb_new_child_real_data(encryptedData, cleartext, cryptgrm_len, cryptgrm_len);
 
        return clear_tvb;
 
@@ -1357,10 +1488,12 @@ on_gcry_error:
 #endif
 }
 
-static tvbuff_t* snmp_usm_priv_aes(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar const** error _U_) {
+static tvbuff_t*
+snmp_usm_priv_aes(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar const** error _U_)
+{
 #ifdef HAVE_LIBGCRYPT
-    gcry_error_t err;
-    gcry_cipher_hd_t hd = NULL;
+       gcry_error_t err;
+       gcry_cipher_hd_t hd = NULL;
 
        guint8* cleartext;
        guint8* aes_key = p->user_assoc->user.privKey.data; /* first 16 bytes */
@@ -1395,7 +1528,7 @@ static tvbuff_t* snmp_usm_priv_aes(snmp_usm_params_t* p _U_, tvbuff_t* encrypted
        err = gcry_cipher_open(&hd, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_CFB, 0);
        if (err != GPG_ERR_NO_ERROR) goto on_gcry_error;
 
-    err = gcry_cipher_setiv(hd, iv, 16);
+       err = gcry_cipher_setiv(hd, iv, 16);
        if (err != GPG_ERR_NO_ERROR) goto on_gcry_error;
 
        err = gcry_cipher_setkey(hd,aes_key,16);
@@ -1406,7 +1539,7 @@ static tvbuff_t* snmp_usm_priv_aes(snmp_usm_params_t* p _U_, tvbuff_t* encrypted
 
        gcry_cipher_close(hd);
 
-       clear_tvb = tvb_new_real_data(cleartext, cryptgrm_len, cryptgrm_len);
+       clear_tvb = tvb_new_child_real_data(encryptedData, cleartext, cryptgrm_len, cryptgrm_len);
 
        return clear_tvb;
 
@@ -1421,7 +1554,9 @@ on_gcry_error:
 }
 
 
-gboolean check_ScopedPdu(tvbuff_t* tvb) {
+gboolean
+check_ScopedPdu(tvbuff_t* tvb)
+{
        int offset;
        gint8 class;
        gboolean pc;
@@ -1459,34 +1594,67 @@ gboolean check_ScopedPdu(tvbuff_t* tvb) {
 
 /*--- Included file: packet-snmp-fn.c ---*/
 #line 1 "packet-snmp-fn.c"
-/*--- Fields for imported types ---*/
 
 
 
+static int
+dissect_snmp_EnterpriseOID(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 64 "snmp.cnf"
+  const gchar* name;
+
+  offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &enterprise_oid);
+
+
+  if (display_oid && enterprise_oid) {
+    name = oid_resolved_from_string(enterprise_oid);
+    if (name) {
+      col_append_fstr (actx->pinfo->cinfo, COL_INFO, " %s", name);
+    }
+  }
+
+
+
+  return offset;
+}
+
 
 
 static int
-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_) {
+dissect_snmp_OCTET_STRING_SIZE_4(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, tree, tvb, offset, hf_index,
                                        NULL);
 
   return offset;
 }
-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_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 0, TRUE, dissect_snmp_OCTET_STRING_SIZE_4);
+
+  return offset;
 }
 
 
 
 static int
-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_) {
+dissect_snmp_INTEGER_0_4294967295(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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 3, TRUE, dissect_snmp_INTEGER_0_4294967295);
+
+  return offset;
 }
 
 
@@ -1494,13 +1662,10 @@ static int dissect_time_stamp(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offse
 static int
 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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
-}
 
 
 
@@ -1510,12 +1675,6 @@ dissect_snmp_ObjectName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
 
   return offset;
 }
-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(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 const value_string snmp_Version_vals[] = {
@@ -1530,63 +1689,30 @@ static const value_string snmp_Version_vals[] = {
 static int
 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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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(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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+dissect_snmp_Community(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, tree, tvb, offset, hf_index,
                                        NULL);
 
   return offset;
 }
-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(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(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(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(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(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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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(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(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);
-}
 
 
 static const value_string snmp_T_error_status_vals[] = {
@@ -1616,13 +1742,10 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
-}
 
 
 
@@ -1632,177 +1755,80 @@ dissect_snmp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
 
   return offset;
 }
-static int dissect_valueType(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_valueType);
-}
 
-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);
-}
 
 
-static const ber_old_sequence_t VarBindList_sequence_of[1] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_VarBindList_item },
+static const ber_sequence_t VarBindList_sequence_of[1] = {
+  { &hf_snmp_VarBindList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_VarBind },
 };
 
 static int
 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_old_sequence_of(implicit_tag, actx, tree, tvb, offset,
-                                          VarBindList_sequence_of, hf_index, ett_snmp_VarBindList);
+  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(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);
-}
 
 
-static const ber_old_sequence_t PDU_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_request_id },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_error_status },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_error_index },
-  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_variable_bindings },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t PDU_sequence[] = {
+  { &hf_snmp_request_id     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER },
+  { &hf_snmp_error_status   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_error_status },
+  { &hf_snmp_error_index    , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER },
+  { &hf_snmp_variable_bindings, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_VarBindList },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       PDU_sequence, hf_index, ett_snmp_PDU);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   PDU_sequence, hf_index, ett_snmp_PDU);
 
   return offset;
 }
 
 
 
-
-static int
-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;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
-
-  return offset;
-}
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 52 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
+dissect_snmp_GetRequest_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 0, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 67 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
+dissect_snmp_GetNextRequest_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 1, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 82 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
-
+dissect_snmp_GetResponse_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 2, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
+dissect_snmp_SetRequest_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 3, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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(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);
-}
 
 
-static const value_string snmp_T_generic_trap_vals[] = {
+static const value_string snmp_GenericTrap_vals[] = {
   {   0, "coldStart" },
   {   1, "warmStart" },
   {   2, "linkDown" },
@@ -1815,31 +1841,9 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+dissect_snmp_GenericTrap(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, tree, tvb, offset, hf_index,
-                                  NULL);
-
-  return offset;
-}
-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);
-}
-
-
-static const ber_old_sequence_t Trap_PDU_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_enterprise },
-  { BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_agent_addr },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_generic_trap },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_specific_trap },
-  { BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_time_stamp },
-  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_variable_bindings },
-  { 0, 0, 0, NULL }
-};
-
-static int
-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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       Trap_PDU_sequence, hf_index, ett_snmp_Trap_PDU);
+                                                &generic_trap);
 
   return offset;
 }
@@ -1847,71 +1851,47 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 98 "snmp.cnf"
gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
guint32 len1;
+dissect_snmp_SpecificTrap(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 48 "snmp.cnf"
 guint specific_trap;
+  
+  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
                                               &specific_trap);
 
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, actx, tree, hf_index);
 
+  if (generic_trap == 6) { /* enterprise specific */
+    const gchar *specific_str = snmp_lookup_specific_trap (specific_trap);
+    if (specific_str) {
+      proto_item_append_text(actx->created_item, " (%s)", specific_str);
+    }
+  }
 
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
 
-  return offset;
-}
-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(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(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);
-}
-
-
-static const ber_old_sequence_t BulkPDU_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_bulkPDU_request_id },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_non_repeaters },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_max_repetitions },
-  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_variable_bindings },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t Trap_PDU_U_sequence[] = {
+  { &hf_snmp_enterprise     , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_snmp_EnterpriseOID },
+  { &hf_snmp_agent_addr     , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_snmp_NetworkAddress },
+  { &hf_snmp_generic_trap   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_GenericTrap },
+  { &hf_snmp_specific_trap  , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_SpecificTrap },
+  { &hf_snmp_time_stamp     , BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_snmp_TimeTicks },
+  { &hf_snmp_variable_bindings, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_VarBindList },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
-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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       BulkPDU_sequence, hf_index, ett_snmp_BulkPDU);
+dissect_snmp_Trap_PDU_U(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 40 "snmp.cnf"
+  generic_trap = 0;
+  enterprise_oid = NULL;
 
-  return offset;
-}
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   Trap_PDU_U_sequence, hf_index, ett_snmp_Trap_PDU_U);
 
 
 
-static int
-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;
 }
@@ -1919,71 +1899,46 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 113 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_GetBulkRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
+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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 4, TRUE, dissect_snmp_Trap_PDU_U);
 
   return offset;
 }
-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_, 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);
+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, tree, tvb, offset, hf_index,
+                                                NULL);
 
   return offset;
 }
 
 
+static const ber_sequence_t BulkPDU_sequence[] = {
+  { &hf_snmp_bulkPDU_request_id, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_Integer32 },
+  { &hf_snmp_non_repeaters  , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER_0_2147483647 },
+  { &hf_snmp_max_repetitions, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER_0_2147483647 },
+  { &hf_snmp_variable_bindings, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_VarBindList },
+  { NULL, 0, 0, 0, NULL }
+};
 
 static int
-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;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_InformRequest_PDU(TRUE, tvb, offset, actx, tree, hf_index);
-
-
+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;
 }
-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_, 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);
+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_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 5, TRUE, dissect_snmp_BulkPDU);
 
   return offset;
 }
@@ -1991,35 +1946,19 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 143 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_SNMPv2_Trap_PDU(TRUE, tvb, offset, actx, 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_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 6, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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_, 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);
+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_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 7, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
@@ -2027,29 +1966,12 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 158 "snmp.cnf"
- gint8 class;
- gboolean pc, ind_field;
- gint32 tag;
- guint32 len1;
-
- if(!implicit_tag){
-   /* XXX  asn2wrs can not yet handle tagged assignment yes so this
-    * XXX is some conformance file magic to work around that bug
-    */
-    offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
-    offset = get_ber_length(tvb, offset, &len1, &ind_field);
- }
- offset = dissect_snmp_Report_PDU(TRUE, tvb, offset, actx, 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_ber_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_CON, 8, TRUE, dissect_snmp_PDU);
 
   return offset;
 }
-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);
-}
 
 
 static const value_string snmp_PDUs_vals[] = {
@@ -2065,57 +1987,61 @@ static const value_string snmp_PDUs_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t PDUs_choice[] = {
-  {   0, BER_CLASS_CON, 0, BER_FLAGS_NOOWNTAG, dissect_get_request },
-  {   1, BER_CLASS_CON, 1, BER_FLAGS_NOOWNTAG, dissect_get_next_request },
-  {   2, BER_CLASS_CON, 2, BER_FLAGS_NOOWNTAG, dissect_get_response },
-  {   3, BER_CLASS_CON, 3, BER_FLAGS_NOOWNTAG, dissect_set_request },
-  {   4, BER_CLASS_CON, 4, BER_FLAGS_NOOWNTAG, dissect_trap },
-  {   5, BER_CLASS_CON, 5, BER_FLAGS_NOOWNTAG, dissect_getBulkRequest },
-  {   6, BER_CLASS_CON, 6, BER_FLAGS_NOOWNTAG, dissect_informRequest },
-  {   7, BER_CLASS_CON, 7, BER_FLAGS_NOOWNTAG, dissect_sNMPv2_Trap },
-  {   8, BER_CLASS_CON, 8, BER_FLAGS_NOOWNTAG, dissect_report },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t PDUs_choice[] = {
+  {   0, &hf_snmp_get_request    , BER_CLASS_CON, 0, BER_FLAGS_NOOWNTAG, dissect_snmp_GetRequest_PDU },
+  {   1, &hf_snmp_get_next_request, BER_CLASS_CON, 1, BER_FLAGS_NOOWNTAG, dissect_snmp_GetNextRequest_PDU },
+  {   2, &hf_snmp_get_response   , BER_CLASS_CON, 2, BER_FLAGS_NOOWNTAG, dissect_snmp_GetResponse_PDU },
+  {   3, &hf_snmp_set_request    , BER_CLASS_CON, 3, BER_FLAGS_NOOWNTAG, dissect_snmp_SetRequest_PDU },
+  {   4, &hf_snmp_trap           , BER_CLASS_CON, 4, BER_FLAGS_NOOWNTAG, dissect_snmp_Trap_PDU },
+  {   5, &hf_snmp_getBulkRequest , BER_CLASS_CON, 5, BER_FLAGS_NOOWNTAG, dissect_snmp_GetBulkRequest_PDU },
+  {   6, &hf_snmp_informRequest  , BER_CLASS_CON, 6, BER_FLAGS_NOOWNTAG, dissect_snmp_InformRequest_PDU },
+  {   7, &hf_snmp_sNMPv2_Trap    , BER_CLASS_CON, 7, BER_FLAGS_NOOWNTAG, dissect_snmp_SNMPv2_Trap_PDU },
+  {   8, &hf_snmp_report         , BER_CLASS_CON, 8, BER_FLAGS_NOOWNTAG, dissect_snmp_Report_PDU },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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;
+#line 28 "snmp.cnf"
+gint pdu_type=-1;
 
-  offset = dissect_ber_old_choice(actx, tree, tvb, offset,
-                                     PDUs_choice, hf_index, ett_snmp_PDUs,
-                                     &pdu_type);
+  col_clear(actx->pinfo->cinfo, COL_INFO);
 
-       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)"));
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 PDUs_choice, hf_index, ett_snmp_PDUs,
+                                 &pdu_type);
+
+  if( (pdu_type!=-1) && snmp_PDUs_vals[pdu_type].strptr ){
+       col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "%s", snmp_PDUs_vals[pdu_type].strptr);
+  }
 
 
 
   return offset;
 }
-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(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(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);
-}
 
 
-static const ber_old_sequence_t Message_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_community },
-  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_data },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t Message_sequence[] = {
+  { &hf_snmp_version        , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_Version },
+  { &hf_snmp_community      , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_Community },
+  { &hf_snmp_data           , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_snmp_PDUs },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       Message_sequence, hf_index, ett_snmp_Message);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   Message_sequence, hf_index, ett_snmp_Message);
+
+  return offset;
+}
+
+
+
+static int
+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, tree, tvb, offset, hf_index,
+                                       NULL);
 
   return offset;
 }
@@ -2127,52 +2053,66 @@ static const value_string snmp_T_datav2u_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t T_datav2u_choice[] = {
-  {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_v2u_plaintext },
-  {   1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t T_datav2u_choice[] = {
+  {   0, &hf_snmp_v2u_plaintext  , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_snmp_PDUs },
+  {   1, &hf_snmp_encrypted      , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_OCTET_STRING },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_choice(actx, tree, tvb, offset,
-                                     T_datav2u_choice, hf_index, ett_snmp_T_datav2u,
-                                     NULL);
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 T_datav2u_choice, hf_index, ett_snmp_T_datav2u,
+                                 NULL);
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t Messagev2u_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_parameters },
-  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_datav2u },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t Messagev2u_sequence[] = {
+  { &hf_snmp_version        , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_Version },
+  { &hf_snmp_parameters     , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_OCTET_STRING },
+  { &hf_snmp_datav2u        , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_snmp_T_datav2u },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       Messagev2u_sequence, hf_index, ett_snmp_Messagev2u);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   Messagev2u_sequence, hf_index, ett_snmp_Messagev2u);
 
   return offset;
 }
 
 
 
+static int
+dissect_snmp_SnmpEngineID(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 99 "snmp.cnf"
+       tvbuff_t* param_tvb = NULL;
+
+       offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
+                                       &param_tvb);
+        if (param_tvb) {
+               proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
+               dissect_snmp_engineid(engine_tree, param_tvb, 0, tvb_length_remaining(param_tvb,0));
+       }
+
+
+
+  return offset;
+}
+
+
 
 static int
 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;
+#line 90 "snmp.cnf"
 
   offset = dissect_ber_octet_string(implicit_tag, actx, 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);
+        if (usm_p.engine_tvb) {
+               proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
                dissect_snmp_engineid(engine_tree, usm_p.engine_tvb, 0, tvb_length_remaining(usm_p.engine_tvb,0));
        }
 
@@ -2180,35 +2120,26 @@ dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  &usm_p.boots);
+                                                &usm_p.boots);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  &usm_p.time);
+                                                &usm_p.time);
 
   return offset;
 }
-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);
-}
 
 
 
@@ -2219,27 +2150,21 @@ dissect_snmp_T_msgUserName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 198 "snmp.cnf"
+#line 112 "snmp.cnf"
        offset = dissect_ber_octet_string(FALSE, actx, 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);
+               usm_p.auth_item = actx->created_item;
+               usm_p.auth_offset = tvb_offset_from_real_beginning(usm_p.auth_tvb);
        }
 
 
   return offset;
 }
-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);
-}
 
 
 
@@ -2250,25 +2175,22 @@ dissect_snmp_T_msgPrivacyParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t UsmSecurityParameters_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgAuthoritativeEngineID },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgAuthoritativeEngineBoots },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgAuthoritativeEngineTime },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgUserName },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgAuthenticationParameters },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgPrivacyParameters },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t UsmSecurityParameters_sequence[] = {
+  { &hf_snmp_msgAuthoritativeEngineID, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgAuthoritativeEngineID },
+  { &hf_snmp_msgAuthoritativeEngineBoots, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgAuthoritativeEngineBoots },
+  { &hf_snmp_msgAuthoritativeEngineTime, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgAuthoritativeEngineTime },
+  { &hf_snmp_msgUserName    , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgUserName },
+  { &hf_snmp_msgAuthenticationParameters, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgAuthenticationParameters },
+  { &hf_snmp_msgPrivacyParameters, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgPrivacyParameters },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       UsmSecurityParameters_sequence, hf_index, ett_snmp_UsmSecurityParameters);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   UsmSecurityParameters_sequence, hf_index, ett_snmp_UsmSecurityParameters);
 
   return offset;
 }
@@ -2278,19 +2200,16 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 317 "snmp.cnf"
+#line 227 "snmp.cnf"
        tvbuff_t *parameter_tvb = NULL;
 
    offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@@ -2298,7 +2217,7 @@ dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
 
  if (parameter_tvb){
        guint8 v3_flags = tvb_get_guint8(parameter_tvb, 0);
-       proto_tree* flags_tree = proto_item_add_subtree(get_ber_last_created_item(),ett_msgFlags);
+       proto_tree* flags_tree = proto_item_add_subtree(actx->created_item,ett_msgFlags);
        
        proto_tree_add_item(flags_tree, hf_snmp_v3_flags_report, parameter_tvb, 0, 1, FALSE);
        proto_tree_add_item(flags_tree, hf_snmp_v3_flags_crypt, parameter_tvb, 0, 1, FALSE);
@@ -2313,48 +2232,39 @@ dissect_snmp_T_msgFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  &MsgSecurityModel);
+                                                &MsgSecurityModel);
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t HeaderData_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgID },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgMaxSize },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgFlags },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgSecurityModel },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t HeaderData_sequence[] = {
+  { &hf_snmp_msgID          , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER_0_2147483647 },
+  { &hf_snmp_msgMaxSize     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER_484_2147483647 },
+  { &hf_snmp_msgFlags       , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgFlags },
+  { &hf_snmp_msgSecurityModel, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgSecurityModel },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       HeaderData_sequence, hf_index, ett_snmp_HeaderData);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   HeaderData_sequence, hf_index, ett_snmp_HeaderData);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 260 "snmp.cnf"
+#line 170 "snmp.cnf"
 
        switch(MsgSecurityModel){
                case SNMP_SEC_USM:      /* 3 */         
@@ -2375,34 +2285,28 @@ dissect_snmp_T_msgSecurityParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t ScopedPDU_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_contextEngineID },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_contextName },
-  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_data },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t ScopedPDU_sequence[] = {
+  { &hf_snmp_contextEngineID, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_SnmpEngineID },
+  { &hf_snmp_contextName    , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_OCTET_STRING },
+  { &hf_snmp_data           , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_snmp_PDUs },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       ScopedPDU_sequence, hf_index, ett_snmp_ScopedPDU);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   ScopedPDU_sequence, hf_index, ett_snmp_ScopedPDU);
 
   return offset;
 }
-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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 207 "snmp.cnf"
+#line 121 "snmp.cnf"
        tvbuff_t* crypt_tvb;
        offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_snmp_encryptedPDU, &crypt_tvb);
 
@@ -2411,7 +2315,7 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
                && usm_p.user_assoc->user.privProtocol ) {
                
                const gchar* error = NULL;
-               proto_tree* encryptedpdu_tree = proto_item_add_subtree(get_ber_last_created_item(),ett_encryptedPDU);
+               proto_tree* encryptedpdu_tree = proto_item_add_subtree(actx->created_item,ett_encryptedPDU);
                tvbuff_t* cleartext_tvb = usm_p.user_assoc->user.privProtocol(&usm_p, crypt_tvb, &error );
 
                if (! cleartext_tvb) {
@@ -2421,8 +2325,7 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
                        expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN,
                                "Failed to decrypt encryptedPDU: %s", error);
 
-                       if (check_col(actx->pinfo->cinfo, COL_INFO))
-                               col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Failed to decrypt");
+                       col_set_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Failed to decrypt");
                                
                        return offset;
                } else {
@@ -2431,37 +2334,31 @@ dissect_snmp_T_encryptedPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
 
                        if (! check_ScopedPdu(cleartext_tvb)) {
                                proto_item* cause = proto_tree_add_text(encryptedpdu_tree, cleartext_tvb, 0, -1,
-                                                                                       "Decrypted data not formated as expected, wrong key?");
+                                                                                       "Decrypted data not formatted as expected, wrong key?");
                                
                                expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN,
-                                                                          "Decrypted data not formated as expected");
+                                                                          "Decrypted data not formatted as expected");
 
-                               if (check_col(actx->pinfo->cinfo, COL_INFO))
-                                       col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Decrypted data not formated as expected");
+                               col_set_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Decrypted data not formatted as expected");
                                
                                return offset;
                        }
 
                        
             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, actx, decrypted_tree, -1);
                 }
        } else {
-                       if (check_col(actx->pinfo->cinfo, COL_INFO))
-                               col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: privKey Unknown");
+                       col_set_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: privKey Unknown");
        }
 
 
 
   return offset;
 }
-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);
-}
 
 
 static const value_string snmp_ScopedPduData_vals[] = {
@@ -2470,39 +2367,36 @@ static const value_string snmp_ScopedPduData_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t ScopedPduData_choice[] = {
-  {   0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_plaintext },
-  {   1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedPDU },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t ScopedPduData_choice[] = {
+  {   0, &hf_snmp_plaintext      , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_ScopedPDU },
+  {   1, &hf_snmp_encryptedPDU   , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_encryptedPDU },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_choice(actx, tree, tvb, offset,
-                                     ScopedPduData_choice, hf_index, ett_snmp_ScopedPduData,
-                                     NULL);
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 ScopedPduData_choice, hf_index, ett_snmp_ScopedPduData,
+                                 NULL);
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t SNMPv3Message_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_msgVersion },
-  { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_msgGlobalData },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_msgSecurityParameters },
-  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_msgData },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t SNMPv3Message_sequence[] = {
+  { &hf_snmp_msgVersion     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_Version },
+  { &hf_snmp_msgGlobalData  , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_snmp_HeaderData },
+  { &hf_snmp_msgSecurityParameters, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_T_msgSecurityParameters },
+  { &hf_snmp_msgData        , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_snmp_ScopedPduData },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       SNMPv3Message_sequence, hf_index, ett_snmp_SNMPv3Message);
+  offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
+                                   SNMPv3Message_sequence, hf_index, ett_snmp_SNMPv3Message);
 
-#line 275 "snmp.cnf"
+#line 185 "snmp.cnf"
 
        if( usm_p.authenticated
                && usm_p.user_assoc
@@ -2516,27 +2410,27 @@ dissect_snmp_SNMPv3Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
                usm_p.authOK = usm_p.user_assoc->user.authModel->authenticate( &usm_p, &calc_auth, &calc_auth_len, &error );
 
                if (error) {
-                       authen_item = proto_tree_add_text(authen_tree,tvb,0,0,"Error while verifying Messsage authenticity: %s", error);
+                       authen_item = proto_tree_add_text(authen_tree,tvb,0,0,"Error while verifying Message authenticity: %s", error);
                        PROTO_ITEM_SET_GENERATED(authen_item);
-                       expert_add_info_format( actx->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 Message authenticity: %s", error );
                } else {
                        int severity;
-                       gchar* fmt;                     
+                       gchar* msg;                     
 
                        authen_item = proto_tree_add_boolean(authen_tree, hf_snmp_msgAuthentication, tvb, 0, 0, usm_p.authOK);
                        PROTO_ITEM_SET_GENERATED(authen_item);
                        
                        if (usm_p.authOK) {
-                               fmt = "SNMP Authentication OK";
+                               msg = "SNMP Authentication OK";
                                severity = PI_CHAT;
                        } else {
                                gchar* calc_auth_str = bytestring_to_str(calc_auth,calc_auth_len,' ');
-                               proto_item_append_text(authen_item, " calcuated = %s", calc_auth_str);
-                               fmt = "SNMP Authentication Error";
+                               proto_item_append_text(authen_item, " calculated = %s", calc_auth_str);
+                               msg = "SNMP Authentication Error";
                                severity = PI_WARN;
                        }
 
-                       expert_add_info_format( actx->pinfo, authen_item, PI_CHECKSUM, severity, fmt );
+                       expert_add_info_format( actx->pinfo, authen_item, PI_CHECKSUM, severity, "%s", msg );
                }
        }
 
@@ -2554,12 +2448,18 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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_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, tree, tvb, offset, hf_index, NULL);
+
+  return offset;
 }
 
 
@@ -2571,28 +2471,32 @@ dissect_snmp_DisplayString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t SimpleOpen_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_smux_version },
-  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_identity },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_description },
-  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_password },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t SimpleOpen_U_sequence[] = {
+  { &hf_snmp_smux_version   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_smux_version },
+  { &hf_snmp_identity       , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_snmp_OBJECT_IDENTIFIER },
+  { &hf_snmp_description    , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_DisplayString },
+  { &hf_snmp_password       , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_snmp_OCTET_STRING },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
-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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       SimpleOpen_sequence, hf_index, ett_snmp_SimpleOpen);
+dissect_snmp_SimpleOpen_U(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_U_sequence, hf_index, ett_snmp_SimpleOpen_U);
 
   return offset;
 }
-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);
+
+
+
+static int
+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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 0, TRUE, dissect_snmp_SimpleOpen_U);
+
+  return offset;
 }
 
 
@@ -2601,25 +2505,22 @@ static const value_string snmp_OpenPDU_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t OpenPDU_choice[] = {
-  {   0, BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_smux_simple },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t OpenPDU_choice[] = {
+  {   0, &hf_snmp_smux_simple    , BER_CLASS_APP, 0, BER_FLAGS_NOOWNTAG, dissect_snmp_SimpleOpen },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_choice(actx, tree, tvb, offset,
-                                     OpenPDU_choice, hf_index, ett_snmp_OpenPDU,
-                                     NULL);
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 OpenPDU_choice, hf_index, ett_snmp_OpenPDU,
+                                 NULL);
 
   return offset;
 }
-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);
-}
 
 
-static const value_string snmp_ClosePDU_vals[] = {
+static const value_string snmp_ClosePDU_U_vals[] = {
   {   0, "goingDown" },
   {   1, "unsupportedVersion" },
   {   2, "packetFormat" },
@@ -2631,14 +2532,21 @@ static const value_string snmp_ClosePDU_vals[] = {
 
 
 static int
-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_) {
+dissect_snmp_ClosePDU_U(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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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_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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 1, TRUE, dissect_snmp_ClosePDU_U);
+
+  return offset;
 }
 
 
@@ -2646,13 +2554,10 @@ static int dissect_close(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_
 static int
 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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
-}
 
 
 static const value_string snmp_T_operation_vals[] = {
@@ -2666,49 +2571,60 @@ 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_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
-}
 
 
-static const ber_old_sequence_t RReqPDU_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_subtree },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_priority },
-  { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_operation },
-  { 0, 0, 0, NULL }
+static const ber_sequence_t RReqPDU_U_sequence[] = {
+  { &hf_snmp_subtree        , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_snmp_ObjectName },
+  { &hf_snmp_priority       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_INTEGER_M1_2147483647 },
+  { &hf_snmp_operation      , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_snmp_T_operation },
+  { NULL, 0, 0, 0, NULL }
 };
 
 static int
-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_old_sequence(implicit_tag, actx, tree, tvb, offset,
-                                       RReqPDU_sequence, hf_index, ett_snmp_RReqPDU);
+dissect_snmp_RReqPDU_U(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_U_sequence, hf_index, ett_snmp_RReqPDU_U);
 
   return offset;
 }
-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);
+
+
+
+static int
+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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 2, TRUE, dissect_snmp_RReqPDU_U);
+
+  return offset;
 }
 
 
-static const value_string snmp_RRspPDU_vals[] = {
+static const value_string snmp_RRspPDU_U_vals[] = {
   {  -1, "failure" },
   { 0, NULL }
 };
 
 
 static int
-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_) {
+dissect_snmp_RRspPDU_U(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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
+
+
+
+static int
+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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 3, TRUE, dissect_snmp_RRspPDU_U);
+
+  return offset;
 }
 
 
@@ -2718,26 +2634,23 @@ static const value_string snmp_RegisterResponse_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t RegisterResponse_choice[] = {
-  {   0, BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_rRspPDU },
-  {   1, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_pDUs },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t RegisterResponse_choice[] = {
+  {   0, &hf_snmp_rRspPDU        , BER_CLASS_APP, 3, BER_FLAGS_NOOWNTAG, dissect_snmp_RRspPDU },
+  {   1, &hf_snmp_pDUs           , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_snmp_PDUs },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_choice(actx, tree, tvb, offset,
-                                     RegisterResponse_choice, hf_index, ett_snmp_RegisterResponse,
-                                     NULL);
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 RegisterResponse_choice, hf_index, ett_snmp_RegisterResponse,
+                                 NULL);
 
   return offset;
 }
-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);
-}
 
 
-static const value_string snmp_SOutPDU_vals[] = {
+static const value_string snmp_SOutPDU_U_vals[] = {
   {   0, "commit" },
   {   1, "rollback" },
   { 0, NULL }
@@ -2745,14 +2658,21 @@ static const value_string snmp_SOutPDU_vals[] = {
 
 
 static int
-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_) {
+dissect_snmp_SOutPDU_U(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, tree, tvb, offset, hf_index,
-                                  NULL);
+                                                NULL);
 
   return offset;
 }
-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);
+
+
+
+static int
+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_tagged_type(implicit_tag, actx, tree, tvb, offset,
+                                      hf_index, BER_CLASS_APP, 4, TRUE, dissect_snmp_SOutPDU_U);
+
+  return offset;
 }
 
 
@@ -2765,20 +2685,20 @@ static const value_string snmp_SMUX_PDUs_vals[] = {
   { 0, NULL }
 };
 
-static const ber_old_choice_t SMUX_PDUs_choice[] = {
-  {   0, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_open },
-  {   1, BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_close },
-  {   2, BER_CLASS_APP, 2, BER_FLAGS_NOOWNTAG, dissect_registerRequest },
-  {   3, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_registerResponse },
-  {   4, BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_commitOrRollback },
-  { 0, 0, 0, 0, NULL }
+static const ber_choice_t SMUX_PDUs_choice[] = {
+  {   0, &hf_snmp_open           , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_snmp_OpenPDU },
+  {   1, &hf_snmp_close          , BER_CLASS_APP, 1, BER_FLAGS_NOOWNTAG, dissect_snmp_ClosePDU },
+  {   2, &hf_snmp_registerRequest, BER_CLASS_APP, 2, BER_FLAGS_NOOWNTAG, dissect_snmp_RReqPDU },
+  {   3, &hf_snmp_registerResponse, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_snmp_RegisterResponse },
+  {   4, &hf_snmp_commitOrRollback, BER_CLASS_APP, 4, BER_FLAGS_NOOWNTAG, dissect_snmp_SOutPDU },
+  { 0, NULL, 0, 0, 0, NULL }
 };
 
 static int
 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_old_choice(actx, tree, tvb, offset,
-                                     SMUX_PDUs_choice, hf_index, ett_snmp_SMUX_PDUs,
-                                     NULL);
+  offset = dissect_ber_choice(actx, tree, tvb, offset,
+                                 SMUX_PDUs_choice, hf_index, ett_snmp_SMUX_PDUs,
+                                 NULL);
 
   return offset;
 }
@@ -2793,12 +2713,12 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
 
 
 /*--- End of included file: packet-snmp-fn.c ---*/
-#line 1358 "packet-snmp-template.c"
+#line 1493 "packet-snmp-template.c"
 
 
 guint
 dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
-    proto_tree *tree, int proto, gint ett, gboolean is_tcp)
+                proto_tree *tree, int proto, gint ett, gboolean is_tcp)
 {
 
        guint length_remaining;
@@ -2809,6 +2729,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint message_length;
        int start_offset = offset;
        guint32 version = 0;
+       tvbuff_t        *next_tvb;
 
        proto_tree *snmp_tree = NULL;
        proto_item *item = NULL;
@@ -2817,7 +2738,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
        usm_p.msg_tvb = tvb;
-       usm_p.start_offset = offset_from_real_beginning(tvb,0) ;
+       usm_p.start_offset = tvb_offset_from_real_beginning(tvb);
        usm_p.engine_tvb = NULL;
        usm_p.user_tvb = NULL;
        usm_p.auth_item = NULL;
@@ -2856,7 +2777,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
                 * This is TCP, and we should, and can, do reassembly.
                 *
                 * Is the "Sequence Of" header split across segment
-                * boundaries?  We requre at least 6 bytes for the
+                * boundaries?  We require at least 6 bytes for the
                 * header, which allows for a 4-byte length (ASN.1
                 * BER).
                 */
@@ -2877,11 +2798,13 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
         * OK, try to read the "Sequence Of" header; this gets the total
         * length of the SNMP message.
         */
-       /* Set tree to 0 to not display internakl BER fields if option used.*/
+       /* Set tree to 0 to not display internal BER fields if option used.*/
        offset = dissect_ber_identifier(pinfo, 0, tvb, offset, &class, &pc, &tag);
+       /*Get the total octet length of the SNMP data*/
        offset = dissect_ber_length(pinfo, 0, tvb, offset, &len, &ind);
-
        message_length = len + 2;
+
+       /*Get the SNMP version data*/
        offset = dissect_ber_integer(FALSE, &asn1_ctx, 0, tvb, offset, -1, &version);
 
 
@@ -2902,7 +2825,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
                         */
                        pinfo->desegment_offset = start_offset;
                        pinfo->desegment_len =
-                           message_length - length_remaining;
+                       message_length - length_remaining;
 
                        /*
                         * Return 0, which means "I didn't dissect anything
@@ -2915,18 +2838,16 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        next_tvb_init(&var_list);
 
-       if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
-               col_set_str(pinfo->cinfo, COL_PROTOCOL,
-                   proto_get_protocol_short_name(find_protocol_by_id(proto)));
-       }
+       col_set_str(pinfo->cinfo, COL_PROTOCOL,
+           proto_get_protocol_short_name(find_protocol_by_id(proto)));
 
        if (tree) {
-               item = proto_tree_add_item(tree, proto, tvb, offset,
-                   message_length, FALSE);
+               item = proto_tree_add_item(tree, proto, tvb, start_offset,
+                                          message_length, FALSE);
                snmp_tree = proto_item_add_subtree(item, ett);
        }
 
-       switch (version){
+       switch (version) {
        case 0: /* v1 */
        case 1: /* v2c */
                offset = dissect_snmp_Message(FALSE , tvb, start_offset, &asn1_ctx, snmp_tree, -1);
@@ -2949,7 +2870,15 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
                break;
        }
 
-       next_tvb_call(&var_list, pinfo, tree, NULL, data_handle);
+       /* There may be appended data after the SNMP data, so treat as raw
+        * data which needs to be dissected in case of UDP as UDP is PDU oriented.
+        */
+       if((!is_tcp) && (length_remaining > (guint)offset)) {
+               next_tvb = tvb_new_subset_remaining(tvb, offset);
+               call_dissector(data_handle, next_tvb, pinfo, tree);
+       } else {
+               next_tvb_call(&var_list, pinfo, tree, NULL, data_handle);
+       }
 
        return offset;
 }
@@ -2976,17 +2905,27 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         */
        /* SNMP starts with a SEQUENCE */
        offset = get_ber_identifier(tvb, 0, &tmp_class, &tmp_pc, &tmp_tag);
-       if((tmp_class!=BER_CLASS_UNI)||(tmp_tag!=BER_UNI_TAG_SEQUENCE)){
+       if((tmp_class!=BER_CLASS_UNI)||(tmp_tag!=BER_UNI_TAG_SEQUENCE)) {
                return 0;
        }
        /* then comes a length which spans the rest of the tvb */
        offset = get_ber_length(tvb, offset, &tmp_length, &tmp_ind);
-       if(tmp_length!=(guint32)tvb_reported_length_remaining(tvb, offset)){
-               return 0;
+       /* if(tmp_length!=(guint32)tvb_reported_length_remaining(tvb, offset)) {
+        * Losen the heuristic a bit to handle the case where data has intentionally
+        * been added after the snmp PDU ( UDP case)
+        */
+       if ( pinfo->ptype == PT_UDP ) {
+               if(tmp_length>(guint32)tvb_reported_length_remaining(tvb, offset)) {
+                       return 0;
+               }
+       }else{
+               if(tmp_length!=(guint32)tvb_reported_length_remaining(tvb, offset)) {
+                       return 0;
+               }
        }
        /* then comes an INTEGER (version)*/
        offset = get_ber_identifier(tvb, offset, &tmp_class, &tmp_pc, &tmp_tag);
-       if((tmp_class!=BER_CLASS_UNI)||(tmp_tag!=BER_UNI_TAG_INTEGER)){
+       if((tmp_class!=BER_CLASS_UNI)||(tmp_tag!=BER_UNI_TAG_INTEGER)) {
                return 0;
        }
        /* do we need to test that version is 0 - 2 (version1-3) ? */
@@ -3013,7 +2952,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        if (pinfo->destport == UDP_PORT_SNMP) {
          conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
                                           pinfo->srcport, 0, NO_PORT_B);
-         if( (conversation == NULL) || (conversation->dissector_handle!=snmp_handle) ){
+         if( (conversation == NULL) || (conversation->dissector_handle!=snmp_handle) ) {
            conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, PT_UDP,
                                            pinfo->srcport, 0, NO_PORT2);
            conversation_set_dissector(conversation, snmp_handle);
@@ -3022,6 +2961,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        return dissect_snmp_pdu(tvb, 0, pinfo, tree, proto_snmp, ett_snmp, FALSE);
 }
+
 static void
 dissect_snmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -3030,7 +2970,7 @@ dissect_snmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        while (tvb_reported_length_remaining(tvb, offset) > 0) {
                message_len = dissect_snmp_pdu(tvb, 0, pinfo, tree,
-                   proto_snmp, ett_snmp, TRUE);
+                                              proto_snmp, ett_snmp, TRUE);
                if (message_len == 0) {
                        /*
                         * We don't have all the data for that message,
@@ -3049,8 +2989,9 @@ dissect_smux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_tree *smux_tree = NULL;
        proto_item *item = NULL;
 
-       if (check_col(pinfo->cinfo, COL_PROTOCOL))
-               col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMUX");
+       next_tvb_init(&var_list);
+
+       col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMUX");
 
        if (tree) {
                item = proto_tree_add_item(tree, proto_smux, tvb, 0, -1, FALSE);
@@ -3065,11 +3006,11 @@ dissect_smux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   MD5 Password to Key Algorithm
   from RFC 3414 A.2.1
 */
-static void snmp_usm_password_to_key_md5(const guint8 *password,
-                                                                 guint   passwordlen,
-                                                                 const guint8 *engineID,
-                                                                 guint   engineLength,
-                                                                 guint8 *key)  {
+static void
+snmp_usm_password_to_key_md5(const guint8 *password, guint passwordlen,
+                            const guint8 *engineID, guint   engineLength,
+                            guint8 *key)
+{
        md5_state_t     MD;
        guint8     *cp, password_buf[64];
        guint32      password_index = 0;
@@ -3117,11 +3058,11 @@ static void snmp_usm_password_to_key_md5(const guint8 *password,
    SHA1 Password to Key Algorithm COPIED from RFC 3414 A.2.2
  */
 
-static void snmp_usm_password_to_key_sha1(const guint8 *password,
-                                                                  guint   passwordlen,
-                                                                  const guint8 *engineID,
-                                                                  guint   engineLength,
-                                                                  guint8 *key ) {
+static void
+snmp_usm_password_to_key_sha1(const guint8 *password, guint passwordlen,
+                             const guint8 *engineID, guint engineLength,
+                             guint8 *key)
+{
        sha1_context     SH;
        guint8     *cp, password_buf[72];
        guint32      password_index = 0;
@@ -3163,9 +3104,14 @@ static void snmp_usm_password_to_key_sha1(const guint8 *password,
  }
 
 
-static void process_prefs(void) {}
+static void
+process_prefs(void)
+{
+}
 
-static void* snmp_users_copy_cb(void* dest, const void* orig, unsigned len _U_) {
+static void*
+snmp_users_copy_cb(void* dest, const void* orig, size_t len _U_)
+{
        const snmp_ue_assoc_t* o = orig;
        snmp_ue_assoc_t* d = dest;
 
@@ -3198,25 +3144,55 @@ static void* snmp_users_copy_cb(void* dest, const void* orig, unsigned len _U_)
        return d;
 }
 
-static void snmp_users_free_cb(void* p) {
+static void
+snmp_users_free_cb(void* p)
+{
        snmp_ue_assoc_t* ue = p;
-       if (ue->user.userName.data) g_free(ue->user.userName.data);
-       if (ue->user.authPassword.data) g_free(ue->user.authPassword.data);
-       if (ue->user.privPassword.data) g_free(ue->user.privPassword.data);
-       if (ue->user.authKey.data) g_free(ue->user.authKey.data);
-       if (ue->user.privKey.data) g_free(ue->user.privKey.data);
-       if (ue->engine.data) g_free(ue->engine.data);
+       g_free(ue->user.userName.data);
+       g_free(ue->user.authPassword.data);
+       g_free(ue->user.privPassword.data);
+       g_free(ue->user.authKey.data);
+       g_free(ue->user.privKey.data);
+       g_free(ue->engine.data);
 }
 
-static void snmp_users_update_cb(void* p _U_, const char** err) {
+static void
+snmp_users_update_cb(void* p _U_, const char** err)
+{
        snmp_ue_assoc_t* ue = p;
        GString* es = g_string_new("");
+       unsigned i;
 
        *err = NULL;
 
-       if (! ue->user.userName.len) g_string_append(es,"no userName, ");
-       if (ue->user.authPassword.len < 8) g_string_sprintfa(es,"short authPassword (%d), ", ue->user.authPassword.len);
-       if (ue->user.privPassword.len < 8) g_string_sprintfa(es,"short privPassword (%d), ", ue->user.privPassword.len);
+       if (num_ueas == 0)
+               /* Nothing to update */
+               return;
+
+       if (! ue->user.userName.len)
+               g_string_append_printf(es,"no userName\n");
+
+       for (i=0; i<num_ueas-1; i++) {
+               snmp_ue_assoc_t* u = &(ueas[i]);
+
+
+               if ( u->user.userName.len == ue->user.userName.len
+                       && u->engine.len == ue->engine.len ) {
+
+                       if (u->engine.len > 0 && memcmp( u->engine.data,   ue->engine.data,  u->engine.len ) == 0) {
+                               if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
+                                       /* XXX: make a string for the engineId */
+                                       g_string_append_printf(es,"duplicate key (userName='%s')\n",ue->user.userName.data);
+                               }
+                       }
+
+                       if (u->engine.len == 0) {
+                               if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) {
+                                       g_string_append_printf(es,"duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data);
+                               }
+                       }
+               }
+       }
 
        if (es->len) {
                g_string_truncate(es,es->len-2);
@@ -3228,6 +3204,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) {
        return;
 }
 
+
 UAT_LSTRING_CB_DEF(snmp_users,userName,snmp_ue_assoc_t,user.userName.data,user.userName.len)
 UAT_LSTRING_CB_DEF(snmp_users,authPassword,snmp_ue_assoc_t,user.authPassword.data,user.authPassword.len)
 UAT_LSTRING_CB_DEF(snmp_users,privPassword,snmp_ue_assoc_t,user.privPassword.data,user.privPassword.len)
@@ -3235,341 +3212,413 @@ UAT_BUFFER_CB_DEF(snmp_users,engine_id,snmp_ue_assoc_t,engine.data,engine.len)
 UAT_VS_DEF(snmp_users,auth_model,snmp_ue_assoc_t,0,"MD5")
 UAT_VS_DEF(snmp_users,priv_proto,snmp_ue_assoc_t,0,"DES")
 
+static void *
+snmp_specific_trap_copy_cb(void *dest, const void *orig, size_t len _U_)
+{
+       snmp_st_assoc_t *u = dest;
+       const snmp_st_assoc_t *o = orig;
+
+       u->enterprise = g_strdup(o->enterprise);
+       u->trap = o->trap;
+       u->desc = g_strdup(o->desc);
+
+       return dest;
+}
+
+static void
+snmp_specific_trap_free_cb(void *r)
+{
+       snmp_st_assoc_t *u = r;
+
+       g_free(u->enterprise);
+       g_free(u->desc);
+}
+
+UAT_CSTRING_CB_DEF(specific_traps, enterprise, snmp_st_assoc_t)
+UAT_DEC_CB_DEF(specific_traps, trap, snmp_st_assoc_t)
+UAT_CSTRING_CB_DEF(specific_traps, desc, snmp_st_assoc_t)
+
        /*--- proto_register_snmp -------------------------------------------*/
 void proto_register_snmp(void) {
   /* List of fields */
   static hf_register_info hf[] = {
                { &hf_snmp_v3_flags_auth,
                { "Authenticated", "snmp.v3.flags.auth", FT_BOOLEAN, 8,
-                   TFS(&flags_set_truth), TH_AUTH, "", HFILL }},
+                   TFS(&tfs_set_notset), TH_AUTH, NULL, HFILL }},
                { &hf_snmp_v3_flags_crypt,
                { "Encrypted", "snmp.v3.flags.crypt", FT_BOOLEAN, 8,
-                   TFS(&flags_set_truth), TH_CRYPT, "", HFILL }},
+                   TFS(&tfs_set_notset), TH_CRYPT, NULL, HFILL }},
                { &hf_snmp_v3_flags_report,
                { "Reportable", "snmp.v3.flags.report", FT_BOOLEAN, 8,
-                   TFS(&flags_set_truth), TH_REPORT, "", HFILL }},
+                   TFS(&tfs_set_notset), TH_REPORT, NULL, HFILL }},
                { &hf_snmp_engineid_conform, {
                    "Engine ID Conformance", "snmp.engineid.conform", FT_BOOLEAN, 8,
                    TFS(&tfs_snmp_engineid_conform), F_SNMP_ENGINEID_CONFORM, "Engine ID RFC3411 Conformance", HFILL }},
                { &hf_snmp_engineid_enterprise, {
-                   "Engine Enterprise ID", "snmp.engineid.enterprise", FT_UINT32, BASE_DEC,
-                   VALS(sminmpec_values), 0, "Engine Enterprise ID", HFILL }},
+                   "Engine Enterprise ID", "snmp.engineid.enterprise", FT_UINT32, BASE_DEC|BASE_EXT_STRING,
+                   &sminmpec_values_ext, 0, NULL, HFILL }},
                { &hf_snmp_engineid_format, {
                    "Engine ID Format", "snmp.engineid.format", FT_UINT8, BASE_DEC,
-                   VALS(snmp_engineid_format_vals), 0, "Engine ID Format", HFILL }},
+                   VALS(snmp_engineid_format_vals), 0, NULL, HFILL }},
                { &hf_snmp_engineid_ipv4, {
                    "Engine ID Data: IPv4 address", "snmp.engineid.ipv4", FT_IPv4, BASE_NONE,
-                   NULL, 0, "Engine ID Data: IPv4 address", HFILL }},
+                   NULL, 0, NULL, HFILL }},
                { &hf_snmp_engineid_ipv6, {
                    "Engine ID Data: IPv6 address", "snmp.engineid.ipv6", FT_IPv6, BASE_NONE,
-                   NULL, 0, "Engine ID Data: IPv6 address", HFILL }},
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_engineid_cisco_type, {
+                   "Engine ID Data: Cisco type", "snmp.engineid.cisco.type", FT_UINT8, BASE_NONE,
+                   VALS(snmp_engineid_cisco_type_vals), 0, NULL, HFILL }},
                { &hf_snmp_engineid_mac, {
                    "Engine ID Data: MAC address", "snmp.engineid.mac", FT_ETHER, BASE_NONE,
-                   NULL, 0, "Engine ID Data: MAC address", HFILL }},
+                   NULL, 0, NULL, HFILL }},
                { &hf_snmp_engineid_text, {
                    "Engine ID Data: Text", "snmp.engineid.text", FT_STRING, BASE_NONE,
-                   NULL, 0, "Engine ID Data: Text", HFILL }},
+                   NULL, 0, NULL, HFILL }},
                { &hf_snmp_engineid_time, {
-                   "Engine ID Data: Time", "snmp.engineid.time", FT_ABSOLUTE_TIME, BASE_NONE,
-                   NULL, 0, "Engine ID Data: Time", HFILL }},
+                   "Engine ID Data: Creation Time", "snmp.engineid.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
+                   NULL, 0, NULL, HFILL }},
                { &hf_snmp_engineid_data, {
-                   "Engine ID Data", "snmp.engineid.data", FT_BYTES, BASE_HEX,
-                   NULL, 0, "Engine ID Data", HFILL }},
-                 { &hf_snmp_msgAuthentication,
-                               { "Authentication", "snmp.v3.auth", FT_BOOLEAN, 8,
-                                       TFS(&auth_flags), 0, "", HFILL }},
-                 { &hf_snmp_decryptedPDU, {
-                                       "Decrypted ScopedPDU", "snmp.decrypted_pdu", FT_BYTES, BASE_HEX,
-                                       NULL, 0, "Decrypted PDU", HFILL }},
-  { &hf_snmp_noSuchObject, { "noSuchObject", "snmp.noSuchObject", FT_NONE, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_noSuchInstance, { "noSuchInstance", "snmp.noSuchInstance", FT_NONE, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_endOfMibView, { "endOfMibView", "snmp.endOfMibView", FT_NONE, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_unSpecified, { "unSpecified", "snmp.unSpecified", FT_NONE, BASE_DEC,  NULL, 0, "", HFILL }},
-         
-  { &hf_snmp_integer32_value, { "Value (Integer32)", "snmp.value.int", FT_INT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_octestring_value, { "Value (OctetString)", "snmp.value.octets", FT_BYTES, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_oid_value, { "Value (OID)", "snmp.value.oid", FT_OID, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_null_value, { "Value (Null)", "snmp.value.null", FT_NONE, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_ipv4_value, { "Value (IpAddress)", "snmp.value.ipv4", FT_IPv4, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_ipv6_value, { "Value (IpAddress)", "snmp.value.ipv6", FT_IPv6, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_anyaddress_value, { "Value (IpAddress)", "snmp.value.addr", FT_BYTES, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_unsigned32_value, { "Value (Unsigned32)", "snmp.value.u32", FT_INT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_gauge32_value, { "Value (Gauge32)", "snmp.value.g32", FT_INT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_unknown_value, { "Value (Unknown)", "snmp.value.unk", FT_BYTES, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_counter_value, { "Value (Counter32)", "snmp.value.counter", FT_UINT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_nsap_value, { "Value (NSAP)", "snmp.value.nsap", FT_UINT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_timeticks_value, { "Value (Timeticks)", "snmp.value.timeticks", FT_UINT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  { &hf_snmp_opaque_value, { "Value (Opaque)", "snmp.value.opaque", FT_BYTES, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_objectname, { "Object Name", "snmp.name", FT_OID, BASE_NONE,  NULL, 0, "", HFILL }},
-  { &hf_snmp_scalar_instance_index, { "Scalar Instance Index", "snmp.name.index", FT_UINT64, BASE_DEC,  NULL, 0, "", HFILL }},
-  
-  
+                   "Engine ID Data", "snmp.engineid.data", FT_BYTES, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_msgAuthentication, {
+                   "Authentication", "snmp.v3.auth", FT_BOOLEAN, BASE_NONE,
+                   TFS(&auth_flags), 0, NULL, HFILL }},
+               { &hf_snmp_decryptedPDU, {
+                   "Decrypted ScopedPDU", "snmp.decrypted_pdu", FT_BYTES, BASE_NONE,
+                   NULL, 0, "Decrypted PDU", HFILL }},
+               { &hf_snmp_noSuchObject, {
+                   "noSuchObject", "snmp.noSuchObject", FT_NONE, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_noSuchInstance, {
+                   "noSuchInstance", "snmp.noSuchInstance", FT_NONE, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_endOfMibView, {
+                   "endOfMibView", "snmp.endOfMibView", FT_NONE, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_unSpecified, {
+                   "unSpecified", "snmp.unSpecified", FT_NONE, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+
+               { &hf_snmp_integer32_value, {
+                   "Value (Integer32)", "snmp.value.int", FT_INT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_octetstring_value, {
+                   "Value (OctetString)", "snmp.value.octets", FT_BYTES, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_oid_value, {
+                   "Value (OID)", "snmp.value.oid", FT_OID, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_null_value, {
+                   "Value (Null)", "snmp.value.null", FT_NONE, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_ipv4_value, {
+                   "Value (IpAddress)", "snmp.value.ipv4", FT_IPv4, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_ipv6_value, {
+                   "Value (IpAddress)", "snmp.value.ipv6", FT_IPv6, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_anyaddress_value, {
+                   "Value (IpAddress)", "snmp.value.addr", FT_BYTES, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_unsigned32_value, {
+                   "Value (Unsigned32)", "snmp.value.u32", FT_INT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_gauge32_value, {
+                   "Value (Gauge32)", "snmp.value.g32", FT_INT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_unknown_value, {
+                   "Value (Unknown)", "snmp.value.unk", FT_BYTES, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_counter_value, {
+                   "Value (Counter32)", "snmp.value.counter", FT_UINT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_big_counter_value, {
+                   "Value (Counter64)", "snmp.value.counter", FT_UINT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_nsap_value, {
+                   "Value (NSAP)", "snmp.value.nsap", FT_UINT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_timeticks_value, {
+                   "Value (Timeticks)", "snmp.value.timeticks", FT_UINT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_opaque_value, {
+                   "Value (Opaque)", "snmp.value.opaque", FT_BYTES, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_objectname, {
+                   "Object Name", "snmp.name", FT_OID, BASE_NONE,
+                   NULL, 0, NULL, HFILL }},
+               { &hf_snmp_scalar_instance_index, {
+                   "Scalar Instance Index", "snmp.name.index", FT_UINT64, BASE_DEC,
+                   NULL, 0, NULL, HFILL }},
+
+
 
 /*--- Included file: packet-snmp-hfarr.c ---*/
 #line 1 "packet-snmp-hfarr.c"
     { &hf_snmp_SMUX_PDUs_PDU,
       { "SMUX-PDUs", "snmp.SMUX_PDUs",
         FT_UINT32, BASE_DEC, VALS(snmp_SMUX_PDUs_vals), 0,
-        "snmp.SMUX_PDUs", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_version,
       { "version", "snmp.version",
         FT_INT32, BASE_DEC, VALS(snmp_Version_vals), 0,
-        "snmp.Version", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_community,
       { "community", "snmp.community",
-        FT_STRING, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_STRING, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_data,
       { "data", "snmp.data",
         FT_UINT32, BASE_DEC, VALS(snmp_PDUs_vals), 0,
-        "snmp.PDUs", HFILL }},
+        "PDUs", HFILL }},
     { &hf_snmp_parameters,
       { "parameters", "snmp.parameters",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "OCTET_STRING", HFILL }},
     { &hf_snmp_datav2u,
       { "datav2u", "snmp.datav2u",
         FT_UINT32, BASE_DEC, VALS(snmp_T_datav2u_vals), 0,
-        "snmp.T_datav2u", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_v2u_plaintext,
       { "plaintext", "snmp.plaintext",
         FT_UINT32, BASE_DEC, VALS(snmp_PDUs_vals), 0,
-        "snmp.PDUs", HFILL }},
+        "PDUs", HFILL }},
     { &hf_snmp_encrypted,
       { "encrypted", "snmp.encrypted",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "OCTET_STRING", HFILL }},
     { &hf_snmp_msgAuthoritativeEngineID,
       { "msgAuthoritativeEngineID", "snmp.msgAuthoritativeEngineID",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_msgAuthoritativeEngineID", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgAuthoritativeEngineBoots,
       { "msgAuthoritativeEngineBoots", "snmp.msgAuthoritativeEngineBoots",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.T_msgAuthoritativeEngineBoots", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_msgAuthoritativeEngineTime,
       { "msgAuthoritativeEngineTime", "snmp.msgAuthoritativeEngineTime",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.T_msgAuthoritativeEngineTime", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_msgUserName,
       { "msgUserName", "snmp.msgUserName",
-        FT_STRING, BASE_HEX, NULL, 0,
-        "snmp.T_msgUserName", HFILL }},
+        FT_STRING, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgAuthenticationParameters,
       { "msgAuthenticationParameters", "snmp.msgAuthenticationParameters",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_msgAuthenticationParameters", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgPrivacyParameters,
       { "msgPrivacyParameters", "snmp.msgPrivacyParameters",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_msgPrivacyParameters", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgVersion,
       { "msgVersion", "snmp.msgVersion",
         FT_INT32, BASE_DEC, VALS(snmp_Version_vals), 0,
-        "snmp.Version", HFILL }},
+        "Version", HFILL }},
     { &hf_snmp_msgGlobalData,
       { "msgGlobalData", "snmp.msgGlobalData",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.HeaderData", HFILL }},
+        "HeaderData", HFILL }},
     { &hf_snmp_msgSecurityParameters,
       { "msgSecurityParameters", "snmp.msgSecurityParameters",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_msgSecurityParameters", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgData,
       { "msgData", "snmp.msgData",
         FT_UINT32, BASE_DEC, VALS(snmp_ScopedPduData_vals), 0,
-        "snmp.ScopedPduData", HFILL }},
+        "ScopedPduData", HFILL }},
     { &hf_snmp_msgID,
       { "msgID", "snmp.msgID",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER_0_2147483647", HFILL }},
+        "INTEGER_0_2147483647", HFILL }},
     { &hf_snmp_msgMaxSize,
       { "msgMaxSize", "snmp.msgMaxSize",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER_484_2147483647", HFILL }},
+        "INTEGER_484_2147483647", HFILL }},
     { &hf_snmp_msgFlags,
       { "msgFlags", "snmp.msgFlags",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_msgFlags", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_msgSecurityModel,
       { "msgSecurityModel", "snmp.msgSecurityModel",
         FT_UINT32, BASE_DEC, VALS(sec_models), 0,
-        "snmp.T_msgSecurityModel", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_plaintext,
       { "plaintext", "snmp.plaintext",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.ScopedPDU", HFILL }},
+        "ScopedPDU", HFILL }},
     { &hf_snmp_encryptedPDU,
       { "encryptedPDU", "snmp.encryptedPDU",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.T_encryptedPDU", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        NULL, HFILL }},
     { &hf_snmp_contextEngineID,
       { "contextEngineID", "snmp.contextEngineID",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "SnmpEngineID", HFILL }},
     { &hf_snmp_contextName,
       { "contextName", "snmp.contextName",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "OCTET_STRING", HFILL }},
     { &hf_snmp_get_request,
       { "get-request", "snmp.get_request",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_get_request", HFILL }},
+        "GetRequest_PDU", HFILL }},
     { &hf_snmp_get_next_request,
       { "get-next-request", "snmp.get_next_request",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_get_next_request", HFILL }},
+        "GetNextRequest_PDU", HFILL }},
     { &hf_snmp_get_response,
       { "get-response", "snmp.get_response",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_get_response", HFILL }},
+        "GetResponse_PDU", HFILL }},
     { &hf_snmp_set_request,
       { "set-request", "snmp.set_request",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_set_request", HFILL }},
+        "SetRequest_PDU", HFILL }},
     { &hf_snmp_trap,
       { "trap", "snmp.trap",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_trap", HFILL }},
+        "Trap_PDU", HFILL }},
     { &hf_snmp_getBulkRequest,
       { "getBulkRequest", "snmp.getBulkRequest",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_getBulkRequest", HFILL }},
+        "GetBulkRequest_PDU", HFILL }},
     { &hf_snmp_informRequest,
       { "informRequest", "snmp.informRequest",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_informRequest", HFILL }},
+        "InformRequest_PDU", HFILL }},
     { &hf_snmp_sNMPv2_Trap,
       { "sNMPv2-Trap", "snmp.sNMPv2_Trap",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_sNMPv2_Trap", HFILL }},
+        "SNMPv2_Trap_PDU", HFILL }},
     { &hf_snmp_report,
       { "report", "snmp.report",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.T_report", HFILL }},
+        "Report_PDU", HFILL }},
     { &hf_snmp_request_id,
       { "request-id", "snmp.request_id",
         FT_INT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER", HFILL }},
+        "INTEGER", HFILL }},
     { &hf_snmp_error_status,
       { "error-status", "snmp.error_status",
         FT_INT32, BASE_DEC, VALS(snmp_T_error_status_vals), 0,
-        "snmp.T_error_status", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_error_index,
       { "error-index", "snmp.error_index",
         FT_INT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER", HFILL }},
+        "INTEGER", HFILL }},
     { &hf_snmp_variable_bindings,
       { "variable-bindings", "snmp.variable_bindings",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.VarBindList", HFILL }},
+        "VarBindList", HFILL }},
     { &hf_snmp_bulkPDU_request_id,
       { "request-id", "snmp.request_id",
         FT_INT32, BASE_DEC, NULL, 0,
-        "snmp.Integer32", HFILL }},
+        "Integer32", HFILL }},
     { &hf_snmp_non_repeaters,
       { "non-repeaters", "snmp.non_repeaters",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER_0_2147483647", HFILL }},
+        "INTEGER_0_2147483647", HFILL }},
     { &hf_snmp_max_repetitions,
       { "max-repetitions", "snmp.max_repetitions",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER_0_2147483647", HFILL }},
+        "INTEGER_0_2147483647", HFILL }},
     { &hf_snmp_enterprise,
       { "enterprise", "snmp.enterprise",
         FT_OID, BASE_NONE, NULL, 0,
-        "snmp.OBJECT_IDENTIFIER", HFILL }},
+        "EnterpriseOID", HFILL }},
     { &hf_snmp_agent_addr,
       { "agent-addr", "snmp.agent_addr",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.NetworkAddress", HFILL }},
+        FT_IPv4, BASE_NONE, NULL, 0,
+        "NetworkAddress", HFILL }},
     { &hf_snmp_generic_trap,
       { "generic-trap", "snmp.generic_trap",
-        FT_INT32, BASE_DEC, VALS(snmp_T_generic_trap_vals), 0,
-        "snmp.T_generic_trap", HFILL }},
+        FT_INT32, BASE_DEC, VALS(snmp_GenericTrap_vals), 0,
+        "GenericTrap", HFILL }},
     { &hf_snmp_specific_trap,
       { "specific-trap", "snmp.specific_trap",
         FT_INT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER", HFILL }},
+        "SpecificTrap", HFILL }},
     { &hf_snmp_time_stamp,
       { "time-stamp", "snmp.time_stamp",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "snmp.TimeTicks", HFILL }},
+        "TimeTicks", HFILL }},
     { &hf_snmp_name,
       { "name", "snmp.name",
         FT_OID, BASE_NONE, NULL, 0,
-        "snmp.ObjectName", HFILL }},
+        "ObjectName", HFILL }},
     { &hf_snmp_valueType,
       { "valueType", "snmp.valueType",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.NULL", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_VarBindList_item,
-      { "Item", "snmp.VarBindList_item",
+      { "VarBind", "snmp.VarBind",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.VarBind", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_open,
       { "open", "snmp.open",
         FT_UINT32, BASE_DEC, VALS(snmp_OpenPDU_vals), 0,
-        "snmp.OpenPDU", HFILL }},
+        "OpenPDU", HFILL }},
     { &hf_snmp_close,
       { "close", "snmp.close",
-        FT_INT32, BASE_DEC, VALS(snmp_ClosePDU_vals), 0,
-        "snmp.ClosePDU", HFILL }},
+        FT_INT32, BASE_DEC, VALS(snmp_ClosePDU_U_vals), 0,
+        "ClosePDU", HFILL }},
     { &hf_snmp_registerRequest,
       { "registerRequest", "snmp.registerRequest",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.RReqPDU", HFILL }},
+        "RReqPDU", HFILL }},
     { &hf_snmp_registerResponse,
       { "registerResponse", "snmp.registerResponse",
         FT_UINT32, BASE_DEC, VALS(snmp_RegisterResponse_vals), 0,
-        "snmp.RegisterResponse", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_commitOrRollback,
       { "commitOrRollback", "snmp.commitOrRollback",
-        FT_INT32, BASE_DEC, VALS(snmp_SOutPDU_vals), 0,
-        "snmp.SOutPDU", HFILL }},
+        FT_INT32, BASE_DEC, VALS(snmp_SOutPDU_U_vals), 0,
+        "SOutPDU", HFILL }},
     { &hf_snmp_rRspPDU,
       { "rRspPDU", "snmp.rRspPDU",
-        FT_INT32, BASE_DEC, VALS(snmp_RRspPDU_vals), 0,
-        "snmp.RRspPDU", HFILL }},
+        FT_INT32, BASE_DEC, VALS(snmp_RRspPDU_U_vals), 0,
+        NULL, HFILL }},
     { &hf_snmp_pDUs,
       { "pDUs", "snmp.pDUs",
         FT_UINT32, BASE_DEC, VALS(snmp_PDUs_vals), 0,
-        "snmp.PDUs", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_smux_simple,
       { "smux-simple", "snmp.smux_simple",
         FT_NONE, BASE_NONE, NULL, 0,
-        "snmp.SimpleOpen", HFILL }},
+        "SimpleOpen", HFILL }},
     { &hf_snmp_smux_version,
       { "smux-version", "snmp.smux_version",
         FT_INT32, BASE_DEC, VALS(snmp_T_smux_version_vals), 0,
-        "snmp.T_smux_version", HFILL }},
+        NULL, HFILL }},
     { &hf_snmp_identity,
       { "identity", "snmp.identity",
         FT_OID, BASE_NONE, NULL, 0,
-        "snmp.OBJECT_IDENTIFIER", HFILL }},
+        "OBJECT_IDENTIFIER", HFILL }},
     { &hf_snmp_description,
       { "description", "snmp.description",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.DisplayString", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "DisplayString", HFILL }},
     { &hf_snmp_password,
       { "password", "snmp.password",
-        FT_BYTES, BASE_HEX, NULL, 0,
-        "snmp.OCTET_STRING", HFILL }},
+        FT_BYTES, BASE_NONE, NULL, 0,
+        "OCTET_STRING", HFILL }},
     { &hf_snmp_subtree,
       { "subtree", "snmp.subtree",
         FT_OID, BASE_NONE, NULL, 0,
-        "snmp.ObjectName", HFILL }},
+        "ObjectName", HFILL }},
     { &hf_snmp_priority,
       { "priority", "snmp.priority",
         FT_INT32, BASE_DEC, NULL, 0,
-        "snmp.INTEGER_M1_2147483647", HFILL }},
+        "INTEGER_M1_2147483647", HFILL }},
     { &hf_snmp_operation,
       { "operation", "snmp.operation",
         FT_INT32, BASE_DEC, VALS(snmp_T_operation_vals), 0,
-        "snmp.T_operation", HFILL }},
+        NULL, HFILL }},
 
 /*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 1869 "packet-snmp-template.c"
+#line 2133 "packet-snmp-template.c"
   };
 
   /* List of subtrees */
@@ -3583,6 +3632,7 @@ void proto_register_snmp(void) {
          &ett_internet,
          &ett_varbind,
          &ett_name,
+         &ett_value,
          &ett_decoding_error,
 
 /*--- Included file: packet-snmp-ettarr.c ---*/
@@ -3598,41 +3648,65 @@ void proto_register_snmp(void) {
     &ett_snmp_PDUs,
     &ett_snmp_PDU,
     &ett_snmp_BulkPDU,
-    &ett_snmp_Trap_PDU,
+    &ett_snmp_Trap_PDU_U,
     &ett_snmp_VarBind,
     &ett_snmp_VarBindList,
     &ett_snmp_SMUX_PDUs,
     &ett_snmp_RegisterResponse,
     &ett_snmp_OpenPDU,
-    &ett_snmp_SimpleOpen,
-    &ett_snmp_RReqPDU,
+    &ett_snmp_SimpleOpen_U,
+    &ett_snmp_RReqPDU_U,
 
 /*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 1884 "packet-snmp-template.c"
+#line 2149 "packet-snmp-template.c"
   };
   module_t *snmp_module;
+
   static uat_field_t users_fields[] = {
-         UAT_FLD_BUFFER(snmp_users,engine_id,"Engine-id for this entry (empty = any)"),
-         UAT_FLD_LSTRING(snmp_users,userName,"The username"),
-         UAT_FLD_VS(snmp_users,auth_model,auth_types,"Algorithm to be used for authentication."),
-         UAT_FLD_LSTRING(snmp_users,authPassword,"The password used for authenticating packets for this entry"),
-         UAT_FLD_VS(snmp_users,priv_proto,priv_types,"Algorithm to be used for privacy."),
-         UAT_FLD_LSTRING(snmp_users,privPassword,"The password used for encrypting packets for this entry"),
+         UAT_FLD_BUFFER(snmp_users,engine_id,"Engine ID","Engine-id for this entry (empty = any)"),
+         UAT_FLD_LSTRING(snmp_users,userName,"Username","The username"),
+         UAT_FLD_VS(snmp_users,auth_model,"Authentication model",auth_types,"Algorithm to be used for authentication."),
+         UAT_FLD_LSTRING(snmp_users,authPassword,"Password","The password used for authenticating packets for this entry"),
+         UAT_FLD_VS(snmp_users,priv_proto,"Privacy protocol",priv_types,"Algorithm to be used for privacy."),
+         UAT_FLD_LSTRING(snmp_users,privPassword,"Privacy password","The password used for encrypting packets for this entry"),
          UAT_END_FIELDS
   };
-  
-  assocs_uat = uat_new("SNMP Users",
-                                          sizeof(snmp_ue_assoc_t),
-                                          "snmp_users",
-                                          (void**)&ueas,
-                                          &num_ueas,
-                                          UAT_CAT_CRYPTO,
-                                          "ChSNMPUsersSection",
-                                          snmp_users_copy_cb,
-                                          snmp_users_update_cb,
-                                          snmp_users_free_cb,
-                                          users_fields);
-  
+
+  uat_t *assocs_uat = uat_new("SNMP Users",
+                             sizeof(snmp_ue_assoc_t),
+                             "snmp_users",
+                             TRUE,
+                             (void*)&ueas,
+                             &num_ueas,
+                             UAT_CAT_CRYPTO,
+                             "ChSNMPUsersSection",
+                             snmp_users_copy_cb,
+                             snmp_users_update_cb,
+                             snmp_users_free_cb,
+                             renew_ue_cache,
+                             users_fields);
+
+  static uat_field_t specific_traps_flds[] = {
+    UAT_FLD_CSTRING(specific_traps,enterprise,"Enterprise OID","Enterprise Object Identifier"),
+    UAT_FLD_DEC(specific_traps,trap,"Trap Id","The specific-trap value"),
+    UAT_FLD_CSTRING(specific_traps,desc,"Description","Trap type description"),
+    UAT_END_FIELDS
+  };
+
+  uat_t* specific_traps_uat = uat_new("SNMP Enterprise Specific Trap Types",
+                                      sizeof(snmp_st_assoc_t),
+                                      "snmp_specific_traps",
+                                      TRUE,
+                                      (void*) &specific_traps,
+                                      &num_specific_traps,
+                                      UAT_CAT_GENERAL,
+                                      "ChSNMPEnterpriseSpecificTrapTypes",
+                                      snmp_specific_trap_copy_cb,
+                                      NULL,
+                                      snmp_specific_trap_free_cb,
+                                                                         NULL,
+                                      specific_traps_flds);
+
   /* Register protocol */
   proto_snmp = proto_register_protocol(PNAME, PSNAME, PFNAME);
   new_register_dissector("snmp", dissect_snmp, proto_snmp);
@@ -3642,33 +3716,48 @@ void proto_register_snmp(void) {
   proto_register_subtree_array(ett, array_length(ett));
 
 
-       /* Register configuration preferences */
-       snmp_module = prefs_register_protocol(proto_snmp, process_prefs);
-       prefs_register_bool_preference(snmp_module, "display_oid",
-               "Show SNMP OID in info column",
-               "Whether the SNMP OID should be shown in the info column",
-               &display_oid);
+  /* Register configuration preferences */
+  snmp_module = prefs_register_protocol(proto_snmp, process_prefs);
+  prefs_register_bool_preference(snmp_module, "display_oid",
+                       "Show SNMP OID in info column",
+                       "Whether the SNMP OID should be shown in the info column",
+                       &display_oid);
 
-       prefs_register_obsolete_preference(snmp_module, "mib_modules");
-       prefs_register_obsolete_preference(snmp_module, "var_in_tree");
-       prefs_register_obsolete_preference(snmp_module, "users_file");
+  prefs_register_obsolete_preference(snmp_module, "mib_modules");
+  prefs_register_obsolete_preference(snmp_module, "users_file");
 
-       prefs_register_bool_preference(snmp_module, "desegment",
-           "Reassemble SNMP-over-TCP messages\nspanning multiple TCP segments",
-           "Whether the SNMP dissector should reassemble messages spanning multiple TCP segments."
-           " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
-           &snmp_desegment);
+  prefs_register_bool_preference(snmp_module, "desegment",
+                       "Reassemble SNMP-over-TCP messages\nspanning multiple TCP segments",
+                       "Whether the SNMP dissector should reassemble messages spanning multiple TCP segments."
+                       " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
+                       &snmp_desegment);
 
+  prefs_register_bool_preference(snmp_module, "var_in_tree",
+                       "Display dissected variables inside SNMP tree",
+                       "ON - display dissected variables inside SNMP tree, OFF - display dissected variables in root tree after SNMP",
+                       &snmp_var_in_tree);
 
   prefs_register_uat_preference(snmp_module, "users_table",
-                                                               "Users Table",
-                                                               "Table of engine-user associations used for authentication and decryption",
-                                                               assocs_uat);
-  
-  
-       value_sub_dissectors_table = register_dissector_table("snmp.variable_oid","SNMP Variable OID", FT_STRING, BASE_NONE);
-       
-       register_init_routine(renew_ue_cache);
+                               "Users Table",
+                               "Table of engine-user associations used for authentication and decryption",
+                               assocs_uat);
+
+  prefs_register_uat_preference(snmp_module, "specific_traps_table",
+                               "Enterprise Specific Trap Types",
+                               "Table of enterprise specific-trap type descriptions",
+                               specific_traps_uat);
+
+#ifdef HAVE_LIBSMI
+  prefs_register_static_text_preference(snmp_module, "info_mibs",
+                                       "MIB settings can be changed in the Name Resolution preferences",
+                                       "MIB settings can be changed in the Name Resolution preferences");
+#endif
+
+  value_sub_dissectors_table = register_dissector_table("snmp.variable_oid","SNMP Variable OID", FT_STRING, BASE_NONE);
+
+  register_init_routine(renew_ue_cache);
+
+  register_ber_syntax_dissector("SNMP", proto_snmp, dissect_snmp_tcp);
 }
 
 
@@ -3680,6 +3769,7 @@ void proto_reg_handoff_snmp(void) {
 
        dissector_add("udp.port", UDP_PORT_SNMP, snmp_handle);
        dissector_add("udp.port", UDP_PORT_SNMP_TRAP, snmp_handle);
+       dissector_add("udp.port", UDP_PORT_SNMP_PATROL, snmp_handle);
        dissector_add("ethertype", ETHERTYPE_SNMP, snmp_handle);
        dissector_add("ipx.socket", IPX_SOCKET_SNMP_AGENT, snmp_handle);
        dissector_add("ipx.socket", IPX_SOCKET_SNMP_SINK, snmp_handle);
@@ -3708,10 +3798,10 @@ proto_register_smux(void)
        static hf_register_info hf[] = {
                { &hf_smux_version,
                { "Version", "smux.version", FT_UINT8, BASE_DEC, NULL,
-                   0x0, "", HFILL }},
+                   0x0, NULL, HFILL }},
                { &hf_smux_pdutype,
                { "PDU type", "smux.pdutype", FT_UINT8, BASE_DEC, VALS(smux_types),
-                   0x0, "", HFILL }},
+                   0x0, NULL, HFILL }},
        };
        static gint *ett[] = {
                &ett_smux,
@@ -3732,5 +3822,3 @@ proto_reg_handoff_smux(void)
        smux_handle = create_dissector_handle(dissect_smux, proto_smux);
        dissector_add("tcp.port", TCP_PORT_SMUX, smux_handle);
 }
-
-