Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13668
b: refs/heads/master
c: bfa83a9
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Graf authored and Thomas Graf committed Nov 10, 2005
1 parent 94b0af5 commit e2da65d
Show file tree
Hide file tree
Showing 5 changed files with 1,230 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fb9cbb1082d6b31fb45aa1a14432449a0df6cf1
refs/heads/master: bfa83a9e03cf8d501c6272999843470afecb32ed
24 changes: 23 additions & 1 deletion trunk/include/linux/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ struct nlmsghdr

#define NLMSG_ALIGNTO 4
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
Expand All @@ -86,6 +87,8 @@ struct nlmsghdr
#define NLMSG_DONE 0x3 /* End of a dump */
#define NLMSG_OVERRUN 0x4 /* Data lost */

#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */

struct nlmsgerr
{
int error;
Expand All @@ -108,6 +111,25 @@ enum {
NETLINK_CONNECTED,
};

/*
* <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
* +---------------------+- - -+- - - - - - - - - -+- - -+
* | Header | Pad | Payload | Pad |
* | (struct nlattr) | ing | | ing |
* +---------------------+- - -+- - - - - - - - - -+- - -+
* <-------------- nlattr->nla_len -------------->
*/

struct nlattr
{
__u16 nla_len;
__u16 nla_type;
};

#define NLA_ALIGNTO 4
#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))

#ifdef __KERNEL__

#include <linux/capability.h>
Expand Down
Loading

0 comments on commit e2da65d

Please sign in to comment.