diff options
Diffstat (limited to 'epan/ipv4.h')
-rw-r--r-- | epan/ipv4.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/epan/ipv4.h b/epan/ipv4.h index 6bc65027e4..fce104aedb 100644 --- a/epan/ipv4.h +++ b/epan/ipv4.h @@ -34,35 +34,37 @@ typedef struct { guint32 addr; /* stored in host order */ guint32 nmask; /* stored in host order */ -} ipv4_addr; +} ipv4_addr_and_mask; -/* Allocate a new ipv4_addr struct, initialize it, and return pointer */ -ipv4_addr* ipv4_addr_new(void); +/* Allocate a new ipv4_addr_and_mask struct, initialize it, + * and return pointer + */ +ipv4_addr_and_mask* ipv4_addr_and_mask_new(void); -/* Frees an ipv4 struct */ -void ipv4_addr_free(ipv4_addr *ipv4); +/* Frees an ipv4_addr_and_mask struct */ +void ipv4_addr_and_mask_free(ipv4_addr_and_mask *ipv4); -void ipv4_addr_set_host_order_addr(ipv4_addr *ipv4, const guint32 new_addr); -void ipv4_addr_set_net_order_addr(ipv4_addr *ipv4, const guint32 new_addr); -void ipv4_addr_set_netmask_bits(ipv4_addr *ipv4, const guint new_nmask_bits); +void ipv4_addr_and_mask_set_host_order_addr(ipv4_addr_and_mask *ipv4, const guint32 new_addr); +void ipv4_addr_and_mask_set_net_order_addr(ipv4_addr_and_mask *ipv4, const guint32 new_addr); +void ipv4_addr_and_mask_set_netmask_bits(ipv4_addr_and_mask *ipv4, const guint new_nmask_bits); WS_DLL_PUBLIC -guint32 ipv4_get_net_order_addr(ipv4_addr *ipv4); -guint32 ipv4_get_host_order_addr(ipv4_addr *ipv4); +guint32 ipv4_get_net_order_addr(ipv4_addr_and_mask *ipv4); +guint32 ipv4_get_host_order_addr(ipv4_addr_and_mask *ipv4); /* Fills in a buffer with a dotted-decimal notation representation of an IPv4 * address. */ -void ipv4_addr_str_buf(const ipv4_addr *ipv4, gchar *buf); +void ipv4_addr_and_mask_str_buf(const ipv4_addr_and_mask *ipv4, gchar *buf); -/* Compares two ipv4_addrs, taking into account the less restrictive of the +/* Compares two ipv4_addr_and_masks, taking into account the less restrictive of the * two netmasks, applying that netmask to both addrs. */ -gboolean ipv4_addr_eq(const ipv4_addr *a, const ipv4_addr *b); -gboolean ipv4_addr_gt(const ipv4_addr *a, const ipv4_addr *b); -gboolean ipv4_addr_ge(const ipv4_addr *a, const ipv4_addr *b); -gboolean ipv4_addr_lt(const ipv4_addr *a, const ipv4_addr *b); -gboolean ipv4_addr_le(const ipv4_addr *a, const ipv4_addr *b); +gboolean ipv4_addr_and_mask_eq(const ipv4_addr_and_mask *a, const ipv4_addr_and_mask *b); +gboolean ipv4_addr_and_mask_gt(const ipv4_addr_and_mask *a, const ipv4_addr_and_mask *b); +gboolean ipv4_addr_and_mask_ge(const ipv4_addr_and_mask *a, const ipv4_addr_and_mask *b); +gboolean ipv4_addr_and_mask_lt(const ipv4_addr_and_mask *a, const ipv4_addr_and_mask *b); +gboolean ipv4_addr_and_mask_le(const ipv4_addr_and_mask *a, const ipv4_addr_and_mask *b); -#define ipv4_addr_ne(a,b) !ipv4_addr_eq((a),(b)) +#define ipv4_addr_and_mask_ne(a,b) !ipv4_addr_and_mask_eq((a),(b)) #endif |