X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fnetfilter_ipv4%2Fip_nat_protocol.h;h=612a43614e7ba659ed3f103b5f4f2e67ef658c48;hb=refs%2Fremotes%2Fvserver;hp=998ab2bd325c8c5aab736cf2d02cbc786d5e43cc;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h index 998ab2bd3..612a43614 100644 --- a/include/linux/netfilter_ipv4/ip_nat_protocol.h +++ b/include/linux/netfilter_ipv4/ip_nat_protocol.h @@ -4,24 +4,27 @@ #include #include +#include +#include + struct iphdr; struct ip_nat_range; struct ip_nat_protocol { - struct list_head list; - /* Protocol name */ const char *name; /* Protocol number. */ unsigned int protonum; - /* Do a packet translation according to the ip_nat_proto_manip - * and manip type. Return true if succeeded. */ + struct module *me; + + /* Translate a packet to the target according to manip type. + Return true if succeeded. */ int (*manip_pkt)(struct sk_buff **pskb, - unsigned int hdroff, - const struct ip_conntrack_manip *manip, + unsigned int iphdroff, + const struct ip_conntrack_tuple *tuple, enum ip_nat_manip_type maniptype); /* Is the manipable part of the tuple between min and max incl? */ @@ -39,20 +42,33 @@ struct ip_nat_protocol enum ip_nat_manip_type maniptype, const struct ip_conntrack *conntrack); - unsigned int (*print)(char *buffer, - const struct ip_conntrack_tuple *match, - const struct ip_conntrack_tuple *mask); + int (*range_to_nfattr)(struct sk_buff *skb, + const struct ip_nat_range *range); - unsigned int (*print_range)(char *buffer, - const struct ip_nat_range *range); + int (*nfattr_to_range)(struct nfattr *tb[], + struct ip_nat_range *range); }; /* Protocol registration. */ extern int ip_nat_protocol_register(struct ip_nat_protocol *proto); extern void ip_nat_protocol_unregister(struct ip_nat_protocol *proto); +extern struct ip_nat_protocol *ip_nat_proto_find_get(u_int8_t protocol); +extern void ip_nat_proto_put(struct ip_nat_protocol *proto); + +/* Built-in protocols. */ +extern struct ip_nat_protocol ip_nat_protocol_tcp; +extern struct ip_nat_protocol ip_nat_protocol_udp; +extern struct ip_nat_protocol ip_nat_protocol_icmp; +extern struct ip_nat_protocol ip_nat_unknown_protocol; + extern int init_protocols(void) __init; extern void cleanup_protocols(void); extern struct ip_nat_protocol *find_nat_proto(u_int16_t protonum); +extern int ip_nat_port_range_to_nfattr(struct sk_buff *skb, + const struct ip_nat_range *range); +extern int ip_nat_port_nfattr_to_range(struct nfattr *tb[], + struct ip_nat_range *range); + #endif /*_IP_NAT_PROTO_H*/