diff options
author | Antonio Quartulli | 2018-06-08 13:20:12 +0800 |
---|---|---|
committer | Gert Doering | 2018-06-08 15:37:21 +0200 |
commit | 3e1606fe86ba1b09d05ba828b5e4e280ceddd30a (patch) | |
tree | 9c45a6be2442868620c45607c147e5bd4d564ad9 /src/openvpn/pool.h | |
parent | 5d2cd1222e06291021cf5e793f585d5f1485ae9b (diff) | |
download | openvpn-3e1606fe86ba1b09d05ba828b5e4e280ceddd30a.zip openvpn-3e1606fe86ba1b09d05ba828b5e4e280ceddd30a.tar.gz |
pool: convert pool 'type' to enum
The pool 'type' member is actually an enumered type, therefore
declare it as 'enum' to improve static code analisys and
readability.
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20180608052017.6696-4-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17000.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/pool.h')
-rw-r--r-- | src/openvpn/pool.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/openvpn/pool.h b/src/openvpn/pool.h index 544d418..73ea559 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 { @@ -49,7 +52,7 @@ struct ifconfig_pool { bool duplicate_cn; struct { - int type; + enum pool_type type; in_addr_t base; int size; } ipv4; @@ -69,7 +72,7 @@ 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(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); |