⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 natinit.c

📁 VXWORKS NAT 部分源代码4 有兴趣朋友可以参考下
💻 C
字号:
/* natInit.c - WIND NET NAT initialization */

/* Copyright 2000-2004 Wind River Systems, Inc. */

/* @format.tab-size 4, @format.use-tabs true, @format.new-line lf */

/*
modification history
--------------------
01g,05dec03,myz  move timer facility to natEvtTimer.c
01f,29aug03,zhu  updated the format for refgen
01e,29apr03,myz  incorporate Sady's review suggestions. 
01d,25apr03,myz  created the event dispatcher to provide the timer facility.
01c,25apr03,svk  Implement version number
01b,23apr03,zhu  updated copyright
01a,21apr03,myz  Replaced RWOS task layer with direct vxWorks's task creation.
030901  tk   Create natInitSync semaphore
*/

/* 
DESCRIPTION

This library supplies the WIND NET NAT initialization function.  

*/

/* ANSI Headers */

#include <stdio.h>
#include <string.h>
#include "nat.h"

/* globals */

char *	natVersion = NAT_VERSION; /* NAT version number string */


/***************************************************************************
*
* natInit - initialize WIND NET NAT
*
* Call this function to initialize WIND NET NAT. This call should follow  
* a call to natcfg(), a function that initializes the array at the global 
* variable, 'nat_configuration_text'.  This array supplies the 
* configuration parameters for WIND NET NAT.  After the call to natInit() 
* completes,  WIND NET NAT ignores the array at 'nat_configuration_text'.  
* Thus, if you change the configuration information in that array, you 
* need to disable WIND_NET_NAT entirely (see the natEnable() reference 
* entry), and then call natInit() again before the changes take effect. 
* 
* This function also initializes the WIND NET NAT timer facility.  
*  
*/
STATUS natInit (void)
   {
   /* create semaphore for NAT sync with ALGs */

   natInitSync = semBCreate (SEM_Q_FIFO, SEM_EMPTY);
   if (natInitSync == NULL)
       {
       nat_printf (NAT_PRINTF_ERROR,"Failed to create natInitSync semaphore\n");
       return (ERROR);
       }

   natTimerInit();
   nat_task_initialize(NULL);
   return OK;
   }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -