Gather information about network devices. More...
Typedefs | |
| typedef struct Eeze_Net | Eeze_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. | |
Gather information about network devices.
| EAPI Eeze_Net * eeze_net_new | ( | const char * | name | ) |
Create a new net object.
| name | The name of the underlying device (eth0, br1, etc) |
This function creates a new net object based on name. Only the most minimal lookups are performed at creation in order to save memory.
References eina_hash_add(), eina_hash_find(), EINA_REFCOUNT_INIT, EINA_REFCOUNT_REF, eina_stringshare_add(), and eina_stringshare_del().
Referenced by eeze_net_list().
| EAPI void eeze_net_free | ( | Eeze_Net * | net | ) |
Free a net object.
| net | The object to free |
Use this function to free a net object.
References eina_hash_del_by_key(), EINA_REFCOUNT_UNREF, EINA_SAFETY_ON_NULL_RETURN, and eina_stringshare_del().
| EAPI const char * eeze_net_mac_get | ( | Eeze_Net * | net | ) |
Get the MAC address of a net object.
| net | The net object |
net. References EINA_SAFETY_ON_NULL_RETURN_VAL.
| EAPI int eeze_net_idx_get | ( | Eeze_Net * | net | ) |
Get the index of a net object.
| net | The net object |
net References EINA_SAFETY_ON_NULL_RETURN_VAL.
| EAPI Eina_Bool eeze_net_scan | ( | Eeze_Net * | net | ) |
Scan an interface to cache its network addresses.
| net | The net object to scan |
References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_replace_length(), and EINA_TRUE.
| EAPI const char * eeze_net_addr_get | ( | Eeze_Net * | net, |
| Eeze_Net_Addr_Type | type ) |
Get the address of a net object.
| net | The net object |
| type | The type of address to retrieve |
net corresponding to type, NULL on failure This function returns a value previously cached. References EINA_SAFETY_ON_NULL_RETURN_VAL.
| EAPI const char * eeze_net_attribute_get | ( | Eeze_Net * | net, |
| const char * | attr ) |
Get a system attribute of a net object.
| net | The net object |
| attr | The attribute to retrieve |
net References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.
| EAPI const char * eeze_net_syspath_get | ( | Eeze_Net * | net | ) |
Get the /sys/ path of a net object.
| net | The net object |
References EINA_SAFETY_ON_NULL_RETURN_VAL.
| EAPI Eina_List * eeze_net_list | ( | void | ) |
Get a list of all the network interfaces available.
References eeze_net_new(), and eina_list_append().