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

TOMOYO Linux Cross Reference
Linux/include/net/netfilter/nf_nat_l4proto.h

Version: ~ [ linux-5.3 ] ~ [ linux-5.2.15 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.73 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.144 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.193 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.193 ] ~ [ 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.73 ] ~ [ 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-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ 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 /* Header for use in defining a given protocol. */
  2 #ifndef _NF_NAT_L4PROTO_H
  3 #define _NF_NAT_L4PROTO_H
  4 #include <net/netfilter/nf_nat.h>
  5 #include <linux/netfilter/nfnetlink_conntrack.h>
  6 
  7 struct nf_nat_range;
  8 struct nf_nat_l3proto;
  9 
 10 struct nf_nat_l4proto {
 11         /* Protocol number. */
 12         u8 l4proto;
 13 
 14         /* Translate a packet to the target according to manip type.
 15          * Return true if succeeded.
 16          */
 17         bool (*manip_pkt)(struct sk_buff *skb,
 18                           const struct nf_nat_l3proto *l3proto,
 19                           unsigned int iphdroff, unsigned int hdroff,
 20                           const struct nf_conntrack_tuple *tuple,
 21                           enum nf_nat_manip_type maniptype);
 22 
 23         /* Is the manipable part of the tuple between min and max incl? */
 24         bool (*in_range)(const struct nf_conntrack_tuple *tuple,
 25                          enum nf_nat_manip_type maniptype,
 26                          const union nf_conntrack_man_proto *min,
 27                          const union nf_conntrack_man_proto *max);
 28 
 29         /* Alter the per-proto part of the tuple (depending on
 30          * maniptype), to give a unique tuple in the given range if
 31          * possible.  Per-protocol part of tuple is initialized to the
 32          * incoming packet.
 33          */
 34         void (*unique_tuple)(const struct nf_nat_l3proto *l3proto,
 35                              struct nf_conntrack_tuple *tuple,
 36                              const struct nf_nat_range *range,
 37                              enum nf_nat_manip_type maniptype,
 38                              const struct nf_conn *ct);
 39 
 40         int (*nlattr_to_range)(struct nlattr *tb[],
 41                                struct nf_nat_range *range);
 42 };
 43 
 44 /* Protocol registration. */
 45 int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto);
 46 void nf_nat_l4proto_unregister(u8 l3proto,
 47                                const struct nf_nat_l4proto *l4proto);
 48 
 49 const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto);
 50 
 51 /* Built-in protocols. */
 52 extern const struct nf_nat_l4proto nf_nat_l4proto_tcp;
 53 extern const struct nf_nat_l4proto nf_nat_l4proto_udp;
 54 extern const struct nf_nat_l4proto nf_nat_l4proto_icmp;
 55 extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6;
 56 extern const struct nf_nat_l4proto nf_nat_l4proto_unknown;
 57 #ifdef CONFIG_NF_NAT_PROTO_DCCP
 58 extern const struct nf_nat_l4proto nf_nat_l4proto_dccp;
 59 #endif
 60 #ifdef CONFIG_NF_NAT_PROTO_SCTP
 61 extern const struct nf_nat_l4proto nf_nat_l4proto_sctp;
 62 #endif
 63 #ifdef CONFIG_NF_NAT_PROTO_UDPLITE
 64 extern const struct nf_nat_l4proto nf_nat_l4proto_udplite;
 65 #endif
 66 
 67 bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple,
 68                              enum nf_nat_manip_type maniptype,
 69                              const union nf_conntrack_man_proto *min,
 70                              const union nf_conntrack_man_proto *max);
 71 
 72 void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto,
 73                                  struct nf_conntrack_tuple *tuple,
 74                                  const struct nf_nat_range *range,
 75                                  enum nf_nat_manip_type maniptype,
 76                                  const struct nf_conn *ct, u16 *rover);
 77 
 78 int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[],
 79                                    struct nf_nat_range *range);
 80 
 81 #endif /*_NF_NAT_L4PROTO_H*/
 82 

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