|
Hi,chuangde: Let’s read the code together: packet-udp.c: decode_udp_ports(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree
*tree, int uh_sport, int uh_dport, int uh_ulen) { /*First, try to dissector
udp data by udp-port*/ if (low_port != 0
&&
dissector_try_port(udp_dissector_table, low_port, next_tvb, pinfo, tree)) return; if (high_port != 0
&&
dissector_try_port(udp_dissector_table, high_port, next_tvb, pinfo, tree)) return; /*then ,we try heuristic subdissector table,SIP is in the heuristic
dissector list of udp, so we have a try */ if
(!try_heuristic_first) { /* do
lookup with the heuristic subdissector table */ if
(dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)) return; } /* give up finally, data handle*/
call_dissector(data_handle,next_tvb, pinfo, tree); } packet-sip.c:
void proto_reg_handoff_sip(void) { /*register udp-sip port*/ dissector_add("udp.port", UDP_PORT_SIP,
sip_handle); /* Add a
sub-dissector to a heuristic dissector list of udp */ heur_dissector_add("udp", dissect_sip_heur,
proto_sip); } Good luck Bright 发件人: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] 代表 zhangchuangde@xxxxxxxxxxxxxxx hi, #define TCP_PORT_SIP 5060 I
know when a tcp/udp/tls packet's port is 5060/5061, the protocol
analyzer will dissect it into sip protocol. however,
as the first packet in the accessory,
its src port is 6304 and dst port is 6090, and this packet is also dissected
into sip protocol.how wireshark know this packet is a sip packet? can you tell me how and why? thanks a lot!
Ade
Zhang
|