summaryrefslogtreecommitdiff
path: root/doc/README.dissector
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-02-22 14:16:44 -0500
committerEvan Huus <eapache@gmail.com>2014-02-23 15:30:35 +0000
commit83fc3468532ee7a033b66b3a2d3511b568a1d38c (patch)
treee96aadacc024726cd686199bfe4ea007751e36e5 /doc/README.dissector
parent41fc5a53e9d645b9a089f57c08679a6d2bf766b5 (diff)
downloadwireshark-83fc3468532ee7a033b66b3a2d3511b568a1d38c.tar.gz
Documentation updates
Change-Id: I6bd7fa40726fe7ffd68b9341c640874f2a0f1c7c Reviewed-on: https://code.wireshark.org/review/314 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'doc/README.dissector')
-rw-r--r--doc/README.dissector34
1 files changed, 4 insertions, 30 deletions
diff --git a/doc/README.dissector b/doc/README.dissector
index 59b0900b48..2bc2d638cf 100644
--- a/doc/README.dissector
+++ b/doc/README.dissector
@@ -1959,6 +1959,10 @@ The syntax for creating a new TVBUFF_SUBSET is:
next_tvb = tvb_new_subset(tvb, offset, length, reported_length)
+or, in the common case where it should just run to the end of the packet,
+
+next_tvb = tvb_new_subset_remaining(tvb, offset)
+
Where:
tvb is the tvbuff that the dissector has been working on. It
can be a tvbuff of any type.
@@ -1977,36 +1981,6 @@ Where:
the protocol doesn't say anything about the size of its payload.
-An example from packet-ipx.c -
-
-void
-dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- tvbuff_t *next_tvb;
- int reported_length, available_length;
-
-
- /* Make the next tvbuff */
-
-/* IPX does have a length value in the header, so calculate report_length */
- Set this to -1 if there isn't any length information in the protocol
-*/
- reported_length = ipx_length - IPX_HEADER_LEN;
-
-/* Calculate the available data in the packet,
- set this to -1 to use all the data in the tv_buffer
-*/
- available_length = tvb_captured_length(tvb) - IPX_HEADER_LEN;
-
-/* Create the tvbuffer for the next dissector */
- next_tvb = tvb_new_subset(tvb, IPX_HEADER_LEN,
- MIN(available_length, reported_length),
- reported_length);
-
-/* call the next dissector */
- dissector_next( next_tvb, pinfo, tree);
-
-
1.8 Editing Makefile.common and CMakeLists.txt to add your dissector.
To arrange that your dissector will be built as part of Wireshark, you