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
8
* Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
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.
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.
19
* You should have received a copy of the GNU General Public License
20
* along with this program (see the file COPYING included with this
21
* distribution); if not, write to the Free Software Foundation, Inc.,
22
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30
/*#define IFCONFIG_POOL_TEST*/
35
#define IFCONFIG_POOL_MAX 65536
36
#define IFCONFIG_POOL_MIN_NETBITS 16
38
#define IFCONFIG_POOL_30NET 0
39
#define IFCONFIG_POOL_INDIV 1
41
struct ifconfig_pool_entry
56
struct in6_addr base_ipv6;
57
unsigned int size_ipv6;
58
struct ifconfig_pool_entry *list;
61
struct ifconfig_pool_persist
63
struct status_output *file;
67
typedef int ifconfig_pool_handle;
69
struct ifconfig_pool *ifconfig_pool_init (int type, in_addr_t start, in_addr_t end, const bool duplicate_cn, const bool ipv6_pool, const struct in6_addr ipv6_base, const int ipv6_netbits );
71
void ifconfig_pool_free (struct ifconfig_pool *pool);
73
bool ifconfig_pool_verify_range (const int msglevel, const in_addr_t start, const in_addr_t end);
75
ifconfig_pool_handle ifconfig_pool_acquire (struct ifconfig_pool *pool, in_addr_t *local, in_addr_t *remote, struct in6_addr *remote_ipv6, const char *common_name);
77
bool ifconfig_pool_release (struct ifconfig_pool* pool, ifconfig_pool_handle hand, const bool hard);
79
struct ifconfig_pool_persist *ifconfig_pool_persist_init (const char *filename, int refresh_freq);
80
void ifconfig_pool_persist_close (struct ifconfig_pool_persist *persist);
81
bool ifconfig_pool_write_trigger (struct ifconfig_pool_persist *persist);
83
void ifconfig_pool_read (struct ifconfig_pool_persist *persist, struct ifconfig_pool *pool);
84
void ifconfig_pool_write (struct ifconfig_pool_persist *persist, const struct ifconfig_pool *pool);
86
#ifdef IFCONFIG_POOL_TEST
87
void ifconfig_pool_test (in_addr_t start, in_addr_t end);