OpenVPN
|
#include "buffer.h"
Go to the source code of this file.
Data Structures | |
struct | client_nat_entry |
struct | client_nat_option_list |
Macros | |
#define | MAX_CLIENT_NAT 64 |
#define | CN_OUTGOING 0 |
#define | CN_INCOMING 1 |
#define | CN_SNAT 0 |
#define | CN_DNAT 1 |
Functions | |
struct client_nat_option_list * | new_client_nat_list (struct gc_arena *gc) |
struct client_nat_option_list * | clone_client_nat_option_list (const struct client_nat_option_list *src, struct gc_arena *gc) |
void | copy_client_nat_option_list (struct client_nat_option_list *dest, const struct client_nat_option_list *src) |
void | print_client_nat_list (const struct client_nat_option_list *list, int msglevel) |
void | add_client_nat_to_option_list (struct client_nat_option_list *dest, const char *type, const char *network, const char *netmask, const char *foreign_network, int msglevel) |
void | client_nat_transform (const struct client_nat_option_list *list, struct buffer *ipbuf, const int direction) |
void add_client_nat_to_option_list | ( | struct client_nat_option_list * | dest, |
const char * | type, | ||
const char * | network, | ||
const char * | netmask, | ||
const char * | foreign_network, | ||
int | msglevel | ||
) |
Definition at line 106 of file clinat.c.
References add_entry(), CN_DNAT, CN_SNAT, client_nat_entry::foreign_network, getaddr(), msg, client_nat_entry::netmask, client_nat_entry::network, and client_nat_entry::type.
Referenced by add_option().
void client_nat_transform | ( | const struct client_nat_option_list * | list, |
struct buffer * | ipbuf, | ||
const int | direction | ||
) |
Definition at line 193 of file clinat.c.
References ADD_CHECKSUM_32, ADJUST_CHECKSUM, BLEN, BPTR, openvpn_iphdr::check, openvpn_udphdr::check, openvpn_tcphdr::check, check_debug_level(), D_CLIENT_NAT, openvpn_iphdr::daddr, client_nat_option_list::entries, client_nat_entry::foreign_network, ip_tcp_udp_hdr::ip, client_nat_option_list::n, client_nat_entry::netmask, client_nat_entry::network, OPENVPN_IPPROTO_TCP, OPENVPN_IPPROTO_UDP, print_pkt(), openvpn_iphdr::protocol, openvpn_iphdr::saddr, SUB_CHECKSUM_32, ip_tcp_udp_hdr::tcp, client_nat_entry::type, ip_tcp_udp_hdr::u, and ip_tcp_udp_hdr::udp.
Referenced by process_ip_header().
struct client_nat_option_list* clone_client_nat_option_list | ( | const struct client_nat_option_list * | src, |
struct gc_arena * | gc | ||
) |
void copy_client_nat_option_list | ( | struct client_nat_option_list * | dest, |
const struct client_nat_option_list * | src | ||
) |
Definition at line 92 of file clinat.c.
References add_entry(), client_nat_option_list::entries, and client_nat_option_list::n.
Referenced by pre_connect_restore().
struct client_nat_option_list* new_client_nat_list | ( | struct gc_arena * | gc | ) |
Definition at line 75 of file clinat.c.
References ALLOC_OBJ_CLEAR_GC.
Referenced by cnol_check_alloc().
void print_client_nat_list | ( | const struct client_nat_option_list * | list, |
int | msglevel | ||
) |
Definition at line 52 of file clinat.c.
References client_nat_option_list::entries, client_nat_entry::foreign_network, gc_free(), gc_new(), IA_NET_ORDER, gc_arena::list, msg, client_nat_entry::netmask, client_nat_entry::network, print_in_addr_t(), and client_nat_entry::type.
Referenced by show_settings().