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

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

Version: ~ [ linux-6.2-rc3 ] ~ [ linux-6.1.5 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.87 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.162 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.228 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.269 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.302 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ 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