aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-ipv4.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-10-29 18:39:41 -0700
committerGuy Harris <guy@alum.mit.edu>2017-10-30 01:40:13 +0000
commitdd1c18dd031038cbee7e219e322cbea1eafc87ca (patch)
treecd9e471c265d8d2ceab059f6677626e67e920d96 /epan/ftypes/ftype-ipv4.c
parent734c5b35a5491794dc9cb31ed07a8d0d5576d4f5 (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'epan/ftypes/ftype-ipv4.c')
-rw-r--r--epan/ftypes/ftype-ipv4.c6
1 files changed, 3 insertions, 3 deletions
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,