2023-03-29 09:02:21 +00:00
|
|
|
//
|
|
|
|
// Created by xajhuang on 2023/3/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef VCPE_LEASE_H
|
|
|
|
#define VCPE_LEASE_H
|
|
|
|
#include <uthash/uthash.h>
|
|
|
|
#include <linux/if_ether.h>
|
|
|
|
#include <common.h>
|
2023-04-07 07:56:38 +00:00
|
|
|
#include "ip_pool.h"
|
2023-04-23 10:06:27 +00:00
|
|
|
#include "rfc2131.h"
|
2023-04-25 09:06:34 +00:00
|
|
|
#include "user_mgr.h"
|
|
|
|
|
2023-03-29 09:02:21 +00:00
|
|
|
#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;
|
|
|
|
|
2023-03-31 06:32:32 +00:00
|
|
|
int dhcp_lease_init();
|
2023-04-25 09:06:34 +00:00
|
|
|
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);
|
2023-04-27 09:04:43 +00:00
|
|
|
int is_pre_assigned(PDHCP_REQ pReq, PPOOL_CTX pCtx, U64 *dbId);
|
2023-03-29 09:02:21 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif //VCPE_LEASE_H
|