hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/netfilter/nfnetlink.h
....@@ -4,6 +4,7 @@
44
55 #include <linux/netlink.h>
66 #include <linux/capability.h>
7
+#include <linux/android_kabi.h>
78 #include <net/netlink.h>
89 #include <uapi/linux/netfilter/nfnetlink.h>
910
....@@ -22,6 +23,14 @@
2223 struct netlink_ext_ack *extack);
2324 const struct nla_policy *policy; /* netlink attribute policy */
2425 const u_int16_t attr_count; /* number of nlattr's */
26
+
27
+ ANDROID_KABI_RESERVE(1);
28
+};
29
+
30
+enum nfnl_abort_action {
31
+ NFNL_ABORT_NONE = 0,
32
+ NFNL_ABORT_AUTOLOAD,
33
+ NFNL_ABORT_VALIDATE,
2534 };
2635
2736 struct nfnetlink_subsystem {
....@@ -31,9 +40,11 @@
3140 const struct nfnl_callback *cb; /* callback for individual types */
3241 struct module *owner;
3342 int (*commit)(struct net *net, struct sk_buff *skb);
34
- int (*abort)(struct net *net, struct sk_buff *skb);
35
- void (*cleanup)(struct net *net);
43
+ int (*abort)(struct net *net, struct sk_buff *skb,
44
+ enum nfnl_abort_action action);
3645 bool (*valid_genid)(struct net *net, u32 genid);
46
+
47
+ ANDROID_KABI_RESERVE(1);
3748 };
3849
3950 int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
....@@ -50,6 +61,33 @@
5061 return subsys << 8 | msg_type;
5162 }
5263
64
+static inline void nfnl_fill_hdr(struct nlmsghdr *nlh, u8 family, u8 version,
65
+ __be16 res_id)
66
+{
67
+ struct nfgenmsg *nfmsg;
68
+
69
+ nfmsg = nlmsg_data(nlh);
70
+ nfmsg->nfgen_family = family;
71
+ nfmsg->version = version;
72
+ nfmsg->res_id = res_id;
73
+}
74
+
75
+static inline struct nlmsghdr *nfnl_msg_put(struct sk_buff *skb, u32 portid,
76
+ u32 seq, int type, int flags,
77
+ u8 family, u8 version,
78
+ __be16 res_id)
79
+{
80
+ struct nlmsghdr *nlh;
81
+
82
+ nlh = nlmsg_put(skb, portid, seq, type, sizeof(struct nfgenmsg), flags);
83
+ if (!nlh)
84
+ return NULL;
85
+
86
+ nfnl_fill_hdr(nlh, family, version, res_id);
87
+
88
+ return nlh;
89
+}
90
+
5391 void nfnl_lock(__u8 subsys_id);
5492 void nfnl_unlock(__u8 subsys_id);
5593 #ifdef CONFIG_PROVE_LOCKING