]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/netfilter_arp/arp_tables.h
Merge branch 'xen-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
[linux-2.6-omap-h63xx.git] / include / linux / netfilter_arp / arp_tables.h
index 44e39b61d9e7e3b11e4b3e863204b4a89bb8cd1b..2fc73fa8e37f859fbeec4948e7ab009ef0e1a333 100644 (file)
@@ -112,19 +112,20 @@ struct arpt_entry
  * New IP firewall options for [gs]etsockopt at the RAW IP level.
  * Unlike BSD Linux inherits IP options so you don't have to use a raw
  * socket for this. Instead we check rights in the calls.
+ *
+ * ATTENTION: check linux/in.h before adding new number here.
  */
-#define ARPT_CTL_OFFSET                32
-#define ARPT_BASE_CTL          (XT_BASE_CTL+ARPT_CTL_OFFSET)
+#define ARPT_BASE_CTL          96
 
-#define ARPT_SO_SET_REPLACE            (XT_SO_SET_REPLACE+ARPT_CTL_OFFSET)
-#define ARPT_SO_SET_ADD_COUNTERS       (XT_SO_SET_ADD_COUNTERS+ARPT_CTL_OFFSET)
-#define ARPT_SO_SET_MAX                        (XT_SO_SET_MAX+ARPT_CTL_OFFSET)
+#define ARPT_SO_SET_REPLACE            (ARPT_BASE_CTL)
+#define ARPT_SO_SET_ADD_COUNTERS       (ARPT_BASE_CTL + 1)
+#define ARPT_SO_SET_MAX                        ARPT_SO_SET_ADD_COUNTERS
 
-#define ARPT_SO_GET_INFO               (XT_SO_GET_INFO+ARPT_CTL_OFFSET)
-#define ARPT_SO_GET_ENTRIES            (XT_SO_GET_ENTRIES+ARPT_CTL_OFFSET)
-/* #define ARPT_SO_GET_REVISION_MATCH  XT_SO_GET_REVISION_MATCH  */
-#define ARPT_SO_GET_REVISION_TARGET    (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
-#define ARPT_SO_GET_MAX                        (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
+#define ARPT_SO_GET_INFO               (ARPT_BASE_CTL)
+#define ARPT_SO_GET_ENTRIES            (ARPT_BASE_CTL + 1)
+/* #define ARPT_SO_GET_REVISION_MATCH  (APRT_BASE_CTL + 2) */
+#define ARPT_SO_GET_REVISION_TARGET    (ARPT_BASE_CTL + 3)
+#define ARPT_SO_GET_MAX                        (ARPT_SO_GET_REVISION_TARGET)
 
 /* CONTINUE verdict for targets */
 #define ARPT_CONTINUE XT_CONTINUE
@@ -189,6 +190,7 @@ struct arpt_replace
 
 /* The argument to ARPT_SO_ADD_COUNTERS. */
 #define arpt_counters_info xt_counters_info
+#define arpt_counters xt_counters
 
 /* The argument to ARPT_SO_GET_ENTRIES. */
 struct arpt_get_entries
@@ -236,6 +238,47 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
  */
 #ifdef __KERNEL__
 
+/* Standard entry. */
+struct arpt_standard
+{
+       struct arpt_entry entry;
+       struct arpt_standard_target target;
+};
+
+struct arpt_error_target
+{
+       struct arpt_entry_target target;
+       char errorname[ARPT_FUNCTION_MAXNAMELEN];
+};
+
+struct arpt_error
+{
+       struct arpt_entry entry;
+       struct arpt_error_target target;
+};
+
+#define ARPT_ENTRY_INIT(__size)                                                       \
+{                                                                             \
+       .target_offset  = sizeof(struct arpt_entry),                           \
+       .next_offset    = (__size),                                            \
+}
+
+#define ARPT_STANDARD_INIT(__verdict)                                         \
+{                                                                             \
+       .entry          = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)),       \
+       .target         = XT_TARGET_INIT(ARPT_STANDARD_TARGET,                 \
+                                        sizeof(struct arpt_standard_target)), \
+       .target.verdict = -(__verdict) - 1,                                    \
+}
+
+#define ARPT_ERROR_INIT                                                               \
+{                                                                             \
+       .entry          = ARPT_ENTRY_INIT(sizeof(struct arpt_error)),          \
+       .target         = XT_TARGET_INIT(ARPT_ERROR_TARGET,                    \
+                                        sizeof(struct arpt_error_target)),    \
+       .target.errorname = "ERROR",                                           \
+}
+
 #define arpt_register_target(tgt)      \
 ({     (tgt)->family = NF_ARP;         \
        xt_register_target(tgt); })
@@ -244,7 +287,7 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
 extern int arpt_register_table(struct arpt_table *table,
                               const struct arpt_replace *repl);
 extern void arpt_unregister_table(struct arpt_table *table);
-extern unsigned int arpt_do_table(struct sk_buff **pskb,
+extern unsigned int arpt_do_table(struct sk_buff *skb,
                                  unsigned int hook,
                                  const struct net_device *in,
                                  const struct net_device *out,