aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2013-02-07 22:07:49 +0000
committerBill Meier <wmeier@newsguy.com>2013-02-07 22:07:49 +0000
commit900d29a95eae9a08aa7aec08f6a319ba5265dc80 (patch)
tree4e40afd390fd39757dd9553c559284f5ef9be751 /epan/dissectors
parentcfff564398e06c2a0be00c3378369d694b0d078c (diff)
Use proto_registrar_get_id_byname() instead of proto_registrar_get_byname();
The code is slightly cleaner and the use of proto_registrar_get_id_byname() enables an additional checkhf test to reduce false positives. Also: comment out 2 unused hf_... vars in packet-smb-sidsnooping.c (found by checkhf) svn path=/trunk/; revision=47541
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-smb-sidsnooping.c54
-rw-r--r--epan/dissectors/packet-tte.c6
2 files changed, 17 insertions, 43 deletions
diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c
index 4ed5799401..dc066a014c 100644
--- a/epan/dissectors/packet-smb-sidsnooping.c
+++ b/epan/dissectors/packet-smb-sidsnooping.c
@@ -39,9 +39,11 @@
#include <epan/dissectors/packet-smb.h>
#include "packet-smb-sidsnooping.h"
+#if 0
static int hf_lsa = -1;
-static int hf_lsa_info_level = -1;
static int hf_lsa_opnum = -1;
+#endif
+static int hf_lsa_info_level = -1;
static int hf_lsa_domain = -1;
static int hf_nt_domain_sid = -1;
static int hf_samr_hnd = -1;
@@ -325,7 +327,6 @@ ctx_handle_hash(gconstpointer k)
static void
sid_snooping_init(void)
{
- header_field_info *hfi;
GString *error_string;
if(lsa_policy_information_tap_installed){
@@ -363,44 +364,17 @@ sid_name_snooping=0;
ctx_handle_table=g_hash_table_new(ctx_handle_hash, ctx_handle_equal);
- hf_lsa=proto_get_id_by_filter_name("lsa");
-
- hfi=proto_registrar_get_byname("lsa.opnum");
- if(hfi){
- hf_lsa_opnum=hfi->id;
- }
-
- hfi=proto_registrar_get_byname("nt.domain_sid");
- if(hfi){
- hf_nt_domain_sid=hfi->id;
- }
-
- hfi=proto_registrar_get_byname("lsa.domain");
- if(hfi){
- hf_lsa_domain=hfi->id;
- }
-
- hfi=proto_registrar_get_byname("lsa.info.level");
- if(hfi){
- hf_lsa_info_level=hfi->id;
- }
-
- hfi=proto_registrar_get_byname("samr.handle");
- if(hfi){
- hf_samr_hnd=hfi->id;
- }
- hfi=proto_registrar_get_byname("samr.rid");
- if(hfi){
- hf_samr_rid=hfi->id;
- }
- hfi=proto_registrar_get_byname("samr.acct_name");
- if(hfi){
- hf_samr_acct_name=hfi->id;
- }
- hfi=proto_registrar_get_byname("samr.level");
- if(hfi){
- hf_samr_level=hfi->id;
- }
+#if 0
+ hf_lsa = proto_get_id_by_filter_name("lsa");
+ hf_lsa_opnum = proto_registrar_get_id_byname("lsa.opnum");
+#endif
+ hf_nt_domain_sid = proto_registrar_get_id_byname("nt.domain_sid");
+ hf_lsa_domain = proto_registrar_get_id_byname("lsa.domain");
+ hf_lsa_info_level = proto_registrar_get_id_byname("lsa.info.level");
+ hf_samr_hnd = proto_registrar_get_id_byname("samr.handle");
+ hf_samr_rid = proto_registrar_get_id_byname("samr.rid");
+ hf_samr_acct_name = proto_registrar_get_id_byname("samr.acct_name");
+ hf_samr_level = proto_registrar_get_id_byname("samr.level");
error_string=register_tap_listener("dcerpc",
diff --git a/epan/dissectors/packet-tte.c b/epan/dissectors/packet-tte.c
index 88798cca09..49bfe94c6f 100644
--- a/epan/dissectors/packet-tte.c
+++ b/epan/dissectors/packet-tte.c
@@ -179,7 +179,7 @@ proto_reg_handoff_tte(void)
{
heur_dissector_add("eth", dissect_tte, proto_tte);
- hf_eth_dst = proto_registrar_get_byname ("eth.dst")->id;
- hf_eth_src = proto_registrar_get_byname ("eth.src")->id;
- hf_eth_type = proto_registrar_get_byname ("eth.type")->id;
+ hf_eth_dst = proto_registrar_get_id_byname ("eth.dst");
+ hf_eth_src = proto_registrar_get_id_byname ("eth.src");
+ hf_eth_type = proto_registrar_get_id_byname ("eth.type");
}