summaryrefslogtreecommitdiff
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-03 15:05:13 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-04 00:03:34 +0000
commit32f9f92487f797bcaef6d3cbf92b7fb802a6079e (patch)
treebf558a353d296a429f8bfa50db4d653c40e4bf0b /epan/proto.c
parentfa7cf8737cd913a3217971d7fa8008efb4f0dd87 (diff)
downloadwireshark-32f9f92487f797bcaef6d3cbf92b7fb802a6079e.tar.gz
Rename ipv4_addr and ipv6_addr to indicate their full contents.
They're not just addresses, they also include a mask length for IPv4 and a prefix length for IPv6. Rename them appropriately. Rename the old ipv4_addr_and_mask() and ipv6_addr_and_mask() to reflect that 1) they fetch data from a tvbuff and 2) *don't* fetch the mask length or prefix length, those lengths are passed as arguments to indicate how many bytes worth of address to fetch. Change-Id: I4cad5a186ad7bfcb60022a91dbe8bc8479e6471f Reviewed-on: https://code.wireshark.org/review/13035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 87088d89ce..b6f1c00a62 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -4527,13 +4527,13 @@ const gchar *
proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
gchar *result, gchar *expr, const int size)
{
- guint32 number;
- guint64 number64;
- guint8 *bytes;
- ipv4_addr *ipv4;
- struct e_in6_addr *ipv6;
- address addr;
- guint32 n_addr; /* network-order IPv4 address */
+ guint32 number;
+ guint64 number64;
+ guint8 *bytes;
+ ipv4_addr_and_mask *ipv4;
+ struct e_in6_addr *ipv6;
+ address addr;
+ guint32 n_addr; /* network-order IPv4 address */
const true_false_string *tfstring;
@@ -4802,7 +4802,7 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
break;
case FT_IPv4:
- ipv4 = (ipv4_addr *)fvalue_get(&finfo->value);
+ ipv4 = (ipv4_addr_and_mask *)fvalue_get(&finfo->value);
n_addr = ipv4_get_net_order_addr(ipv4);
set_address (&addr, AT_IPv4, 4, &n_addr);
address_to_str_buf(&addr, result+offset_r, size-offset_r);
@@ -6623,17 +6623,17 @@ label_fill_descr(char *label_str, gsize pos, const header_field_info *hfinfo, co
void
proto_item_fill_label(field_info *fi, gchar *label_str)
{
- header_field_info *hfinfo;
- guint8 *bytes;
- guint32 integer;
- guint64 integer64;
- ipv4_addr *ipv4;
- e_guid_t *guid;
- guint32 n_addr; /* network-order IPv4 address */
- gchar *name;
- address addr;
- char *addr_str;
- char *tmp;
+ header_field_info *hfinfo;
+ guint8 *bytes;
+ guint32 integer;
+ guint64 integer64;
+ ipv4_addr_and_mask *ipv4;
+ e_guid_t *guid;
+ guint32 n_addr; /* network-order IPv4 address */
+ gchar *name;
+ address addr;
+ char *addr_str;
+ char *tmp;
if (!fi) {
if (label_str)
@@ -6820,7 +6820,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
break;
case FT_IPv4:
- ipv4 = (ipv4_addr *)fvalue_get(&fi->value);
+ ipv4 = (ipv4_addr_and_mask *)fvalue_get(&fi->value);
n_addr = ipv4_get_net_order_addr(ipv4);
addr.type = AT_IPv4;