### Class

# Gio InetAddress

#### Description [src]

    class Gio.InetAddress : GObject.Object
    {
      /* No available fields */
    }

`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

#### Ancestors

- GObject

#### Constructors

###### g_inet_address_new_any

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

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

since: 2.22

###### g_inet_address_new_from_bytes_with_ipv6_info

Creates a new `GInetAddress` from the given `family`, `bytes` and `scope_id`.

since: 2.86

###### g_inet_address_new_from_string

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

since: 2.22

###### g_inet_address_new_loopback

Creates a `GInetAddress` for the loopback address for `family`.

since: 2.22

#### Instance methods

###### g_inet_address_equal

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

since: 2.30

###### g_inet_address_get_family

Gets `address`‘s family.

since: 2.22

###### g_inet_address_get_flowinfo

Gets the value of `GInetAddress:flowinfo`.

since: 2.86

###### g_inet_address_get_is_any

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

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

since: 2.22

###### g_inet_address_get_is_loopback

Tests whether `address` is the loopback address for its family.

since: 2.22

###### g_inet_address_get_is_mc_global

Tests whether `address` is a global multicast address.

since: 2.22

###### g_inet_address_get_is_mc_link_local

Tests whether `address` is a link-local multicast address.

since: 2.22

###### g_inet_address_get_is_mc_node_local

Tests whether `address` is a node-local multicast address.

since: 2.22

###### g_inet_address_get_is_mc_org_local

Tests whether `address` is an organization-local multicast address.

since: 2.22

###### g_inet_address_get_is_mc_site_local

Tests whether `address` is a site-local multicast address.

since: 2.22

###### g_inet_address_get_is_multicast

Tests whether `address` is a multicast address.

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

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

since: 2.22

###### g_inet_address_get_scope_id

Gets the value of `GInetAddress:scope-id`.

since: 2.86

###### g_inet_address_to_bytes

Gets the raw binary address data from `address`.

since: 2.22

###### g_inet_address_to_string

Converts `address` to string form.

since: 2.22

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gio.InetAddress:bytes

The raw address data.

since: 2.22

###### Gio.InetAddress:family

The address family (IPv4 or IPv6).

since: 2.22

###### Gio.InetAddress:flowinfo

The flowinfo for an IPv6 address. See `g_inet_address_get_flowinfo()`.

since: 2.86

###### Gio.InetAddress:is-any

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

since: 2.22

###### Gio.InetAddress:is-link-local

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

since: 2.22

###### Gio.InetAddress:is-loopback

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

since: 2.22

###### Gio.InetAddress:is-mc-global

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

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

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

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

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

since: 2.22

###### Gio.InetAddress:is-multicast

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

since: 2.22

###### Gio.InetAddress:is-site-local

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

since: 2.22

###### Gio.InetAddress:scope-id

The scope-id for an IPv6 address. See `g_inet_address_get_scope_id()`.

since: 2.86

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GioInetAddressClass {
      GObjectClass parent_class;
      gchar* (* to_string) (
        GInetAddress* address
      );
      const guint8* (* to_bytes) (
        GInetAddress* address
      );

    }

No description available.

###### 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`.

since: 2.22

###### Gio.InetAddressClass.to_string

Converts `address` to string form.

since: 2.22