summaryrefslogtreecommitdiff
path: root/src/openvpn/pool.h
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
committerBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
commit9fc3b98112217f2d92a67977dbde0987cc7a1803 (patch)
tree29fcc8654ee65d9dd89ade797bea2f3d9dfd9cfd /src/openvpn/pool.h
parenta8758c0e03eed188dcb9da0e4fd781a67c25bf1e (diff)
parent69b02b1f7fd609d84ace13ab04697158de2418a9 (diff)
Merge branch 'debian/experimental-2.5'
Diffstat (limited to 'src/openvpn/pool.h')
-rw-r--r--src/openvpn/pool.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/openvpn/pool.h b/src/openvpn/pool.h
index 6de28ac..b06424c 100644
--- a/src/openvpn/pool.h
+++ b/src/openvpn/pool.h
@@ -34,8 +34,11 @@
#define IFCONFIG_POOL_MAX 65536
#define IFCONFIG_POOL_MIN_NETBITS 16
-#define IFCONFIG_POOL_30NET 0
-#define IFCONFIG_POOL_INDIV 1
+enum pool_type
+{
+ IFCONFIG_POOL_30NET,
+ IFCONFIG_POOL_INDIV
+};
struct ifconfig_pool_entry
{
@@ -47,13 +50,17 @@ struct ifconfig_pool_entry
struct ifconfig_pool
{
- in_addr_t base;
- int size;
- int type;
bool duplicate_cn;
- bool ipv6;
- struct in6_addr base_ipv6;
- unsigned int size_ipv6;
+ struct {
+ bool enabled;
+ enum pool_type type;
+ in_addr_t base;
+ } ipv4;
+ struct {
+ bool enabled;
+ struct in6_addr base;
+ } ipv6;
+ int size;
struct ifconfig_pool_entry *list;
};
@@ -65,7 +72,12 @@ struct ifconfig_pool_persist
typedef int ifconfig_pool_handle;
-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 );
+struct ifconfig_pool *ifconfig_pool_init(const bool ipv4_pool,
+ enum pool_type 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);
void ifconfig_pool_free(struct ifconfig_pool *pool);