2023-03-29 09:02:21 +00:00
|
|
|
//
|
|
|
|
// Created by xajhuang on 2023/3/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef VCPE_IP_POOL_H
|
|
|
|
#define VCPE_IP_POOL_H
|
|
|
|
#include <uthash/uthash.h>
|
|
|
|
#include <common.h>
|
2023-04-07 07:56:38 +00:00
|
|
|
#include <bitset/bitset.h>
|
|
|
|
|
2023-03-29 09:02:21 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* key format FFFFFFF-FFFFFFF
|
|
|
|
* minAddr-maxAddr
|
|
|
|
* Hex format string
|
|
|
|
*/
|
|
|
|
#define MAX_POOL_HASH_KEY (18)
|
|
|
|
|
|
|
|
typedef struct {
|
2023-04-07 07:56:38 +00:00
|
|
|
U32 poolKey;
|
2023-03-29 09:02:21 +00:00
|
|
|
U32 minAddr;
|
|
|
|
U32 maxAddr;
|
|
|
|
U32 netMask;
|
|
|
|
U32 gwAddr;
|
|
|
|
U32 primeDNS;
|
|
|
|
U32 salveDNS;
|
|
|
|
U32 leaseTime;
|
2023-04-07 07:56:38 +00:00
|
|
|
bitset_t *assignPool;
|
2023-03-29 09:02:21 +00:00
|
|
|
UT_hash_handle hh;
|
|
|
|
} IPPOOL_INFO, *PIPPOOL_INFO;
|
|
|
|
|
|
|
|
void init_default_pool();
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif //VCPE_IP_POOL_H
|