From Graham Bloice:
[obnox/wireshark/wip.git] / docbook / wsdg_src / WSDG_chapter_dissection.xml
index 6457db04ef84006c1150ddf9f987be280c9b07d7..69d229a0d00ff1bcac11c629147d7e7d4c32bf3d 100644 (file)
@@ -536,9 +536,10 @@ static const value_string packettypenames[] = {
    <programlisting>
    <![CDATA[
        { &hf_foo_pdu_type,
-       { "FOO PDU Type",           "foo.type",
-       FT_UINT8, BASE_DEC, VALS(packettypenames), 0x0,
-       "", HFILL }
+               { "FOO PDU Type", "foo.type",
+               FT_UINT8, BASE_DEC,
+               VALS(packettypenames), 0x0,
+               NULL, HFILL }
        },
 ]]>    
    </programlisting></example>
@@ -558,19 +559,22 @@ static int hf_foo_endflag = -1;
 static int hf_foo_priorityflag = -1;
 ...
        { &hf_foo_startflag,
-       { "FOO PDU Start Flags",           "foo.flags.start",
-       FT_BOOLEAN, 8, NULL, FOO_START_FLAG,
-       "", HFILL }
+               { "FOO PDU Start Flags", "foo.flags.start",
+               FT_BOOLEAN, 8, 
+               NULL, FOO_START_FLAG,
+               NULL, HFILL }
        },
        { &hf_foo_endflag,
-       { "FOO PDU End Flags",           "foo.flags.end",
-       FT_BOOLEAN, 8, NULL, FOO_END_FLAG,
-       "", HFILL }
+               { "FOO PDU End Flags", "foo.flags.end",
+               FT_BOOLEAN, 8,
+               NULL, FOO_END_FLAG,
+               NULL, HFILL }
        },
        { &hf_foo_priorityflag,
-       { "FOO PDU Priority Flags",           "foo.flags.priority",
-       FT_BOOLEAN, 8, NULL, FOO_PRIORITY_FLAG,
-       "", HFILL }
+               { "FOO PDU Priority Flags", "foo.flags.priority",
+               FT_BOOLEAN, 8, 
+               NULL, FOO_PRIORITY_FLAG,
+               NULL, HFILL }
        },
 ...
        proto_tree_add_item(foo_tree, hf_foo_flags, tvb, offset, 1, FALSE);
@@ -678,7 +682,6 @@ dissect_foo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                next_tvb = tvb_new_real_data(decompressed_buffer, orig_size, orig_size);
                tvb_set_child_real_data_tvbuff(tvb, next_tvb);
                add_new_data_source(pinfo, next_tvb, "Decompressed Data");
-               tvb_set_free_cb(next_tvb, g_free);
        } else {
                next_tvb = tvb_new_subset(tvb, offset, -1, -1);
        }
@@ -1038,7 +1041,7 @@ static void dissect_foo_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
 }
 
 /* determine PDU length of protocol foo */
-static guint get_foo_message_len(tvbuff_t *tvb, int offset)
+static guint get_foo_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
 {
     /* TODO: change this to your needs */
     return (guint)tvb_get_ntohl(tvb, offset+4); /* e.g. length is at offset 4 */
@@ -1070,7 +1073,7 @@ static guint get_foo_message_len(tvbuff_t *tvb, int offset)
        <title>How to tap protocols</title>
        <para>
        Adding a Tap interface to a protocol allows it to do some useful things.
-       In particular you can produce protocol statistics from teh tap interface.
+       In particular you can produce protocol statistics from the tap interface.
        </para>
        <para>
        A tap is basically a way of allowing other items to see whats happening as