This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

tcp options dissector

0
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


One Answer:

1

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.

answered 21 Sep '11, 03:04

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%