15 #include <net/ethernet.h>
17 #include <netinet/if_ether.h>
19 #include "linux/rtnetlink.h"
22 #define NL_CB_TYPE NL_CB_DEBUG
24 #define NL_CB_TYPE NL_CB_DEFAULT
41 char ifname[IF_NAMESIZE];
44 uint8_t addr[ETHER_ADDR_LEN];
98 const char *ip_addr,
const char *brd_addr,
99 const char *subnet_mask);
122 const char *type,
const char *ip_addr,
123 const char *brd_addr,
const char *subnet_mask);
int nl_is_iw_vlan(const char *ifname)
Check if interface has the VLAN capability.
Definition: nl.c:1202
int nl_create_interface(const struct nlctx *context, const char *ifname, const char *type, const char *ip_addr, const char *brd_addr, const char *subnet_mask)
Creates and interface and assigns an IP.
Definition: nl.c:849
void nl_free_context(struct nlctx *context)
Frees the nl context.
Definition: nl.c:843
int nl_set_interface_state(const char *if_name, bool state)
Set the interface state.
Definition: nl.c:797
int nl_new_interface(const char *if_name, const char *type)
Creates a new interface object.
Definition: nl.c:728
UT_array * nl_get_interfaces(int if_id)
Get the array of struct netif_info_t for each available interface.
Definition: nl.c:675
int nl_set_interface_ip(const struct nlctx *context, const char *ifname, const char *ip_addr, const char *brd_addr, const char *subnet_mask)
Set the interface IP.
Definition: nl.c:760
int iwace_isvlan(uint32_t wiphy)
Check if wireless physical interface has VLAN capability.
Definition: nl.c:1119
char * nl_get_valid_iw(char buf[static IF_NAMESIZE])
Returns an exisiting WiFi interface name that supports VLAN.
Definition: nl.c:1240
int nl_reset_interface(const char *ifname)
Resets the interface.
Definition: nl.c:896
struct nlctx * nl_init_context(void)
Initialises the nl context.
Definition: nl.c:832
UT_array * get_netiw_info(void)
Get the array of all wireless physical interfaces.
Definition: nl.c:1161
struct nlmsghdr n
Definition: nl.h:49
char buf[1024]
Definition: nl.h:51
struct ifinfomsg i
Definition: nl.h:50
Network wireless interface information structure.
Definition: nl.h:40
uint64_t wdev
Definition: nl.h:43
uint32_t ifindex
Definition: nl.h:42
int nl80211_id
Definition: nl.h:33
struct nl_sock * nl_sock
Definition: nl.h:32
void * reserved
Definition: nl.h:28