?? usrnetwork.c
字號:
/* usrNetwork.c - network initialization */#warning using local usrNetwork.c/* Copyright 1992 - 2002 Wind River Systems, Inc. *//*modification history--------------------06u,17may02,wap Initialize structures to eliminate diab error (SPR #76331, SPR #76377)06t,16may02,vvv restored SLIP support06s,30apr02,elr Added TELNETD_PARSER_CONTROL for telnetd Added check for definition of TELNETD_PARSER_CONTROL Changed telnetd initialization sequence06r,26apr02,mas non-boot 'sm' unit number hard-coded to zero (SPR 74787)06q,26apr02,vvv removed unneccessary NFS client error message (SPR #64507); fixed incorrect dev name comparison in usrBpInit (SPR #74788)06p,05apr02,hbh prevented double initialisation for host device for Full Windows simulator.06o,01apr02,wap properly dereference pointer when evaluating unitNum06n,28mar02,vvv added configuration parameters for NET_SHOW (SPR #69286/73759)06m,26mar02,vvv check for errors in usrNetInit (SPR #73503)06l,20mar02,wap try to properly derive network unitNum (SPR #73762)06k,14mar02,mas updated to support new SM components (SPR 73371)06j,13mar02,vvv removed SLIP, SNMP references (SPR #72992)06i,07mar02,vvv fixed MIB startup sequence (SPR #72989)06h,23jan02,vvv added arpMaxEntries06g,06nov01,vvv made NFS max. path length configurable (SPR #63551)06f,02nov01,pch wrap recent diags in NET_DIAG for scalability.06e,01nov01,pch SPR 70284 (from 440 port: 11sep01,pch): Add diagnostics; use "other" as net device name if "bootDev" not found; cleanup.06d,26oct01,vvv allow DHCP server to start when target does not boot from network device (SPR #64898); fixed SNTPS doc 06c,12oct01,rae merge from truestack ver 06f, base 05w SPRs 70115, 6940506b,19oct01,vvv fixed IP_MAX_UNITS declaration (SPR #70476)06a,20sep01,jmp fixed SIMNT route setting (SPR# 64900).05z,04jun01,rae move init for MIB2_IF, to make boot interface visible05m,13mar01,t_m pull mii calls05l,23nov00,jpd added miiLibInit() call; add include of proxyLib.h05k,01dec99,jgn fix BSP build warning05y,07feb01,spm added merge record, corrected changes, and fixed modification history for 30jan01 update from version 05j of tor2_0_x branch (base 04z); general overhaul of telnet server (SPR #28675)05x,30jan01,ijm merged SPR# 28602 fixes for proxy ARP (versions 05b and 05i of tor2_0_x branch - SPR #7576, #8993, #28601, and #28632)05w,16nov00,spm enabled new DHCP lease for runtime device setup (SPR #20438)05v,14nov00,rae removed unused argument from sockLibAdd()05u,27oct00,spm fixed DHCP startup update and mod history entry05t,27oct00,spm code cleanup; removed incorrect proxy server requirement05s,23oct00,niq updated DHCP startup for latest version (from tor3_x branch)05r,06oct00,spm fixed device search with non-zero unit numbers (SPR #26154)05q,03may99,pul max_linkhdr to be set in usrNetInit05p,29apr99,pul Upgraded NPT phase3 code to tor2.0.005o,02apr99,pul "To make max_linkhdr user configurable"05n,26mar99,pul remove muxMCastMapAdd05m,19mar99,dat SPR 25877 removed old driver support05l,18mar99,sj removed INCLUDE_NPT check05k,16mar99,dat SPR 25790, boot from END or netif device05j,09mar99,ham rejected the 05e modification.05i,08mar99,ham added boot device "pcmcia" entry, SPR#24714.05h,05mar99,sj eliminated call to muxTkLibInit. Must set muxMaxBinds05g,26feb99,dat changed netIf to usrNetIfTbl and made it global. Added FEI support (23818)05f,02feb99,sgv added bitflag parameter to sockLibAdd05e,20jan99,scb usrBpInit() modified to use "sm=" before SM_ANCHOR_ADRS (23035)05d,03Nov98,pul moved muxBindBase to muxTkLib.c05c,30nov98,c_s 20x -> 200 merge05b,30nov98,gnn corrected mod history and merged TFFS support05a,07oct98,sj added Network Protocol Toolkit(NPT) support04z,11sep98,spm corrected default value of RIP_GARBAGE_TIME (SPR #21908)04y,25aug98,n_s fixed interface config when using bootline other field and END. spr #22217.04x,04may98,cym added Windows ULIP code.04w,29apr98,dbt removed RDB references (no longer supported).04v,25sep97,jmb Add a default route for HPSIM SLIP connection.04u,10jul97,jmb Make NFS client work on HPSIM by setting nfsMaxMsgLen to a number less than the MTU - 127.04t,27jan97,jmb Add SLIP patches for HPSIM (from Mark Mason).04s,18jul98,spm merged support for TFFS boot device into release view04r,05dec97,spm added DHCP code review modifications04q,30nov97,vin added network stack system pool04p,29oct97,spm delayed DHCP client startup to prevent failure for fast processors (SPR #9641)04o,06oct97,spm moved DHCP server default parameters to dhcpsLib.h; added stub routine to support delayed startup of DHCP relay agent04n,06oct97,spm removed unused constant INCLUDE_BSD; added optional binary compatibility for BSD 4.3 applications04m,03oct97,gnn removed references to endDriver global04l,25sep97,gnn SENS beta feedback fixes04k,19sep97,vin added cluster blk configuration to network configuration. changed MBLK_CONFIG to M_CL_CONFIG.04j,26aug97,spm major overhaul of DHCP: reorganized code and changed user interface to support multple leases at runtime; improved handling of address information by client; altered all DHCP components to allow selection of UDP ports04i,14aug97,vin changed MBUF_CONFIG to MBLK_CONFIG04h,12aug97,gnn changes necessitated by MUX/END update.04g,11aug97,vin changed mbufConfig and clDescTbl.04d,06aug97,cdp fixed signed/unsigned comparison in checkInetAddrField.04f,15jul97,spm added support for SNTP client and server04e,03jul97,vin made routing sockets scalable.04d,03jul97,sgv fix for spr #8602 changed ftpdInit to check for authentication when INCLUDE_FTPD_SECURITY is defined04c,02jun97,spm allowed DHCP server to start without lease storage hook04b,20may97,gnn fixed SPR 8627 so that multiple gn devices are supported.04a,09may97,spm increased stack size for DHCP server task03z,30apr97,spm made hop limit for relay agent configurable; fixed DHCP bugs03y,25apr97,gnn changed INCLUDE_GN to INCLUDE_END03x,18apr97,spm eliminated DHCP-related compiler warnings when building BSP03w,17apr97,gnn changed network booting to work with END configNet files. fixed two bugs that ANVL found in RIP timers.03v,17apr97,vin added ipFilterLibInit() in usrNetProtoInit().03u,14apr97,vin added mCastRouteLibInit(), igmpShowInit, icmpShowInit, tcpShowInit, udpShowInit for scalability.03t,10apr97,jag added DNS resolver support03s,07apr97,gnn fixed a merge bug with Stephen's changes.03r,07apr97,gnn added new booting system for END network device.03q,07apr97,spm added DHCP server and relay agent support, fixed unit number support, removed redundant code for DHCP client03p,12mar97,gnn added new timer variables for ripLibInit03o,24feb97,gnn added RIP_MULTICAST for use by RIP changed routedLibInit to ripLibInit03n,14feb97,rjc OSPF_INCLUDE changed to INCLUDE_OSPF03m,14feb97,rjc added ospf init calls03l,07feb97,rjc deleted routePref, now in routeLib.c03k,31jan97,vin added macros for config parameters.03j,31jan97,spm added dhcpShowInit() to link DHCP client show routines.03i,29jan97,gnn moved the muxDevLoad call to later in the sequence.03h,21jan97,vin added scalability of network stack, moved _func_remCurId[SG]et from netLib.c for scalability.03g,21jan97,gnn Added another argument to muxDevLoad().03d,13jan97,jpd Added if_lnEbsa driver entry.03c,07jan97,jpd Added if_oli driver entry.03f,20dec96,vin removed warnings muxDevLoad().03e,18dec96,spm fixed small bug in DHCP client code03d,03dec96,spm removed bootLeaseExtract test when DHCP client not included to reduce code size03c,27nov96,spm added support for DHCP client.03b,26nov96,gnn added INCLUDE_RIP directive for routed/rip.03a,25nov96,vin added new cluster configuration.02z,15nov96,vin fixed problems with passive and silent options for PPP.02y,23oct96,gnn added END_DEV_NAME define for gnattach routine.02x,22oct96,gnn added END_BUFF_LOAN define so upper layer can request buffer loaning.03d,10dec97,spm added configurable password authentication for FTP server from SENS branch (SPR #8602)03c,11apr97,dvs added routes for SIMSPARCSOLARIS when using ppp instead of ULIP03b,11dec96,vin SPR7604 for PPP silent mode and passive mode.03a,10dec96,yp added route for ULIP driver so we send packets for our selves to localhost since not all hosts return whats ours02z,18nov96,dbt ANSIfied function headers (SPR #7427.)02y,11nov96,spm added bzero() call to checkInetAddrField(). (SPR #6326).02x,01nov96,hdn added support for PCMCIA. moved NETIF to sysLib.h.02w,13aug96,dat added NETIF_USR_DECL and NETIF_USR_ENTRIES, SPR 697002v,23jul96,hdn added support for ATA driver.02u,21jun96,jmb long modhist -- deleted entries prior to 1994. (SPR #6528)02t,13jun96,hdn added INCLUDE_ESMC for SMC91c9x Ethernet driver.02v,12aug96,rjc snmp init funcs modified to reflect removal of memory partition options.02u,07aug96,rjc added resolver changes.02t,29may96,dat fixed SPR 4392 re: network services after scsi (disk) boot02s,04apr96,rjc Merged in changes for snmp agent for vxWorks5302r,07mar96,gnn added SLIP_MTU so that we could configure the MTU. (SPR #4652)02q,06mar96,sgv Added error checks in usrStrmInit for tliInit(), dlpiInit() autopushInit() and strmDebugInit.02p,11nov95,vin baudrate in bootstring, added pppHookLib.02n,06sep95,jag deleted call to fattachInit (), and changed iosStrmInit to strmInit ().02n,01aug95,dzb changed STREAMS options to go through iosStrmInit (). added protocol initialization hook routine. PPP initialization failure message (SPR #4505).02m,28jul95,jag changed INCLUDE_STREAMS_LOG to INCLUDE_STREAMS_STRACE and INCLUDE_STREAMS_STRERR. Added the routines to support these options.02l,25jul95,dzb tweaked socket library initialization.02k,25jul95,dzb added socket library init for BSD vs. STREAMS.02j,25jul95,jag Added check for the return value of iosStrmInit.02i,18jul95,dzb wait for PPP interface to come up in usrPPPInit().02h,17jul95,dzb fixed ordering of boot params search.02g,26jun95,dzb removed PPP_S_USEHOSTNAME option.02f,22jun95,sgv Added streamsInit() to Initialise STREAMS02e,21jun95,dzb Added INCLUDE_PPP_CRYPT for unbundled crypt() support.02d,20jun95,dzb changed PPP options structure to set values from macros.02c,09jan95,dzb Added PPP support.02c,29jun95,caf added nicEvb driver entry.02b,28mar95,kkk changed smNetInit() parameters to use macros from configAll.h (SPR #4130)02z,27mar95,jag removed dependency of INCLUDE_NFS_SERVER from INCLUDE_NFS01z,19mar95,dvs removed tron references - no longer supported.01y,30jan95,hdn included nfsdLib.h if INCLUDE_NFS_SERVER is defined. added 6th argument to nfsdInit ().02b,31mar95,caf added dc driver entry.02a,02jan95,kat added ilac driver entry.01x,09dec94,jag Added INCLUDE_MIB2_AT01w,13nov94,dzb fixed placement of INCLUDE_PING.01v,17aug94,dzb fixed setting the gateway for a slip connection (SPR #2353). added qu netif device. added zbuf socket interface init. added ping init. added CSLIP support. added tcpTrace init.01u,11nov94,jag divided SNMP and MIB-II support.01t,09feb94,hdn added support for if_elt 3COM Etherlink III driver. added support for if_ene Eagle NE2000 driver.*//*DESCRIPTIONThis file is used to configure and initialize the VxWorks networking support.This file is included by usrConfig.c.SEE ALSO: usrExtra.cNOMANUAL*/#ifndef __INCusrNetworkc#define __INCusrNetworkc#include "zbufSockLib.h"#include "pingLib.h"#include "ipProto.h"#include "ifIndexLib.h"#ifdef INCLUDE_ARP_API#include "arpLib.h"#endif#ifdef INCLUDE_SNTPS#include "sntpsLib.h"/* Include this declaration if hook is defined. *//* IMPORT STATUS SNTPS_TIME_HOOK (int, void *); */#endif#define DEF_MAX_LINK_HDR 16#ifndef USR_MAX_LINK_HDR#define USR_MAX_LINK_HDR DEF_MAX_LINK_HDR#endif/* * To reduce code size by removing some diagnostic messages, change this to * #define NET_DIAG(x) * (so it expands to nothing). * Note that invocations require double parentheses, for example * NET_DIAG(("message %s string", "format")); */#define NET_DIAG(x) printf xIMPORT int max_linkhdr;#ifdef INCLUDE_SNTPC#include "sntpcLib.h"#endif#include "m2Lib.h"#include "private/funcBindP.h"#ifdef INCLUDE_OSPF#include "ospf/ospfLib.h"#endif /* INCLUDE_OSPF */#ifdef INCLUDE_NFS_SERVER#include "nfsdLib.h"#endif#ifdef INCLUDE_DNS_RESOLVER#include "resolvLib.h"#endif#ifdef INCLUDE_PROXY_CLIENT#include "proxyLib.h"#endif /* INCLUDE_PROXY_CLIENT */#if (CPU==SIMHPPA)extern int nfsMaxMsgLen;#endif#ifdef INCLUDE_FTPD_SECURITY#include "loginLib.h"#endif#if defined (INCLUDE_NFS) || defined (INCLUDE_NFS_SERVER)const int nfsMaxPath = NFS_MAXPATH + 1;#endif#ifdef INCLUDE_DHCPS#include "dhcpsLib.h"IMPORT long dhcps_dflt_lease;IMPORT long dhcps_max_lease;IMPORT STATUS dhcpsLeaseHookAdd (FUNCPTR);IMPORT STATUS dhcpsAddressHookAdd (FUNCPTR);/* Include these declarations if hooks are defined. *//* IMPORT STATUS DHCPS_LEASE_HOOK (int, char *, int); *//* IMPORT STATUS DHCPS_ADDRESS_HOOK (int, char *, int); */#endif#ifdef INCLUDE_DHCPC#include "dhcp/dhcpcInit.h"#include "dhcp/dhcpcCommonLib.h"#elseLOCAL STATUS dhcpcBootLineClean (char *);#ifdef INCLUDE_BOOTP#include "bootpLib.h"#endif /* INCLUDE_BOOTP */#endif /* INCLUDE_DHCPC */#ifdef INCLUDE_DHCPR#ifndef INCLUDE_DHCPS /* Server is superset of relay agent. */#include "dhcprLib.h"#endif#endif#ifdef INCLUDE_END#include "end.h"#include "muxLib.h"#include "muxTkLib.h"#include "configNet.h"#include "m2Lib.h"#endif /* INCLUDE_END */#ifdef INCLUDE_PROXY_CLIENT#include "proxyLib.h"#endif#if (defined (INCLUDE_DHCPC) || defined (INCLUDE_DHCPS) || \ defined (INCLUDE_RIP) || defined (INCLUDE_OSPF)) \ && !defined (INCLUDE_ROUTE_SOCK)#define INCLUDE_ROUTE_SOCK#endif /* INCLUDE_DHCPC || INCLUDE_DHCPS */#ifdef INCLUDE_SLIP#if (CPU==SIMHPPA)extern void sysSlipSetup ();#endif /* (CPU=SIMHPPA) */#endif /* INCLUDE_SLIP */#ifdef INCLUDE_END#ifdef INCLUDE_NT_ULIPextern int ntResolv ();#endif /* INCLUDE_NT_ULIP */#endif /* INCLUDE_END *//* global variables *//* network protocol configuration parameters */#ifdef INCLUDE_TCPTCP_CFG_PARAMS tcpCfgParams = /* tcp configuration parameters */ { TCP_FLAGS_DFLT, /* include rfc1323 support */ TCP_SND_SIZE_DFLT, /* default send buffer size */ TCP_RCV_SIZE_DFLT, /* default recv buffer size */ TCP_CON_TIMEO_DFLT, /* initial connection time out */ TCP_REXMT_THLD_DFLT, /* retransmit threshold */ TCP_MSS_DFLT, /* default maximum segment size */ TCP_RND_TRIP_DFLT, /* default round trip time */ TCP_IDLE_TIMEO_DFLT, /* idle timeouts before first probe */ TCP_MAX_PROBE_DFLT /* max no. probes before dropping */ };#endif /* INCLUDE_TCP */#ifdef INCLUDE_UDPUDP_CFG_PARAMS udpCfgParams = /* udp configuration parameters */ { UDP_FLAGS_DFLT, UDP_SND_SIZE_DFLT, /* send buffer size */ UDP_RCV_SIZE_DFLT /* recv buffer size */ };#endif /* INCLUDE_UDP */#ifdef INCLUDE_ICMPICMP_CFG_PARAMS icmpCfgParams = /* icmp configuration parameters */ { ICMP_FLAGS_DFLT /* no icmp mask replies by default */ };#endif /* INCLUDE_ICMP */IP_CFG_PARAMS ipCfgParams = /* ip configuration parameters */ { IP_FLAGS_DFLT, /* default ip flags */ IP_TTL_DFLT, /* ip default time to live */ IP_QLEN_DFLT, /* default ip intr queue len */ IP_FRAG_TTL_DFLT /* default ip fragment time to live */ };/* network buffers configuration *//* * mBlk, clBlk configuration table for network stack data pool. * Only used for data transfer in the network stack. */M_CL_CONFIG mClBlkConfig = { /* no. mBlks no. clBlks memArea memSize ----------- ---------- ------- ------- */ NUM_NET_MBLKS, NUM_CL_BLKS, NULL, 0 };/* * network stack data cluster pool configuration table * Only used for data transfer in the network stack. */CL_DESC clDescTbl [] = { /* clusterSize num memArea memSize
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -