VSF Documented
netlink.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_NETLINK_H__
2#define __VSF_LINUX_NETLINK_H__
3
4#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
5# include "../sys/socket.h"
6#else
7# include <sys/socket.h>
8#endif
9
10#define NLMSG_NOOP 0x1
11#define NLMSG_ERROR 0x2
12#define NLMSG_DONE 0x3
13#define NLMSG_OVERRUN 0x4
14
15#define NETLINK_ROUTE 0
16
22};
23
24struct nlmsghdr {
30};
31
32struct nlmsgerr {
33 int error;
34 struct nlmsghdr msg;
35};
36
37#define NLMSG_ALIGNTO 4U
38#define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1))
39#define NLMSG_HDRLEN ((int)NLMSG_ALIGN(sizeof(struct nlmsghdr)))
40#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
41#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
42#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
43#define NLMSG_NEXT(nlh, len)((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
44 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
45#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
46 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
47 (nlh)->nlmsg_len <= (len))
48#define NLMSG_PAYLOAD(nlh, len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
49
50#endif // __VSF_LINUX_NETLINK_H__
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
uint16_t sa_family_t
Definition socket.h:73
Definition netlink.h:32
struct nlmsghdr msg
Definition netlink.h:34
int error
Definition netlink.h:33
Definition netlink.h:24
uint32_t nlmsg_len
Definition netlink.h:25
uint16_t nlmsg_pid
Definition netlink.h:29
uint16_t nlmsg_type
Definition netlink.h:26
uint16_t nlmsg_seq
Definition netlink.h:28
uint16_t nlmsg_flags
Definition netlink.h:27
Definition netlink.h:17
uint32_t nl_groups
Definition netlink.h:21
sa_family_t nl_family
Definition netlink.h:18
uint32_t nl_pid
Definition netlink.h:20
uint16_t nl_pad
Definition netlink.h:19