aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:31:06 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:49 -0400
commitd387f6ad10764fc2174373b4a1cca443adee36e3 (patch)
treeed22c34f55de9c668eed1727d46239f3b48599b7 /include/net
parent2942e90050569525628a9f34e0daaa9b661b49cc (diff)
[NETLINK]: Add notification message sending interface
Adds nlmsg_notify() implementing proper notification logic. The message is multicasted to all listeners in the group. The applications the requests orignates from can request a unicast back report in which case said socket will be excluded from the multicast to avoid duplicated notifications. nlmsg_multicast() is extended to take allocation flags to allow notification in atomic contexts. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/genetlink.h5
-rw-r--r--include/net/netlink.h6
2 files changed, 7 insertions, 4 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 8c2287264266..97d6d3aba9d2 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -133,11 +133,12 @@ static inline int genlmsg_cancel(struct sk_buff *skb, void *hdr)
133 * @skb: netlink message as socket buffer 133 * @skb: netlink message as socket buffer
134 * @pid: own netlink pid to avoid sending to yourself 134 * @pid: own netlink pid to avoid sending to yourself
135 * @group: multicast group id 135 * @group: multicast group id
136 * @flags: allocation flags
136 */ 137 */
137static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, 138static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid,
138 unsigned int group) 139 unsigned int group, gfp_t flags)
139{ 140{
140 return nlmsg_multicast(genl_sock, skb, pid, group); 141 return nlmsg_multicast(genl_sock, skb, pid, group, flags);
141} 142}
142 143
143/** 144/**
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 3a5e40b1e045..b154b81d9a7a 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -43,6 +43,7 @@
43 * Message Sending: 43 * Message Sending:
44 * nlmsg_multicast() multicast message to several groups 44 * nlmsg_multicast() multicast message to several groups
45 * nlmsg_unicast() unicast a message to a single socket 45 * nlmsg_unicast() unicast a message to a single socket
46 * nlmsg_notify() send notification message
46 * 47 *
47 * Message Length Calculations: 48 * Message Length Calculations:
48 * nlmsg_msg_size(payload) length of message w/o padding 49 * nlmsg_msg_size(payload) length of message w/o padding
@@ -545,15 +546,16 @@ static inline void nlmsg_free(struct sk_buff *skb)
545 * @skb: netlink message as socket buffer 546 * @skb: netlink message as socket buffer
546 * @pid: own netlink pid to avoid sending to yourself 547 * @pid: own netlink pid to avoid sending to yourself
547 * @group: multicast group id 548 * @group: multicast group id
549 * @flags: allocation flags
548 */ 550 */
549static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, 551static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
550 u32 pid, unsigned int group) 552 u32 pid, unsigned int group, gfp_t flags)
551{ 553{
552 int err; 554 int err;
553 555
554 NETLINK_CB(skb).dst_group = group; 556 NETLINK_CB(skb).dst_group = group;
555 557
556 err = netlink_broadcast(sk, skb, pid, group, GFP_KERNEL); 558 err = netlink_broadcast(sk, skb, pid, group, flags);
557 if (err > 0) 559 if (err > 0)
558 err = 0; 560 err = 0;
559 561