Add initial RFC2780 IP Version lookup support

Add support for https://www.iana.org/assignments/version-numbers/version-numbers.xhtml IP Version lookups.

Change-Id: I58a330ab9acba17356344df3ffeb94cc1b2b1443
Reviewed-on: https://code.wireshark.org/review/22821
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Arjen Zonneveld 2017-07-27 14:49:52 +02:00 committed by Michael Mann
parent b16d487cbc
commit 168065dad7
2 changed files with 26 additions and 0 deletions

View File

@ -313,6 +313,17 @@ static capture_dissector_handle_t ip_cap_handle;
/* IP structs and definitions */
const value_string ip_version_vals[] = {
{ IP_VERSION_NUM_RESERVED, "Reserved" },
{ IP_VERSION_NUM_INET, "IPv4" },
{ IP_VERSION_NUM_ST, "ST Datagram" },
{ IP_VERSION_NUM_INET6, "IPv6" },
{ IP_VERSION_NUM_TPIX, "TP/IX" },
{ IP_VERSION_NUM_PIP, "PIP" },
{ IP_VERSION_NUM_TUBA, "TUBA" },
{ 0, NULL },
};
/* Offsets of fields within an IP header. */
#define IPH_V_HL 0
#define IPH_TOS 1

View File

@ -28,6 +28,21 @@
extern int proto_ip;
/*
* IP Version numbers, from
*
* https://www.iana.org/assignments/version-numbers/version-numbers.xhtml
*/
#define IP_VERSION_NUM_RESERVED 0 /* Reserved */
#define IP_VERSION_NUM_INET 4 /* IP (IP version 4) */
#define IP_VERSION_NUM_ST 5 /* ST Datagram Mode */
#define IP_VERSION_NUM_INET6 6 /* IP6 (IP version 6) */
#define IP_VERSION_NUM_TPIX 7 /* TP/IX: The Next Internet */
#define IP_VERSION_NUM_PIP 8 /* The P Internet Protocol */
#define IP_VERSION_NUM_TUBA 9 /* TUBA */
extern const value_string ip_version_vals[];
typedef struct _ws_ip
{
guint8 ip_ver; /* 4 or 6 */