📄 dhcp_server.h
字号:
/******************************************************************************\
Copyright (c) 2007, UTStarcom,Inc. (ShenZhen R&D Center)
All Rights Reserved.
Subsystem : WIMAX
Group : GW/AnchorEP/DHCP
File : dhcp_server.h
Version :
Build :
Author : kevin.shi
Maintained by : kevin.shi
Create Date : 2007-01-01
Last Modify :
Description : DHCP server primary include file
\******************************************************************************/
/*
-----------------------------------------------------------
Software Develop CodeName :
Module Reference :
-----------------------------------------------------------
Change History:
07-01.01 kevin.shi create file.
*/
#ifndef _DHCP_SERVER_H_
#define _DHCP_SERVER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "dhcp.h"
#include "dhcp_comm.h"
#include "gw_up_if.h"
#define NOICMPCHK
#define DHCP_NO_MORE_PROCESS 1
#define DHCP_NO_SUPPORT_INITREBOOT 2
/*
* function prototype definition
*/
int garbage_collect (void);
int get_cid (struct dhcp *, int, struct client_id *);
int get_haddr(struct dhcp *msg,struct chaddr *haddr);
int get_maxoptlen (struct dhcp *, int);
int get_subnet (struct dhcp *, int, struct in_addr *);
int choose_lease (int, /*time_t,*/ struct dhcp_resource *);
void clean_sbuf (void);
void construct_msg (unsigned char , struct dhcp_resource *,GW_UP_DHCP_MSG *);
int nvttostr (char *, char *, int);
int insert_it (char *);
int insert_opt (struct dhcp_resource *, u_long, int, char *, char);
#define PASSIVE 0
#define ACTIVE 1
int discover();
int request();
int decline();
int release();
int ins_ip (struct dhcp_resource *, u_long, int, char *, char);
int ins_ips (struct dhcp_resource *, u_long, int, char *, char);
int ins_dht (struct dhcp_resource *, u_long, int, char *, char);
int ins_str (struct dhcp_resource *, u_long, int, char *, char);
int ins_short (struct dhcp_resource *, u_long, int, char *, char);
int ins_octet (struct dhcp_resource *, u_long, int, char *, char);
int ins_mtpt (struct dhcp_resource *, u_long, int, char *, char);
/*
int ins_ippairs (struct dhcp_resource *, u_long, int, char *, char);
int ins_long (struct dhcp_resource *, u_long, int, char *, char);
*/
static int (*ins_opt []) (struct dhcp_resource *, u_long, int, char *, char) =
{
NULL, /* PAD == 0 */
ins_ip, /* SUBNET_MASK */
NULL,//ins_long, /* TIME_OFFSET */
ins_ips, /* ROUTER */
NULL,//ins_ips, /* TIME_SERVER */
NULL,//ins_ips, /* NAME_SERVER */
ins_ips, /* DNS_SERVER */
NULL,//ins_ips, /* LOG_SERVER */
NULL,//ins_ips, /* COOKIE_SERVER */
NULL,//ins_ips, /* LPR_SERVER */
NULL,//ins_ips, /* IMPRESS_SERVER */
NULL,//ins_ips, /* RLS_SERVER */
ins_str, /* HOSTNAME */
NULL,//ins_short, /* BOOTSIZE */
NULL,//ins_str, /* MERIT_DUMP */
ins_str, /* DNS_DOMAIN */
NULL,//ins_ip, /* SWAP_SERVER */
NULL,//ins_str, /* ROOT_PATH */
NULL,//ins_str, /* EXTENSIONS_PATH */
ins_octet, /* IP_FORWARD */
ins_octet, /* NONLOCAL_SRCROUTE */
NULL,//ins_ippairs, /* POLICY_FILTER */
NULL,//ins_short, /* MAX_DGRAM_SIZE */
ins_octet, /* DEFAULT_IP_TTL */
NULL,//ins_long, /* MTU_AGING_TIMEOUT */
ins_mtpt, /* MTU_PLATEAU_TABLE */
ins_short, /* IF_MTU */
ins_octet, /* ALL_SUBNET_LOCAL */
NULL,//ins_ip, /* BRDCAST_ADDR */
ins_octet, /* MASK_DISCOVER */
ins_octet, /* MASK_SUPPLIER */
ins_octet, /* ROUTER_DISCOVER */
NULL,//ins_ip, /* ROUTER_SOLICIT */
NULL,//ins_ippairs, /* STATIC_ROUTE */
ins_octet, /* TRAILER */
NULL,//ins_long, /* ARP_CACHE_TIMEOUT */
ins_octet, /* ETHER_ENCAP */
ins_octet, /* DEFAULT_TCP_TTL */
NULL,//ins_long, /* KEEPALIVE_INTER */
ins_octet, /* KEEPALIVE_GARBA */
NULL,//ins_str, /* NIS_DOMAIN */
NULL,//ins_ips, /* NIS_SERVER */
NULL,//ins_ips, /* NTP_SERVER */
NULL, /* VENDOR_SPEC */
ins_ips, /* NBN_SERVER */
NULL,//ins_ips, /* NBDD_SERVER */
ins_octet, /* NB_NODETYPE */
NULL,//ins_str, /* NB_SCOPE */
NULL,//ins_ips, /* XFONT_SERVER */
NULL,//ins_ips, /* XDISPLAY_MANAGER */
NULL, /* REQUEST_IPADDR */
NULL, /* LEASE_TIME */
NULL, /* OPT_OVERLOAD */
NULL, /* DHCP_MSGTYPE */
NULL, /* SERVER_ID */
NULL, /* REQ_LIST */
NULL, /* DHCP_ERRMSG */
NULL, /* DHCP_MAXMSGSIZE */
ins_dht, /* DHCP_T1 */
ins_dht, /* DHCP_T2 */
NULL, /* CLASS_ID */
NULL, /* CLIENT_ID */
NULL,
NULL,
NULL,//ins_str, /* NISP_DOMAIN */
NULL,//ins_ips, /* NISP_SERVER */
NULL, /* TFTP_SERVERNAME */
NULL, /* BOOTFILE */
NULL,//ins_ips, /* MOBILEIP_HA */
NULL,//ins_ips, /* SMTP_SERVER */
NULL,//ins_ips, /* POP3_SERVER */
NULL,//ins_ips, /* NNTP_SERVER */
NULL,//ins_ips, /* DFLT_WWW_SERVER */
NULL,//ins_ips, /* DFLT_FINGER_SERVER */
NULL,//ins_ips, /* DFLT_IRC_SERVER */
NULL,//ins_ips, /* STREETTALK_SERVER */
NULL,//ins_ips /* STDA_SERVER */
};
#ifdef __cplusplus
}
#endif
#endif /*_DHCP_SERVER_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -