Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb0ba6bd authored by Balbir Singh's avatar Balbir Singh Committed by Linus Torvalds
Browse files

[PATCH] per-task-delay-accounting: utilities for genetlink usage



Two utilities for simplifying usage of NETLINK_GENERIC interface.

Signed-off-by: default avatarBalbir Singh <balbir@in.ibm.com>
Signed-off-by: default avatarShailabh Nagar <nagar@watson.ibm.com>
Cc: Jes Sorensen <jes@sgi.com>
Cc: Peter Chubb <peterc@gelato.unsw.edu.au>
Cc: Erich Focht <efocht@ess.nec.de>
Cc: Levent Serinol <lserinol@gmail.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 52f17b6c
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
	return nlmsg_unicast(genl_sock, skb, pid);
}

/**
 * gennlmsg_data - head of message payload
 * @gnlh: genetlink messsage header
 */
static inline void *genlmsg_data(const struct genlmsghdr *gnlh)
{
	return ((unsigned char *) gnlh + GENL_HDRLEN);
}

/**
 * genlmsg_len - length of message payload
 * @gnlh: genetlink message header
 */
static inline int genlmsg_len(const struct genlmsghdr *gnlh)
{
	struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh -
							NLMSG_HDRLEN);
	return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
}

#endif	/* __NET_GENERIC_NETLINK_H */