This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.
void
proto_reg_handoff_foo(void)
{
    static dissector_handle_t foo_handle;

    foo_handle = create_dissector_handle(dissect_UDP_1234, proto_foo);
    dissector_add_uint("udp.port", 1234, foo_handle);
}

My dissector function (dissect_UDP_1234) will be called for UDP traffic on port 1234. (http://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html)

Is there a similar way to do this: my dissector function (dissect_TCP_OPTIONS_123) will be called, if TCP options 123 is present?

Can I write something like this:

dissector_add_uint("tcp.options", 123, foo_handle);

But it did't work for me. :(

Any suggestion how to do this, other than modifying packet-tcp.c file.

Thanks

asked 20 Sep '11, 23:46

Vikas's gravatar image

Vikas
1223
accept rate: 0%

edited 21 Sep '11, 03:02

Jaap's gravatar image

Jaap ♦
11.7k16101


Currently there's no tcp.options table to dynamically extend with additional options. For now it will have to be coded in packet-tcp.c. There may already be an wishlist item and/or enhancement bug for this, but I'm not sure.

permanent link

answered 21 Sep '11, 03:04

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×752
×16

question asked: 20 Sep '11, 23:46

question was seen: 3,599 times

last updated: 21 Sep '11, 03:04

p​o​w​e​r​e​d by O​S​Q​A