2 * Format of an ARP firewall descriptor
4 * src, tgt, src_mask, tgt_mask, arpop, arpop_mask are always stored in
6 * flags are stored in host byte order (of course).
13 #include <linux/if_arp.h>
14 #include <linux/skbuff.h>
15 #include <uapi/linux/netfilter_arp/arp_tables.h>
18 struct arpt_standard
{
19 struct arpt_entry entry
;
20 struct xt_standard_target target
;
24 struct arpt_entry entry
;
25 struct xt_error_target target
;
28 #define ARPT_ENTRY_INIT(__size) \
30 .target_offset = sizeof(struct arpt_entry), \
31 .next_offset = (__size), \
34 #define ARPT_STANDARD_INIT(__verdict) \
36 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \
37 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
38 sizeof(struct xt_standard_target)), \
39 .target.verdict = -(__verdict) - 1, \
42 #define ARPT_ERROR_INIT \
44 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \
45 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
46 sizeof(struct xt_error_target)), \
47 .target.errorname = "ERROR", \
50 extern void *arpt_alloc_initial_table(const struct xt_table
*);
51 int arpt_register_table(struct net
*net
, const struct xt_table
*table
,
52 const struct arpt_replace
*repl
,
53 const struct nf_hook_ops
*ops
, struct xt_table
**res
);
54 void arpt_unregister_table(struct net
*net
, struct xt_table
*table
,
55 const struct nf_hook_ops
*ops
);
56 extern unsigned int arpt_do_table(struct sk_buff
*skb
,
57 const struct nf_hook_state
*state
,
58 struct xt_table
*table
);
61 #include <net/compat.h>
63 struct compat_arpt_entry
{
67 compat_uint_t comefrom
;
68 struct compat_xt_counters counters
;
69 unsigned char elems
[0];
72 static inline struct xt_entry_target
*
73 compat_arpt_get_target(struct compat_arpt_entry
*e
)
75 return (void *)e
+ e
->target_offset
;
78 #endif /* CONFIG_COMPAT */
79 #endif /* _ARPTABLES_H */