aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mih.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-15 16:51:45 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-16 22:00:30 +0000
commit799d6fd057b0c20a7692a1181d811a8ff3a88d04 (patch)
tree31d6d1248aee7c3192ae6d854b43eeb2c0b996a0 /epan/dissectors/packet-mih.c
parent92bb13a4d22a48c43aa5fa6910c68829edebfdd0 (diff)
create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3 Reviewed-on: https://code.wireshark.org/review/11860 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-mih.c')
-rw-r--r--epan/dissectors/packet-mih.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/epan/dissectors/packet-mih.c b/epan/dissectors/packet-mih.c
index 034c293214..e1b237664e 100644
--- a/epan/dissectors/packet-mih.c
+++ b/epan/dissectors/packet-mih.c
@@ -1986,7 +1986,7 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
return;
}
-static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL;
int offset = 0;
@@ -2065,23 +2065,19 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (service)
{
case 1 :/*for Service Management..*/
- if(mid_tree)
- proto_tree_add_item(mid_tree, hf_mih_serv_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mid_tree, hf_mih_serv_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, serv_act_id_values, "Unknown"));
break;
case 2 :/*for event services..*/
- if(mid_tree)
- proto_tree_add_item(mid_tree, hf_mih_event_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mid_tree, hf_mih_event_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, event_act_id_values, "Unknown"));
break;
case 3 :/*for Command Services..*/
- if(mid_tree)
- proto_tree_add_item(mid_tree, hf_mih_command_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mid_tree, hf_mih_command_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, command_act_id_values, "Unknown"));
break;
case 4 :/*for Information Services..*/
- if(mid_tree)
- proto_tree_add_item(mid_tree, hf_mih_info_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mid_tree, hf_mih_info_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, info_act_id_values, "Unknown"));
break;
}
@@ -2191,7 +2187,7 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += (guint32)len;
payload_length -= (1 + len_of_len + (guint32)len);
}else{
- return;
+ return offset;
}
}
else
@@ -2202,6 +2198,8 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if(fragment!=0)
proto_tree_add_item(mih_tree, hf_fragmented_tlv, tvb, offset, -1, ENC_NA);
+
+ return tvb_captured_length(tvb);
}
/*dissector initialistaion*/
@@ -4871,7 +4869,7 @@ void proto_reg_handoff_mih(void)
{
dissector_handle_t mih_handle;
- mih_handle = create_dissector_handle(dissect_mih, proto_mih);
+ mih_handle = new_create_dissector_handle(dissect_mih, proto_mih);
/*Layer 3 handle*/
dissector_add_uint("udp.port", MIH_PORT, mih_handle);
dissector_add_uint("tcp.port", MIH_PORT, mih_handle);