1#ifndef _NF_NAT_H 2#define _NF_NAT_H 3#include <linux/netfilter_ipv4.h> 4#include <linux/netfilter/nf_conntrack_tuple.h> 5 6#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 7 8enum nf_nat_manip_type 9{ 10 IP_NAT_MANIP_SRC, 11 IP_NAT_MANIP_DST 12}; 13 14/* SRC manip occurs POST_ROUTING or LOCAL_IN */ 15#define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING && (hooknum) != NF_IP_LOCAL_IN) 16 17#define IP_NAT_RANGE_MAP_IPS 1 18#define IP_NAT_RANGE_PROTO_SPECIFIED 2 19#define IP_NAT_RANGE_PROTO_RANDOM 4 20 21/* Single range specification. */ 22struct nf_nat_range 23{ 24 /* Set to OR of flags above. */ 25 unsigned int flags; 26 27 /* Inclusive: network order. */ 28 __be32 min_ip, max_ip; 29 30 /* Inclusive: network order */ 31 union nf_conntrack_man_proto min, max; 32}; 33 34/* For backwards compat: don't use in modern code. */ 35struct nf_nat_multi_range_compat 36{ 37 unsigned int rangesize; /* Must be 1. */ 38 39 /* hangs off end. */ 40 struct nf_nat_range range[1]; 41}; 42 43#define ip_nat_range nf_nat_range 44#define ip_nat_multi_range nf_nat_multi_range_compat 45#endif 46