interface handling for the Commotion daemon More...
Go to the source code of this file.
Classes | |
struct | co_iface_t |
contains the file descriptor, interface status (up or down), profile name, interface frequency struct, wpa control struct, wpa id, and a bool to indicare whether the interface is wireless or not More... | |
Macros | |
#define | FREQ_LEN 5 |
#define | MAC_LEN 6 |
#define | WPA_REPLY_SIZE 2048 |
#define | IFACES_MAX 32 |
#define | SIOCGIWNAME 0x8B01 |
Typedefs | |
typedef struct co_iface_t | co_iface_t |
Enumerations | |
enum | co_iface_status_t { DOWN = 0, UP = 1 } |
Functions | |
struct co_iface_t | __attribute__ ((packed)) |
int | co_ifaces_create (void) |
checks for available interfaces | |
void | co_ifaces_shutdown (void) |
removes all interfaces | |
int | co_iface_remove (char *iface_name) |
removes an interface from the list of available interfaces More... | |
co_obj_t * | co_iface_add (const char *iface_name, const int family) |
adds a new interface to the list of available interfaces, and checks whether it is IPv4 and IPv6 capable, and whether it is wireless More... | |
int | co_iface_wpa_connect (co_obj_t *iface) |
connects the commotion interface to wpa supplicant More... | |
int | co_iface_wpa_disconnect (co_obj_t *iface) |
turns off wpa supplicant More... | |
int | co_iface_get_mac (co_obj_t *iface, unsigned char *output, int output_size) |
int | co_iface_set_ip (co_obj_t *iface, const char *ip_addr, const char *netmask) |
sets ip address and netmask for commotion interface More... | |
int | co_iface_unset_ip (co_obj_t *iface) |
Resets ip address of chosen interface. More... | |
int | co_iface_set_ssid (co_obj_t *iface, const char *ssid) |
sets SSID from profile or uses default More... | |
int | co_iface_set_bssid (co_obj_t *iface, const char *bssid) |
sets BSSID from profile or uses default More... | |
int | co_iface_set_frequency (co_obj_t *iface, const int frequency) |
sets wireless frequency (eg. channel) from profile or uses default More... | |
int | co_iface_set_encryption (co_obj_t *iface, const char *proto) |
specifies the wpa encryption protocol More... | |
int | co_iface_set_key (co_obj_t *iface, const char *key) |
specifies the wpa encryption key More... | |
int | co_iface_set_mode (co_obj_t *iface, const char *mode) |
specifies the Wi-Fi mode More... | |
int | co_iface_set_apscan (co_obj_t *iface, const int value) |
sets AP_SCAN value More... | |
int | co_iface_wireless_enable (co_obj_t *iface) |
enables specified wireless network More... | |
int | co_iface_wireless_disable (co_obj_t *iface) |
disables specified wireless network More... | |
int | co_set_dns (const char *dnsserver, const char *searchdomain, const char *resolvpath) |
sets DNS name server and sets search domain More... | |
int | co_generate_ip (const char *base, const char *genmask, const nodeid_t id, char *output, int type) |
generates an ip table for a commotion interface More... | |
char * | co_iface_profile (char *iface_name) |
sets node configuration profile More... | |
co_obj_t * | co_iface_get (char *iface_name) |
retrieves node configuration profile More... | |
Variables | |
co_obj_t | _header |
uint8_t | _exttype |
uint8_t | _len |
int | fd |
co_iface_status_t | status |
char * | profile |
struct ifreq | ifr |
struct wpa_ctrl * | ctrl |
int | wpa_id |
bool | wireless |
Detailed Description
interface handling for the Commotion daemon
Enumeration Type Documentation
enum co_iface_status_t |
indicates whether the interface is UP(1) or DOWN(0)
Function Documentation
int co_generate_ip | ( | const char * | base, |
const char * | genmask, | ||
const nodeid_t | id, | ||
char * | output, | ||
int | type | ||
) |
generates an ip table for a commotion interface
- Parameters
-
base base address genmask genmask id the node id type whether the device is a gateway (1) or not (0)
co_obj_t* co_iface_add | ( | const char * | iface_name, |
const int | family | ||
) |
adds a new interface to the list of available interfaces, and checks whether it is IPv4 and IPv6 capable, and whether it is wireless
- Parameters
-
iface_name name of the interface family address family of the interface. Must be AF_INET (IPv4) or AF_INET6 (IPv6), which uses host and port number for addressing
References co_list_append(), and strlcpy().
co_obj_t* co_iface_get | ( | char * | iface_name | ) |
retrieves node configuration profile
- Parameters
-
iface_name name of interface
References co_list_parse().
int co_iface_get_mac | ( | co_obj_t * | iface, |
unsigned char * | output, | ||
int | output_size | ||
) |
- Parameters
-
iface interface object output output of hardware MAC address lookup output_size size of MAC address. Must be six bytes
char* co_iface_profile | ( | char * | iface_name | ) |
sets node configuration profile
- Parameters
-
iface_name name of interface
References co_list_parse().
int co_iface_remove | ( | char * | iface_name | ) |
removes an interface from the list of available interfaces
- Parameters
-
iface_name name of interface to be removed
References co_iface_unset_ip(), co_iface_wireless_disable(), co_iface_wpa_disconnect(), co_list_delete(), and co_list_parse().
int co_iface_set_apscan | ( | co_obj_t * | iface, |
const int | value | ||
) |
sets AP_SCAN value
- Parameters
-
iface interface object value desired value for AP_SCAN
int co_iface_set_bssid | ( | co_obj_t * | iface, |
const char * | bssid | ||
) |
sets BSSID from profile or uses default
- Parameters
-
iface interface object bssid desired BSSID
int co_iface_set_encryption | ( | co_obj_t * | iface, |
const char * | proto | ||
) |
int co_iface_set_frequency | ( | co_obj_t * | iface, |
const int | frequency | ||
) |
sets wireless frequency (eg. channel) from profile or uses default
- Parameters
-
iface interface object frequency desired frequency
int co_iface_set_ip | ( | co_obj_t * | iface, |
const char * | ip_addr, | ||
const char * | netmask | ||
) |
sets ip address and netmask for commotion interface
- Parameters
-
iface interface object ip_addr ip address for the socket netmask netmask for the socket
int co_iface_set_key | ( | co_obj_t * | iface, |
const char * | key | ||
) |
int co_iface_set_mode | ( | co_obj_t * | iface, |
const char * | mode | ||
) |
int co_iface_set_ssid | ( | co_obj_t * | iface, |
const char * | ssid | ||
) |
int co_iface_unset_ip | ( | co_obj_t * | iface | ) |
Resets ip address of chosen interface.
- Parameters
-
iface interface object
Referenced by co_iface_remove().
int co_iface_wireless_disable | ( | co_obj_t * | iface | ) |
disables specified wireless network
- Parameters
-
iface interface object
Referenced by co_iface_remove().
int co_iface_wireless_enable | ( | co_obj_t * | iface | ) |
enables specified wireless network
- Parameters
-
iface interface object
int co_iface_wpa_connect | ( | co_obj_t * | iface | ) |
connects the commotion interface to wpa supplicant
- Parameters
-
iface interface object
int co_iface_wpa_disconnect | ( | co_obj_t * | iface | ) |
turns off wpa supplicant
- Parameters
-
iface interface object
Referenced by co_iface_remove().
int co_set_dns | ( | const char * | dnsserver, |
const char * | searchdomain, | ||
const char * | resolvpath | ||
) |
sets DNS name server and sets search domain
- Parameters
-
dnsserver IP addresss of DNS server searchdomain desired search domain resolvpath filepath to resolv.conf
Generated on Fri Jun 6 2014 13:22:05 for commotiond by 1.8.7