2023-04-20 08:46:20 +00:00
|
|
|
//
|
|
|
|
// Created by xajhuang on 2023/4/20.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef VCPE_RFC2131_H
|
|
|
|
#define VCPE_RFC2131_H
|
|
|
|
#include <linux/if_ether.h>
|
|
|
|
#include "common.h"
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DHCP_COOKIE_VAL (0x63825363)
|
|
|
|
#define MAX_DHCP_PKG_SIZE (512)
|
|
|
|
#define VLAN_VNI_ID(x) ntohs((x))
|
|
|
|
#define DHCP_XID(x) ntohl((x))
|
|
|
|
|
|
|
|
#define DHCP_CLI_PORT (68)
|
|
|
|
#define DHCP_SVR_PORT (67)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
U8 unicast;
|
|
|
|
U8 cliMac[ETH_ALEN];
|
2023-04-23 10:06:27 +00:00
|
|
|
U32 uid;
|
2023-04-20 08:46:20 +00:00
|
|
|
U32 xid;
|
|
|
|
U32 reqIpAddr;
|
|
|
|
U32 leaseTime;
|
|
|
|
char clientId[256];
|
|
|
|
char vendorClassId[256];
|
|
|
|
char hostName[256];
|
|
|
|
} DHCP_REQ, *PDHCP_REQ;
|
|
|
|
|
2023-04-21 07:01:36 +00:00
|
|
|
typedef struct {
|
|
|
|
U8 cliMac[ETH_ALEN];
|
|
|
|
char svrHostname[64];
|
|
|
|
char domainName[64];
|
|
|
|
U32 svrIp;
|
|
|
|
U32 xid;
|
|
|
|
U32 ipAddr;
|
|
|
|
U32 netmask;
|
|
|
|
U32 route;
|
|
|
|
U32 primeDNS;
|
|
|
|
U32 secondDNS;
|
|
|
|
U32 leaseTime;
|
|
|
|
} DHCP_RSP, *PDHCP_RSP;
|
|
|
|
|
2023-04-20 08:46:20 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif //VCPE_RFC2131_H
|