PCI: Hotplug core: remove 'name'
[safe/jmp/linux-2.6] / include / linux / netfilter / x_tables.h
index c79c883..be41b60 100644 (file)
@@ -183,6 +183,8 @@ struct xt_counters_info
  * @fragoff:   packet is a fragment, this is the data offset
  * @thoff:     position of transport header relative to skb->data
  * @hotdrop:   drop packet if we had inspection problems
+ * @family:    Actual NFPROTO_* through which the function is invoked
+ *             (helpful when match->family == NFPROTO_UNSPEC)
  */
 struct xt_match_param {
        const struct net_device *in, *out;
@@ -191,6 +193,7 @@ struct xt_match_param {
        int fragoff;
        unsigned int thoff;
        bool *hotdrop;
+       u_int8_t family;
 };
 
 /**
@@ -210,12 +213,56 @@ struct xt_mtchk_param {
        const struct xt_match *match;
        void *matchinfo;
        unsigned int hook_mask;
+       u_int8_t family;
 };
 
 /* Match destructor parameters */
 struct xt_mtdtor_param {
        const struct xt_match *match;
        void *matchinfo;
+       u_int8_t family;
+};
+
+/**
+ * struct xt_target_param - parameters for target extensions' target functions
+ *
+ * @hooknum:   hook through which this target was invoked
+ * @target:    struct xt_target through which this function was invoked
+ * @targinfo:  per-target data
+ *
+ * Other fields see above.
+ */
+struct xt_target_param {
+       const struct net_device *in, *out;
+       unsigned int hooknum;
+       const struct xt_target *target;
+       const void *targinfo;
+       u_int8_t family;
+};
+
+/**
+ * struct xt_tgchk_param - parameters for target extensions'
+ * checkentry functions
+ *
+ * @entryinfo: the family-specific rule data
+ *             (struct ipt_entry, ip6t_entry, arpt_entry, ebt_entry)
+ *
+ * Other fields see above.
+ */
+struct xt_tgchk_param {
+       const char *table;
+       void *entryinfo;
+       const struct xt_target *target;
+       void *targinfo;
+       unsigned int hook_mask;
+       u_int8_t family;
+};
+
+/* Target destructor parameters */
+struct xt_tgdtor_param {
+       const struct xt_target *target;
+       void *targinfo;
+       u_int8_t family;
 };
 
 struct xt_match
@@ -269,24 +316,16 @@ struct xt_target
           must now handle non-linear skbs, using skb_copy_bits and
           skb_ip_make_writable. */
        unsigned int (*target)(struct sk_buff *skb,
-                              const struct net_device *in,
-                              const struct net_device *out,
-                              unsigned int hooknum,
-                              const struct xt_target *target,
-                              const void *targinfo);
+                              const struct xt_target_param *);
 
        /* Called when user tries to insert an entry of this type:
            hook_mask is a bitmask of hooks from which it can be
            called. */
        /* Should return true or false. */
-       bool (*checkentry)(const char *tablename,
-                          const void *entry,
-                          const struct xt_target *target,
-                          void *targinfo,
-                          unsigned int hook_mask);
+       bool (*checkentry)(const struct xt_tgchk_param *);
 
        /* Called when entry of this type deleted. */
-       void (*destroy)(const struct xt_target *target, void *targinfo);
+       void (*destroy)(const struct xt_tgdtor_param *);
 
        /* Called when userspace align differs from kernel space one */
        void (*compat_from_user)(void *dst, void *src);
@@ -362,12 +401,10 @@ extern void xt_unregister_match(struct xt_match *target);
 extern int xt_register_matches(struct xt_match *match, unsigned int n);
 extern void xt_unregister_matches(struct xt_match *match, unsigned int n);
 
-extern int xt_check_match(struct xt_mtchk_param *, u_int8_t family,
+extern int xt_check_match(struct xt_mtchk_param *,
                          unsigned int size, u_int8_t proto, bool inv_proto);
-extern int xt_check_target(const struct xt_target *target, unsigned short family,
-                          unsigned int size, const char *table, unsigned int hook,
-                          unsigned short proto, int inv_proto,
-                          const void *entry, void *targinfo);
+extern int xt_check_target(struct xt_tgchk_param *,
+                          unsigned int size, u_int8_t proto, bool inv_proto);
 
 extern struct xt_table *xt_register_table(struct net *net,
                                          struct xt_table *table,