diff options
Diffstat (limited to 'include/net/genetlink.h')
| -rw-r--r-- | include/net/genetlink.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 805de50df00d..8c2287264266 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) | |||
| 150 | return nlmsg_unicast(genl_sock, skb, pid); | 150 | return nlmsg_unicast(genl_sock, skb, pid); |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | /** | ||
| 154 | * gennlmsg_data - head of message payload | ||
| 155 | * @gnlh: genetlink messsage header | ||
| 156 | */ | ||
| 157 | static inline void *genlmsg_data(const struct genlmsghdr *gnlh) | ||
| 158 | { | ||
| 159 | return ((unsigned char *) gnlh + GENL_HDRLEN); | ||
| 160 | } | ||
| 161 | |||
| 162 | /** | ||
| 163 | * genlmsg_len - length of message payload | ||
| 164 | * @gnlh: genetlink message header | ||
| 165 | */ | ||
| 166 | static inline int genlmsg_len(const struct genlmsghdr *gnlh) | ||
| 167 | { | ||
| 168 | struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh - | ||
| 169 | NLMSG_HDRLEN); | ||
| 170 | return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); | ||
| 171 | } | ||
| 172 | |||
| 153 | #endif /* __NET_GENERIC_NETLINK_H */ | 173 | #endif /* __NET_GENERIC_NETLINK_H */ |
