~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/netfilter_ipv4/ip_tables.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * 25-Jul-1998 Major changes to allow for ip chain table
  3  *
  4  * 3-Jan-2000 Named tables to allow packet selection for different uses.
  5  */
  6 
  7 /*
  8  *      Format of an IP firewall descriptor
  9  *
 10  *      src, dst, src_mask, dst_mask are always stored in network byte order.
 11  *      flags are stored in host byte order (of course).
 12  *      Port numbers are stored in HOST byte order.
 13  */
 14 #ifndef _IPTABLES_H
 15 #define _IPTABLES_H
 16 
 17 #include <linux/if.h>
 18 #include <linux/in.h>
 19 #include <linux/ip.h>
 20 #include <linux/skbuff.h>
 21 
 22 #include <linux/init.h>
 23 #include <uapi/linux/netfilter_ipv4/ip_tables.h>
 24 
 25 extern void ipt_init(void) __init;
 26 
 27 int ipt_register_table(struct net *net, const struct xt_table *table,
 28                        const struct ipt_replace *repl,
 29                        const struct nf_hook_ops *ops, struct xt_table **res);
 30 void ipt_unregister_table(struct net *net, struct xt_table *table,
 31                           const struct nf_hook_ops *ops);
 32 
 33 /* Standard entry. */
 34 struct ipt_standard {
 35         struct ipt_entry entry;
 36         struct xt_standard_target target;
 37 };
 38 
 39 struct ipt_error {
 40         struct ipt_entry entry;
 41         struct xt_error_target target;
 42 };
 43 
 44 #define IPT_ENTRY_INIT(__size)                                                 \
 45 {                                                                              \
 46         .target_offset  = sizeof(struct ipt_entry),                            \
 47         .next_offset    = (__size),                                            \
 48 }
 49 
 50 #define IPT_STANDARD_INIT(__verdict)                                           \
 51 {                                                                              \
 52         .entry          = IPT_ENTRY_INIT(sizeof(struct ipt_standard)),         \
 53         .target         = XT_TARGET_INIT(XT_STANDARD_TARGET,                   \
 54                                          sizeof(struct xt_standard_target)),   \
 55         .target.verdict = -(__verdict) - 1,                                    \
 56 }
 57 
 58 #define IPT_ERROR_INIT                                                         \
 59 {                                                                              \
 60         .entry          = IPT_ENTRY_INIT(sizeof(struct ipt_error)),            \
 61         .target         = XT_TARGET_INIT(XT_ERROR_TARGET,                      \
 62                                          sizeof(struct xt_error_target)),      \
 63         .target.errorname = "ERROR",                                           \
 64 }
 65 
 66 extern void *ipt_alloc_initial_table(const struct xt_table *);
 67 extern unsigned int ipt_do_table(struct sk_buff *skb,
 68                                  const struct nf_hook_state *state,
 69                                  struct xt_table *table);
 70 
 71 #ifdef CONFIG_COMPAT
 72 #include <net/compat.h>
 73 
 74 struct compat_ipt_entry {
 75         struct ipt_ip ip;
 76         compat_uint_t nfcache;
 77         __u16 target_offset;
 78         __u16 next_offset;
 79         compat_uint_t comefrom;
 80         struct compat_xt_counters counters;
 81         unsigned char elems[0];
 82 };
 83 
 84 /* Helper functions */
 85 static inline struct xt_entry_target *
 86 compat_ipt_get_target(struct compat_ipt_entry *e)
 87 {
 88         return (void *)e + e->target_offset;
 89 }
 90 
 91 #endif /* CONFIG_COMPAT */
 92 #endif /* _IPTABLES_H */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp