]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/netlink.h
[XFRM]: Purge dst references to deleted SAs passively.
[linux-2.6-omap-h63xx.git] / include / net / netlink.h
index b154b81d9a7a80ca6b40ee068e356648492bc617..47044da167c50793377d257029fd71e919236bb9 100644 (file)
@@ -65,6 +65,9 @@
  *   nlmsg_validate()                  validate netlink message incl. attrs
  *   nlmsg_for_each_attr()             loop over all attributes
  *
+ * Misc:
+ *   nlmsg_report()                    report back to application?
+ *
  * ------------------------------------------------------------------------
  *                          Attributes Interface
  * ------------------------------------------------------------------------
@@ -189,11 +192,24 @@ struct nla_policy {
        u16             minlen;
 };
 
+/**
+ * struct nl_info - netlink source information
+ * @nlh: Netlink message header of original request
+ * @pid: Netlink PID of requesting application
+ */
+struct nl_info {
+       struct nlmsghdr         *nlh;
+       u32                     pid;
+};
+
 extern void            netlink_run_queue(struct sock *sk, unsigned int *qlen,
                                          int (*cb)(struct sk_buff *,
                                                    struct nlmsghdr *, int *));
 extern void            netlink_queue_skip(struct nlmsghdr *nlh,
                                           struct sk_buff *skb);
+extern int             nlmsg_notify(struct sock *sk, struct sk_buff *skb,
+                                    u32 pid, unsigned int group, int report,
+                                    gfp_t flags);
 
 extern int             nla_validate(struct nlattr *head, int len, int maxtype,
                                     struct nla_policy *policy);
@@ -375,6 +391,17 @@ static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype,
                            nlmsg_attrlen(nlh, hdrlen), maxtype, policy);
 }
 
+/**
+ * nlmsg_report - need to report back to application?
+ * @nlh: netlink message header
+ *
+ * Returns 1 if a report back to the application is requested.
+ */
+static inline int nlmsg_report(struct nlmsghdr *nlh)
+{
+       return !!(nlh->nlmsg_flags & NLM_F_ECHO);
+}
+
 /**
  * nlmsg_for_each_attr - iterate over a stream of attributes
  * @pos: loop counter, set to current attribute