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

How can I make my dissector handle multiple ports?

0

My Dissector will use multiple ports across our network. How can I define them?

packet-bppcp.c
dissector_add_uint("tcp.port", BPPCP_PORT, bppcp_handle);

packet-bppcp.h #define BPPCP_PORT 26810 /* 4006 4181 4192 45634 7003 9010 9020 */

asked 07 Jan ‘13, 09:44

jballard1979's gravatar image

jballard1979
207710
accept rate: 0%

edited 07 Jan ‘13, 11:30

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196


One Answer:

2

See the HTTP dissector for an example:

#define TCP_DEFAULT_RANGE "80,3128,3132,5985,8080,8088,11371,1900,2869,2710"
[...]
range_convert_str(&global_http_tcp_range, TCP_DEFAULT_RANGE, 65535);
http_tcp_range = range_empty();
prefs_register_range_preference(http_module, "tcp.port", "TCP Ports",
                "TCP Ports range",
                &global_http_tcp_range, 65535);

answered 07 Jan '13, 09:55

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%

Implemented using example above.

Thanks boss.

(07 Jan '13, 10:57) jballard1979

If a supplied answer resolves your question can you please "accept" it by clicking the checkmark icon next to it. This highlights good answers for the benefit of subsequent users with the same or similar questions.

(07 Jan '13, 11:32) Kurt Knochner ♦