Package ch.bailu.gtk.gio
Class InetAddressMask
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.InetAddressMask
- All Implemented Interfaces:
PointerInterface
#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. Eg, "10.0.0.0/8", or "fe80::/10".
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. Eg, "10.0.0.0/8", or "fe80::/10".
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionInetAddressMask
(InetAddress addr, int length) Creates a new #GInetAddressMask representing all addresses whose
first @length bits match @addr.InetAddressMask
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceInitable
.boolean
equal
(InetAddressMask mask2) Tests if @mask and @mask2 are the same mask.Gets @mask's base addressstatic ClassHandler
int
Gets the #GSocketFamily of @mask's addressstatic int
int
Gets @mask's lengthstatic long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
matches
(InetAddress address) Tests if @address falls within the range described by @mask.static InetAddressMask
newFromStringInetAddressMask
(Str mask_string) Parses @mask_string as an IP address and (optional) length, and
creates a new #GInetAddressMask.static InetAddressMask
newFromStringInetAddressMask
(String mask_string) Parses @mask_string as an IP address and (optional) length, and
creates a new #GInetAddressMask.toStr()
Converts @mask back to its corresponding string form.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
InetAddressMask
-
InetAddressMask
Creates a new #GInetAddressMask representing all addresses whose
first @length bits match @addr.- Parameters:
addr
- a #GInetAddresslength
- number of bits of @addr to use
-
-
Method Details
-
getClassHandler
-
newFromStringInetAddressMask
public static InetAddressMask newFromStringInetAddressMask(@Nonnull Str mask_string) throws AllocationError 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.- Parameters:
mask_string
- an IP address or address/length string- Returns:
- a new #GInetAddressMask corresponding to @string, or %NULL on error.
- Throws:
AllocationError
-
newFromStringInetAddressMask
public static InetAddressMask newFromStringInetAddressMask(String mask_string) throws AllocationError 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.- Parameters:
mask_string
- an IP address or address/length string- Returns:
- a new #GInetAddressMask corresponding to @string, or %NULL on error.
- Throws:
AllocationError
-
equal
Tests if @mask and @mask2 are the same mask.- Parameters:
mask2
- another #GInetAddressMask- Returns:
- whether @mask and @mask2 are the same mask
-
getAddress
Gets @mask's base address- Returns:
- @mask's base address
-
getFamily
public int getFamily()Gets the #GSocketFamily of @mask's address- Returns:
- the #GSocketFamily of @mask's address
-
getLength
public int getLength()Gets @mask's length- Returns:
- @mask's length
-
matches
Tests if @address falls within the range described by @mask.- Parameters:
address
- a #GInetAddress- Returns:
- whether @address falls within the range described by @mask.
-
toStr
Converts @mask back to its corresponding string form.- Returns:
- a string corresponding to @mask.
-
asInitable
Implements interfaceInitable
. Call this to get access to interface functions.- Returns:
Initable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-