diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-01-03 15:05:13 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-04 00:03:34 +0000 |
commit | 32f9f92487f797bcaef6d3cbf92b7fb802a6079e (patch) | |
tree | bf558a353d296a429f8bfa50db4d653c40e4bf0b /epan/ftypes/ftype-ipv4.c | |
parent | fa7cf8737cd913a3217971d7fa8008efb4f0dd87 (diff) |
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/ftypes/ftype-ipv4.c')
-rw-r--r-- | epan/ftypes/ftype-ipv4.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c index 3f0b6f77f3..c189d42617 100644 --- a/epan/ftypes/ftype-ipv4.c +++ b/epan/ftypes/ftype-ipv4.c @@ -30,8 +30,8 @@ static void set_uinteger(fvalue_t *fv, guint32 value) { - ipv4_addr_set_net_order_addr(&(fv->value.ipv4), value); - ipv4_addr_set_netmask_bits(&(fv->value.ipv4), 32); + ipv4_addr_and_mask_set_net_order_addr(&(fv->value.ipv4), value); + ipv4_addr_and_mask_set_netmask_bits(&(fv->value.ipv4), 32); } static gpointer @@ -75,7 +75,7 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, if (addr_str_to_free) wmem_free(NULL, addr_str_to_free); - ipv4_addr_set_net_order_addr(&(fv->value.ipv4), addr); + ipv4_addr_and_mask_set_net_order_addr(&(fv->value.ipv4), addr); /* If CIDR, get netmask bits. */ if (slash) { @@ -97,11 +97,11 @@ val_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_, } return FALSE; } - ipv4_addr_set_netmask_bits(&fv->value.ipv4, nmask_bits); + ipv4_addr_and_mask_set_netmask_bits(&fv->value.ipv4, nmask_bits); } else { /* Not CIDR; mask covers entire address. */ - ipv4_addr_set_netmask_bits(&(fv->value.ipv4), 32); + ipv4_addr_and_mask_set_netmask_bits(&(fv->value.ipv4), 32); } return TRUE; @@ -119,43 +119,43 @@ val_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_) static void val_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf) { - ipv4_addr_str_buf(&fv->value.ipv4, buf); + ipv4_addr_and_mask_str_buf(&fv->value.ipv4, buf); } static gboolean cmp_eq(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_eq(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_eq(&a->value.ipv4, &b->value.ipv4); } static gboolean cmp_ne(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_ne(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_ne(&a->value.ipv4, &b->value.ipv4); } static gboolean cmp_gt(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_gt(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_gt(&a->value.ipv4, &b->value.ipv4); } static gboolean cmp_ge(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_ge(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_ge(&a->value.ipv4, &b->value.ipv4); } static gboolean cmp_lt(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_lt(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_lt(&a->value.ipv4, &b->value.ipv4); } static gboolean cmp_le(const fvalue_t *a, const fvalue_t *b) { - return ipv4_addr_le(&a->value.ipv4, &b->value.ipv4); + return ipv4_addr_and_mask_le(&a->value.ipv4, &b->value.ipv4); } static gboolean |