52 lines
955 B
C
52 lines
955 B
C
//
|
|
// 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];
|
|
U32 uid;
|
|
U32 xid;
|
|
U32 reqIpAddr;
|
|
U32 leaseTime;
|
|
char clientId[256];
|
|
char vendorClassId[256];
|
|
U32 serverAddr;
|
|
char hostName[256];
|
|
} DHCP_REQ, *PDHCP_REQ;
|
|
|
|
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;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif //VCPE_RFC2131_H
|