資源簡介
提供Linux系統下DHCP源碼下載
dhcp-3.1.1.tar.gz
代碼片段和文件信息
/*?clparse.c
???Parser?for?dhclient?config?and?lease?files...?*/
/*
?*?Copyright?(c)?2004-2009?by?Internet?Systems?Consortium?Inc.?(“ISC“)
?*?Copyright?(c)?1996-2003?by?Internet?Software?Consortium
?*
?*?Permission?to?use?copy?modify?and?distribute?this?software?for?any
?*?purpose?with?or?without?fee?is?hereby?granted?provided?that?the?above
?*?copyright?notice?and?this?permission?notice?appear?in?all?copies.
?*
?*?THE?SOFTWARE?IS?PROVIDED?“AS?IS“?AND?ISC?DISCLAIMS?ALL?WARRANTIES
?*?WITH?REGARD?TO?THIS?SOFTWARE?INCLUDING?ALL?IMPLIED?WARRANTIES?OF
?*?MERCHANTABILITY?AND?FITNESS.??IN?NO?EVENT?SHALL?ISC?BE?LIABLE?FOR
?*?ANY?SPECIAL?DIRECT?INDIRECT?OR?CONSEQUENTIAL?DAMAGES?OR?ANY?DAMAGES
?*?WHATSOEVER?RESULTING?FROM?LOSS?OF?USE?DATA?OR?PROFITS?WHETHER?IN?AN
?*?ACTION?OF?CONTRACT?NEGLIGENCE?OR?OTHER?TORTIOUS?ACTION?ARISING?OUT
?*?OF?OR?IN?CONNECTION?WITH?THE?USE?OR?PERFORMANCE?OF?THIS?SOFTWARE.
?*
?*???Internet?Systems?Consortium?Inc.
?*???950?Charter?Street
?*???Redwood?City?CA?94063
?*???
?*???https://www.isc.org/
?*
?*?This?software?has?been?written?for?Internet?Systems?Consortium
?*?by?Ted?Lemon?in?cooperation?with?Vixie?Enterprises?and?Nominum?Inc.
?*?To?learn?more?about?Internet?Systems?Consortium?see
?*?‘‘https://www.isc.org/‘‘.??To?learn?more?about?Vixie?Enterprises
?*?see?‘‘http://www.vix.com‘‘.???To?learn?more?about?Nominum?Inc.?see
?*?‘‘http://www.nominum.com‘‘.
?*/
#ifndef?lint
static?char?copyright[]?=
“$Id:?clparse.cv?1.67.76.5?2009/09/01?20:32:27?dhankins?Exp?$?Copyright?(c)?2004-2009?Internet?Systems?Consortium.??All?rights?reserved.\n“;
#endif?/*?not?lint?*/
#include?“dhcpd.h“
static?TIME?parsed_time;
struct?client_config?top_level_config;
u_int32_t?default_requested_options?[]?=?{
DHO_SUBNET_MASK
DHO_BROADCAST_ADDRESS
DHO_TIME_OFFSET
DHO_ROUTERS
DHO_DOMAIN_NAME
DHO_DOMAIN_NAME_SERVERS
DHO_HOST_NAME
0
};
/*?client-conf-file?:==?client-declarations?END_OF_FILE
???client-declarations?:==?
?|?client-declaration
?|?client-declarations?client-declaration?*/
isc_result_t?read_client_conf?()
{
struct?client_config?*config;
struct?client_state?*state;
struct?interface_info?*ip;
isc_result_t?status;
/*?Set?up?the?initial?dhcp?option?universe.?*/
initialize_common_option_spaces?();
/*?Initialize?the?top?level?client?configuration.?*/
memset?(&top_level_config?0?sizeof?top_level_config);
/*?Set?some?defaults...?*/
top_level_config.timeout?=?60;
top_level_config.select_interval?=?0;
top_level_config.reboot_timeout?=?10;
top_level_config.retry_interval?=?300;
top_level_config.backoff_cutoff?=?15;
top_level_config.initial_interval?=?3;
top_level_config.bootp_policy?=?P_ACCEPT;
top_level_config.script_name?=?path_dhclient_script;
top_level_config.requested_options?=?default_requested_options;
top_level_config.omapi_port?=?-1;
top_level_config.do_forward_update?=?1;
group_allocate?(&top_level_config.on_receipt?MDL);
if?(!top_level_config.on_receipt)
lo
- 上一篇:軟件測試實驗報告測試用例,代碼,截圖
- 下一篇:Linux RS485 通信代碼
評論
共有 條評論