diff options
Diffstat (limited to 'doc/README.dissector')
-rw-r--r-- | doc/README.dissector | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/doc/README.dissector b/doc/README.dissector index e15ca6e26c..68a83cc0f3 100644 --- a/doc/README.dissector +++ b/doc/README.dissector @@ -3028,31 +3028,29 @@ Where: module - Returned by the prefs_register_protocol routine These functions are declared in <epan/prefs.h>. -An example from packet-beep.c - +An example from packet-rtpproxy.c - - proto_beep = proto_register_protocol("Blocks Extensible Exchange Protocol", - "BEEP", "beep"); + proto_rtpproxy = proto_register_protocol ( "Sippy RTPproxy Protocol", "RTPproxy", "rtpproxy"); ... - /* Register our configuration options for BEEP, particularly our port */ + rtpproxy_module = prefs_register_protocol(proto_rtpproxy, proto_reg_handoff_rtpproxy); - beep_module = prefs_register_protocol(proto_beep, proto_reg_handoff_beep); + prefs_register_bool_preference(rtpproxy_module, "establish_conversation", + "Establish Media Conversation", + "Specifies that RTP/RTCP/T.38/MSRP/etc streams are decoded based " + "upon port numbers found in RTPproxy answers", + &rtpproxy_establish_conversation); - prefs_register_uint_preference(beep_module, "tcp.port", "BEEP TCP Port", - "Set the port for BEEP messages (if other" - " than the default of 10288)", - 10, &global_beep_tcp_port); + prefs_register_uint_preference(rtpproxy_module, "reply.timeout", + "RTPproxy reply timeout", /* Title */ + "Maximum timeout value in waiting for reply from RTPProxy (in milliseconds).", /* Descr */ + 10, + &rtpproxy_timeout); - prefs_register_bool_preference(beep_module, "strict_header_terminator", - "BEEP Header Requires CRLF", - "Specifies that BEEP requires CRLF as a " - "terminator, and not just CR or LF", - &global_beep_strict_term); - -This will create preferences "beep.tcp.port" and -"beep.strict_header_terminator", the first of which is an unsigned -integer and the second of which is a Boolean. +This will create preferences "rtpproxy.establish_conversation" and +"rtpproxy.reply.timeout", the first of which is an Boolean and the +second of which is a unsigned integer. Note that a warning will pop up if you've saved such preference to the preference file and you subsequently take the code out. The way to make @@ -3086,36 +3084,32 @@ example, stolen from packet-dns.c: #include "packet-tcp.h" - dissector_handle_t dns_udp_handle; - dissector_handle_t dns_tcp_handle; - dissector_handle_t mdns_udp_handle; + dissector_handle_t hartip_tcp_handle; + dissector_handle_t hartip_udp_handle; - dns_udp_handle = create_dissector_handle(dissect_dns_udp, - proto_dns); - dns_tcp_handle = create_dissector_handle(dissect_dns_tcp, - proto_dns); - mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, - proto_dns); + hartip_tcp_handle = create_dissector_handle(dissect_hartip_tcp, proto_hartip); + hartip_udp_handle = create_dissector_handle(dissect_hartip_udp, proto_hartip); - dissector_add_uint("udp.port", UDP_PORT_DNS, dns_udp_handle); - dissector_add_uint("tcp.port", TCP_PORT_DNS, dns_tcp_handle); - dissector_add_uint("udp.port", UDP_PORT_MDNS, mdns_udp_handle); - dissector_add_uint("tcp.port", TCP_PORT_MDNS, dns_tcp_handle); + dissector_add_uint("udp.port", HARTIP_PORT, hartip_udp_handle); + dissector_add_uint_with_preference("tcp.port", HARTIP_PORT, hartip_tcp_handle); -The dissect_dns_udp function does very little work and calls -dissect_dns_common, while dissect_dns_tcp calls tcp_dissect_pdus with a +The dissect_hartip_udp function does very little work and calls +dissect_hartip_common, while dissect_hartip_tcp calls tcp_dissect_pdus with a reference to a callback which will be called with reassembled data: static int - dissect_dns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - void *data _U_) + dissect_hartip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + void *data) { - tcp_dissect_pdus(tvb, pinfo, tree, dns_desegment, 2, - get_dns_pdu_len, dissect_dns_tcp_pdu, data); - return tvb_captured_length(tvb); + if (!tvb_bytes_exist(tvb, 0, HARTIP_HEADER_LENGTH)) + return 0; + + tcp_dissect_pdus(tvb, pinfo, tree, hartip_desegment, HARTIP_HEADER_LENGTH, + get_dissect_hartip_len, dissect_hartip_pdu, data); + return tvb_reported_length(tvb); } -(The dissect_dns_tcp_pdu function acts similarly to dissect_dns_udp.) +(The dissect_hartip_pdu function acts similarly to dissect_hartip_udp.) The arguments to tcp_dissect_pdus are: the tvbuff pointer, packet_info pointer, and proto_tree pointer |