2012-12-24 15:36:14 +04:00
|
|
|
#ifndef __CR_LIBNETLINK_H__
|
|
|
|
#define __CR_LIBNETLINK_H__
|
2011-12-26 22:12:03 +04:00
|
|
|
|
2011-12-27 20:13:18 +04:00
|
|
|
#define CR_NLMSG_SEQ 24680 /* arbitrary chosen */
|
|
|
|
|
2011-12-27 14:24:47 +04:00
|
|
|
extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
|
2012-08-10 17:21:34 +04:00
|
|
|
#define parse_rtattr_nested(tb, max, rta) \
|
|
|
|
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
|
2012-08-02 07:23:06 +04:00
|
|
|
extern int do_rtnl_req(int nl, void *req, int size,
|
2015-01-14 17:28:24 +03:00
|
|
|
int (*receive_callback)(struct nlmsghdr *h, void *),
|
|
|
|
int (*error_callback)(int err, void *), void *);
|
2011-12-26 22:12:03 +04:00
|
|
|
|
2012-08-10 17:21:34 +04:00
|
|
|
extern int addattr_l(struct nlmsghdr *n, int maxlen, int type,
|
|
|
|
const void *data, int alen);
|
|
|
|
|
|
|
|
#define NLMSG_TAIL(nmsg) \
|
|
|
|
((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
|
|
|
|
|
|
|
|
|
2012-12-25 22:40:24 +04:00
|
|
|
#endif /* __CR_LIBNETLINK_H__ */
|