From dd1c18dd031038cbee7e219e322cbea1eafc87ca Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 29 Oct 2017 18:39:41 -0700 Subject: Make FT_IPv4 a bit more like FT_IPv6. FT_IPv6 doesn't expose the prefix, which is used only for values in filter expressions, not values in protocol fields; do the same for FT_IPv4, hiding the netmask, and using fvalue_get_integer() to get the value, having it return a network-byte-order value for the address. (This also makes it opaque whether the address and netmask are stored in host or network byte order.) Change-Id: I4285a87f6ccef2c0ccec040490ddcd15d787326e Reviewed-on: https://code.wireshark.org/review/24177 Reviewed-by: Guy Harris --- epan/ftypes/ftype-ipv4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/ftypes/ftype-ipv4.c') diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c index 6d45e2eb97..27276d2409 100644 --- a/epan/ftypes/ftype-ipv4.c +++ b/epan/ftypes/ftype-ipv4.c @@ -34,10 +34,10 @@ set_uinteger(fvalue_t *fv, guint32 value) fv->value.ipv4.nmask = ip_get_subnet_mask(32); } -static gpointer +static guint32 value_get(fvalue_t *fv) { - return &(fv->value.ipv4); + return g_htonl(fv->value.ipv4.addr); } static gboolean @@ -234,7 +234,7 @@ ftype_register_ipv4(void) val_repr_len, /* len_string_repr */ { .set_value_uinteger = set_uinteger }, /* union set_value */ - { .get_value_ptr = value_get }, /* union get_value */ + { .get_value_uinteger = value_get }, /* union get_value */ cmp_eq, cmp_ne, -- cgit v1.2.3