Class

GioInetAddress

Description [src]

class Gio.InetAddress : GObject.Object {
  parent_instance: GObject
}

GInetAddress represents an IPv4 or IPv6 internet address. Use g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to look up the GInetAddress for a hostname. Use g_resolver_lookup_by_address() or g_resolver_lookup_by_address_async() to look up the hostname for a GInetAddress.

To actually connect to a remote host, you will need a GInetSocketAddress (which includes a GInetAddress as well as a port number).

Hierarchy

hierarchy this GInetAddress ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

g_inet_address_new_any

Creates a GInetAddress for the “any” address (unassigned/”don’t care”) for family.

Available since: 2.22

g_inet_address_new_from_bytes

Creates a new GInetAddress from the given family and bytes. bytes should be 4 bytes for G_SOCKET_FAMILY_IPV4 and 16 bytes for G_SOCKET_FAMILY_IPV6.

Available since: 2.22

g_inet_address_new_from_string

Parses string as an IP address and creates a new GInetAddress.

Available since: 2.22

g_inet_address_new_loopback

Creates a GInetAddress for the loopback address for family.

Available since: 2.22

Instance methods

g_inet_address_equal

Checks if two GInetAddress instances are equal, e.g. the same address.

Available since: 2.30

g_inet_address_get_family

Gets addresss family.

Available since: 2.22

g_inet_address_get_is_any

Tests whether address is the “any” address for its family.

Available since: 2.22

g_inet_address_get_is_link_local

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).

Available since: 2.22

g_inet_address_get_is_loopback

Tests whether address is the loopback address for its family.

Available since: 2.22

g_inet_address_get_is_mc_global

Tests whether address is a global multicast address.

Available since: 2.22

g_inet_address_get_is_mc_link_local

Tests whether address is a link-local multicast address.

Available since: 2.22

g_inet_address_get_is_mc_node_local

Tests whether address is a node-local multicast address.

Available since: 2.22

g_inet_address_get_is_mc_org_local

Tests whether address is an organization-local multicast address.

Available since: 2.22

g_inet_address_get_is_mc_site_local

Tests whether address is a site-local multicast address.

Available since: 2.22

g_inet_address_get_is_multicast

Tests whether address is a multicast address.

Available since: 2.22

g_inet_address_get_is_site_local

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).

Available since: 2.22

g_inet_address_get_native_size

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().

Available since: 2.22

g_inet_address_to_bytes

Gets the raw binary address data from address.

Available since: 2.22

g_inet_address_to_string

Converts address to string form.

Available since: 2.22

Methods inherited from GObject (43)

Properties

Gio.InetAddress:bytes
No description available.
Gio.InetAddress:family
No description available.
Gio.InetAddress:is-any

Whether this is the “any” address for its family. See g_inet_address_get_is_any().

Available since: 2.22

Gio.InetAddress:is-link-local

Whether this is a link-local address. See g_inet_address_get_is_link_local().

Available since: 2.22

Gio.InetAddress:is-loopback

Whether this is the loopback address for its family. See g_inet_address_get_is_loopback().

Available since: 2.22

Gio.InetAddress:is-mc-global

Whether this is a global multicast address. See g_inet_address_get_is_mc_global().

Available since: 2.22

Gio.InetAddress:is-mc-link-local

Whether this is a link-local multicast address. See g_inet_address_get_is_mc_link_local().

Available since: 2.22

Gio.InetAddress:is-mc-node-local

Whether this is a node-local multicast address. See g_inet_address_get_is_mc_node_local().

Available since: 2.22

Gio.InetAddress:is-mc-org-local

Whether this is an organization-local multicast address. See g_inet_address_get_is_mc_org_local().

Available since: 2.22

Gio.InetAddress:is-mc-site-local

Whether this is a site-local multicast address. See g_inet_address_get_is_mc_site_local().

Available since: 2.22

Gio.InetAddress:is-multicast

Whether this is a multicast address. See g_inet_address_get_is_multicast().

Available since: 2.22

Gio.InetAddress:is-site-local

Whether this is a site-local address. See g_inet_address_get_is_loopback().

Available since: 2.22

Signals

Signals inherited from GObject (1)

Class structure

struct GioInetAddressClass {
  GObjectClass parent_class;
  gchar* (* to_string) (
    GInetAddress* address
  );
  const guint8* (* to_bytes) (
    GInetAddress* address
  );
  
}
Class members
parent_class
GObjectClass
  No description available.
to_string
gchar* (* to_string) (
    GInetAddress* address
  )
  No description available.
to_bytes
const guint8* (* to_bytes) (
    GInetAddress* address
  )
  No description available.

Virtual methods

Gio.InetAddressClass.to_bytes

Gets the raw binary address data from address.

Available since: 2.22

Gio.InetAddressClass.to_string

Converts address to string form.

Available since: 2.22