Net
Functions | |
Eeze_Net * | eeze_net_new (const char *name) |
Create a new net object. | |
void | eeze_net_free (Eeze_Net *net) |
Free a net object. | |
const char * | eeze_net_mac_get (Eeze_Net *net) |
Get the MAC address of a net object. | |
int | eeze_net_idx_get (Eeze_Net *net) |
Get the index of a net object. | |
Eina_Bool | eeze_net_scan (Eeze_Net *net) |
Scan an interface to cache its network addresses. | |
const char * | eeze_net_addr_get (Eeze_Net *net, Eeze_Net_Addr_Type type) |
Get the address of a net object. | |
const char * | eeze_net_attribute_get (Eeze_Net *net, const char *attr) |
Get a system attribute of a net object. | |
const char * | eeze_net_syspath_get (Eeze_Net *net) |
Get the /sys/ path of a net object. | |
Eina_List * | eeze_net_list (void) |
Get a list of all the network interfaces available. |
Function Documentation
EAPI const char * eeze_net_addr_get | ( | Eeze_Net * | net, |
Eeze_Net_Addr_Type | type | ||
) |
Get the address of a net object.
- Parameters:
-
net The net object type The type of address to retrieve
- Returns:
- The stringshared address for
net
corresponding totype
, NULL on failure This function returns a value previously cached.
- See also:
- eeze_net_scan()
EAPI const char * eeze_net_attribute_get | ( | Eeze_Net * | net, |
const char * | attr | ||
) |
Get a system attribute of a net object.
- Parameters:
-
net The net object attr The attribute to retrieve
- Returns:
- The non-stringshared value of the attribute, NULL on failure Use this function to perform a udev sysattr lookup on the underlying device of
net
EAPI void eeze_net_free | ( | Eeze_Net * | net | ) |
Free a net object.
- Parameters:
-
net The object to free
Use this function to free a net object.
- See also:
- eeze_net_new()
- eeze_net_list()
EAPI int eeze_net_idx_get | ( | Eeze_Net * | net | ) |
Get the index of a net object.
- Parameters:
-
net The net object
- Returns:
- The ifindex of the object, -1 on failure Use this function to get the hardware index of
net
EAPI Eina_List * eeze_net_list | ( | void | ) |
Get a list of all the network interfaces available.
- Returns:
- A list of Eeze_Net objects Use this function to get all network interfaces available to the application. This list must be freed by the user.
References eeze_net_new().
EAPI const char * eeze_net_mac_get | ( | Eeze_Net * | net | ) |
Get the MAC address of a net object.
- Parameters:
-
net The net object
- Returns:
- The MAC address, NULL on failure Use this function to retrieve the non-stringshared MAC address of
net
.
EAPI Eeze_Net * eeze_net_new | ( | const char * | name | ) |
Create a new net object.
- Parameters:
-
name The name of the underlying device (eth0, br1, etc)
- Returns:
- A newly allocated net object, or NULL on failure
This function creates a new net object based on name
. Only the most minimal lookups are performed at creation in order to save memory.
Referenced by eeze_net_list().
EAPI Eina_Bool eeze_net_scan | ( | Eeze_Net * | net | ) |
Scan an interface to cache its network addresses.
- Parameters:
-
net The net object to scan
- Returns:
- EINA_TRUE on success, EINA_FALSE on failure Use this function to scan and cache the ip address, netmask, and broadcast address for an interface. This function will perform a full scan every time it is called, and IPv6 addresses will be cached if Eeze was compiled with IPv6 support was enabled at compile time.
- See also:
- eeze_net_addr_get()
EAPI const char * eeze_net_syspath_get | ( | Eeze_Net * | net | ) |
Get the /sys/ path of a net object.
- Parameters:
-
net The net object
- Returns:
- The stringshared /sys/ path of the interface, NULL on failure