InetAddressMask

open class InetAddressMask(pointer: <Error class: unknown class><<Error class: unknown class>>) : Initable

GInetAddressMask represents a range of IPv4 or IPv6 addresses described by a base address and a length indicating how many bits of the base address are relevant for matching purposes. These are often given in string form. For example, 10.0.0.0/8, or fe80::/10.

Skipped during bindings generation

  • method to_string: C function g_inet_address_mask_to_string is ignored

Since

2.32

Constructors

Link copied to clipboard
constructor(addr: InetAddress, length: <Error class: unknown class>)

Creates a new #GInetAddressMask representing all addresses whose first @length bits match @addr.

constructor(maskString: String)

Parses @mask_string as an IP address and (optional) length, and creates a new #GInetAddressMask. The length, if present, is delimited by a "/". If it is not present, then the length is assumed to be the full length of the address.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The base address.

Link copied to clipboard

The address family (IPv4 or IPv6).

Link copied to clipboard
val gioInetAddressMaskPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gioInitablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val length: <Error class: unknown class>

The prefix length, in bytes.

Functions

Link copied to clipboard
open fun equal(mask2: InetAddressMask): Boolean

Tests if @mask and @mask2 are the same mask.

Link copied to clipboard

Gets @mask's base address

Link copied to clipboard

Gets the #GSocketFamily of @mask's address

Link copied to clipboard
open fun getLength(): <Error class: unknown class>

Gets @mask's length

Link copied to clipboard
open fun init(cancellable: Cancellable? = null): <Error class: unknown class><Boolean>

Initializes the object implementing the interface.

Link copied to clipboard
open fun matches(address: InetAddress): Boolean

Tests if @address falls within the range described by @mask.