vcpe/srcs/service/dhcpd/include/rfc2131.h

54 lines
993 B
C
Raw Normal View History

//
// 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;
U32 xid;
U32 reqIpAddr;
U32 leaseTime;
char clientId[256];
char vendorClassId[256];
2023-04-27 09:04:43 +00:00
U32 reqServer;
U32 serverAddr;
U32 cliAddr;
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