[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wireshark-dev
Subject:    Re: [Wireshark-dev] How to collect information from various packets
From:       Beth <beth.tridium () gmail ! com>
Date:       2009-09-24 12:04:47
Message-ID: d8618dc20909240504g46332710j698e0b4ba8ab5873 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Since Wireshark includes glib, you can take advantage of glib's hash table
API to store your ID/string mapping in a hash table.  If the table is global
to your dissector code, then each time your dissector is run it will have
access to the whole table and can look up the strings as needed.

To make the hash table global to your dissector, simply declare it at the
top of your dissector source file, below the #includes but above the C
functions. Make sure you create the hash table in your init code, and add
the 'insert' and 'lookup' calls in your dissect function(s).

The Glib hash table API is described here:
http://library.gnome.org/devel/glib/stable/glib-Hash-Tables.html

[Attachment #5 (text/html)]

Since Wireshark includes glib, you can take advantage of glib&#39;s hash table API to \
store your ID/string mapping in a hash table.  If the table is global to your \
dissector code, then each time your dissector is run it will have access to the whole \
table and can look up the strings as needed.<br> <br>To make the hash table global to \
your dissector, simply declare it at the top of your dissector source file, below the \
#includes but above the C functions. Make sure you create the hash table in your init \
code, and add the &#39;insert&#39; and &#39;lookup&#39; calls in your dissect \
function(s).<br> <br>The Glib hash table API is described here: <br><a \
href="http://library.gnome.org/devel/glib/stable/glib-Hash-Tables.html">http://library.gnome.org/devel/glib/stable/glib-Hash-Tables.html</a><br><br>




___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@wireshark.org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic