Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Determine address type of string

Date: Mon, 9 Nov 2015 10:14:19 +0100
Hello,

I am writing a custom dissector as a plugin. There I need to determine
the address type of a string in a TLV. It can be either an IPv4
address, IPv6 address or a FQDN.

What is the best way to parse this string into the Wireshark data types?

My idea was to check which delimieters occur ("." -> IPv4, ":" ->
IPv6) iand if there dots, to check whether the parts between the dots
are numerical.

Bye,
Jo