📄 dhcpdcfg.h
字号:
/** Copyright (c) 1998-2000 by NETsilicon Inc.** This software is copyrighted by and is the sole property of* NETsilicon. All rights, title, ownership, or other interests* in the software remain the property of NETsilicon. This* software may only be used in accordance with the corresponding* license agreement. Any unauthorized use, duplication, transmission,* distribution, or disclosure of this software is expressly forbidden.** This Copyright notice may not be removed or modified without prior* written consent of NETsilicon.** NETsilicon, reserves the right to modify this software* without notice.** NETsilicon* 411 Waverley Oaks Road USA 781.647.1234* Suite 227 http://www.netsilicon.com* Waltham, MA 02452 AmericaSales@netsilicon.com**************************************************************************/#define DHCP_SERVER_SERVERNAME "Fusion DCHP Server"#define DHCP_SERVER_BOOTFILE "Your mama's boots"#define DHCP_SERVER_LEASE 30*60 /* 30 minute lease */#define DHCP_SERVER_START_IP 0x0A010181L /* \ IP addresses 10.1.1.129 */#define DHCP_SERVER_END_IP 0x0A0101FEL /* / to 10.1.1.254 */#define DHCPD_TIMER 60000 /* execute DHCPD timer function every second */#define DHCPD_INTERFACES 1 /* number of DHCPD interfaces */ /* DHCPD interface list */DHCPD_CONFIG dhcpd_config[DHCPD_INTERFACES] = { {"eth0"} };/************************************************************************* ** CONFIGURATION DATABASE ** *************************************************************************/DhcpConfig dhcpConfigArray[]={ {/* example entry */ {0x00,0xC0,0xF0,0x25,0x5C,0x86},6, /* ethernet address & length */ 0x0A010101L, /* \ IP address 10.1.1.1 only */ 0x0A010101L, /* / */ 5*60, /* 5-minute lease */ DHCP_SERVER_SERVERNAME, DHCP_SERVER_BOOTFILE, { SUBNET_MASK,4,255,255,255,0, /* example options */ DHCP_MAX_MSG_SIZE,2,(u8)(SIZEOF_DHCP_MESSAGE / 256), (u8)(SIZEOF_DHCP_MESSAGE % 256), END_OPTION /* option terminator */ } },/* example entry */ { {0x00,0xE0,0x98,0x05,0x83,0xE4},6, /* ethernet address & length */ 0x0A010102L, /* \ IP address 10.1.1.2 only */ 0x0A010102L, /* / */ 5*60, /* 5-minute lease */ DHCP_SERVER_SERVERNAME, DHCP_SERVER_BOOTFILE, { SUBNET_MASK,4,255,255,255,0, /* example options */ DHCP_MAX_MSG_SIZE,2,(u8)(SIZEOF_DHCP_MESSAGE / 256), (u8)(SIZEOF_DHCP_MESSAGE % 256), END_OPTION /* option terminator */ } },};#define NUMCONFIGS ARR_CNT(dhcpConfigArray)DhcpConfig dhcnfDefault={ /* example default lease configuration: */ {0x00,0x00,0x00,0x00,0x00,0x00},6, /* client id to be filled in */ DHCP_SERVER_START_IP, /* \ IP addresses 10.1.1.129 */ DHCP_SERVER_END_IP, /* / to 10.1.1.254 */ DHCP_SERVER_LEASE, /* 30-minute lease */ DHCP_SERVER_SERVERNAME, DHCP_SERVER_BOOTFILE, { SUBNET_MASK,4,255,255,255,0, /* example options */ DHCP_MAX_MSG_SIZE,2,(u8)(SIZEOF_DHCP_MESSAGE / 256), (u8)(SIZEOF_DHCP_MESSAGE % 256), END_OPTION /* option terminator */ } };/************************************************************************* ** Function : dhlSave ** ** Description : ** Stub for saving lease linked list to non-volatale storage. ** ** Parameters : None. ** ** Return : None. ** *************************************************************************/void dhlSave(void) /* stub for saving lease linked list */{ /* Linked list of leases changed, save to persistent storage. */ /* (Optional to examine and clear DHL_CHANGED flags.) */}/************************************************************************* ** Function : ** ** Description : ** Stub for restoring lease linked list from non-volatale storage. ** ** Parameters : None. ** ** Return : None. ** *************************************************************************/void dhlRestore(void) /* stub for restoring lease linked list */{ /* Read linked list of leases from persistent storage. */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -