亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ipsec_network_interface.c

?? ipsec PNE 3.3 source code, running at more than vxworks6.x version.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ipsec_network_interface.c - WindNet IPsec and IKE - network i/f code *//*  * Copyright (c) 2000-2005 Wind River Systems, Inc.  *  * The right to copy, distribute, modify or otherwise make use  * of this software may be licensed only pursuant to the terms  * of an applicable Wind River license agreement.  *//*modification history--------------------02o,12dec05,djp  removed compiler warnings02n,28nov05,djp  replace WRN_INET with WRSEC_INET02m,12apr05,djp  Fixed compiler warnings02l,13jan05,ps  eliminate aliased function names.02i,10sep04,rlm  Minor fixes to #include stmts for compile errors with                 -DINCLUDE_IPFW_HOOKS -DVIRTUAL_STACK02h,30jul04,rlm  Fixes to virtual stack variable names to match new unified                 network stack02g,12jun03,rparkhil added support for STACK_NAME02f,24Apr03,sam(teamf1) renamed ipsec_get_pmtu_message to ipsecPmtuMessageGet.02e,19Apr03,rks(teamf1) semaphore was not getting released when returning     from a error path in ipsecDetachIfMapi.02d,15apr03,sam(teamf1) added functions to set and get PMTU age(SPR #86677).02c,24feb03,mad(teamf1) replaced wrSecFree with wrSecFree in the functions                             ipsecAttachIfMapi() and ipsecDetachIfMapi().02b,18Dec02,mhb(teamf1) added code for deleting the spd policies that                             are added when ipsecAttachIf is called. 03a,20Sep02,rks(teamf1) added support for IPV6_STACK02b,25mar02,rpt   added mapi func "ipsecDFBitMapi" for DF bit configuration02a,19mar02,rpt   updated func definitions to support IPv4 and IPv6 address                   data structures 01a,20oct00,aos   written*//******************************************************************************/#include <stdio.h>#include <stdarg.h>#include <stdlib.h>#include <vxWorks.h>/* Following two #includes required to get quad_t datatype when   VIRTUAL_STACK and INCLUDE_IPFW_HOOKS are defined. */#if (_WRS_VXWORKS_MAJOR < 6)#include <osdep.h>#include <machdep.h>#endif#include <netinet/in.h>#ifdef _KERNEL#define _KERNEL_PREDEFINED#else#define _KERNEL#endif#include <net/if.h>#include <net/if_var.h>#include <netinet/in_var.h> /* for _in_ifaddrhead */#ifndef _KERNEL_PREDEFINED#undef _KERNEL#else#undef _KERNEL_PREDEFINED#endif#include "ipsecP.h"#include "ipsec_class.h"#include "ipsec_globals.h"#include "ipsec_network_interface.h"#include "ipsec_print_routines.h"#ifdef VIRTUAL_STACK#include <netinet/vsLib.h>#include <netinet/vsData.h> /* for vsTbl[] */#include <vs/vsIf.h>        /* for ifnet_head *//* required if INCLUDE_IPFW_HOOKS defined */#ifdef _KERNEL#define _KERNEL_PREDEFINED#else#define _KERNEL#endif#include <netinet/vsIp.h> /* for _in_ifaddrhead */#ifndef _KERNEL_PREDEFINED#undef _KERNEL#else#undef _KERNEL_PREDEFINED#endif#else#include <net/if_var.h> /* for ifnet_head */#endif                  /* VIRTUAL_STACK *//*******************************************************************************//*DESCRIPTION*//* defines *//* globals *//* forward declarations */NET_IF *sadb_create_network_interface(void);/******************************************************************************** ipsecAttachIfMapi - Attaches a network interface to IPsec* RETURNS: OK if network interface is successfully attached to IPsec, * otherwise ERROR*/STATUS ipsecAttachIfMapi    (    WRSEC_INET_ADDR *pAddress    )    {    int s;    IPSEC_NETWORK_INTERFACE *p_ipsec_network_interface;    STATUS return_value;    struct ifnet ifnet_clone;	struct ifnet *sptr_ifnet;	struct ifnet *sptr_ifnet_original;    char addr_string[40];    WRSEC_INET_ADDR_FAMILY wrn_inet_address_family;    DF_BIT_CONFIG df_bit_config = CLEAR;    if (ipsec_global_class.ipsec_enabled == FALSE)        {        return (ERROR);        }    wrn_inet_address_family = pAddress->type;    if (wrn_inet_address_family != WRSEC_AF_INET4 && wrn_inet_address_family != WRSEC_AF_INET6)        {        ipsec_printf (IPSEC_ERROR_PRINTF, "IPsec: Invalid Address\n");        return (ERROR);        }    if (ipsec_find_network_interface_based_on_ip_address (pAddress) != NULL)        {        wrSecFree (pAddress);        return (OK);        }    sptr_ifnet = NULL;    p_ipsec_network_interface = NULL;    return_value = ERROR;    s = splnet ();    /* Find the corresponding ifnet entry */    sptr_ifnet = ipsec_get_ifnet_handle (pAddress);    if (sptr_ifnet != NULL)        {        ifnet_clone = *sptr_ifnet;        splx (s);        sptr_ifnet_original = sptr_ifnet;        sptr_ifnet = &ifnet_clone;        p_ipsec_network_interface = wrSecCalloc (1, sizeof (IPSEC_NETWORK_INTERFACE));        if (p_ipsec_network_interface != NULL)            {            p_ipsec_network_interface->net_interface = sadb_create_network_interface ();            if (!p_ipsec_network_interface->net_interface)                {                ipsec_printf_mon (                    IPSEC_ERROR_PRINTF,                      "IPsec: Failed to add network interface %s%u into SADB\n",						sptr_ifnet->if_name, sptr_ifnet->if_unit);                wrSecFree (p_ipsec_network_interface);                }            else                {                strcpy (p_ipsec_network_interface->cptr_netif_name, sptr_ifnet->if_name);                p_ipsec_network_interface->enabled = TRUE;                p_ipsec_network_interface->port_number = sptr_ifnet->if_index;                p_ipsec_network_interface->port_sub_unit = sptr_ifnet->if_unit;                p_ipsec_network_interface->sptr_ifnet = sptr_ifnet_original;                p_ipsec_network_interface->p_address = pAddress;                p_ipsec_network_interface->df_bit = df_bit_config;                p_ipsec_network_interface->pmtu_age = IPSEC_DEFAULT_PMTU_AGE;                if (sadbAddNetIfAddr(p_ipsec_network_interface->net_interface, p_ipsec_network_interface->p_address) == FALSE)                    {                    wrSecInetAddrToString(addr_string, 40, pAddress);                    ipsec_printf_mon (                        IPSEC_ERROR_PRINTF,                      "IPsec: Failed to add address %s %s %s%u into SADB\n",                        addr_string,                             "to network interface",							sptr_ifnet->if_name, sptr_ifnet->if_unit);                    wrSecFree (p_ipsec_network_interface);                    }                else                    {                    /* Add a secure network interface to IPsec */                    if (wrSecListAddFront (ipsec_global_class.ipsec_network_interface_list, p_ipsec_network_interface) == ERROR)                        {                        wrSecInetAddrToString(addr_string, 40, pAddress);                        ipsec_printf_mon (IPSEC_ERROR_PRINTF,                "IPsec: %s %s to list\n",                                          "Failed to add network interface", addr_string);                        }                    else                        {                        return_value = OK;                        }                    }                }            }        else            {            ipsec_printf_mon (IPSEC_ERROR_PRINTF, "IPsec: Error: ipsecAttachIfMapi(): wrSecAlloc failed\n");            }        }    else        {        splx (s);        wrSecInetAddrToString(addr_string, 40, pAddress);        ipsec_printf_mon (IPSEC_ERROR_PRINTF, "IPsec: Failed to get NETINTERFACE for IP Address: %s\n", addr_string);        }    return (return_value);    }/******************************************************************************** ipsecDetachIfMapi - Detaches a network interface from IPsec** RETURNS: OK if network interface is successfully detached from IPsec, * otherwise ERROR*/STATUS ipsecDetachIfMapi    (    WRSEC_INET_ADDR *pAddress    )    {    void *iterator = (void*)NULL;    IPSEC_NETWORK_INTERFACE *p_ipsec_network_interface;    STATUS return_value;    WRSEC_INET_ADDR_FAMILY wrn_inet_address_family;    char addr_string[40];    struct ifnet ifnet_clone;	struct ifnet *sptr_ifnet;	struct ifnet *sptr_ifnet_original;    int s;    DF_BIT_CONFIG df_bit_config = CLEAR;    if (ipsec_global_class.ipsec_enabled == FALSE)        {        return (ERROR);        }    return_value = ERROR;    p_ipsec_network_interface = NULL;    wrn_inet_address_family = pAddress->type;    if (wrn_inet_address_family != WRSEC_AF_INET4 && wrn_inet_address_family != WRSEC_AF_INET6)        {        ipsec_printf (IPSEC_ERROR_PRINTF, "IPsec: Invalid Address format\n");        return (ERROR);        }	wrSecListScanLock( ipsec_global_class.ipsec_network_interface_list );	while ((p_ipsec_network_interface = wrSecListScan(ipsec_global_class.ipsec_network_interface_list,                                                      &iterator)) != NULL)		{		if ((pAddress->type == p_ipsec_network_interface->p_address->type) &&            wrSecInetAddrEquals(pAddress, p_ipsec_network_interface->p_address))			{			sptr_ifnet = NULL;			s = splimp ();			/* Find the corresponding ifnet entry */			sptr_ifnet = ipsec_get_ifnet_handle (pAddress);			if (sptr_ifnet != NULL)				{				ifnet_clone = *sptr_ifnet;				splx (s);				sptr_ifnet_original = sptr_ifnet;				sptr_ifnet = &ifnet_clone;				strcpy (p_ipsec_network_interface->cptr_netif_name, sptr_ifnet->if_name);				p_ipsec_network_interface->enabled = TRUE;				p_ipsec_network_interface->port_number = sptr_ifnet->if_index;				p_ipsec_network_interface->port_sub_unit = sptr_ifnet->if_unit;				p_ipsec_network_interface->sptr_ifnet = sptr_ifnet_original;				p_ipsec_network_interface->p_address = pAddress;				p_ipsec_network_interface->df_bit = df_bit_config;				if (sadbDeleteNetIfAddr (p_ipsec_network_interface->net_interface, p_ipsec_network_interface->p_address)						== FALSE)					{					wrSecInetAddrToString(addr_string, 40, pAddress);					ipsec_printf_mon (						IPSEC_ERROR_PRINTF,						"IPsec: Failed to delete address %s %s %s%u from SADB\n",						addr_string,						"from network interface",						sptr_ifnet->if_name,						sptr_ifnet->if_unit);					return ERROR;					}				}			else				{				splx (s);				wrSecInetAddrToString(addr_string, 40, pAddress);				ipsec_printf_mon (IPSEC_ERROR_PRINTF, "IPsec: Failed to get NETINTERFACE for IP Address: %s\n",								  addr_string);				return ERROR;				}			/* delete the network interface from			the security association database */			if (sadbDeleteNetIf (p_ipsec_network_interface->net_interface) == FALSE)				{				ipsec_printf_mon (					IPSEC_WARNING_PRINTF,                          "IPsec: %s %s%u\n",					"Failed to delete SADB for network interface", p_ipsec_network_interface->cptr_netif_name,					p_ipsec_network_interface->port_sub_unit);				}			else				{								/* remove the remove ipsec network interface  */				if (!wrSecListScanRemove(ipsec_global_class.ipsec_network_interface_list, &iterator))				{					ipsec_printf_mon (						IPSEC_WARNING_PRINTF,						"IPsec: %s %s%u\n",						"Failed to remove iterator network interface",						p_ipsec_network_interface->cptr_netif_name,						p_ipsec_network_interface->port_sub_unit);				}				ipsec_printf (					IPSEC_DEBUG_PRINTF,                         "IPSec:  Network interface removed %s%u\n",					p_ipsec_network_interface->cptr_netif_name, p_ipsec_network_interface->port_sub_unit);				wrSecFree (pAddress);				wrSecFree (p_ipsec_network_interface);				p_ipsec_network_interface = NULL;				return_value = OK;				}			break;			}		}	wrSecListScanUnlock( ipsec_global_class.ipsec_network_interface_list );    return (return_value);    }/******************************************************************************** ipsecDFBitMapi - Configures the DF bit handling (SET/COPY/CLEAR) for each * interface enabled with IPSec. * RETURNS: OK if DF bit is successfully configured for the given IPSec enabled * interface  otherwise ERROR*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩精品一区| 制服丝袜国产精品| 日本一区二区成人在线| 国产91精品一区二区| 亚洲一线二线三线久久久| 欧美一区二区三区成人| 成人高清伦理免费影院在线观看| 亚洲伦理在线精品| 日韩欧美123| 色哟哟在线观看一区二区三区| 蜜桃精品在线观看| 中文字幕亚洲电影| 日韩欧美久久一区| 26uuu久久综合| 欧美日韩精品欧美日韩精品一| 国产精品一区二区久久精品爱涩 | 精品中文字幕一区二区小辣椒| 久久精品一级爱片| 3atv一区二区三区| 欧美成人精品福利| 欧美日韩在线免费视频| 成人综合激情网| 爽好多水快深点欧美视频| 一区视频在线播放| 亚洲成在人线免费| 一区二区三区欧美日韩| 国产精品国产精品国产专区不片| 精品国产乱码久久久久久久久| 欧美系列日韩一区| 欧美无砖砖区免费| 精品伦理精品一区| 国产精品激情偷乱一区二区∴| 亚洲精品欧美综合四区| 日韩电影在线一区| 免费精品视频最新在线| 亚洲444eee在线观看| 久久精品国产亚洲高清剧情介绍| 午夜精品一区二区三区电影天堂 | 91网站在线播放| 成人精品视频一区二区三区| 欧美日韩中字一区| 久久亚洲精精品中文字幕早川悠里 | 成人黄色免费短视频| 欧美日韩一区二区三区四区| 久久久一区二区| 久久久高清一区二区三区| 亚洲乱码国产乱码精品精小说| 免费观看在线综合色| 99精品视频一区二区| 91视频观看免费| 日韩欧美一卡二卡| 亚洲一区在线看| 福利一区福利二区| 欧美成人福利视频| 亚洲国产一二三| 日韩激情一二三区| 色偷偷88欧美精品久久久| 国产网站一区二区| 久久99精品国产麻豆婷婷洗澡| 欧美色国产精品| 亚洲裸体xxx| 亚洲国产日韩精品| 99精品国产视频| 久久精品一区四区| 激情综合亚洲精品| 日韩欧美高清dvd碟片| 三级在线观看一区二区 | 制服视频三区第一页精品| 亚洲青青青在线视频| 国产成人在线电影| 在线观看欧美黄色| 精品盗摄一区二区三区| 免费观看在线色综合| 91麻豆精品国产无毒不卡在线观看 | 欧美激情综合网| 国产精品中文有码| 欧美精品一区二区久久久| 蜜臀av一区二区三区| 91精品久久久久久蜜臀| 日韩高清不卡在线| 日韩欧美国产一区二区在线播放 | 欧美激情在线一区二区| 国产成人在线视频免费播放| 久久久国产精品麻豆| 国产精品 欧美精品| 国产精品午夜在线| 日本一不卡视频| 777a∨成人精品桃花网| 麻豆精品一区二区| 精品国产精品网麻豆系列| 国产麻豆9l精品三级站| 欧美日韩第一区日日骚| 美女国产一区二区| 久久精品亚洲精品国产欧美| 成人综合激情网| 亚洲精品日日夜夜| 欧美一级在线观看| 成人综合在线观看| 一区二区三区精品视频在线| 日韩一区二区在线看| 天堂久久一区二区三区| 久久亚洲综合av| 99视频精品免费视频| 国产亚洲精久久久久久| 91蜜桃网址入口| 日韩二区三区在线观看| 国产欧美日韩精品一区| 色婷婷久久久综合中文字幕 | 国产乱理伦片在线观看夜一区| 国产精品丝袜一区| 欧美日韩在线免费视频| 狠狠色2019综合网| 精品人在线二区三区| 成人国产视频在线观看| 日韩国产一二三区| 中文字幕在线不卡国产视频| 欧美亚洲综合久久| 国产伦精品一区二区三区免费| 亚洲欧美另类在线| 久久蜜臀精品av| 欧美日韩国产美女| 成人午夜短视频| 日本亚洲最大的色成网站www| 中文字幕在线不卡| 久久久久久久久久久久久久久99 | 亚洲乱码国产乱码精品精小说| 欧美一区二区成人6969| 99精品欧美一区| 国产精品一区久久久久| 亚洲va韩国va欧美va| 亚洲男人的天堂一区二区| 久久日韩粉嫩一区二区三区| 欧美丰满高潮xxxx喷水动漫| 蜜桃精品在线观看| 亚洲一区二区三区激情| 国产精品国产三级国产a| 久久亚洲综合色| 精品久久久久久久久久久院品网 | 国产精品美女www爽爽爽| 日韩一区二区三区在线| 欧洲色大大久久| 高清不卡一区二区| 国产成人鲁色资源国产91色综| 美女在线视频一区| 日日夜夜一区二区| 亚洲大片精品永久免费| 亚洲最新在线观看| 亚洲激情六月丁香| 亚洲综合在线视频| 亚洲男人的天堂av| 亚洲欧美国产77777| 国产精品传媒视频| 亚洲视频 欧洲视频| 欧美一区二区网站| 欧美日韩性生活| 欧美人狂配大交3d怪物一区| 在线观看不卡一区| 欧美人妇做爰xxxⅹ性高电影| 在线观看日韩毛片| 欧美日本在线观看| 91精品欧美综合在线观看最新| 欧美日韩国产bt| 在线成人av网站| 日韩美女视频一区二区在线观看| 日韩一区二区在线观看视频 | 日韩美女视频一区二区 | 视频一区视频二区中文| 麻豆成人av在线| 国产在线精品一区二区不卡了 | 久久99精品一区二区三区| 激情六月婷婷综合| 国产精品资源在线观看| 成人h精品动漫一区二区三区| 色哟哟欧美精品| 在线播放国产精品二区一二区四区| 欧美日韩在线播放一区| 日韩欧美国产综合| 中文字幕欧美日韩一区| 亚洲综合在线五月| 日本va欧美va精品| 国产乱对白刺激视频不卡| 91视频在线观看免费| 7777精品久久久大香线蕉| 精品国产电影一区二区| 亚洲欧洲综合另类| 免费观看30秒视频久久| 国产精品一区二区久久不卡 | 免费在线观看成人| 国产精品一色哟哟哟| 色综合一个色综合亚洲| av电影在线观看一区| 欧美三级日本三级少妇99| 亚洲精品一区二区三区在线观看 | 丁香五精品蜜臀久久久久99网站| 91在线小视频| 日韩欧美资源站| 亚洲欧美日韩久久| 精品在线你懂的| 欧美日韩国产一区| 国产精品福利一区二区三区|