usrNetLib.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usrNetLib.c - network subsystem initialization */
  2. /* Copyright 1992 - 2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,23jan02,vvv  added arpMaxEntries
  7. 01c,09oct01,rae  merge from truestack (SPR #70476)
  8. 01b,27apr99,dat  SPR 27032, IP_MAX_UNITS was not effective
  9. 01a,05dec97,spm  added DHCP code review modifications
  10. */
  11. /*
  12. DESCRIPTION
  13. This file is used to configure and initialize the VxWorks networking support.
  14. The file is included in the project configuration file when INCLUDE_NET_SETUP 
  15. is defined. It creates the network memory pools and the device control 
  16. structure used by both END and BSD style drivers. It also initializes the 
  17. interface index library.
  18. NOMANUAL
  19. */
  20. /* network buffers configuration */
  21. /*
  22.  * mBlk, clBlk configuration table for network stack data pool.
  23.  * Only used for data transfer in the network stack.
  24.  */
  25. M_CL_CONFIG mClBlkConfig = 
  26.     {
  27.     /* 
  28.     no. mBlks no. clBlks memArea memSize
  29.     ----------- ---------- ------- -------
  30.     */
  31.     NUM_NET_MBLKS,  NUM_CL_BLKS, NULL,  0
  32.     };
  33. /*
  34.  * network stack data cluster pool configuration table
  35.  * Only used for data transfer in the network stack.
  36.  */
  37. CL_DESC clDescTbl [] = 
  38.     {
  39.     /* 
  40.     clusterSize num memArea memSize
  41.     ----------- ---- ------- -------
  42.     */
  43.     {64, NUM_64, NULL, 0},
  44.     {128, NUM_128, NULL, 0},
  45.     {256, NUM_256, NULL, 0},
  46.     {512, NUM_512, NULL, 0},
  47.     {1024, NUM_1024, NULL, 0},
  48.     {2048, NUM_2048, NULL, 0}
  49.     }; 
  50. int clDescTblNumEnt = (NELEMENTS(clDescTbl));
  51. /*
  52.  * mBlk, clBlk configuration table for network stack system pool.
  53.  * Used for network stack system structures such as routes, sockets,
  54.  * protocol control blocks, interface addresses, mulitcast addresses,
  55.  * and multicast routing entries.
  56.  */
  57. M_CL_CONFIG sysMclBlkConfig = 
  58.     {
  59.     /* 
  60.     no. mBlks no. clBlks memArea memSize
  61.     ----------- ---------- ------- -------
  62.     */
  63.     NUM_SYS_MBLKS,  NUM_SYS_CL_BLKS, NULL,  0
  64.     };
  65. /*
  66.  * network stack system cluster pool configuration table
  67.  * Used for network stack system structures such as routes, sockets,
  68.  * protocol control blocks, interface addresses, mulitcast addresses,
  69.  * and multicast routing entries.
  70.  */
  71. CL_DESC sysClDescTbl [] = 
  72.     {
  73.     /* 
  74.     clusterSize num memArea memSize
  75.     ----------- ---- ------- -------
  76.     */
  77.     {64, NUM_SYS_64, NULL, 0},
  78.     {128, NUM_SYS_128, NULL, 0},
  79.     {256, NUM_SYS_256, NULL, 0},
  80.     {512, NUM_SYS_512, NULL, 0},
  81.     }; 
  82. int sysClDescTblNumEnt = (NELEMENTS(sysClDescTbl));
  83. IP_DRV_CTRL        ipDrvCtrl[IP_MAX_UNITS];
  84. int                ipMaxUnits = IP_MAX_UNITS;
  85. IMPORT int         arpMaxEntries;
  86. void usrNetLibInit ()
  87.     {
  88.     ifIndexLibInit ();
  89.     arpMaxEntries = ARP_MAX_ENTRIES;
  90.     }