//
// Created by xajhuang on 2023/3/23.
//

#ifndef VCPE_IP_POOL_H
#define VCPE_IP_POOL_H
#include <uthash/uthash.h>
#include <common.h>
#include <bitset/bitset.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * key format FFFFFFF-FFFFFFF
 * minAddr-maxAddr
 * Hex format string
 */
#define MAX_POOL_HASH_KEY (18)

typedef struct {
    U32            poolKey;
    U32            minAddr;
    U32            maxAddr;
    U32            netMask;
    U32            gwAddr;
    U32            primeDNS;
    U32            salveDNS;
    U32            leaseTime;
    bitset_t      *assignPool;
    UT_hash_handle hh;
} IPPOOL_INFO, *PIPPOOL_INFO;

void init_default_pool();
#ifdef __cplusplus
}
#endif
#endif    //VCPE_IP_POOL_H