forked from osmocom/wireshark
![]() Observe that some code in setup_sdp_transport is effectively the same code as a part from dissect_sdp with these differences: - Removal of these two conditions (setup_sdp_transport already returns early when a packet is visited): (!pinfo->fd->flags.visited) && (transport_info == &local_transport_info) - "establish_frame" in setup_sdp_transport is replaced by "pinfo->num" in dissect_sdp. dissect_sdp further has two additional blocks that add information to the VoIP calls dialog. This is preserved. Freeing of the RTP payload information has also been simplified. Instead of checking it inside the main loop that adds addresses (now moved to a new function, "apply_sdp_transport"), let the caller do it outside the loop. The transformation in this patch is rather mechanical: 0. Add a comment on what the new function is supposed to do. 1. Move code from setup_sdp_transport into a new function, apply_sdp_transport and reduce indentation level. 2. Copy all variables to the new function and populate the parameter list. 3. Compile result, remove unused variables that the compiler warns for. 4. Move freeing of unused media outside the loop to the caller. 5. Create a new conditional statement before the duplicated loop, which checks whether setup_sdp_transport has been used before. (SIP first calls setup_sdp_transport, then it invokes the media type dissector which calls dissect_sdp to populate the tree.) 6. Remove the duplicated code from the dissect_sdp loop until only the VoIP Calls dialog info remains. There is no functional change intended. Change-Id: I928379466af56ef1729cccbf4a5b60895ddb3227 Reviewed-on: https://code.wireshark.org/review/19047 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> |
||
---|---|---|
.. | ||
compress | ||
crypt | ||
dfilter | ||
dissectors | ||
ftypes | ||
wmem | ||
wslua | ||
.editorconfig | ||
addr_and_mask.c | ||
addr_and_mask.h | ||
addr_resolv.c | ||
addr_resolv.h | ||
address.h | ||
address_types.c | ||
address_types.h | ||
afn.c | ||
afn.h | ||
aftypes.c | ||
aftypes.h | ||
app_mem_usage.c | ||
app_mem_usage.h | ||
arcnet_pids.h | ||
arptypes.h | ||
asm_utils.c | ||
asm_utils.h | ||
asm_utils_win32_x86.asm | ||
asn1.c | ||
asn1.h | ||
ax25_pids.h | ||
bridged_pids.h | ||
capture_dissectors.c | ||
capture_dissectors.h | ||
charsets.c | ||
charsets.h | ||
chdlctypes.h | ||
circuit.c | ||
circuit.h | ||
CMakeLists.txt | ||
color_filters.c | ||
color_filters.h | ||
column-info.h | ||
column-utils.c | ||
column-utils.h | ||
column.c | ||
column.h | ||
conv_id.h | ||
conversation.c | ||
conversation.h | ||
conversation_debug.h | ||
conversation_table.c | ||
conversation_table.h | ||
crc6-tvb.c | ||
crc6-tvb.h | ||
crc8-tvb.c | ||
crc8-tvb.h | ||
crc10-tvb.c | ||
crc10-tvb.h | ||
crc16-tvb.c | ||
crc16-tvb.h | ||
crc32-tvb.c | ||
crc32-tvb.h | ||
decode_as.c | ||
decode_as.h | ||
diam_dict.h | ||
diam_dict.l | ||
disabled_protos.c | ||
disabled_protos.h | ||
dissector_filters.c | ||
dissector_filters.h | ||
doxygen.cfg.in | ||
dtd.h | ||
dtd_grammar.lemon | ||
dtd_parse.h | ||
dtd_parse.l | ||
dtd_preparse.l | ||
dvb_chartbl.c | ||
dvb_chartbl.h | ||
dwarf.c | ||
dwarf.h | ||
eap.h | ||
eapol_keydes_types.h | ||
enterprise-numbers | ||
epan-int.h | ||
epan.c | ||
epan.h | ||
epan_dissect.h | ||
etypes.h | ||
ex-opt.c | ||
ex-opt.h | ||
except.c | ||
except.h | ||
exceptions.h | ||
exntest.c | ||
expert.c | ||
expert.h | ||
export_object.c | ||
export_object.h | ||
exported_pdu.c | ||
exported_pdu.h | ||
filter_expressions.c | ||
filter_expressions.h | ||
follow.c | ||
follow.h | ||
frame_data.c | ||
frame_data.h | ||
frame_data_sequence.c | ||
frame_data_sequence.h | ||
funnel.c | ||
funnel.h | ||
garrayfix.h | ||
geoip_db.c | ||
geoip_db.h | ||
golay.c | ||
golay.h | ||
guid-utils.c | ||
guid-utils.h | ||
iana_charsets.c | ||
iana_charsets.h | ||
iax2_codec_type.h | ||
in_cksum.c | ||
in_cksum.h | ||
ip_opts.h | ||
ipproto.c | ||
ipproto.h | ||
ipv4.c | ||
ipv4.h | ||
ipv6.h | ||
lapd_sapi.h | ||
llcsaps.h | ||
Makefile.am | ||
media_params.c | ||
media_params.h | ||
next_tvb.c | ||
next_tvb.h | ||
nlpid.h | ||
oids.c | ||
oids.h | ||
oids_test.c | ||
osi-utils.c | ||
osi-utils.h | ||
oui.c | ||
oui.h | ||
packet-range.c | ||
packet-range.h | ||
packet.c | ||
packet.h | ||
packet_info.h | ||
params.h | ||
plugin_if.c | ||
plugin_if.h | ||
ppptypes.h | ||
prefs-int.h | ||
prefs.c | ||
prefs.h | ||
print.c | ||
print.h | ||
print.ps | ||
print_stream.c | ||
print_stream.h | ||
proto.c | ||
proto.h | ||
proto_data.c | ||
proto_data.h | ||
ps.h | ||
ptvcursor.h | ||
radius_dict.l | ||
range.c | ||
range.h | ||
reassemble.c | ||
reassemble.h | ||
reassemble_test.c | ||
reedsolomon.c | ||
reedsolomon.h | ||
req_resp_hdrs.c | ||
req_resp_hdrs.h | ||
rtd_table.c | ||
rtd_table.h | ||
rtp_pt.h | ||
sctpppids.h | ||
show_exception.c | ||
show_exception.h | ||
slow_protocol_subtypes.h | ||
sminmpec.c | ||
sminmpec.h | ||
srt_table.c | ||
srt_table.h | ||
stat_groups.h | ||
stat_tap_ui.c | ||
stat_tap_ui.h | ||
stats_tree.c | ||
stats_tree.h | ||
stats_tree_priv.h | ||
stream.c | ||
stream.h | ||
strutil.c | ||
strutil.h | ||
t35.c | ||
t35.h | ||
tap-voip.h | ||
tap.c | ||
tap.h | ||
tfs.c | ||
tfs.h | ||
time_fmt.h | ||
timestamp.c | ||
timestamp.h | ||
timestats.c | ||
timestats.h | ||
to_str-int.h | ||
to_str.c | ||
to_str.h | ||
tpg.c | ||
tpg.h | ||
tvbparse.c | ||
tvbparse.h | ||
tvbtest.c | ||
tvbuff-int.h | ||
tvbuff.c | ||
tvbuff.h | ||
tvbuff_base64.c | ||
tvbuff_composite.c | ||
tvbuff_real.c | ||
tvbuff_subset.c | ||
tvbuff_zlib.c | ||
uat-int.h | ||
uat.c | ||
uat.h | ||
uat_load.l | ||
value_string.c | ||
value_string.h | ||
x264_prt_id.h | ||
xdlc.c | ||
xdlc.h |