InetAddressMask

open class InetAddressMask(val gioInetAddressMaskPointer: <Error class: unknown class><<Error class: unknown class>>) : Initable(source)

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.

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(gioInetAddressMaskPointer: <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
abstract val gioProxyPointer: <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 connect(connection: IoStream, proxyAddress: ProxyAddress, cancellable: Cancellable? = null): <Error class: unknown class><IoStream>

Given @connection to communicate with a proxy (eg, a #GSocketConnection that is connected to the proxy server), this does the necessary handshake to connect to @proxy_address, and if required, wraps the #GIOStream to handle proxy payload.

Link copied to clipboard
open fun connectAsync(connection: IoStream, proxyAddress: ProxyAddress, cancellable: Cancellable? = null, callback: AsyncReadyCallback?)

Asynchronous version of g_proxy_connect().

Link copied to clipboard
open fun connectFinish(result: AsyncResult): <Error class: unknown class><IoStream>

See g_proxy_connect().

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

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

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.

Link copied to clipboard

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return false if @proxy is implementing such a protocol. When false is returned, the caller should resolve the destination hostname first, and then pass a #GProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().

Link copied to clipboard
open override fun toString(): String

Converts @mask back to its corresponding string form.