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

📄 ipsec_if.h

📁 ipsec PNE 3.3 source code, running at more than vxworks6.x version.
💻 H
字号:
/* ipsec_if.h - WindNet IPsec and IKE: IPsec interface definitions *//*  * Copyright (c) 2000-2006 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-------------------------------------035,13jan06,djp  removed rwos dependencies034,11jan06,djp  Added required includes and removed rwos dependencies033,09jan05,djp  Added required includes03d,03nov04,rlm  Fixes for AES-CTR mode when compiled with gcc.03c,19jul04,rlm  Added definitions for AES-CTR mode support03b,14apr03,sam(teamf1)	changes for PMTU support(SPR #86677).03a,20Sep02,rks(teamf1) modification for IPv602b,25mar02,rpt   added mapi declaration "ipsecDFBitMapi" for DF bit config02a,19mar02,rpt   replaced IP_MESSAGE with IP_VI_MESSAGE, IP_V4_MESSAGE and                   IP_V6_MESSAGE. 01a,19mar02,rpt   extracted from WindNet IPSec 1.1, added modification history*//******************************************************************************/#if !defined (__IPSEC_IF_H__)#define __IPSEC_IF_H__/******************************************************************************//* This file is dependent on the inclusion of "target/h/net/mbuf.h" */#include <vxWorks.h>#ifndef __INCmbufh#include <net/mbuf.h>#endif#include "../common/wrSecInetAddr.h"#include "packetBuf.h"/* AES-CTR mode definitions */#define IPSEC_AES_CTR_NONCE_SIZE 4 /* 32 bits, 4 bytes */#define IPSEC_AES_CTR_IV_SIZE    8 /* 64 bits, 8 bytes */#define IPSEC_AES_CTR_CTR_SIZE   4 /* 32 bits, 4 bytes *//* Inherited from RW codebase */#define IP_VERSION_4 4#define IP_WORD_SIZE 4#define IP_PACKET_HEADER_MINIMUM_LENGTH 20#define IP_DEFAULT_TIME_TO_LIVE 32#define IPV6_PACKET_HEADER_MINIMUM_LENGTH 40typedef struct _ctrblk    {    unsigned char nonce[IPSEC_AES_CTR_NONCE_SIZE]; /* already set in cipher obj at SA creation */    uint32_t IV[2];    uint32_t ctr;    } AES_CTRBLK;/******************************************************************************/typedef enum IP_VERSION_NUMBER    {    INVALID_VERSION = 0,    IP_V4 = 4,    IP_V6 = 6    }IP_VERSION_NUMBER;/******************************************************************************/typedef enum IP_TRANSPORT_PROTOCOL{	ICMP_PROTOCOL										= 1,	IGMP_PROTOCOL										= 2,	TCP_PROTOCOL										= 6,	UDP_PROTOCOL										= 17,	ESP_PROTOCOL										= 50,	AH_PROTOCOL											= 51,	OSPF_PROTOCOL										= 89,	TRANSPORT_PROTOCOL_ANY							= 0xffff} IP_TRANSPORT_PROTOCOL;/* Version Independent IP Message Structure *//******************************************************************************/typedef struct IP_VI_MESSAGE    {    IP_VERSION_NUMBER version;    /*need to redo the serialize and deserialize functions     for IP_V4_Message and IP_V6_Message */    PACKETBUF    * pPayload;    } IP_VI_MESSAGE;/******************************************************************************//* IPv4 Message structure *//******************************************************************************/typedef UINT IP_TYPE_OF_SERVICE;typedef struct IP_V4_MESSAGE    {    IP_VI_MESSAGE vi_data;    UINT header_length;    IP_TYPE_OF_SERVICE type_of_service;    UINT total_length;    UINT datagram_identifier;    UINT dont_fragment_flag;    UINT more_fragment_flag;    UINT fragment_offset;    UINT time_to_live;    IP_TRANSPORT_PROTOCOL transport_protocol;    UINT checksum;    struct WRSEC_INET4_ADDR source_address;    struct WRSEC_INET4_ADDR destination_address;    } IP_V4_MESSAGE;/******************************************************************************//* IPv6 Message structure *//******************************************************************************/typedef struct IP_V6_MESSAGE    {    IP_VI_MESSAGE vi_data;    /*	IP_TRAFFIC_CLASS				traffic_class; To be added later */    UINT flow_label;    UINT payload_length;    UCHAR next_header;    UINT hop_limit;    struct WRSEC_INET6_ADDR source_address;    struct WRSEC_INET6_ADDR destination_address;    IP_TRANSPORT_PROTOCOL transport_protocol;    UCHAR *p_extn_headers;    USHORT extn_headers_len;    UCHAR first_extn_header;    } IP_V6_MESSAGE;/******************************************************************************//******************************************************************************/STATUS ipsecAttachIfMapi    (    WRSEC_INET_ADDR *pAddress    );STATUS ipsecDetachIfMapi    (    WRSEC_INET_ADDR *pAddress    );STATUS ipsecDFBitMapi    (    WRSEC_INET_ADDR *pAddress,    int dfBitConfig    );STATUS ipsecSetPMTUAgeMapi    (    WRSEC_INET_ADDR *pAddress,    UINT value    );BOOL ipsecIsNetIfAttached    (    WRSEC_INET_ADDR *pAddress    );/******************************************************************************/#endif /* __IPSEC_IF_H__*/

⌨️ 快捷键说明

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