Lely core libraries
2.3.4
|
Go to the documentation of this file.
21 #ifndef LELY_IO_INTERN_RTNL_H_
22 #define LELY_IO_INTERN_RTNL_H_
26 #ifdef HAVE_LINUX_RTNETLINK_H
28 #include <linux/rtnetlink.h>
35 #define RTA_TAIL(rta) \
36 (struct rtattr *)((char *)(rta) + RTA_ALIGN((rta)->rta_len))
55 unsigned short rtalen,
void *data);
88 unsigned int ifi_flags,
struct rtattr *rta,
89 unsigned short rtalen);
131 unsigned int *pifi_flags,
unsigned short type,
void *data,
132 unsigned short payload);
153 unsigned int ifi_flags,
unsigned short type,
const void *data,
154 unsigned short payload);
166 struct rtattr *rta,
unsigned short len,
unsigned short type);
168 static inline struct rtattr *
169 io_rta_find(
struct rtattr *rta,
unsigned short len,
unsigned short type)
171 for (; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
172 if (rta->rta_type == type)
182 #endif // HAVE_LINUX_RTNETLINK_H
184 #endif // !LELY_IO_INTERN_RTNL_H_
int io_rtnl_getlink(int fd, __u32 seq, __u32 pid, io_rtnl_newlink_func_t *func, void *data)
Sends an RTM_GETLINK request and invokes the specified callback function for each received network in...
int io_rtnl_socket(__u32 pid, __u32 groups)
Opens an rtnetlink socket.
int io_rtnl_getattr(int fd, __u32 seq, __u32 pid, int ifi_index, unsigned int *pifi_flags, unsigned short type, void *data, unsigned short payload)
Invokes io_rtnl_getlink() and retrieves a single attribute of the specified network interface.
int io_rtnl_setattr(int fd, __u32 seq, __u32 pid, int ifi_index, unsigned int ifi_flags, unsigned short type, const void *data, unsigned short payload)
Invokes io_rtnl_newlink() to set at most one attribute of the specified network interface.
int io_rtnl_newlink(int fd, __u32 seq, __u32 pid, int ifi_index, unsigned int ifi_flags, struct rtattr *rta, unsigned short rtalen)
Sends an RTM_NEWLINK request and waits until the acknowledgment is received.
static struct rtattr * io_rta_find(struct rtattr *rta, unsigned short len, unsigned short type)
Finds an attribute in a list of attributes.
int io_rtnl_newlink_func_t(struct ifinfomsg *ifi, struct rtattr *rta, unsigned short rtalen, void *data)
The type of a callback function invoked when an RTM_NEWLINK response is received.