/* * Copyright (C) 2006 Lennert Buytenhek * Use and distribution permitted according to the terms of the LGPL. */ #ifndef __TCP_SNAT_H #define __TCP_SNAT_H #include #include #include /* * iptables -t nat -A POSTROUTING -s $orig_src_ip -d $dst_ip -p tcp -m tcp * --sport $src_port --dport $dst_port -j SNAT --to-source $new_src_ip */ struct tcp_snat_request { u_int32_t dst_ip; u_int16_t dst_port; u_int32_t orig_src_ip; u_int16_t src_port; u_int32_t new_src_ip; }; int insert_snat_rule(struct tcp_snat_request *tsr); #endif