Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Mon, 12 Mar 2007 16:54:06 -0700

On Mon, Mar 12, 2007 at 02:07:59PM -0400, Neely Grady-W30566 wrote:

> Hi I am new to the list and this is my first post.

Welcome!

> I am writing a dissector plugin for Wireshark and have a question.  
> If I have a set of data that I am iterating through.  Sometimes the 
> one message inside the data ends on a byte boundary, and others end on 
> the third bit or the fifth bit or some other non-nibble boundary bit.
> 
> What I want to do is print this different fields inside each message. 
> But I cannot assume a bitmask will always be the same since each 
> message can end essentially anywhere in the bytestream and not just on 
> a boundary.
>
> Can I use the proto_tree_add_item? How would I define a bitmask in the 
> hf_ structure?

Are you using the same field name for each message, no matter which bit 
it ends on?  In this case, you wouldn't be able to use 
proto_tree_add_item() unless you defined three different field names, 
each with a different bitmask.  You would still need logic in the 
program to determine which field to use in the proto_tree_add_item() 
call.  How does the protocol specify how long the bit stream will be?


Steve

  • Follow-Ups:
    • Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string
      • From: Neely Grady-W30566
  • References:
    • [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string
      • From: Neely Grady-W30566
  • Prev by Date: Re: [Wireshark-dev] Get 3 bytes
  • Next by Date: Re: [Wireshark-dev] Get 3 bytes
  • Previous by thread: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string
  • Next by thread: Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation