Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Functions
inet_cidr.h File Reference
#include <wireshark.h>
#include <wsutil/inet_addr.h>

Go to the source code of this file.

Classes

struct  ipv4_addr_and_mask
 
struct  ipv6_addr_and_prefix
 

Functions

WS_DLL_PUBLIC uint32_t ws_ipv4_get_subnet_mask (const uint32_t mask_length)
 
WS_DLL_PUBLIC void ws_ipv4_addr_and_mask_init (ipv4_addr_and_mask *dst, ws_in4_addr src_addr, int src_bits)
 
WS_DLL_PUBLIC bool ws_ipv4_addr_and_mask_contains (const ipv4_addr_and_mask *ipv4, const ws_in4_addr *addr)
 
WS_DLL_PUBLIC bool ws_ipv6_addr_and_prefix_contains (const ipv6_addr_and_prefix *ipv6, const ws_in6_addr *addr)
 

Detailed Description

Definitions of IPv4 address-and-mask structure, which is what an FT_IPV4 value is (even if there's no mask in a packet, those values can be compared against an address+mask in a filter expression).

Gilbert Ramirez gram@.nosp@m.alum.nosp@m.ni.ri.nosp@m.ce.e.nosp@m.du

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ ws_ipv4_get_subnet_mask()

WS_DLL_PUBLIC uint32_t ws_ipv4_get_subnet_mask ( const uint32_t  mask_length)

Returns the IPv4 subnet mask of the specified length

Parameters
mask_lengththe number of bits in the subnet mask (max of 32)
Returns
the subnet mask of the specified length