diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-10-19 21:08:34 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-10-19 21:08:34 +0000 |
commit | c522a2611c0350d50e7124dc43e9796eee550f17 (patch) | |
tree | 1d1c8853f5ee1f9a25e3390e21d931b70b8978fc | |
parent | f225f8819e3026c8ff4d267a5981b8dbdd6478ae (diff) |
from Jaap Keuter:
Working with the reassembly functionality Ethereal provides I've found
some additional changes had to be made to the EDG 8.4.1:
- a typo (made by myself)
- fragment_add_seq_check() doesn't take -1 as length remaining
- process_reassembled_data() can be called with or without tree, and
is required in both dissection runs
- some whitespace stuff
svn path=/trunk/; revision=16273
-rw-r--r-- | docbook/edg_src/EDG_chapter_dissection.xml | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/docbook/edg_src/EDG_chapter_dissection.xml b/docbook/edg_src/EDG_chapter_dissection.xml index 5e77f6a2fa..3e06385261 100644 --- a/docbook/edg_src/EDG_chapter_dissection.xml +++ b/docbook/edg_src/EDG_chapter_dissection.xml @@ -763,7 +763,7 @@ msg_pkt ::= SEQUENCE { ..... } msg_id INTEGER(0..65535), - frag_id INTEGER(0..65565), + frag_id INTEGER(0..65535), ..... } ]]> @@ -782,12 +782,12 @@ if (flags & FL_FRAGMENT) { /* fragmented */ guint16 msg_num = tvb_get_ntohs(tvb, offset); offset += 2; pinfo->fragmented = TRUE; - frag_msg = fragment_add_seq_check (tvb, offset, pinfo, + frag_msg = fragment_add_seq_check(tvb, offset, pinfo, msg_seqid, /* ID for fragments belonging together */ msg_fragment_table, /* list of message fragments */ msg_reassembled_table, /* list of reassembled messages */ msg_num, /* fragment sequence number */ - -1, /* fragment length - to the end */ + tvb_length_remaining(tvb, offset), /* fragment length - to the end */ flags & FL_FRAG_LAST); /* More fragments? */ ]]> </programlisting></example> @@ -821,7 +821,7 @@ if (flags & FL_FRAGMENT) { /* fragmented */ msg_num is the packet number within the sequence. </para></listitem> <listitem><para> - The length here is specified as -1, as we want the rest of the packet data. + The length here is specified as the rest of the tvb as we want the rest of the packet data. </para></listitem> <listitem><para> Finally a parameter that signals if this is the last fragment or not. @@ -832,19 +832,17 @@ if (flags & FL_FRAGMENT) { /* fragmented */ <example><title>Reassembling fragments part 2</title> <programlisting> <![CDATA[ - if (msg_tree) - new_tvb = process_reassembled_data(tvb, offset, pinfo, + new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled Message", frag_msg, &msg_frag_items, NULL, msg_tree); if (frag_msg) { /* Reassembled */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_str (pinfo->cinfo, COL_INFO, + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_str(pinfo->cinfo, COL_INFO, " (Message Reassembled)"); - } else { - /* Not last packet of reassembled Short Message */ - if (check_col (pinfo->cinfo, COL_INFO)) - col_append_fstr (pinfo->cinfo, COL_INFO, + } else { /* Not last packet of reassembled Short Message */ + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment %u)", msg_num); } @@ -858,16 +856,14 @@ else { /* Not fragmented */ next_tvb = tvb_new_subset(tvb, offset, -1, -1); } -offset = 0; +..... pinfo->fragmented = save_fragmented; ]]> </programlisting></example> <para> Having passed the fragment data to the reassembly handler, we can - now check if we have the whole message. We can only do this if were - in the display mode, as we need to pass the display tree parameter into this - routine. If there is enough information, this routine will return the - newly reassembled data buffer. + now check if we have the whole message. If there is enough information, + this routine will return the newly reassembled data buffer. </para> <para> After that, we add a couple of informative messages to the display |