diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-08-28 21:13:15 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2018-08-29 19:36:43 +0000 |
commit | 9d9a873d9a4b71b12623afeff1bd46fbfa7eb211 (patch) | |
tree | 50d6199c3df2794c22c2da1a42b1537d81271028 /epan/address_types.c | |
parent | 389339cab294b1200ce9139e34c517150bb1cd9c (diff) |
Make AT_VINES a built-in type
Change-Id: I5c11cf4c7bee1b2b7072a6a0db5344a6b8a569ac
Reviewed-on: https://code.wireshark.org/review/29326
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/address_types.c')
-rw-r--r-- | epan/address_types.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/epan/address_types.c b/epan/address_types.c index e8031f3388..9e575a1f15 100644 --- a/epan/address_types.c +++ b/epan/address_types.c @@ -480,6 +480,33 @@ static int ax25_len(void) } /****************************************************************************** + * AT_VINES + ******************************************************************************/ + +static int vines_addr_to_str(const address* addr, gchar *buf, int buf_len _U_) +{ + const guint8 *addr_data = (const guint8 *)addr->data; + gchar *bufp = buf; + + bufp = dword_to_hex(bufp, pntoh32(&addr_data[0])); /* 8 bytes */ + *bufp++ = '.'; /* 1 byte */ + bufp = word_to_hex(bufp, pntoh16(&addr_data[4])); /* 4 bytes */ + *bufp++ = '\0'; /* NULL terminate */ + + return (int)(bufp - buf); +} + +static int vines_addr_str_len(const address* addr _U_) +{ + return 14; +} + +static int vines_len(void) +{ + return VINES_ADDR_LEN; +} + +/****************************************************************************** * END OF PROVIDED ADDRESS TYPES ******************************************************************************/ @@ -630,6 +657,18 @@ void address_types_initialize(void) NULL, /* addr_name_res_str */ NULL, /* addr_name_res_len */ }; + static address_type_t vines_address = { + AT_VINES, /* addr_type */ + "AT_VINES", /* name */ + "Banyan Vines Address", /* pretty_name */ + vines_addr_to_str, /* addr_to_str */ + vines_addr_str_len,/* addr_str_len */ + NULL, /* addr_to_byte */ + NULL, /* addr_col_filter */ + vines_len, /* addr_fixed_len */ + NULL, /* addr_name_res_str */ + NULL, /* addr_name_res_len */ + }; num_dissector_addr_type = 0; @@ -648,6 +687,7 @@ void address_types_initialize(void) address_type_register(AT_EUI64, &eui64_address ); address_type_register(AT_IB, &ib_address ); address_type_register(AT_AX25, &ax25_address ); + address_type_register(AT_VINES, &vines_address ); } /* Given an address type id, return an address_type_t* */ |