OpenVPN
clinat.h
Go to the documentation of this file.
1 /*
2  * OpenVPN -- An application to securely tunnel IP networks
3  * over a single TCP/UDP port, with support for SSL/TLS-based
4  * session authentication and key exchange,
5  * packet encryption, packet authentication, and
6  * packet compression.
7  *
8  * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2
12  * as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #if !defined(CLINAT_H)
25 #define CLINAT_H
26 
27 #include "buffer.h"
28 
29 #define MAX_CLIENT_NAT 64
30 
31 #define CN_OUTGOING 0
32 #define CN_INCOMING 1
33 
35 #define CN_SNAT 0
36 #define CN_DNAT 1
37  int type;
41 };
42 
44  int n;
46 };
47 
49 
51 
53 
54 void print_client_nat_list(const struct client_nat_option_list *list, int msglevel);
55 
57  const char *type,
58  const char *network,
59  const char *netmask,
60  const char *foreign_network,
61  int msglevel);
62 
63 void client_nat_transform(const struct client_nat_option_list *list,
64  struct buffer *ipbuf,
65  const int direction);
66 
67 #endif /* if !defined(CLINAT_H) */
Definition: clinat.h:34
in_addr_t foreign_network
Definition: clinat.h:40
void client_nat_transform(const struct client_nat_option_list *list, struct buffer *ipbuf, const int direction)
Definition: clinat.c:195
in_addr_t netmask
Definition: clinat.h:39
#define in_addr_t
Definition: config-msvc.h:104
void copy_client_nat_option_list(struct client_nat_option_list *dest, const struct client_nat_option_list *src)
Definition: clinat.c:94
void print_client_nat_list(const struct client_nat_option_list *list, int msglevel)
Definition: clinat.c:54
int type
Definition: clinat.h:37
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
in_addr_t network
Definition: clinat.h:38
#define MAX_CLIENT_NAT
Definition: clinat.h:29
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
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: clinat.c:108
struct client_nat_option_list * clone_client_nat_option_list(const struct client_nat_option_list *src, struct gc_arena *gc)
Definition: clinat.c:85
char * dest
Definition: compat-lz4.h:431
struct client_nat_option_list * new_client_nat_list(struct gc_arena *gc)
Definition: clinat.c:77