2 * Definitions of IPv4 address-and-mask structure, which is what an
3 * FT_IPV4 value is (even if there's no mask in a packet, those
4 * values can be compared against an address+mask in a filter
7 * Gilbert Ramirez <gram@alumni.rice.edu>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include <wireshark.h>
20 #include <wsutil/inet_addr.h>
23 uint32_t addr
; /* stored in host order */
24 uint32_t nmask
; /* stored in host order */
30 } ipv6_addr_and_prefix
;
33 ********** IPv4 *********
37 * Returns the IPv4 subnet mask of the specified length
39 * @param mask_length the number of bits in the subnet mask (max of 32)
40 * @return the subnet mask of the specified length
44 ws_ipv4_get_subnet_mask(const uint32_t mask_length
);
48 ws_ipv4_addr_and_mask_init(ipv4_addr_and_mask
*dst
, ws_in4_addr src_addr
, int src_bits
);
52 ws_ipv4_addr_and_mask_contains(const ipv4_addr_and_mask
*ipv4
, const ws_in4_addr
*addr
);
55 ********** IPv6 *********
60 ws_ipv6_addr_and_prefix_contains(const ipv6_addr_and_prefix
*ipv6
, const ws_in6_addr
*addr
);