summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asn1/snmp/packet-snmp-template.c35
-rw-r--r--epan/dissectors/packet-snmp.c45
-rw-r--r--epan/emem.c5
-rw-r--r--epan/oids.c6
-rw-r--r--epan/uat-int.h3
-rw-r--r--epan/uat.c3
-rw-r--r--epan/uat.h1
7 files changed, 49 insertions, 49 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index b57fca3d81..452f9cfbda 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -103,6 +103,7 @@
#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;
@@ -226,6 +227,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;
#include "packet-snmp-ett.c"
@@ -381,14 +383,14 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
oid_info_t* oid_info;
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;
char* valstr;
int hfid = -1;
int min_len = 0, max_len = 0;
gboolean oid_info_is_ok;
- const char* oid_string;
+ const char* oid_string = NULL;
seq_offset = offset;
/* first have the VarBind's sequence header */
@@ -498,15 +500,10 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
add_oid_debug_subtree(oid_info,pt_name);
- if (oid_matched+oid_left) {
+ if (subids && oid_matched+oid_left) {
oid_string = oid_subid2string(subids,oid_matched+oid_left);
- } 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) {
case OID_KIND_SCALAR:
@@ -659,14 +656,6 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
}
indexing_done:
- 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_varbind : NULL, value_sub_dissectors_table, oid_string);
-
- return seq_offset + seq_len;
- }
-
if (oid_info_is_ok) {
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);
@@ -745,8 +734,16 @@ indexing_done:
expert_add_info_format(actx->pinfo, pi_value, PI_UNDECODED, PI_NOTE, "Unresolved value, Missing MIB");
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);
@@ -1878,6 +1875,7 @@ void proto_register_snmp(void) {
&ett_internet,
&ett_varbind,
&ett_name,
+ &ett_value,
&ett_decoding_error,
#include "packet-snmp-ettarr.c"
};
@@ -1954,6 +1952,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);
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 260fcb9280..98d05fd213 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -111,6 +111,7 @@
#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;
@@ -288,7 +289,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 214 "packet-snmp-template.c"
+#line 215 "packet-snmp-template.c"
static int hf_smux_version = -1;
static int hf_smux_pdutype = -1;
@@ -304,6 +305,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;
@@ -330,7 +332,7 @@ static gint ett_snmp_SimpleOpen = -1;
static gint ett_snmp_RReqPDU = -1;
/*--- End of included file: packet-snmp-ett.c ---*/
-#line 232 "packet-snmp-template.c"
+#line 234 "packet-snmp-template.c"
static const true_false_string auth_flags = {
"OK",
@@ -483,14 +485,14 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
oid_info_t* oid_info;
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;
char* valstr;
int hfid = -1;
int min_len = 0, max_len = 0;
gboolean oid_info_is_ok;
- const char* oid_string;
+ const char* oid_string = NULL;
seq_offset = offset;
/* first have the VarBind's sequence header */
@@ -600,15 +602,10 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
add_oid_debug_subtree(oid_info,pt_name);
- if (oid_matched+oid_left) {
+ if (subids && oid_matched+oid_left) {
oid_string = oid_subid2string(subids,oid_matched+oid_left);
- } 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) {
case OID_KIND_SCALAR:
@@ -761,14 +758,6 @@ extern int dissect_snmp_VarBind(gboolean implicit_tag _U_,
}
indexing_done:
- 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_varbind : NULL, value_sub_dissectors_table, oid_string);
-
- return seq_offset + seq_len;
- }
-
if (oid_info_is_ok) {
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);
@@ -847,8 +836,16 @@ indexing_done:
expert_add_info_format(actx->pinfo, pi_value, PI_UNDECODED, PI_NOTE, "Unresolved value, Missing MIB");
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);
@@ -2792,7 +2789,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
/*--- End of included file: packet-snmp-fn.c ---*/
-#line 1357 "packet-snmp-template.c"
+#line 1354 "packet-snmp-template.c"
guint
@@ -3568,7 +3565,7 @@ void proto_register_snmp(void) {
"snmp.T_operation", HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 1868 "packet-snmp-template.c"
+#line 1865 "packet-snmp-template.c"
};
/* List of subtrees */
@@ -3582,6 +3579,7 @@ void proto_register_snmp(void) {
&ett_internet,
&ett_varbind,
&ett_name,
+ &ett_value,
&ett_decoding_error,
/*--- Included file: packet-snmp-ettarr.c ---*/
@@ -3607,7 +3605,7 @@ void proto_register_snmp(void) {
&ett_snmp_RReqPDU,
/*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 1883 "packet-snmp-template.c"
+#line 1881 "packet-snmp-template.c"
};
module_t *snmp_module;
static uat_field_t users_fields[] = {
@@ -3682,6 +3680,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);
diff --git a/epan/emem.c b/epan/emem.c
index 430ff4e1b6..38464b43ec 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -65,7 +65,6 @@
/* Do we want to use canaries ? */
#define DEBUG_USE_CANARIES 1
-
#ifdef WANT_GUARD_PAGES
/* Add guard pages at each end of our allocated memory */
#if defined(HAVE_SYSCONF) && defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(HAVE_STDINT_H)
@@ -125,8 +124,8 @@ typedef struct _emem_header_t {
emem_chunk_t *used_list;
} emem_header_t;
-static emem_header_t ep_packet_mem;
-static emem_header_t se_packet_mem;
+emem_header_t ep_packet_mem;
+emem_header_t se_packet_mem;
#if !defined(SE_DEBUG_FREE)
#if defined (_WIN32)
diff --git a/epan/oids.c b/epan/oids.c
index 000759b630..7e3de7fccd 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -34,7 +34,7 @@
#include <ctype.h>
#include "emem.h"
-#include "uat-int.h"
+#include "uat.h"
#include "prefs.h"
#include "proto.h"
#include "packet.h"
@@ -100,7 +100,9 @@ static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_ty
if(n) {
if (i == oid_len) {
if (n->name) {
- D(2,("Renaming Oid from: %s -> %s, this menas the same oid is registered more than once",n->name,name));
+ if (!g_str_equal(n->name,name)) {
+ D(2,("Renaming Oid from: %s -> %s, this menas the same oid is registered more than once",n->name,name));
+ }
g_free(n->name);
}
diff --git a/epan/uat-int.h b/epan/uat-int.h
index 8735cd672a..1dd8c947e6 100644
--- a/epan/uat-int.h
+++ b/epan/uat-int.h
@@ -63,6 +63,7 @@ struct _uat_t {
gboolean changed;
uat_rep_t* rep;
uat_rep_free_cb_t free_rep;
+ gboolean loaded;
};
gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing);
@@ -83,8 +84,6 @@ void uat_clear(uat_t*);
gboolean uat_save(uat_t* , char** );
-gboolean uat_load(uat_t* , char** );
-
void uat_load_all(void);
#define UAT_UPDATE(uat) do { *((uat)->user_ptr) = (void*)((uat)->user_data->data); *((uat)->nrows_p) = (uat)->user_data->len; } while(0)
diff --git a/epan/uat.c b/epan/uat.c
index 44ec7a53c3..20a4230543 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -309,7 +309,8 @@ void uat_load_all(void) {
uat_t* u = g_ptr_array_index(all_uats,i);
err = NULL;
- uat_load(u, &err);
+ if (!u->loaded)
+ uat_load(u, &err);
if (err) {
report_failure("Error loading table '%s': %s",u->name,err);
diff --git a/epan/uat.h b/epan/uat.h
index 494d5d2fe9..6f095d80a6 100644
--- a/epan/uat.h
+++ b/epan/uat.h
@@ -242,6 +242,7 @@ uat_t* uat_new(const char* name,
uat_free_cb_t free_cb,
uat_field_t* flds_array);
+gboolean uat_load(uat_t* uat_in, char** err);
/*
* uat_dup()