// // Created by xajhuang on 2023/3/23. // #ifndef VCPE_LEASE_H #define VCPE_LEASE_H #include #include #include #include "ip_pool.h" #include "rfc2131.h" #include "user_mgr.h" #ifdef __cplusplus extern "C" { #endif typedef struct { U8 macAddr[ETH_ALEN]; U32 ipAddr; UT_hash_handle hh; } MAC_FILTER, *PMAC_FILTER; typedef struct { U32 uId; U8 macAddr[ETH_ALEN]; U32 ipAddr; U32 express; } LEASE_CACHE, *PLEASE_CACHE; int dhcp_lease_init(); int pre_alloc_dhcp_res(PDHCP_REQ pReq, PDHCP_USER pUser, U32 *pOutIp, PPOOL_CTX *pOutPool); int usr_lease_lock_ip(PDHCP_USER pUser, U32 ip); int is_pre_assigned(PDHCP_REQ pReq, PPOOL_CTX pCtx); int lease_release(PDHCP_REQ pReq); int lease_add_host(PDHCP_REQ pReq); #ifdef __cplusplus } #endif #endif //VCPE_LEASE_H