diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2014-06-19 00:35:24 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-06-19 00:09:52 +0000 |
commit | 43c64c0adef3ffc8a6258c6e9ac95777e79e4ddc (patch) | |
tree | 16e04edd2d0fdc8159d317647015ea5d6ac91555 /doc | |
parent | 5844e129891e39beeab038abfe8a7cc7bfb08ad1 (diff) | |
download | wireshark-43c64c0adef3ffc8a6258c6e9ac95777e79e4ddc.tar.gz |
Update the sample code dealing with desegmentation to new style dissector
Change-Id: I2e9f6341138e7305b849a754e28edfd322d44160
Reviewed-on: https://code.wireshark.org/review/2415
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.dissector | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/README.dissector b/doc/README.dissector index ff333d8fba..3da238283e 100644 --- a/doc/README.dissector +++ b/doc/README.dissector @@ -2973,8 +2973,9 @@ static hf_register_info hf[] = { * @param tvb The buffer to dissect. * @param pinfo Packet Info. * @param tree The protocol tree. +* @param data Optional data parameter given by parent dissector. **/ -static void dissect_cstr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) +static int dissect_cstr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void *data _U_) { guint offset = 0; while(offset < tvb_reported_length(tvb)) { @@ -2985,7 +2986,7 @@ static void dissect_cstr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* we ran out of data: ask for more */ pinfo->desegment_offset = offset; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; - return; + return (offset + available); } col_set_str(pinfo->cinfo, COL_INFO, "C String"); @@ -3001,6 +3002,7 @@ static void dissect_cstr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* if we get here, then the end of the tvb coincided with the end of a string. Happy days. */ + return tvb_captured_length(tvb); } This simple dissector will repeatedly return DESEGMENT_ONE_MORE_SEGMENT |