Functions
g_inet_address_new_from_string ()
GInetAddress *
g_inet_address_new_from_string (const gchar *string);
Parses string
as an IP address and creates a new GInetAddress.
Returns
a new GInetAddress corresponding to string
, or NULL if
string
could not be parsed.
Free the returned object with g_object_unref().
Since: 2.22
g_inet_address_new_any ()
GInetAddress *
g_inet_address_new_any (GSocketFamily family);
Creates a GInetAddress for the "any" address (unassigned/"don't
care") for family
.
Returns
a new GInetAddress corresponding to the "any" address
for family
.
Free the returned object with g_object_unref().
Since: 2.22
g_inet_address_new_loopback ()
GInetAddress *
g_inet_address_new_loopback (GSocketFamily family);
Creates a GInetAddress for the loopback address for family
.
Returns
a new GInetAddress corresponding to the loopback address
for family
.
Free the returned object with g_object_unref().
Since: 2.22
g_inet_address_equal ()
gboolean
g_inet_address_equal (GInetAddress *address,
GInetAddress *other_address);
Checks if two GInetAddress instances are equal, e.g. the same address.
Returns
TRUE if address
and other_address
are equal, FALSE otherwise.
Since: 2.30
g_inet_address_to_bytes ()
const guint8 *
g_inet_address_to_bytes (GInetAddress *address);
Gets the raw binary address data from address
.
[skip]
Returns
a pointer to an internal array of the bytes in address
,
which should not be modified, stored, or freed. The size of this
array can be gotten with g_inet_address_get_native_size().
Since: 2.22
g_inet_address_get_native_size ()
gsize
g_inet_address_get_native_size (GInetAddress *address);
Gets the size of the native raw binary address for address
. This
is the size of the data that you get from g_inet_address_to_bytes().
Returns
the number of bytes used for the native version of address
.
Since: 2.22
g_inet_address_to_string ()
gchar *
g_inet_address_to_string (GInetAddress *address);
Converts address
to string form.
Returns
a representation of address
as a string, which should be
freed after use.
Since: 2.22
g_inet_address_get_family ()
GSocketFamily
g_inet_address_get_family (GInetAddress *address);
Gets address
's family
Returns
address
's family
Since: 2.22
g_inet_address_get_is_any ()
gboolean
g_inet_address_get_is_any (GInetAddress *address);
Tests whether address
is the "any" address for its family.
Returns
TRUE if address
is the "any" address for its family.
Since: 2.22
g_inet_address_get_is_loopback ()
gboolean
g_inet_address_get_is_loopback (GInetAddress *address);
Tests whether address
is the loopback address for its family.
Returns
TRUE if address
is the loopback address for its family.
Since: 2.22
g_inet_address_get_is_link_local ()
gboolean
g_inet_address_get_is_link_local (GInetAddress *address);
Tests whether address
is a link-local address (that is, if it
identifies a host on a local network that is not connected to the
Internet).
Returns
TRUE if address
is a link-local address.
Since: 2.22
g_inet_address_get_is_site_local ()
gboolean
g_inet_address_get_is_site_local (GInetAddress *address);
Tests whether address
is a site-local address such as 10.0.0.1
(that is, the address identifies a host on a local network that can
not be reached directly from the Internet, but which may have
outgoing Internet connectivity via a NAT or firewall).
Returns
TRUE if address
is a site-local address.
Since: 2.22
g_inet_address_get_is_multicast ()
gboolean
g_inet_address_get_is_multicast (GInetAddress *address);
Tests whether address
is a multicast address.
Returns
TRUE if address
is a multicast address.
Since: 2.22
g_inet_address_get_is_mc_link_local ()
gboolean
g_inet_address_get_is_mc_link_local (GInetAddress *address);
Tests whether address
is a link-local multicast address.
Returns
TRUE if address
is a link-local multicast address.
Since: 2.22
g_inet_address_get_is_mc_node_local ()
gboolean
g_inet_address_get_is_mc_node_local (GInetAddress *address);
Tests whether address
is a node-local multicast address.
Returns
TRUE if address
is a node-local multicast address.
Since: 2.22
g_inet_address_get_is_mc_site_local ()
gboolean
g_inet_address_get_is_mc_site_local (GInetAddress *address);
Tests whether address
is a site-local multicast address.
Returns
TRUE if address
is a site-local multicast address.
Since: 2.22
g_inet_address_get_is_mc_org_local ()
gboolean
g_inet_address_get_is_mc_org_local (GInetAddress *address);
Tests whether address
is an organization-local multicast address.
Returns
TRUE if address
is an organization-local multicast address.
Since: 2.22
g_inet_address_get_is_mc_global ()
gboolean
g_inet_address_get_is_mc_global (GInetAddress *address);
Tests whether address
is a global multicast address.
Returns
TRUE if address
is a global multicast address.
Since: 2.22
Property Details
The “bytes” property
“bytes” gpointer
The raw address data.
Owner: GInetAddress
Flags: Read / Write / Construct Only
The “family” property
“family” GSocketFamily
The address family (IPv4 or IPv6).
Owner: GInetAddress
Flags: Read / Write / Construct Only
Default value: G_SOCKET_FAMILY_INVALID
The “is-any” property
“is-any” gboolean
Whether this is the "any" address for its family.
See g_inet_address_get_is_any().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-link-local” property
“is-link-local” gboolean
Whether this is a link-local address.
See g_inet_address_get_is_link_local().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-loopback” property
“is-loopback” gboolean
Whether this is the loopback address for its family.
See g_inet_address_get_is_loopback().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-mc-global” property
“is-mc-global” gboolean
Whether this is a global multicast address.
See g_inet_address_get_is_mc_global().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-mc-link-local” property
“is-mc-link-local” gboolean
Whether this is a link-local multicast address.
See g_inet_address_get_is_mc_link_local().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-mc-node-local” property
“is-mc-node-local” gboolean
Whether this is a node-local multicast address.
See g_inet_address_get_is_mc_node_local().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-mc-org-local” property
“is-mc-org-local” gboolean
Whether this is an organization-local multicast address.
See g_inet_address_get_is_mc_org_local().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-mc-site-local” property
“is-mc-site-local” gboolean
Whether this is a site-local multicast address.
See g_inet_address_get_is_mc_site_local().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-multicast” property
“is-multicast” gboolean
Whether this is a multicast address.
See g_inet_address_get_is_multicast().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22
The “is-site-local” property
“is-site-local” gboolean
Whether this is a site-local address.
See g_inet_address_get_is_loopback().
Owner: GInetAddress
Flags: Read
Default value: FALSE
Since: 2.22