An Internet Protocol (IP) Address.
This class is a set of helpers to translate to and from address strings used in Efl.Net. For IP they take the following formats:
- IPv4 complete: 127.0.0.1:1234 - IPv4 no port: 127.0.0.1 - IPv6 complete: [::1]:1234 - IPv6 no port: [::1] - IPv6 no braces (implies no port): ::1
However in other libraries you can use the address numbers or even a 'struct sockaddr' handle. Translating by yourself may be too much work. To convert to a string just create an instance with Efl.Net.Ip_Address.create or Efl.Net.Ip_Address.create_sockaddr and then query Efl.Net.Ip_Address.string. To convert from numeric string to sockaddr, create an instance with Efl.Net.Ip_Address.parse and then query Efl.Net.Ip_Address.sockaddr.
To resolve a host and port name to numbers use Efl.Net.Ip_Address.resolve, this will asynchronously resolve and return the results in a promise.
The result of Efl.Net.Ip_Address.string can be passed to Efl.Net.Dialer.dial and Efl.Net.Server.serve
⇒ Efl.Object (class)
address (get, set)
The bytes representing the address.
const Eina_Slice efl_net_ip_address_get(const Eo *obj); void efl_net_ip_address_set(Eo *obj, const Eina_Slice address);
Checks if "0.0.0.0" (IPv4) or "::" (IPv6)
Eina_Bool efl_net_ip_address_any_check(const Eo *obj);
create static
Creates an object given family, port and address.
Efl_Net_Ip_Address *efl_net_ip_address_create(uint16_t port, const Eina_Slice address);
create_sockaddr static
Creates an object given sockaddr
Efl_Net_Ip_Address *efl_net_ip_address_create_sockaddr(const void *sockaddr);
family (get, set)
The address family, one of AF_INET6 or AF_INET.
int efl_net_ip_address_family_get(const Eo *obj); void efl_net_ip_address_family_set(Eo *obj, int family);
finalize [Overridden from Efl.Object]
Implement this method to finish the initialization of your object after all (if any) user-provided configuration methods have been executed.
Efl_Object *efl_finalize(Eo *obj);
Checks if IPv4 and is CLASS-A
Eina_Bool efl_net_ip_address_ipv4_class_a_check(const Eo *obj);
Checks if IPv4 and is CLASS-B
Eina_Bool efl_net_ip_address_ipv4_class_b_check(const Eo *obj);
Checks if IPv4 and is CLASS-C
Eina_Bool efl_net_ip_address_ipv4_class_c_check(const Eo *obj);
Checks if IPv4 and is CLASS-D
Eina_Bool efl_net_ip_address_ipv4_class_d_check(const Eo *obj);
Checks if IPv6 is link-local.
Eina_Bool efl_net_ip_address_ipv6_local_link_check(const Eo *obj);
Checks if IPv6 is site-local.
Eina_Bool efl_net_ip_address_ipv6_local_site_check(const Eo *obj);
Checks if IPv6 is compatible with IPv4.
Eina_Bool efl_net_ip_address_ipv6_v4compat_check(const Eo *obj);
Checks if IPv6 is mapping an IPv4.
Eina_Bool efl_net_ip_address_ipv6_v4mapped_check(const Eo *obj);
Checks if loopback "127.0.0.1" (IPv4) or "::1" (IPv6)
Eina_Bool efl_net_ip_address_loopback_check(const Eo *obj);
Checks if multicast
Eina_Bool efl_net_ip_address_multicast_check(const Eo *obj);
parse static
Parses a numeric address and return an object representing it.
Efl_Net_Ip_Address *efl_net_ip_address_parse(const char *numeric_address);
port (get, set)
The address port in Host/Native endianess.
uint16_t efl_net_ip_address_port_get(const Eo *obj); void efl_net_ip_address_port_set(Eo *obj, uint16_t port);
resolve static
Asynchronously resolves host and port names.
Eina_Future *efl_net_ip_address_resolve(const char *address, int family, int flags);
sockaddr (get, set)
The <netinet/in.h>-compatible 'struct sockaddr'.
const void *efl_net_ip_address_sockaddr_get(const Eo *obj); void efl_net_ip_address_sockaddr_set(Eo *obj, const void *sockaddr);
string (get)
const char *efl_net_ip_address_string_get(const Eo *obj);
Efl.Object | ||
---|---|---|
allow_parent_unref (get, set) | Allow an object to be deleted by unref even if it has a parent. | |
children_iterator_new | Get an iterator on all children. | |
comment (get, set) | A human readable comment for the object. | |
composite_attach | Make an object a composite object of another. | |
composite_detach | Detach a composite object from another object. | |
composite_part_is | Check if an object is part of a composite object. | |
constructor | Implement this method to provide optional initialization code for your object. | |
debug_name_override | Build a read-only name for this object used for debugging. | |
destructor | Implement this method to provide deinitialization code for your object if you need it. | |
event_callback_forwarder_del | Remove an event callback forwarder for a specified event and object. | |
event_callback_forwarder_priority_add | Add an event callback forwarder that will make this object emit an event whenever another object (source ) emits it. The event is said to be forwarded from source to this object. |
|
event_callback_stop | Stop the current callback call. | |
event_freeze | Freeze events of this object. | |
event_freeze_count (get) | ||
static | event_global_freeze | Globally freeze events for ALL EFL OBJECTS. |
static | event_global_freeze_count (get) | |
static | event_global_thaw | Globally thaw events for ALL EFL OBJECTS. |
event_thaw | Thaw events of object. | |
finalized (get) | ||
invalidate | Implement this method to perform special actions when your object loses its parent, if you need to. | |
invalidated (get) | ||
invalidating (get) | ||
name (get, set) | The name of the object. | |
name_find | Find a child object with the given name and return it. | |
parent (get, set) | The parent of an object. | |
provider_find | Searches upwards in the object tree for a provider which knows the given class/interface. | |
provider_register | Will register a manager of a specific class to be answered by Efl.Object.provider_find. | |
provider_unregister | Will unregister a manager of a specific class that was previously registered and answered by Efl.Object.provider_find. |
Efl.Object | ||
---|---|---|
del | Object is being deleted. See Efl.Object.destructor. | |
destruct | Object has been fully destroyed. It can not be used beyond this point. This event should only serve to clean up any reference you keep to the object. | |
invalidate | Object is being invalidated and losing its parent. See Efl.Object.invalidate. | |
noref | Object has lost its last reference, only parent relationship is keeping it alive. Advanced usage. | |
ownership,shared | Object has acquired a second reference. It has multiple owners now. Triggered whenever increasing the refcount from one to two, it will not trigger by further increasing the refcount beyond two. | |
ownership,unique | Object has lost a reference and only one is left. It has just one owner now. Triggered whenever the refcount goes from two to one. |