summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 76f8225)
raw | patch | inline | side by side (parent: 76f8225)
author | Tinku Mannan <tmannan@ti.com> | |
Wed, 20 Feb 2013 20:18:04 +0000 (15:18 -0500) | ||
committer | Tinku Mannan <tmannan@ti.com> | |
Wed, 20 Feb 2013 20:18:04 +0000 (15:18 -0500) |
1. Added net_test_max_params applications, removed obsolete testing appps.
2. Added net_test configuration files to test out ability to create
larege number of SA's, largs number of MAC/IP interfaces.
3. Updated testing application to read config file from command line.
2. Added net_test configuration files to test out ability to create
larege number of SA's, largs number of MAC/IP interfaces.
3. Updated testing application to read config file from command line.
14 files changed:
ti/runtime/netapi/src/netapi_sec.c | patch | blob | history | |
ti/runtime/netapi/src/netcp_cfg.c | patch | blob | history | |
ti/runtime/netapi/src/pktio.c | patch | blob | history | |
ti/runtime/netapi/test/addsa_test.c | [deleted file] | patch | blob | history |
ti/runtime/netapi/test/build/Makefile | patch | blob | history | |
ti/runtime/netapi/test/mt_test.c | [deleted file] | patch | blob | history |
ti/runtime/netapi/test/net_test.c | patch | blob | history | |
ti/runtime/netapi/test/net_test_config_max_iface.txt | [new file with mode: 0644] | patch | blob |
ti/runtime/netapi/test/net_test_config_max_sa.txt | [new file with mode: 0644] | patch | blob |
ti/runtime/netapi/test/net_test_max_params.c | [new file with mode: 0755] | patch | blob |
ti/runtime/netapi/test/net_test_router.c | patch | blob | history | |
ti/runtime/netapi/test/net_test_sa_utils.c | patch | blob | history | |
ti/runtime/netapi/test/net_test_utils.c | patch | blob | history | |
ti/runtime/netapi/test/net_test_utils.h | patch | blob | history |
index 7d69af13ca9a70bef1f0cf0f43f71c9498712de2..08c90ae23ff98eaf14fa8c33cdd949c817e5b85f 100755 (executable)
&swInfo0,
&swInfo1) == nwal_TRUE)
{
- netapi_Log("netapisecAddSA swInfo0: 0x%x, swInfo1: 0x%x\n", swInfo0, swInfo1);
+ //netapi_Log("netapisecAddSA swInfo0: 0x%x, swInfo1: 0x%x\n", swInfo0, swInfo1);
}
else
netapi_Log("netapisecAddSA: call to nwal_getSecAssoc() returned error\n");
return -1;
}
- netapi_Log("netapi_secAddSA: Creating sideband mode SA for %d ( mac %d)\n", tunnelId, iface_no);
+ //netapi_Log("netapi_secAddSA: Creating sideband mode SA for %d ( mac %d)\n", tunnelId, iface_no);
*p_data_mode_handle = dm_handle;
memset(&dmPSCmdInfo, 0, sizeof(nwalTxDmPSCmdInfo_t));
retValue = nwal_initDMPSCmdInfo(netapip_returnNwalInstanceHandle(h),
index 293ff7d74fd0c633919063c1fe59ceff35a0580f..1d03194d823cf55da42f775564704b662247a3d3 100755 (executable)
p->tunnel[sa_slot].swInfo0 = swInfo0;
p->tunnel[sa_slot].swInfo1 = swInfo1;
p->tunnel[sa_slot].user_data = user_data;
- netapi_Log("netapip_netcpCfgInsertSa: swInfo0 0x%x, swInfo1: 0x%x, user data: %d\n",
- p->tunnel[sa_slot].swInfo0, p->tunnel[sa_slot].swInfo1, (uint32_t)p->tunnel[sa_slot].user_data);
+ //netapi_Log("netapip_netcpCfgInsertSa: swInfo0 0x%x, swInfo1: 0x%x, user data: %d\n",
+// p->tunnel[sa_slot].swInfo0, p->tunnel[sa_slot].swInfo1, (uint32_t)p->tunnel[sa_slot].user_data);
if (dmPSCmdInfo)
{
index 5cfd2dc7fa08eff6b210fb67bc1e62f017ab5d66..5e8e61bff2611864618630ef0e1eb6e3f661e687 100755 (executable)
swInfo1,
0);
- netapi_Log("netapi_pktioSendL4CkSumCryptPort: swinfo0 0x%x, swinfo1: 0x%x\n",swInfo0,swInfo1);
pPloadDesc = Pktlib_getDescFromPacket(pkt);
pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
swInfo0,
swInfo1,
0);
- netapi_Log("netapi_pktioSendCryptPort: swinfo0 0x%x, swinfo1: 0x%x\n",swInfo0,swInfo1);
+
pPloadDesc = Pktlib_getDescFromPacket(pkt);
pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
pTxPktInfo->saAhMacSize,
pTxPktInfo->enetPort);
- netapi_Log("netapi_pktioSendL4CkSumAHCryptPort: swinfo0 0x%x, swinfo1: 0x%x\n",swInfo0,swInfo1);
pPloadDesc = Pktlib_getDescFromPacket(pkt);
pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
PKTIO_HANDLE_T *p=(PKTIO_HANDLE_T*) pp;
nwalTxPktInfo_t *pTxPktInfo = m->u.tx_meta;
Cppi_HostDesc* pPloadDesc;
- netapi_Log("netapi_pktioSendL4CkSumPort: non-ipsec packet sent with L4 chksum\n");
- netapi_Log("netapi_pktioSendL4CkSumPort: l4offbytes: %d, l4HdrLen: %d, enetPort %d\n",
- pTxPktInfo->l4OffBytes,
- pTxPktInfo->l4HdrLen,
- pTxPktInfo->enetPort);
nwal_mCmdSetL4CkSumPort(pkt,
&p->tx_psCmdInfo,
pTxPktInfo->l4OffBytes,
diff --git a/ti/runtime/netapi/test/addsa_test.c b/ti/runtime/netapi/test/addsa_test.c
+++ /dev/null
@@ -1,1560 +0,0 @@
-/******************************************
- * File: net_test.c
- * Purpose: test app for netapi
- **************************************************************
- * FILE: net_test.c
- *
- * DESCRIPTION: netapi user space transport
- * library test application
- *
- * REVISION HISTORY: rev 0.0.1
- *
- * Copyright (c) Texas Instruments Incorporated 2010-2011
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- *****************************************/
-#define NWAL_ENABLE_SA
-
-//define this for multi-thread
-//#define MULTI_THREAD
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#include <pthread.h>
-
-#include "trie.h"
-#include "string.h"
-#include "netapi.h"
-#include "pktio.h"
-#include <sys/resource.h>
-#include "net_test.h"
-#include <ti/drv/sa/salld.h>
-
-
-
-
-#define TEST_SA
-//#define TEST_MAC_IP
-#define SA_CREATE_LOOP_COUNT 64
-#define IP_CREATE_LOOP_COUNT 64
-#define MAC_CREATE_LOOP_COUNT 59
-
-
-long htonl(long x)
-{
- long temp = (x&0xff000000)>>24 | (x&0xff0000)>>8 | (x&0xff00)<<8 | (x&0xff)<<24 ;
- return temp;
-}
-
-/* net test default configuration */
-netTestConfig_t config =
-{
- {0x00,0x01,0x02,0x03,0x05,0x05},
- {0x00,0x01,0x02,0x03,0x05,0x06},
- {10, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 2, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {192,168 , 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- {192,168 , 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- IPSEC_MODE_RX_INFLOW,
- IPSEC_MODE_TX_INFLOW,
- 0
-};
-
-#if 0
-netTestConfigMax_t configMax =
-{
- {{0x00,0x00,0x02,0x03,0x05,0x07},
- { 0x00,0x01,0x02,0x03,0x05,0x09}},
- {{0x00,0x02,0x02,0x03,0x05,0x04},
- { 0x00,0x03,0x02,0x03,0x05,0x03}},
- {{0x00,0x04,0x02,0x03,0x05,0x07},
- { 0x00,0x05,0x02,0x03,0x05,0x09}},
- {{0x00,0x06,0x02,0x03,0x05,0x04},
- { 0x00,0x07,0x02,0x03,0x05,0x03}},
- {{0x00,0x08,0x02,0x03,0x05,0x07},
- { 0x00,0x09,0x02,0x03,0x05,0x09}},
- {{0x00,0x0a,0x02,0x03,0x05,0x04},
- { 0x00,0x0b,0x02,0x03,0x05,0x03}},
- {{0x00,0x0c,0x02,0x03,0x05,0x07},
- { 0x00,0x0d,0x02,0x03,0x05,0x09}},
- {{0x00,0x0e,0x02,0x03,0x05,0x04},
- { 0x00,0x0f,0x02,0x03,0x05,0x03}},
-
-
- {{0x00,0x10,0x02,0x03,0x05,0x07},
- { 0x00,0x11,0x02,0x03,0x05,0x09}},
- {{0x00,0x12,0x02,0x03,0x05,0x04},
- { 0x00,0x13,0x02,0x03,0x05,0x03}},
- {{0x00,0x14,0x02,0x03,0x05,0x07},
- { 0x00,0x15,0x02,0x03,0x05,0x09}},
- {{0x00,0x16,0x02,0x03,0x05,0x04},
- { 0x00,0x17,0x02,0x03,0x05,0x03}},
- {{0x00,0x18,0x02,0x03,0x05,0x07},
- { 0x00,0x19,0x02,0x03,0x05,0x09}},
- {{0x00,0x1a,0x02,0x03,0x05,0x04},
- { 0x00,0x1b,0x02,0x03,0x05,0x03}},
- {{0x00,0x1c,0x02,0x03,0x05,0x07},
- { 0x00,0x1d,0x02,0x03,0x05,0x09}},
- {{0x00,0x1e,0x02,0x03,0x05,0x04},
- { 0x00,0x1f,0x02,0x03,0x05,0x03}},
-
- {{0x00,0x10,0x02,0x03,0x05,0x07},
- { 0x00,0x11,0x02,0x03,0x05,0x09}},
- {{0x00,0x12,0x02,0x03,0x05,0x04},
- { 0x00,0x13,0x02,0x03,0x05,0x03}},
- {{0x00,0x14,0x02,0x03,0x05,0x07},
- { 0x00,0x15,0x02,0x03,0x05,0x09}},
- {{0x00,0x16,0x02,0x03,0x05,0x04},
- { 0x00,0x17,0x02,0x03,0x05,0x03}},
- {{0x00,0x18,0x02,0x03,0x05,0x07},
- { 0x00,0x19,0x02,0x03,0x05,0x09}},
- {{0x00,0x1a,0x02,0x03,0x05,0x04},
- { 0x00,0x1b,0x02,0x03,0x05,0x03}},
- {{0x00,0x1c,0x02,0x03,0x05,0x07},
- { 0x00,0x1d,0x02,0x03,0x05,0x09}},
- {{0x00,0x1e,0x02,0x03,0x05,0x04},
- { 0x00,0x1f,0x02,0x03,0x05,0x03}},
-
-
- {{10, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {{10, 0, 2, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 3, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {{10, 0, 4, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 5, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {192,168 , 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- {192,168 , 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- IPSEC_MODE_RX_INFLOW,
- IPSEC_MODE_TX_INFLOW,
- 0
-};
-#endif
-
-
-//#define NP 5000
-//int n_pkt = NP;
-
-Trie *p_trie_sa;
-
-/*******************************************
- *************NETAPI OBJECTS***************
- *****************************************/
-static NETAPI_CFG_T our_netapi_default_cfg=
-{
-TUNE_NETAPI_PERM_MEM_SZ,
-128, //start of packet offset for hw to place data on rx for default flow
-TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM, //max number of descriptors in system
-TUNE_NETAPI_NUM_GLOBAL_DESC, //total we will use
-TUNE_NETAPI_DEFAULT_NUM_BUFFERS, //#descriptors+buffers in default heap
-64, //#descriptors w/o buffers in default heap
-TUNE_NETAPI_DEFAULT_BUFFER_SIZE+128+128, //size of buffers in default heap
-128 , //tail room
-256 //extra room
-};
-
-Pktlib_HeapHandle ourHeap;
-Pktlib_HeapHandle specialSmall;
-Pktlib_HeapHandle specialLarge;
-
-PKTIO_HANDLE_T *our_chan;
-PKTIO_HANDLE_T *netcp_rx_chan;
-PKTIO_HANDLE_T *netcp_rx_chan2;
-PKTIO_HANDLE_T *netcp_tx_chan_esp;
-PKTIO_HANDLE_T *netcp_sb_tx_chan;
-PKTIO_HANDLE_T *netcp_sb_rx_chan;
-PKTIO_CFG_T our_chan_cfg={PKTIO_RX_TX, PKTIO_LOCAL, PKTIO_Q_ANY, 8};
-PKTIO_CFG_T netcp_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_rx_cfg2={PKTIO_RX, (PKTIO_GLOBAL|PKTIO_PKT), PKTIO_Q_ANY, 8};
-PKTIO_CFG_T netcp_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_sb_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_sb_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
-
-void house(NETAPI_SCHED_HANDLE_T *s);
-NETAPI_T netapi_handle;
-NETAPI_SCHED_HANDLE_T * our_sched;
-NETAPI_SCHED_CONFIG_T our_sched_cfg={
- NETAPI_SCHED_DURATION|NETAPI_SCHED_CBV, 0, house, 5000000 //every 5000000 poll loops
-};
-
-
-NETCP_CFG_IP_T ip_rule0[IP_CREATE_LOOP_COUNT];
-NETCP_CFG_IP_T ip_rule1[IP_CREATE_LOOP_COUNT];
-//NETCP_CFG_IP_T ip_rule0;
-//NETCP_CFG_IP_T ip_rule1;
-
-NETCP_CFG_CLASS_T class_0;
-NETCP_CFG_CLASS_T class_1;
-NETCP_CFG_CLASS_T class_2;
-NETCP_CFG_FLOW_HANDLE_T specialFlow;
-
-
-NETCP_CFG_CLASSIFIER_T class_0_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L4,
- {
- .c_l4={0,0, NWAL_APP_PLOAD_PROTO_UDP, {2500}}
- }
-};
-
-NETCP_CFG_CLASSIFIER_T class_1_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L4,
- {
- .c_l4= {0,0, NWAL_APP_PLOAD_PROTO_UDP, {2502}}
- }
-};
-
-NETCP_CFG_ROUTE_T class2_route=
-{
-NULL, NULL //* to be filled in
-};
-NETCP_CFG_CLASSIFIER_T class_2_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L3_L4,
- {
- .c_l3_l4={0, 4 ,0/*fill in below*/ , NULL, NULL, //L2/L3
- NWAL_APP_PLOAD_PROTO_UDP, {2504}} //L4
- }
-};
-
-netapi_pktioControl_T zap_channel_control={PKTIO_CLEAR, NULL};
-
-/* security objects. (for loopback mode) */
-netTestSA_t sa_info[SA_CREATE_LOOP_COUNT];
-
-NETCP_CFG_IPSEC_POLICY_T rx_policy[SA_CREATE_LOOP_COUNT];
-
-
-
-NETAPI_SEC_SA_INFO_T rx_sa [14] = {
-{
- NWAL_SA_DIR_INBOUND,
- 0x11111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x22222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x33333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x44444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x55555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x66666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x77777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x91111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x92222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x93333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x94444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x95555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x96666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x97777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-}
-
-
-
-};
-
-/*tx */
-NETAPI_SEC_SA_INFO_T tx_sa[14]= {
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x11111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //seq no
-},
- {
- NWAL_SA_DIR_OUTBOUND,
- 0x22222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x33333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x44444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x55555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x66666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x77777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x91111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //seq no
-},
- {
- NWAL_SA_DIR_OUTBOUND,
- 0x92222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x93333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x94444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x95555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x96666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x97777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-}
-};
-
-
-static nwalSecKeyParams_t ourTXKeyParams[14] ={
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NULL*/
- 16, /* MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NULL*/
- 16, /* MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-}
-};
-
-/* these keys are for aes-ctr and hmac sha2_256 */
-static nwalSecKeyParams_t ourRXKeyParams[14] ={
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt */
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NWAL_SA_EALG_NULL*/
- 16, /* NWAL_SA_AALG_HMAC_MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt t*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt */
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NWAL_SA_EALG_NULL*/
- 16, /* NWAL_SA_AALG_HMAC_MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt t*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-}
-};
-
-
-static uint8_t ourAuthKey[36] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
- 0x20, 0x21, 0x22, 0x23 };
-;
-
-static uint8_t ourEncrKey[36] =
- {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
- 0x30, 0x31, 0x32, 0x33 };
-
-
-/*************************END NETAPI OBJECTS***********************/
-
-#define START_SRC_IP 0x0a00000a
-#define DST_IP 0xc0a80001
-#define NEW_START_SRC_IP 0x9eda000a
-#define DST_PORT 0x555
-#define START_SRC_PORT 0x1234
-#define NEW_START_SRC_PORT 100
-void update_header(HEAD_T * p_head, int len)
-{
- unsigned char *p = (unsigned char *) &p_head->udp[1];
- len -= (20+14);
- /* update ip checksum */
- /* update udp checksum */
- /* update length */
- *p= (len&0xff00)>>8;
- *(p+1) = len&0xff;
-}
-
-//===========stub transmitter==================
-void send_pkt(Ti_Pkt *pkt, int len)
-{
-//just free pkt. Don't send
-Pktlib_freePacket((Ti_Pkt*)pkt);
- return;
-}
-
-
-/* check header */
-struct LastPktInfo
-{
-int iface;
-int ipcsum;
-int l4csum;
-} ;
-static struct LastPktInfo lpInfo;
-
-
-void recv_cb_bench(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-/****************************************************************************************/
-/******************SB Accelerator Callback PKT RECEIVE HANDLER *************************/
-/****************** Handles Decrypt and Encrypt operation callbacks ******************/
-/******************************************************************************************/
-void recv_sb_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-/******************************************************/
-/******************PKT RECEIVE HANDLER *************************/
-/******************************************************/
-void recv_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-//******************************************************
-//use scheduling housekeeping callback to generate pkts
-//******************************************************
-static int done_burst=0;
-void house(NETAPI_SCHED_HANDLE_T * s)
-{
-}
-
-void build_sa_db(int i)
-{
- long tmp_spi;
- static uint32_t spi = 11111111;
- if ((tx_sa[0].authMode == NWAL_SA_AALG_HMAC_SHA1) && (tx_sa[0].cipherMode == NWAL_SA_EALG_AES_CBC))
- {
- tx_sa[0].spi = rx_sa[0].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CBC_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0; /* pkt len - mac - ip -icv (12) */
- sa_info[i].tx_payload_info.encSize = 0; /* authSize - esp header size (always 8 bytes) */
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0; /* not being referenced in net_test */
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[0].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
-
-
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_SHA2_256) && (tx_sa[i].cipherMode == NWAL_SA_EALG_AES_CTR))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CTR_IV_LEN;
-
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CTR;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_SHA2_256) && (tx_sa[i].cipherMode == NWAL_SA_EALG_3DES_CBC))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_3DES_CBC_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_3DES_CBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_MD5) && (rx_sa[i].cipherMode == NWAL_SA_EALG_NULL))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_NULL_IV_LEN;
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_NULL;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_NULL) && (rx_sa[i].cipherMode == NWAL_SA_EALG_AES_GCM))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- //sa_info[i].tx_payload_info.encIvSize = netTest_AES_GCM_IV_LEN;
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_GCM_IV_LEN;
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_GCM;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_AES_GCM_CCM_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_NULL) && (rx_sa[i].cipherMode == NWAL_SA_EALG_AES_CCM))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- //sa_info[i].tx_payload_info.authIvSize = 0;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CCM_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CCM;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_AES_GCM_CCM_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_AES_XCBC) && (rx_sa[i].cipherMode == NWAL_SA_EALG_NULL))
- {
- tx_sa[i].spi = rx_sa[i].spi =spi++;
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
-
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_NULL_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_NULL;
- sa_info[i].authMode = NWAL_SA_AALG_AES_XCBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM , GMAC*/
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else
- netapi_Log("build_sa_db(): invalid encryption/authentication combination selected\n");
-
- //netapi_Log("sa_build_db(): authOffset %d, innerIpOffset %d, encOffset %d\n", sa_info[i].tx_payload_info.authOffset, sa_info[i].inner_ip_offset, sa_info[i].tx_payload_info.encOffset);
- netapi_Log("build_sa_db spi 0x%x\n", spi);
-
-}
-
-/***************************************
- ********** test driver*****************
- ***************************************/
-int main(int argc, char **argv)
-{
- int err,i, j, count;
- Pktlib_HeapCfg heapCfg;
- rlim_t oss,ss = 1024*1024;
- struct rlimit rl;
- int32_t errCode;
- Pktlib_HeapIfTable* pPktifTable;
-
-
- FILE * fpr = NULL;
-
-
- err= getrlimit(RLIMIT_STACK,&rl);
- if (!err) netapi_Log(" stack limit = %d\n",rl.rlim_cur); else netapi_Log("getrlimit failed\n");
-
-
- memset(&sa_info, 0, sizeof(sa_info));
-
- /* create netapi */
- netapi_handle = netapi_init(NETAPI_SYS_MASTER, &our_netapi_default_cfg);
-
- /* open the main heap */
- ourHeap = Pktlib_findHeapByName("netapi");
- if (!ourHeap)
- {
- netapi_Log("Pktlib_findHeapByName() fail\n");
- exit(1);
- }
-
- /* create two secondary heaps */
- /* Initialize the heap configuration. */
- memset ((void *)&heapCfg, 0, sizeof(Pktlib_HeapCfg));
-
- pPktifTable = netapi_getPktlibIfTable();
- /* Populate the heap configuration */
- heapCfg.name = "netapi-small";
- heapCfg.memRegion = TUNE_NETAPI_QM_GLOBAL_REGION;
- heapCfg.sharedHeap = 1;
- heapCfg.useStarvationQueue = 0;
- heapCfg.dataBufferSize = 512;
- heapCfg.numPkts = 64;
- heapCfg.numZeroBufferPackets= 0;
- heapCfg.heapInterfaceTable.data_malloc = pPktifTable->data_malloc;
- heapCfg.heapInterfaceTable.data_free = pPktifTable->data_free;
- heapCfg.dataBufferPktThreshold = 0;
- heapCfg.zeroBufferPktThreshold = 0;
-
- specialSmall = Pktlib_createHeap(&heapCfg, &errCode);
- heapCfg.name = "netapi-big";
- heapCfg.dataBufferSize = 1600;
- specialLarge = Pktlib_createHeap(&heapCfg, &errCode);
- //register these heaps so poll routine will include their garbage queues.
- netapi_registerHeap(netapi_handle, specialSmall);
- netapi_registerHeap(netapi_handle, specialLarge);
-
- /* create a pktio channel */
- our_chan=netapi_pktioCreate(netapi_handle,"our1stq",(PKTIO_CB) recv_cb_bench, &our_chan_cfg,&err);
- if (!our_chan)
- {
- netapi_Log("pktio create failed err=%d\n",err);
- exit(1);
- }
-
- /* open netcp default tx, rx queues */
- netcp_tx_chan_esp= netapi_pktioOpen(netapi_handle, NETCP_TX, NULL, &netcp_tx_cfg, &err);
- if (!netcp_tx_chan_esp)
- {
- netapi_Log("pktio open TX failed err=%d\n",err);
- exit(1);
- }
- netcp_rx_chan= netapi_pktioOpen(netapi_handle, NETCP_RX, (PKTIO_CB) recv_cb, &netcp_rx_cfg, &err);
-
- if (!netcp_rx_chan)
- {
- netapi_Log("pktio open RX failed err=%d\n",err);
- exit(1);
- }
-
- /* create a pktio channel for specially classified pkts */
- netcp_rx_chan2= netapi_pktioCreate(netapi_handle, "classq", (PKTIO_CB) recv_cb, &netcp_rx_cfg2, &err);
- if (!netcp_rx_chan2) {netapi_Log("pktio create RX2 failed err=%d\n",err); exit(1);}
-
- /* open netcp default tx, rx queues for sideband crypto */
- netcp_sb_tx_chan= netapi_pktioOpen(netapi_handle, NETCP_SB_TX, NULL, &netcp_sb_tx_cfg, &err);
- if (!netcp_sb_tx_chan)
- {
- netapi_Log("pktio open SB TX failed err=%d\n",err);
- exit(1);
- }
- netcp_sb_rx_chan= netapi_pktioOpen(netapi_handle, NETCP_SB_RX, (PKTIO_CB) recv_sb_cb, &netcp_sb_rx_cfg, &err);
- if (!netcp_sb_rx_chan)
- {
- netapi_Log("pktio open SB RX failed err=%d\n",err);
- exit(1);
- }
-
- netapi_Log("net_test> %d bytes left in our CMA area\n", netapi_getBufMemRemainder());
- /* create scheduler instance */
- our_sched =netapi_schedOpen(netapi_handle,&our_sched_cfg, &err);
- if (!our_sched) {netapi_Log("sched create failed\n"); exit(1);}
-
- //#define PROMISCUOUS
-#define ETH0 0
-#define ETH1 1
-
-
-#if 0
- /* add mac intefaces */
- netapi_netcpCfgCreateMacInterface(
- netapi_handle,
- &config.mac0[0],
- ETH0,0,
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- (NETCP_CFG_VLAN_T ) NULL , //future
- 1,
- &err);
- if (err) {netapi_Log("addmac0 failed %d\n",err); exit(1); }
-
- //attach an IP to this interface
- ip_rule0[0]=netapi_netcpCfgAddIp(
- netapi_handle,
- ETH0,
- nwal_IPV4,
- &config.ip0,
- NULL, //all IP
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- &err
- );
- if (err) {netapi_Log("addip0 failed %d\n",err); exit(1); }
-
- //create a 2nd mac instance
- netapi_netcpCfgCreateMacInterface(
- netapi_handle,
- &config.mac1[0],
- ETH1,1,
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- (NETCP_CFG_VLAN_T ) NULL , //future
- 1,
- &err);
- if (err) {netapi_Log("addmac1 failed %d\n",err); exit(1); }
-
- //attach an IP to this interface
- ip_rule1[0]=netapi_netcpCfgAddIp(
- netapi_handle,
- ETH1,
- nwal_IPV4,
- &config.ip1,
- NULL, //all IP
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- &err
- );
- if (err) {netapi_Log("addip1 failed %d\n",err); exit(1); }
-#endif
-
-
-#if todo
- //attach 2 classifiers to iface 0, ip0
- class_0_cfg.u.c_l4.ip = ip_rule0[0];
- class_0 = netapi_netcpCfgAddClass(netapi_handle,
- &class_0_cfg,
- NULL,
- NETCP_CFG_ACTION_TO_SW,
- &err);
- if (err) {netapi_Log("addclass0 failed %d\n",err); exit(1);}
-
- class_1_cfg.u.c_l4.ip = ip_rule0[0];
- class_1 = netapi_netcpCfgAddClass(netapi_handle,
- &class_1_cfg,
- NULL,
- NETCP_CFG_ACTION_TO_SW,
- &err);
- if (err) {netapi_Log("addclass1 failed %d\n",err); exit(1);}
-
-
- //3rd classifier has a different IP and route
- class_2_cfg.u.c_l3_l4.ip_addr = &config.ip2;
-#endif
-
- //create specialFlow for this classifier
- {
- Pktlib_HeapHandle heaps[2];
- //int sizes[2];
- heaps[0]= specialSmall;
- heaps[1]= specialLarge;
-#define SPECIAL_SOP_OFF 128
- // sizes[0]=512-SPECIAL_SOP_OFF;
- //sizes[1]=1600-SPECIAL_SOP_OFF;
- }
-
-//security stuff
- p_trie_sa = trie_new();
- if (!p_trie_sa) {netapi_Log("trie alloc for SA failed\n"); exit(1);}
-
- count = 0;
-
-#ifdef TEST_MAC_IP
- for (i = 0; i < MAC_CREATE_LOOP_COUNT ;i++)
- {
- /* add mac intefaces */
- netapi_netcpCfgCreateMacInterface(
- netapi_handle,
- &config.mac0[0],
- i,0,
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- (NETCP_CFG_VLAN_T ) NULL , //future
- 1,
- &err);
- if (err) {netapi_Log("addmac0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addmac0 passed for index %d, mac before %d\n",i, config.mac0[5]);
- config.mac0[3]++;
- }
- }
-
- for (i = 0; i < IP_CREATE_LOOP_COUNT ;i++)
- {
- //attach an IP to this interface
- ip_rule0[i]=netapi_netcpCfgAddIp(
- netapi_handle,
- 0,
- nwal_IPV4,
- &config.ip0,
- NULL, //all IP
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- &err
- );
- if (err) {netapi_Log("addip0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addip0 passed for index%d ip[3] %d\n",i, config.ip0.ipv4[3]);
- config.ip0.ipv4[3]++;
- }
-
- }
-#endif
-
-
- sleep(1);
-#ifdef TEST_SA
-
- for (i = 0; i < SA_CREATE_LOOP_COUNT;i++)
- {
- ourRXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourRXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(rx_sa[0].src), &config.remote_ipsec_ip,4);
- memcpy(&(rx_sa[0].dst), &config.local_ipsec_ip,4);
-
- build_sa_db(i);
- count++;
- netapi_Log("main: calling netapi_secAddSA for rx, count = %d\n", count);
- sa_info[i].rx_tunnel = netapi_secAddSA(
- netapi_handle,
- config.ipsec_if_no, //iface #0
- &rx_sa[0],
- &ourRXKeyParams[0],
- config.ipsec_mode_rx == IPSEC_MODE_RX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].rx_data_mode_handle),
- &(sa_info[i].rx_inflow_mode_handle),
- &err);
- //if (err) {netapi_Log("addRxSa failed %d\n",err); exit(1);}
- if (err) {netapi_Log("addRxSa failed %d\n",err);}
-
-
- }
-//tx SA
-//security stuff
- for (i = 0; i <SA_CREATE_LOOP_COUNT;i++)
- {
- ourTXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourTXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(tx_sa[0].src), &config.local_ipsec_ip,4);
- memcpy(&(tx_sa[0].dst), &config.remote_ipsec_ip,4);
- count++;
- netapi_Log("main: calling netapi_secAddSA for tx, count = %d\n", count);
- sa_info[i].tx_tunnel = netapi_secAddSA( netapi_handle,
- 0, //iface #0
- &tx_sa[0],
- &ourTXKeyParams[0],
- config.ipsec_mode_tx == IPSEC_MODE_TX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].tx_data_mode_handle),
- &(sa_info[i].tx_inflow_mode_handle),
- &err);
- if (err) {netapi_Log("addTxSa failed %d\n",err); exit(1);}
- }
-
-#endif
-
- /*************************************************
- ************CLEAN UP****************************
- ************************************************/
-
- //delete Classifiers
- netapi_netcpCfgDelClass(netapi_handle, class_0, &err);
- netapi_netcpCfgDelClass(netapi_handle, class_1, &err);
- //netapi_netcpCfgDelClass(netapi_handle, class_2, &err);
-
- count = 0;
- //delete policy
-#ifdef TEST_SA
- for (i = 0; i < SA_CREATE_LOOP_COUNT;i++)
- {
- if (rx_policy[i])
- netapi_secDelRxPolicy(netapi_handle, rx_policy[i], &err);
- count ++;
- //delete tunnels
- netapi_Log("main: calling netapi_secDelSA for rx, count = %d\n", count);
- netapi_secDelSA(netapi_handle, 0, sa_info[i].rx_tunnel, &err);
- //sleep(1);
- //netapi_Log("main: calling netapi_secDelSA for tx, count = %d\n", count);
- netapi_secDelSA(netapi_handle, 0, sa_info[i].tx_tunnel, &err);
- }
-#endif
-
-#ifdef TEST_MAC_IP
- //delete IPs and MAC Interfacess
- for (i = 0; i < IP_CREATE_LOOP_COUNT;i++)
- {
- netapi_Log("calling netapi_netcpCfgDelIp and for index %d\n", i);
- netapi_netcpCfgDelIp(netapi_handle, i, 0, NULL, NULL, ip_rule0[i], &err);
- netapi_netcpCfgDelMac(netapi_handle,i,&err);
- }
- for (i = 0; i < MAC_CREATE_LOOP_COUNT;i++)
- {
- netapi_Log("calling and netapi_netcpCfgDelMac for index %d\n", i);
- netapi_netcpCfgDelMac(netapi_handle,i,&err);
- }
-#endif
- //close pktio channels we opened
- netapi_Log("main: calling netapi_pktioClose for netcp_tx_chan_esp\n");
- netapi_pktioClose(netcp_tx_chan_esp ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_rx_chan\n");
- netapi_pktioClose(netcp_rx_chan ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_sb_tx_chan\n");
- netapi_pktioClose(netcp_sb_tx_chan ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_sb_rx_chan\n");
- netapi_pktioClose(netcp_sb_rx_chan ,&err);
-
- //clear pktio channel we created
- netapi_pktioControl(our_chan, (PKTIO_CB) NULL, (PKTIO_CFG_T *) NULL, &zap_channel_control, &err);
- netapi_pktioControl(netcp_rx_chan2, (PKTIO_CB) NULL, (PKTIO_CFG_T *) NULL, &zap_channel_control, &err);
-
- //delete pktio channels we created
- netapi_pktioDelete(our_chan, &err);
- netapi_pktioDelete(netcp_rx_chan2,&err);
- netapi_shutdown(netapi_handle);
-
- }
-
-
-
-
index f8eac95bf078819e80033544d43cc3b198377ba3..c30c45169bde2b397989f962083d18e5a5d09cd4 100755 (executable)
#
NT_ROUTER_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_router.o $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
#
+ADDSA_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_max_params.o $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
+#
NTB_OBJS= $(ARMV7OBJDIR)/netapi/test/nt_bridge.o $(ARMV7OBJDIR)/netapi/test/stubs.o
# INCLUDE Directories
all: tests
-tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test $(ARMV7BINDIR)/netapi/test/net_test_router
+tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test $(ARMV7BINDIR)/netapi/test/net_test_router $(ARMV7BINDIR)/netapi/test/net_test_max_params
api_clean:
rm -f $(ARMV7LIBDIR)/libnetapi.a
rm -f $(ARMV7BINDIR)/netapi/test/net_test
rm -f $(ARMV7BINDIR)/netapi/test/net_test_router
+ rm -f $(ARMV7BINDIR)/netapi/test/net_test_max_params
$(ARMV7OBJDIR)/netapi/test/%.o:$(NETAPI_INC_DIR)/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
$(ARMV7BINDIR)/netapi/test/net_test: $(NT_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
$(CC) $(LDFLAGS) $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/netapi/test/net_test
+$(ARMV7BINDIR)/netapi/test/net_test_max_params: $(ADDSA_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
+ $(CC) $(LDFLAGS) $(ADDSA_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/netapi/test/net_test_max_params
$(ARMV7BINDIR)/netapi/test/net_test_router: $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
$(CC) $(LDFLAGS) $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS) -o $(ARMV7BINDIR)/netapi/test/net_test_router
diff --git a/ti/runtime/netapi/test/mt_test.c b/ti/runtime/netapi/test/mt_test.c
+++ /dev/null
@@ -1,1847 +0,0 @@
-/******************************************
- * File: net_test.c
- * Purpose: test app for netapi
- **************************************************************
- * FILE: net_test.c
- *
- * DESCRIPTION: netapi user space transport
- * library test application
- *
- * REVISION HISTORY: rev 0.0.1
- *
- * Copyright (c) Texas Instruments Incorporated 2010-2011
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- *****************************************/
-#define NWAL_ENABLE_SA
-
-//define this for multi-thread
-#define MULTI_THREAD
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-#include <pthread.h>
-
-#include "trie.h"
-#include "string.h"
-#include "netapi.h"
-#include "pktio.h"
-#include <sys/resource.h>
-#include "net_test.h"
-#include <ti/drv/sa/salld.h>
-
-
-
-
-#define TEST_SA
-//#define TEST_MAC_IP
-#define SA_CREATE_LOOP_COUNT 64
-#define IP_CREATE_LOOP_COUNT 64
-#define MAC_CREATE_LOOP_COUNT 59
-
-#ifdef MULTI_THREAD
- //__thread int our_core;
-
- cpu_set_t cpu_set;
-#endif
-
-long htonl(long x)
-{
- long temp = (x&0xff000000)>>24 | (x&0xff0000)>>8 | (x&0xff00)<<8 | (x&0xff)<<24 ;
- return temp;
-}
-
-/* net test default configuration */
-netTestConfig_t config =
-{
- {0x00,0x01,0x02,0x03,0x05,0x05},
- {0x00,0x01,0x02,0x03,0x05,0x06},
- {10, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 2, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {192,168 , 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- {192,168 , 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- IPSEC_MODE_RX_INFLOW,
- IPSEC_MODE_TX_INFLOW,
- 0
-};
-
-#if 0
-netTestConfigMax_t configMax =
-{
- {{0x00,0x00,0x02,0x03,0x05,0x07},
- { 0x00,0x01,0x02,0x03,0x05,0x09}},
- {{0x00,0x02,0x02,0x03,0x05,0x04},
- { 0x00,0x03,0x02,0x03,0x05,0x03}},
- {{0x00,0x04,0x02,0x03,0x05,0x07},
- { 0x00,0x05,0x02,0x03,0x05,0x09}},
- {{0x00,0x06,0x02,0x03,0x05,0x04},
- { 0x00,0x07,0x02,0x03,0x05,0x03}},
- {{0x00,0x08,0x02,0x03,0x05,0x07},
- { 0x00,0x09,0x02,0x03,0x05,0x09}},
- {{0x00,0x0a,0x02,0x03,0x05,0x04},
- { 0x00,0x0b,0x02,0x03,0x05,0x03}},
- {{0x00,0x0c,0x02,0x03,0x05,0x07},
- { 0x00,0x0d,0x02,0x03,0x05,0x09}},
- {{0x00,0x0e,0x02,0x03,0x05,0x04},
- { 0x00,0x0f,0x02,0x03,0x05,0x03}},
-
-
- {{0x00,0x10,0x02,0x03,0x05,0x07},
- { 0x00,0x11,0x02,0x03,0x05,0x09}},
- {{0x00,0x12,0x02,0x03,0x05,0x04},
- { 0x00,0x13,0x02,0x03,0x05,0x03}},
- {{0x00,0x14,0x02,0x03,0x05,0x07},
- { 0x00,0x15,0x02,0x03,0x05,0x09}},
- {{0x00,0x16,0x02,0x03,0x05,0x04},
- { 0x00,0x17,0x02,0x03,0x05,0x03}},
- {{0x00,0x18,0x02,0x03,0x05,0x07},
- { 0x00,0x19,0x02,0x03,0x05,0x09}},
- {{0x00,0x1a,0x02,0x03,0x05,0x04},
- { 0x00,0x1b,0x02,0x03,0x05,0x03}},
- {{0x00,0x1c,0x02,0x03,0x05,0x07},
- { 0x00,0x1d,0x02,0x03,0x05,0x09}},
- {{0x00,0x1e,0x02,0x03,0x05,0x04},
- { 0x00,0x1f,0x02,0x03,0x05,0x03}},
-
- {{0x00,0x10,0x02,0x03,0x05,0x07},
- { 0x00,0x11,0x02,0x03,0x05,0x09}},
- {{0x00,0x12,0x02,0x03,0x05,0x04},
- { 0x00,0x13,0x02,0x03,0x05,0x03}},
- {{0x00,0x14,0x02,0x03,0x05,0x07},
- { 0x00,0x15,0x02,0x03,0x05,0x09}},
- {{0x00,0x16,0x02,0x03,0x05,0x04},
- { 0x00,0x17,0x02,0x03,0x05,0x03}},
- {{0x00,0x18,0x02,0x03,0x05,0x07},
- { 0x00,0x19,0x02,0x03,0x05,0x09}},
- {{0x00,0x1a,0x02,0x03,0x05,0x04},
- { 0x00,0x1b,0x02,0x03,0x05,0x03}},
- {{0x00,0x1c,0x02,0x03,0x05,0x07},
- { 0x00,0x1d,0x02,0x03,0x05,0x09}},
- {{0x00,0x1e,0x02,0x03,0x05,0x04},
- { 0x00,0x1f,0x02,0x03,0x05,0x03}},
-
-
- {{10, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {{10, 0, 2, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 3, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {{10, 0, 4, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {10, 0, 5, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
- {192,168 , 1, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- {192,168 , 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- IPSEC_MODE_RX_INFLOW,
- IPSEC_MODE_TX_INFLOW,
- 0
-};
-#endif
-
-
-
-
-Trie *p_trie_sa;
-
-static int scnt=0;
-static int QUIT=0;
-void mysig(int x)
-{
- QUIT=1;
- scnt+=1;
- netapi_Log(">net_test: recv'd signal %d cnt=%d\n",x,scnt);
- if (scnt > 10) {netapi_Log(">net_test: WARNING EXITING WITH PROPER SHUTDOWN, LUTS LEFT ACTIVE\n");exit(1);}
-
-}
-
-/*******************************************
- *************NETAPI OBJECTS***************
- *****************************************/
-static NETAPI_CFG_T our_netapi_default_cfg=
-{
-TUNE_NETAPI_PERM_MEM_SZ,
-128, //start of packet offset for hw to place data on rx for default flow
-TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM, //max number of descriptors in system
-TUNE_NETAPI_NUM_GLOBAL_DESC, //total we will use
-TUNE_NETAPI_DEFAULT_NUM_BUFFERS, //#descriptors+buffers in default heap
-64, //#descriptors w/o buffers in default heap
-TUNE_NETAPI_DEFAULT_BUFFER_SIZE+128+128, //size of buffers in default heap
-128 , //tail room
-256 //extra room
-};
-
-Pktlib_HeapHandle ourHeap;
-Pktlib_HeapHandle specialSmall;
-Pktlib_HeapHandle specialLarge;
-
-PKTIO_HANDLE_T *our_chan;
-PKTIO_HANDLE_T *netcp_rx_chan;
-PKTIO_HANDLE_T *netcp_rx_chan2;
-PKTIO_HANDLE_T *netcp_tx_chan_esp;
-PKTIO_HANDLE_T *netcp_sb_tx_chan;
-PKTIO_HANDLE_T *netcp_sb_rx_chan;
-PKTIO_CFG_T our_chan_cfg={PKTIO_RX_TX, PKTIO_LOCAL, PKTIO_Q_ANY, 8};
-PKTIO_CFG_T netcp_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_rx_cfg2={PKTIO_RX, (PKTIO_GLOBAL|PKTIO_PKT), PKTIO_Q_ANY, 8};
-PKTIO_CFG_T netcp_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_sb_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
-PKTIO_CFG_T netcp_sb_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
-
-void house(NETAPI_SCHED_HANDLE_T *s);
-NETAPI_T netapi_handle;
-#ifdef MULTI_THREAD
-NETAPI_SCHED_HANDLE_T * scheduler[TUNE_NETAPI_NUM_CORES];
-#endif
-NETAPI_SCHED_HANDLE_T * our_sched;
-
-NETAPI_SCHED_CONFIG_T our_sched_cfg={
- NETAPI_SCHED_DURATION|NETAPI_SCHED_CBV, 0, house, 5000000 //every 5000000 poll loops
-};
-
-
-NETCP_CFG_IP_T ip_rule0[IP_CREATE_LOOP_COUNT];
-NETCP_CFG_IP_T ip_rule1[IP_CREATE_LOOP_COUNT];
-//NETCP_CFG_IP_T ip_rule0;
-//NETCP_CFG_IP_T ip_rule1;
-
-NETCP_CFG_CLASS_T class_0;
-NETCP_CFG_CLASS_T class_1;
-NETCP_CFG_CLASS_T class_2;
-NETCP_CFG_FLOW_HANDLE_T specialFlow;
-
-
-NETCP_CFG_CLASSIFIER_T class_0_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L4,
- {
- .c_l4={0,0, NWAL_APP_PLOAD_PROTO_UDP, {2500}}
- }
-};
-
-NETCP_CFG_CLASSIFIER_T class_1_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L4,
- {
- .c_l4= {0,0, NWAL_APP_PLOAD_PROTO_UDP, {2502}}
- }
-};
-
-NETCP_CFG_ROUTE_T class2_route=
-{
-NULL, NULL //* to be filled in
-};
-NETCP_CFG_CLASSIFIER_T class_2_cfg=
-{
- NETCP_CFG_CLASS_TYPE_L3_L4,
- {
- .c_l3_l4={0, 4 ,0/*fill in below*/ , NULL, NULL, //L2/L3
- NWAL_APP_PLOAD_PROTO_UDP, {2504}} //L4
- }
-};
-
-netapi_pktioControl_T zap_channel_control={PKTIO_CLEAR, NULL};
-
-/* security objects. (for loopback mode) */
-netTestSA_t sa_info[SA_CREATE_LOOP_COUNT];
-
-NETCP_CFG_IPSEC_POLICY_T rx_policy[SA_CREATE_LOOP_COUNT];
-
-
-
-NETAPI_SEC_SA_INFO_T rx_sa [14] = {
-{
- NWAL_SA_DIR_INBOUND,
- 0x11111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x22222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x33333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x44444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x55555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x66666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x77777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x91111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x92222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x93333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x94444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x95555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x96666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_INBOUND,
- 0x97777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-}
-
-
-
-};
-
-/*tx */
-NETAPI_SEC_SA_INFO_T tx_sa[14]= {
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x11111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //seq no
-},
- {
- NWAL_SA_DIR_OUTBOUND,
- 0x22222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x33333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x44444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x55555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x66666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x77777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x91111111, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA1,
- NWAL_SA_EALG_AES_CBC,
- 0,0 //seq no
-},
- {
- NWAL_SA_DIR_OUTBOUND,
- 0x92222222, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_AES_CTR,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x93333333, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_SHA2_256,
- NWAL_SA_EALG_3DES_CBC,
- 0,0 //seq no
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x94444444, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (us) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (them) -> set below*/
- 64, /* NA replayWindow */
- NWAL_SA_AALG_HMAC_MD5,
- NWAL_SA_EALG_NULL,
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x95555555, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_GCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x96666666, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_NULL,
- NWAL_SA_EALG_AES_CCM,
- 0,0 //na
-},
-{
- NWAL_SA_DIR_OUTBOUND,
- 0x97777777, //spi
- nwal_IpSecProtoESP, //ESP mode
- nwal_SA_MODE_TUNNEL, //tunnel mode
- nwal_IPV4, //v4
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Src IP (them) -> set below */
- { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* dst IP (us)-> set below*/
- 64,/* replayWindow */
- NWAL_SA_AALG_AES_XCBC,
- NWAL_SA_EALG_NULL,
- 0,0 //na
-}
-};
-
-
-static nwalSecKeyParams_t ourTXKeyParams[14] ={
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NULL*/
- 16, /* MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NULL*/
- 16, /* MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-}
-};
-
-/* these keys are for aes-ctr and hmac sha2_256 */
-static nwalSecKeyParams_t ourRXKeyParams[14] ={
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt */
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NWAL_SA_EALG_NULL*/
- 16, /* NWAL_SA_AALG_HMAC_MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt t*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 32, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt : 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 20, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA1 */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: CTR 16 bytes Encryption Key and 4 bytes Salt */
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 24, /* encKeySize: DES-CBC: 24 bytes:NWAL_SA_EALG_3DES_CBC and 0 bytes Salt*/
- 32, /* macKeySize: 16 bytes NWAL_SA_AALG_HMAC_SHA2_256 */
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* NWAL_SA_EALG_NULL*/
- 16, /* NWAL_SA_AALG_HMAC_MD5, 16 bytes */
- NULL, //set below
- NULL, //set below
-},
-{
- 20, /* encKeySize: GCM 16 bytes Encryption Key and 4 bytes Salt */
- 0, /* macKeySize: 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 19, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt t*/
- 0, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-},
-{
- 0, /* encKeySize: CTR 16 bytes Encryption Key and 3 bytes Salt : 24 bytes:NWAL_SA_EALG_AES_CTR and 0 bytes Salt*/
- 16, /* macKeySize 0*/
- NULL, //set below
- NULL, //set below
-}
-};
-
-
-static uint8_t ourAuthKey[36] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
- 0x20, 0x21, 0x22, 0x23 };
-;
-
-static uint8_t ourEncrKey[36] =
- {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
- 0x30, 0x31, 0x32, 0x33 };
-
-
- hplib_atomic32_T spi = hplib_mAtomic32Init(0x11111111);
-
-/*************************END NETAPI OBJECTS***********************/
-
-#define START_SRC_IP 0x0a00000a
-#define DST_IP 0xc0a80001
-#define NEW_START_SRC_IP 0x9eda000a
-#define DST_PORT 0x555
-#define START_SRC_PORT 0x1234
-#define NEW_START_SRC_PORT 100
-void update_header(HEAD_T * p_head, int len)
-{
- unsigned char *p = (unsigned char *) &p_head->udp[1];
- len -= (20+14);
- /* update ip checksum */
- /* update udp checksum */
- /* update length */
- *p= (len&0xff00)>>8;
- *(p+1) = len&0xff;
-}
-
-//===========stub transmitter==================
-void send_pkt(Ti_Pkt *pkt, int len)
-{
-//just free pkt. Don't send
-Pktlib_freePacket((Ti_Pkt*)pkt);
- return;
-}
-
-
-/* check header */
-struct LastPktInfo
-{
-int iface;
-int ipcsum;
-int l4csum;
-} ;
-static struct LastPktInfo lpInfo;
-
-
-void recv_cb_bench(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-/****************************************************************************************/
-/******************SB Accelerator Callback PKT RECEIVE HANDLER *************************/
-/****************** Handles Decrypt and Encrypt operation callbacks ******************/
-/******************************************************************************************/
-void recv_sb_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-/******************************************************/
-/******************PKT RECEIVE HANDLER *************************/
-/******************************************************/
-void recv_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
- PKTIO_METADATA_T meta[], int n_pkts,
- uint64_t ts )
-{
-}
-
-//******************************************************
-//use scheduling housekeeping callback to generate pkts
-//******************************************************
-static int done_burst=0;
-void house(NETAPI_SCHED_HANDLE_T * s)
-{
- int err;
- if (QUIT) {netapi_schedClose(s,NULL,&err); return;}
-}
-
-void build_sa_db(int i)
-{
- int coreid = Osal_nwalGetProcId();
- long tmp_spi;
- //static uint32_t spi = 11111111;
- if ((tx_sa[0].authMode == NWAL_SA_AALG_HMAC_SHA1) && (tx_sa[0].cipherMode == NWAL_SA_EALG_AES_CBC))
- {
-
- tx_sa[0].spi = rx_sa[0].spi = hplib_mAtomic32AddReturn(&spi,1);
- netapi_Log("coreid: %d, build_sa_db: spi %d\n", coreid, spi);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CBC_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0; /* pkt len - mac - ip -icv (12) */
- sa_info[i].tx_payload_info.encSize = 0; /* authSize - esp header size (always 8 bytes) */
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0; /* not being referenced in net_test */
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[0].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
-
-
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_SHA2_256) && (tx_sa[i].cipherMode == NWAL_SA_EALG_AES_CTR))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CTR_IV_LEN;
-
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CTR;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_SHA2_256) && (tx_sa[i].cipherMode == NWAL_SA_EALG_3DES_CBC))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_3DES_CBC_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_3DES_CBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_HMAC_MD5) && (rx_sa[i].cipherMode == NWAL_SA_EALG_NULL))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_NULL_IV_LEN;
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_NULL;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_NULL) && (rx_sa[i].cipherMode == NWAL_SA_EALG_AES_GCM))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
- //sa_info[i].tx_payload_info.encIvSize = netTest_AES_GCM_IV_LEN;
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_GCM_IV_LEN;
-
-
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_GCM;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_AES_GCM_CCM_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_NULL) && (rx_sa[i].cipherMode == NWAL_SA_EALG_AES_CCM))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- //sa_info[i].tx_payload_info.authIvSize = 0;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN; /*done: same for all cipher suites */
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_AES_CCM_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_AES_CCM;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_AES_GCM_CCM_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM */
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else if ((tx_sa[i].authMode == NWAL_SA_AALG_AES_XCBC) && (rx_sa[i].cipherMode == NWAL_SA_EALG_NULL))
- {
- tx_sa[i].spi = rx_sa[i].spi = hplib_mAtomic32AddReturn(&spi,1);
- /* static configuration, will not change */
- sa_info[i].tx_payload_info.aadSize = 0;
- sa_info[i].tx_payload_info.pAad = NULL;
- sa_info[i].tx_payload_info.pAuthIV = NULL;
- sa_info[i].tx_payload_info.authOffset = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
-
-
- sa_info[i].tx_payload_info.encOffset = netTest_MAC_HEADER_LEN +
- netTest_IP_HEADER_LEN +
- netTest_ESP_HEADER_LEN +
- netTest_NULL_IV_LEN;
-
- /* dynamic configuration, will be calculated on the fly */
- sa_info[i].tx_payload_info.authSize = 0;
- sa_info[i].tx_payload_info.encSize = 0;
- //sa_info[i].tx_payload_info.ploadLen = 0;
- sa_info[i].tx_payload_info.pEncIV = 0;
- sa_info[i].tx_payload_info.pPkt = 0;
-
- sa_info[i].cipherMode = NWAL_SA_EALG_NULL;
- sa_info[i].authMode = NWAL_SA_AALG_AES_XCBC;
- sa_info[i].inner_ip_offset = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].auth_tag_size = netTest_ICV_LEN; /* icv or mac size,. always 12 except for AES_CCM/AES_GCM , GMAC*/
-
- sa_info[i].tx_pkt_info.enetPort = 0;
- sa_info[i].tx_pkt_info.ipOffBytes = sa_info[i].tx_payload_info.encOffset;
- sa_info[i].tx_pkt_info.l4HdrLen = netTest_UDP_HEADER_LEN; /*UDP header len */
- sa_info[i].tx_pkt_info.l4OffBytes = sa_info[i].inner_ip_offset + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.startOffset = 0;
- sa_info[i].tx_pkt_info.lpbackPass = 0;
- sa_info[i].tx_pkt_info.ploadLen = 0; /*sa_info[i].tx_pkt_info.l4OffBytes + 4 */
- sa_info[i].tx_pkt_info.pPkt = NULL;
- sa_info[i].tx_pkt_info.saOffBytes = netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN;
- sa_info[i].tx_pkt_info.saPayloadLen = 0;
- sa_info[i].tx_pkt_info.pseudoHdrChecksum =0;
-
- sa_info[i].tx_pkt_info.txFlag1 = NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID ;
-
- tmp_spi = htonl((long)(tx_sa[i].spi));
- trie_insert(p_trie_sa,(char *)&tmp_spi,4, (void *) &sa_info[i]); //asociate with tx sa SPI
- }
- else
- netapi_Log("build_sa_db(): invalid encryption/authentication combination selected\n");
-
-}
-
-
-
-#ifdef MULTI_THREAD
-NETAPI_T worker_nh[TUNE_NETAPI_NUM_CORES];
-void slow_path_thread(int coreid)
-{
- int err, i, count=0;
-
- PKTIO_HANDLE_T *our_chan;
- PKTIO_HANDLE_T *rx_chan;
- PKTIO_HANDLE_T *tx_chan;
- PKTIO_HANDLE_T *sb_tx_chan;
- PKTIO_HANDLE_T *sb_rx_chan;
-
-
-
- netapi_Log("slow_path_thread, mypid: %d, core_id %d\n", gettid(), coreid);
-
- CPU_ZERO( &cpu_set);
-#ifdef CORTEX_A15
- CPU_SET( coreid, &cpu_set);
- hplib_utilSetupCore(coreid, &cpu_set);
-#else
- CPU_SET( 0, &cpu_set);
- hplib_utilSetupCore(coreid+1, &cpu_set);
-#endif
- worker_nh[coreid]=netapi_init(NETAPI_CORE_MASTER,NULL);
-
-
- NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) worker_nh[coreid];
-
- /* open netcp default tx, rx queues */
- tx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_TX, NULL, &netcp_tx_cfg, &err);
-
-
-#ifdef EXPERIMENTAL
- rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_RX, (PKTIO_CB) recv_cb_router, &netcp_rx_cfg, &err);
-#else
- rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_RX, (PKTIO_CB) recv_cb, &netcp_rx_cfg, &err);
-#endif
-
-#ifndef EXPERIMENTAL
- /* create a pktio channel for specially classified pkts */
- /* open netcp default tx, rx queues for sideband crypto */
- sb_tx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_SB_TX, NULL, &netcp_sb_tx_cfg, &err);
-
- sb_rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_SB_RX, (PKTIO_CB) recv_sb_cb, &netcp_sb_rx_cfg, &err);
-#endif
-
-
-
-
-
- netapi_setCookie(worker_nh[coreid],coreid);
- //our_core = coreid;
-
- scheduler[coreid] =netapi_schedOpen(worker_nh[coreid],&our_sched_cfg, &err);
- if (!scheduler[coreid])
- {
- netapi_Log("sched create failed for core%d\n",coreid);
- exit(1);
- }
- scheduler[coreid]->config.yield = FALSE;
- scheduler[coreid]->config.pollGarbageQ = TRUE;
- scheduler[coreid]->config.pollCtrlQ = TRUE;
- /*********************************************/
- /**************Entry point into scheduler ****/
- /*********************************************/
-
-#ifdef TEST_MAC_IP
- for (i = 0; i < 30 ;i++)
- {
- /* add mac intefaces */
- netapi_netcpCfgCreateMacInterface(
- worker_nh[coreid],
- &config.mac0[0],
- i,0,
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- (NETCP_CFG_VLAN_T ) NULL , //future
- 1,
- &err);
- if (err) {netapi_Log("addmac0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addmac0 passed for index %d, mac before %d\n",i, config.mac0[5]);
- config.mac0[3]++;
- }
- }
-
- for (i = 0; i < 30 ;i++)
- {
- //attach an IP to this interface
- ip_rule0[i]=netapi_netcpCfgAddIp(
- worker_nh[coreid],
- 0,
- nwal_IPV4,
- &config.ip0,
- NULL, //all IP
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- &err
- );
- if (err) {netapi_Log("addip0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addip0 passed for index%d ip[3] %d\n",i, config.ip0.ipv4[3]);
- config.ip0.ipv4[3]++;
- }
-
- }
-sleep(1);
- //delete IPs and MAC Interfacess
- for (i = 0; i < 30;i++)
- {
- netapi_Log("calling netapi_netcpCfgDelIp and for index %d\n", i);
- netapi_netcpCfgDelIp(worker_nh[coreid], i, 0, NULL, NULL, ip_rule0[i], &err);
- netapi_netcpCfgDelMac(worker_nh[coreid],i,&err);
- }
- for (i = 0; i < 30;i++)
- {
- netapi_Log("calling and netapi_netcpCfgDelMac for index %d\n", i);
- netapi_netcpCfgDelMac(worker_nh[coreid],i,&err);
- }
-#endif
-
-#ifdef TEST_SA
- for (i = 0; i < 32;i++)
- {
- ourRXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourRXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(rx_sa[0].src), &config.remote_ipsec_ip,4);
- memcpy(&(rx_sa[0].dst), &config.local_ipsec_ip,4);
-
- build_sa_db(i);
- count++;
- //netapi_Log("thread: %d: calling netapi_secAddSA for rx, count = %d\n",coreid, count);
- sa_info[i].rx_tunnel = netapi_secAddSA(
- worker_nh[coreid],
- config.ipsec_if_no, //iface #0
- &rx_sa[0],
- &ourRXKeyParams[0],
- config.ipsec_mode_rx == IPSEC_MODE_RX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].rx_data_mode_handle),
- &(sa_info[i].rx_inflow_mode_handle),
- &err);
- //if (err) {netapi_Log("addRxSa failed %d\n",err); exit(1);}
- if (err) {netapi_Log("addRxSa failed %d\n",err);}
- sched_yield();
-
-
- }
-//tx SA
-//security stuff
- count = 0;
- for (i = 0; i <32;i++)
- {
- ourTXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourTXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(tx_sa[0].src), &config.local_ipsec_ip,4);
- memcpy(&(tx_sa[0].dst), &config.remote_ipsec_ip,4);
- count++;
- //netapi_Log("thread: %d: calling netapi_secAddSA for tx, count = %d\n",coreid, count);
- sa_info[i].tx_tunnel = netapi_secAddSA( worker_nh[coreid],
- 0, //iface #0
- &tx_sa[0],
- &ourTXKeyParams[0],
- config.ipsec_mode_tx == IPSEC_MODE_TX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].tx_data_mode_handle),
- &(sa_info[i].tx_inflow_mode_handle),
- &err);
- if (err) {netapi_Log("addTxSa failed %d\n",err); exit(1);}
- sched_yield();
- }
-sleep(1);
-count = 0;
-#ifdef TEST_SA
- for (i = 0; i < 32;i++)
- {
- if (rx_policy[i])
- netapi_secDelRxPolicy(worker_nh[coreid], rx_policy[i], &err);
- count ++;
- //delete tunnels
- netapi_Log("main: calling netapi_secDelSA for rx, count = %d\n", count);
- netapi_secDelSA(worker_nh[coreid], 0, sa_info[i].rx_tunnel, &err);
- //sleep(1);
- //netapi_Log("main: calling netapi_secDelSA for tx, count = %d\n", count);
- netapi_secDelSA(worker_nh[coreid], 0, sa_info[i].tx_tunnel, &err);
- }
-#endif
-#endif
-
-
- netapi_schedRun(scheduler[coreid], &err);
-
- netapi_Log(">net_test: core %d worker thread done\n",coreid);
- netapi_pktioClose(tx_chan, &err);
- netapi_pktioClose(rx_chan, &err);
- netapi_pktioClose(sb_tx_chan, &err);
- netapi_pktioClose(sb_tx_chan, &err);
- netapi_shutdown(worker_nh[coreid]);
-}
-
-void fast_path_thread(int coreid)
-{
- int err, i, count=0;
- PKTIO_HANDLE_T *our_chan;
- PKTIO_HANDLE_T *rx_chan;
- PKTIO_HANDLE_T *tx_chan;
- PKTIO_HANDLE_T *sb_tx_chan;
- PKTIO_HANDLE_T *sb_rx_chan;
-
- netapi_Log("fast_path_thread, mypid: %d, core_id %d\n", gettid(), coreid);
-#ifdef CORTEX_A15
- CPU_SET( coreid, &cpu_set);
- hplib_utilSetupCore(coreid, &cpu_set);
-#else
- CPU_SET( 0, &cpu_set);
- hplib_utilSetupCore(coreid + 1, &cpu_set);
-#endif
- worker_nh[coreid]=netapi_init(NETAPI_CORE_MASTER,NULL);
-
-
- NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) worker_nh[coreid];
-
- /* open netcp default tx, rx queues */
- tx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_TX, NULL, &netcp_tx_cfg, &err);
-
-
-#ifdef EXPERIMENTAL
- rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_RX, (PKTIO_CB) recv_cb_router, &netcp_rx_cfg, &err);
-#else
- rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_RX, (PKTIO_CB) recv_cb, &netcp_rx_cfg, &err);
-#endif
-
-#ifndef EXPERIMENTAL
- /* create a pktio channel for specially classified pkts */
- /* open netcp default tx, rx queues for sideband crypto */
- sb_tx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_SB_TX, NULL, &netcp_sb_tx_cfg, &err);
-
- sb_rx_chan = netapi_pktioOpen(worker_nh[coreid], NETCP_SB_RX, (PKTIO_CB) recv_sb_cb, &netcp_sb_rx_cfg, &err);
-#endif
-
- netapi_setCookie(worker_nh[coreid],coreid);
- //our_core = coreid;
- scheduler[coreid] =netapi_schedOpen(worker_nh[coreid],&our_sched_cfg, &err);
- if (!scheduler[coreid])
- {
- netapi_Log("sched create failed for core%d\n",coreid);
- exit(1);
- }
-
- /*********************************************/
- /**************Entry point into scheduler ****/
- /*********************************************/
- scheduler[coreid]->config.yield = FALSE;
- scheduler[coreid]->config.pollGarbageQ = FALSE;
- scheduler[coreid]->config.pollCtrlQ = FALSE;
- //sleep(100000);
-#ifdef TEST_MAC_IP
- for (i = 30; i < MAC_CREATE_LOOP_COUNT ;i++)
- {
- /* add mac intefaces */
- netapi_netcpCfgCreateMacInterface(
- worker_nh[coreid],
- &config.mac0[0],
- i,0,
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- (NETCP_CFG_VLAN_T ) NULL , //future
- 1,
- &err);
- if (err) {netapi_Log("addmac0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addmac0 passed for index %d, mac before %d\n",i, config.mac0[5]);
- config.mac0[3]++;
- }
- }
-
- for (i = 30; i < IP_CREATE_LOOP_COUNT ;i++)
- {
- //attach an IP to this interface
- ip_rule0[i]=netapi_netcpCfgAddIp(
- worker_nh[coreid],
- 30,
- nwal_IPV4,
- &config.ip0,
- NULL, //all IP
- (NETCP_CFG_ROUTE_HANDLE_T) NULL,
- &err
- );
- if (err) {netapi_Log("addip0 failed %d\n",err); exit(1); }
- else
- {
- netapi_Log("addip0 passed for index%d ip[3] %d\n",i, config.ip0.ipv4[3]);
- config.ip0.ipv4[3]++;
- }
-
- }
-sleep(1);
- //delete IPs and MAC Interfacess
- for (i = 30; i < IP_CREATE_LOOP_COUNT;i++)
- {
- netapi_Log("calling netapi_netcpCfgDelIp and for index %d\n", i);
- netapi_netcpCfgDelIp(worker_nh[coreid], i, 0, NULL, NULL, ip_rule0[i], &err);
- netapi_netcpCfgDelMac(worker_nh[coreid],i,&err);
- }
- for (i = 30; i < MAC_CREATE_LOOP_COUNT;i++)
- {
- netapi_Log("calling and netapi_netcpCfgDelMac for index %d\n", i);
- netapi_netcpCfgDelMac(worker_nh[coreid],i,&err);
- }
-#endif
-
-
-#ifdef TEST_SA
- for (i = 32; i < SA_CREATE_LOOP_COUNT-1;i++)
- {
- ourRXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourRXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(rx_sa[0].src), &config.remote_ipsec_ip,4);
- memcpy(&(rx_sa[0].dst), &config.local_ipsec_ip,4);
-
- build_sa_db(i);
- count++;
- //netapi_Log("thread: %d: calling netapi_secAddSA for rx, count = %d\n",coreid, count);
- sa_info[i].rx_tunnel = netapi_secAddSA(
- worker_nh[coreid],
- config.ipsec_if_no, //iface #0
- &rx_sa[0],
- &ourRXKeyParams[0],
- config.ipsec_mode_rx == IPSEC_MODE_RX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].rx_data_mode_handle),
- &(sa_info[i].rx_inflow_mode_handle),
- &err);
- //if (err) {netapi_Log("addRxSa failed %d\n",err); exit(1);}
- if (err) {netapi_Log("addRxSa failed %d\n",err);}
- sched_yield();
-
- }
- count = 0;
-//tx SA
-//security stuff
- for (i = 32; i <SA_CREATE_LOOP_COUNT-1;i++)
- {
- ourTXKeyParams[0].pEncKey = &ourEncrKey[0];
- ourTXKeyParams[0].pAuthKey = &ourAuthKey[0];
- memcpy(&(tx_sa[0].src), &config.local_ipsec_ip,4);
- memcpy(&(tx_sa[0].dst), &config.remote_ipsec_ip,4);
- count++;
- //netapi_Log("thread: %d: calling netapi_secAddSA for tx, count = %d\n",coreid, count);
- sa_info[i].tx_tunnel = netapi_secAddSA( worker_nh[coreid],
- 0, //iface #0
- &tx_sa[0],
- &ourTXKeyParams[0],
- config.ipsec_mode_tx == IPSEC_MODE_TX_SIDEBAND ? NETAPI_SEC_SA_SIDEBAND: NETAPI_SEC_SA_INFLOW,
- NULL, //use default route
- &(sa_info[i].tx_data_mode_handle),
- &(sa_info[i].tx_inflow_mode_handle),
- &err);
- if (err) {netapi_Log("addTxSa failed %d\n",err); exit(1);}
- sched_yield();
- }
-
-sleep(1);
- count = 0;
-
- for (i = 32; i < SA_CREATE_LOOP_COUNT-1;i++)
- {
- if (rx_policy[i])
- netapi_secDelRxPolicy(worker_nh[coreid], rx_policy[i], &err);
- count ++;
- //delete tunnels
- //netapi_Log("main: calling netapi_secDelSA for rx, count = %d\n", count);
- netapi_secDelSA(worker_nh[coreid], 0, sa_info[i].rx_tunnel, &err);
- //sleep(1);
- //netapi_Log("main: calling netapi_secDelSA for tx, count = %d\n", count);
- netapi_secDelSA(worker_nh[coreid], 0, sa_info[i].tx_tunnel, &err);
- }
-#endif
-
- netapi_schedRun(scheduler[coreid], &err);
- netapi_Log(">net_test: core %d worker thread done\n",coreid);
- netapi_pktioClose(tx_chan, &err);
- netapi_pktioClose(rx_chan, &err);
- netapi_pktioClose(sb_tx_chan, &err);
- netapi_pktioClose(sb_tx_chan, &err);
- netapi_shutdown(worker_nh[coreid]);
-}
-
-#endif
-//#endif
-
-/***************************************
- ********** test driver*****************
- ***************************************/
-int main(int argc, char **argv)
-{
- int err,i, j, count;
- Pktlib_HeapCfg heapCfg;
- rlim_t oss,ss = 1024*1024;
- struct rlimit rl;
- int32_t errCode;
- Pktlib_HeapIfTable* pPktifTable;
-
-
- FILE * fpr = NULL;
-
-
- err= getrlimit(RLIMIT_STACK,&rl);
- if (!err) netapi_Log(" stack limit = %d\n",rl.rlim_cur); else netapi_Log("getrlimit failed\n");
-
-
- memset(&sa_info, 0, sizeof(sa_info));
-
- /* create netapi */
- netapi_handle = netapi_init(NETAPI_SYS_MASTER, &our_netapi_default_cfg);
-
- /* open the main heap */
- ourHeap = Pktlib_findHeapByName("netapi");
- if (!ourHeap)
- {
- netapi_Log("Pktlib_findHeapByName() fail\n");
- exit(1);
- }
-
- /* create two secondary heaps */
- /* Initialize the heap configuration. */
- memset ((void *)&heapCfg, 0, sizeof(Pktlib_HeapCfg));
-
- pPktifTable = netapi_getPktlibIfTable();
- /* Populate the heap configuration */
- heapCfg.name = "netapi-small";
- heapCfg.memRegion = TUNE_NETAPI_QM_GLOBAL_REGION;
- heapCfg.sharedHeap = 1;
- heapCfg.useStarvationQueue = 0;
- heapCfg.dataBufferSize = 512;
- heapCfg.numPkts = 64;
- heapCfg.numZeroBufferPackets= 0;
- heapCfg.heapInterfaceTable.data_malloc = pPktifTable->data_malloc;
- heapCfg.heapInterfaceTable.data_free = pPktifTable->data_free;
- heapCfg.dataBufferPktThreshold = 0;
- heapCfg.zeroBufferPktThreshold = 0;
-
- specialSmall = Pktlib_createHeap(&heapCfg, &errCode);
- heapCfg.name = "netapi-big";
- heapCfg.dataBufferSize = 1600;
- specialLarge = Pktlib_createHeap(&heapCfg, &errCode);
- //register these heaps so poll routine will include their garbage queues.
- netapi_registerHeap(netapi_handle, specialSmall);
- netapi_registerHeap(netapi_handle, specialLarge);
-
- /* create a pktio channel */
- our_chan=netapi_pktioCreate(netapi_handle,"our1stq",(PKTIO_CB) recv_cb_bench, &our_chan_cfg,&err);
- if (!our_chan)
- {
- netapi_Log("pktio create failed err=%d\n",err);
- exit(1);
- }
-
- /* open netcp default tx, rx queues */
- netcp_tx_chan_esp= netapi_pktioOpen(netapi_handle, NETCP_TX, NULL, &netcp_tx_cfg, &err);
- if (!netcp_tx_chan_esp)
- {
- netapi_Log("pktio open TX failed err=%d\n",err);
- exit(1);
- }
- netcp_rx_chan= netapi_pktioOpen(netapi_handle, NETCP_RX, (PKTIO_CB) recv_cb, &netcp_rx_cfg, &err);
-
- if (!netcp_rx_chan)
- {
- netapi_Log("pktio open RX failed err=%d\n",err);
- exit(1);
- }
-
- /* create a pktio channel for specially classified pkts */
- netcp_rx_chan2= netapi_pktioCreate(netapi_handle, "classq", (PKTIO_CB) recv_cb, &netcp_rx_cfg2, &err);
- if (!netcp_rx_chan2) {netapi_Log("pktio create RX2 failed err=%d\n",err); exit(1);}
-
- /* open netcp default tx, rx queues for sideband crypto */
- netcp_sb_tx_chan= netapi_pktioOpen(netapi_handle, NETCP_SB_TX, NULL, &netcp_sb_tx_cfg, &err);
- if (!netcp_sb_tx_chan)
- {
- netapi_Log("pktio open SB TX failed err=%d\n",err);
- exit(1);
- }
- netcp_sb_rx_chan= netapi_pktioOpen(netapi_handle, NETCP_SB_RX, (PKTIO_CB) recv_sb_cb, &netcp_sb_rx_cfg, &err);
- if (!netcp_sb_rx_chan)
- {
- netapi_Log("pktio open SB RX failed err=%d\n",err);
- exit(1);
- }
-
- netapi_Log("net_test> %d bytes left in our CMA area\n", netapi_getBufMemRemainder());
- /* create scheduler instance */
- our_sched =netapi_schedOpen(netapi_handle,&our_sched_cfg, &err);
- if (!our_sched) {netapi_Log("sched create failed\n"); exit(1);}
-
- //#define PROMISCUOUS
-#define ETH0 0
-#define ETH1 1
-
-//security stuff
- p_trie_sa = trie_new();
- if (!p_trie_sa) {netapi_Log("trie alloc for SA failed\n"); exit(1);}
-
-
-#ifdef MULTI_THREAD
-{
- CPU_ZERO( &cpu_set );
- pthread_t *thrs;
- int procs =2; //get this from config eventually
- char c;
- thrs = malloc( sizeof( pthread_t ) * procs );
- if (thrs == NULL)
- {
- perror( "malloc" );
- return -1;
- }
- netapi_Log( "Starting %d threads...\n", procs );
-
- if (pthread_create( &thrs[0], NULL, slow_path_thread,
- (void *)0 ))
- {
- perror( "pthread_create" );
- exit(1);
- }
- if (pthread_create( &thrs[1], NULL, fast_path_thread,
- (void *)1 ))
- {
- perror( "pthread_create" );
- exit(1);
- }
-
- //this thread of execution (main) now just waits on user input
- for(;;)
- {
- netapi_Log(">");
- c=getchar();
- if (c=='q')
- {
- QUIT=1;
- break;
- }
- //else if (c=='s') our_stats_cb(netapi_handle, &netcp_stats);
- else if (c=='h') netapi_Log("'q' to quit, 's' for stats, 'h' for help\n");
- }
-
- //wait for completion
- netapi_Log("main task now pending on slow/fast path completion\n");
- for (i = 0; i < procs; i++)
- pthread_join( thrs[i], NULL );
-
- free( thrs );
-}
-#else
- /*********************************************/
- /**************Entry point into scheduler ****/
- /*********************************************/
- netapi_schedRun(our_sched, &err);
-
-#endif
-
-
-
-
-
-
-
-
-
-#if 0
- //create specialFlow for this classifier
- {
- Pktlib_HeapHandle heaps[2];
- //int sizes[2];
- heaps[0]= specialSmall;
- heaps[1]= specialLarge;
-#define SPECIAL_SOP_OFF 128
- // sizes[0]=512-SPECIAL_SOP_OFF;
- //sizes[1]=1600-SPECIAL_SOP_OFF;
- }
-#endif
-
- count = 0;
- //sleep(1);
-
- /*************************************************
- ************CLEAN UP****************************
- ************************************************/
-
- //delete Classifiers
- netapi_netcpCfgDelClass(netapi_handle, class_0, &err);
- netapi_netcpCfgDelClass(netapi_handle, class_1, &err);
- //netapi_netcpCfgDelClass(netapi_handle, class_2, &err);
-
- count = 0;
- //close pktio channels we opened
- netapi_Log("main: calling netapi_pktioClose for netcp_tx_chan_esp\n");
- netapi_pktioClose(netcp_tx_chan_esp ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_rx_chan\n");
- netapi_pktioClose(netcp_rx_chan ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_sb_tx_chan\n");
- netapi_pktioClose(netcp_sb_tx_chan ,&err);
- netapi_Log("main: calling netapi_pktioClose for netcp_sb_rx_chan\n");
- netapi_pktioClose(netcp_sb_rx_chan ,&err);
-
- //clear pktio channel we created
- netapi_pktioControl(our_chan, (PKTIO_CB) NULL, (PKTIO_CFG_T *) NULL, &zap_channel_control, &err);
- netapi_pktioControl(netcp_rx_chan2, (PKTIO_CB) NULL, (PKTIO_CFG_T *) NULL, &zap_channel_control, &err);
-
- //delete pktio channels we created
- netapi_pktioDelete(our_chan, &err);
- netapi_pktioDelete(netcp_rx_chan2,&err);
- netapi_shutdown(netapi_handle);
-
-}
-
-
-
-
index d678f126031fbaf50f49a47ecca380e23771eab6..79f8c608e223ffa1d79f6efce5b237fc79dfc5e7 100755 (executable)
printf("slow_path_thread, mypid: %d, core_id %d\n", gettid(), thread_num);
CPU_ZERO( &cpu_set);
- printf("fast_path_thread: settting up for thread number %d\n", thread_num);
+ printf("slow_path_thread: settting up for thread number %d\n", thread_num);
#ifdef CORTEX_A15
for (i = netTestCfg.sp_proc_start[thread_num]; i <= netTestCfg.sp_proc_end[thread_num];i++)
{
- printf("fast_path_thread: setting cpu %d to cpu_set\n", i);
+ printf("slow_path_thread: setting cpu %d to cpu_set\n", i);
CPU_SET( i, &cpu_set);
}
hplib_utilSetupCore(thread_num, &cpu_set);
#else
for (i = netTestCfg.sp_proc_start[thread_num]; i <= netTestCfg.sp_proc_end[thread_num];i++)
{
- printf("fast_path_thread: setting cpu %d to cpu_set\n", i);
+ printf("slow_path_thread: setting cpu %d to cpu_set\n", i);
CPU_SET( i, &cpu_set);
}
hplib_utilSetupCore(thread_num, &cpu_set);
/* install signal handler for ^c */
signal(SIGINT,mysig);
- fpr = fopen(input_file_name, "r");
- if (fpr == NULL)
+ if (argc == 2)
+ {
+ printf("main: filename1 %s\n", argv[1]);
+ fpr = fopen(argv[1], "r");
+ }
+ else
+ {
+ fpr = fopen(input_file_name, "r");
+ }
+ if (fpr == NULL)
{
- printf("Error in opening %s input file\n", input_file_name);
exit(1);
}
else
diff --git a/ti/runtime/netapi/test/net_test_config_max_iface.txt b/ti/runtime/netapi/test/net_test_config_max_iface.txt
--- /dev/null
@@ -0,0 +1,143 @@
+#sp0 thread-number start-core end-core
+sp0 = 1 0-0
+fp0 = 2 0-0
+fp1 = 3 0-0
+#mac0 = mac-address switch-port
+mac0 = 00-01-02-03-05-01 sp0
+mac1 = 00-01-02-03-05-02 sp1
+mac2 = 00-01-02-03-05-03 sp0
+mac3 = 00-01-02-03-05-04 sp1
+mac4 = 00-01-02-03-05-05 sp0
+mac5 = 00-01-02-03-05-06 sp1
+mac6 = 00-01-02-03-05-07 sp0
+mac7 = 00-01-02-03-05-08 sp0
+mac8 = 00-01-02-03-05-09 sp0
+mac9 = 00-01-02-03-05-0a sp0
+mac10 = 00-01-02-03-05-15 sp0
+mac11 = 00-01-02-03-05-25 sp0
+mac12 = 00-01-02-03-05-35 sp0
+mac13 = 00-01-02-03-05-45 sp0
+mac14 = 00-01-02-03-05-55 sp0
+mac15 = 00-01-02-03-05-65 sp0
+mac16 = 00-01-02-03-05-75 sp0
+mac17 = 00-01-02-03-05-85 sp0
+mac18 = 00-01-02-03-05-95 sp0
+mac19 = 00-01-02-03-01-05 sp0
+mac20 = 00-01-02-03-02-05 sp0
+mac21 = 00-01-02-03-03-06 sp1
+mac22 = 00-01-02-03-04-05 sp0
+mac23 = 00-01-02-33-05-06 sp1
+mac24 = 00-01-02-03-06-05 sp0
+mac25 = 00-01-02-03-07-06 sp1
+mac26 = 00-01-02-03-08-06 sp1
+mac27 = 00-01-02-03-09-05 sp0
+mac28 = 00-01-02-01-05-06 sp1
+mac29 = 00-01-02-02-05-05 sp0
+mac30 = 00-01-02-63-05-06 sp1
+mac31 = 00-01-02-04-05-06 sp1
+mac32 = 00-01-02-05-05-05 sp0
+mac33 = 00-01-02-06-05-06 sp1
+mac34 = 00-01-02-07-05-05 sp0
+mac35 = 00-01-02-08-05-06 sp1
+mac36 = 00-01-02-09-05-06 sp1
+mac37 = 00-01-01-03-05-05 sp0
+mac38 = 00-01-22-03-05-06 sp1
+mac39 = 00-01-03-03-05-05 sp0
+mac40 = 00-01-04-03-05-06 sp1
+mac41 = 00-01-05-03-05-06 sp1
+mac42 = 00-01-05-03-05-05 sp0
+mac43 = 00-01-06-03-05-06 sp1
+mac44 = 00-01-07-03-05-05 sp0
+mac45 = 00-01-08-03-05-06 sp1
+mac46 = 00-01-09-03-05-06 sp1
+mac47 = 00-01-12-03-05-05 sp0
+mac48 = 00-01-22-33-05-06 sp1
+mac49 = 00-01-32-03-05-05 sp0
+mac50 = 00-01-42-03-05-06 sp1
+mac51 = 00-01-52-03-05-06 sp1
+mac52 = 00-01-62-03-05-05 sp0
+mac53 = 00-01-72-03-05-06 sp1
+mac54 = 00-01-82-03-05-05 sp0
+mac55 = 00-01-92-03-05-06 sp1
+mac56 = 00-01-02-83-05-06 sp1
+mac57 = 00-02-02-03-05-05 sp0
+mac58 = 00-43-02-03-05-06 sp1
+
+#ip0 = ip-address mac-interface
+ip0 = 10.0.0.100 mac0
+ip1 = 10.0.1.100 mac1
+ip2 = 10.0.2.100 mac2
+ip3 = 10.0.0.100 mac3
+ip4 = 10.0.1.100 mac4
+ip5 = 10.0.2.100 mac5
+ip6 = 10.0.0.100 mac6
+ip7 = 10.0.1.100 mac7
+ip8 = 10.0.2.100 mac8
+ip9 = 10.0.0.100 mac9
+ip10 = 10.0.1.100 mac10
+ip11 = 10.0.1.100 mac11
+ip12 = 10.0.1.100 mac12
+ip13 = 10.0.1.100 mac13
+ip14 = 10.0.1.100 mac14
+ip15 = 10.0.1.100 mac15
+ip16 = 10.0.1.100 mac16
+ip17 = 10.0.1.100 mac17
+ip18 = 10.0.1.100 mac18
+ip19 = 10.0.1.100 mac19
+ip20 = 10.0.1.100 mac20
+ip21 = 10.0.1.100 mac21
+ip22 = 10.0.1.100 mac22
+ip23 = 10.0.1.100 mac23
+ip24 = 10.0.1.100 mac24
+ip25 = 10.0.1.100 mac25
+ip26 = 10.0.1.100 mac26
+ip27 = 10.0.1.100 mac27
+ip28 = 10.0.1.100 mac28
+ip29 = 10.0.1.100 mac29
+ip30 = 10.0.1.100 mac30
+ip31 = 10.0.1.100 mac31
+ip32 = 10.0.1.100 mac32
+ip33 = 10.0.1.100 mac33
+ip34 = 10.0.1.100 mac34
+ip35 = 10.0.1.100 mac35
+ip36 = 10.0.1.100 mac36
+ip37 = 10.0.1.100 mac37
+ip38 = 10.0.1.100 mac38
+ip39 = 10.0.1.100 mac39
+ip40 = 10.0.1.100 mac40
+ip41 = 10.0.1.100 mac41
+ip42 = 10.0.1.100 mac42
+ip43 = 10.0.1.100 mac43
+ip44 = 10.0.1.100 mac44
+ip45 = 10.0.1.100 mac45
+ip46 = 10.0.1.100 mac46
+ip47 = 10.0.1.100 mac47
+ip48 = 10.0.1.100 mac48
+ip49 = 10.0.1.100 mac49
+ip50 = 10.0.1.100 mac50
+ip51 = 10.0.1.100 mac51
+ip52 = 10.0.1.100 mac52
+ip53 = 10.0.1.100 mac53
+ip54 = 10.0.1.100 mac54
+ip55 = 10.0.1.100 mac55
+ip56 = 10.0.1.100 mac56
+ip57 = 10.0.1.100 mac57
+ip58 = 10.0.1.100 mac58
+
+local_ipsec_ip = 192.168.1.100
+remote_ipsec_ip = 192.168.1.10
+ipsec_if = 0
+#ipsec_mode_rx = SIDEBAND
+#ipsec_mode_tx = SIDEBAND
+ipsec_mode_rx = INFLOW
+ipsec_mode_tx = INFLOW
+route0 = MAC00-23-24-08-67-46 0
+route1 = MAC00-22-33-44-55-56 1
+
+dstip0 = 10.1.0.100 route1
+dspip1 = 10.0.0.10 route0
+
+
+#sa0 = dir spi prot saMode iptype srcip destip window auth cipher esnlo esphi encrkeysize authkeysize encrkey pauthkey tunnel_id
+
+
diff --git a/ti/runtime/netapi/test/net_test_config_max_sa.txt b/ti/runtime/netapi/test/net_test_config_max_sa.txt
--- /dev/null
@@ -0,0 +1,155 @@
+#sp0 thread-number start-core end-core
+#mac0 = mac-address switch-port
+#mac0 = 00-01-02-03-05-05 sp0
+#mac1 = 00-01-02-03-05-06 sp1
+#ip0 = ip-address mac-interface
+#ip0 = 10.0.0.100 mac0
+#ip1 = 10.0.1.100 mac0
+#ip2 = 10.0.2.100 mac0
+local_ipsec_ip = 192.168.1.100
+remote_ipsec_ip = 192.168.1.10
+ipsec_if = 0
+#ipsec_mode_rx = SIDEBAND
+#ipsec_mode_tx = SIDEBAND
+ipsec_mode_rx = INFLOW
+ipsec_mode_tx = INFLOW
+route0 = MAC00-23-24-08-67-46 0
+route1 = MAC00-22-33-44-55-56 1
+
+dstip0 = 10.1.0.100 route1
+dspip1 = 10.0.0.10 route0
+
+
+#sa0 = dir spi prot saMode iptype srcip destip window auth cipher esnlo esphi encrkeysize authkeysize encrkey pauthkey tunnel_id
+
+sa0 = INBOUND 0x1 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa1 = OUTBOUND 0x2 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa2 = INBOUND 0x3 AH TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa3 = OUTBOUND 0x4 AH TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa4 = INBOUND 0x5 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa5 = OUTBOUND 0x6 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa6 = INBOUND 0x7 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa7 = OUTBOUND 0x8 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa8 = INBOUND 0x9 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_CCM 0 0 19 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x5
+
+sa9 = OUTBOUND 0x10 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 NULL AES_CCM 0 0 19 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x5
+
+sa10 = INBOUND 0x11 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 3DES_CBC 0 0 24 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x6
+
+sa11 = OUTBOUND 0x12 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 3DES_CBC 0 0 24 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x6
+
+sa12 = INBOUND 0x13 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 AES_XCBC NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x7
+
+sa13 = OUTBOUND 0x14 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 AES_XCBC NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x7
+
+sa14 = INBOUND 0x15 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 GMAC NULL 0 0 0 20 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x8
+
+sa15 = OUTBOUND 0x16 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 GMAC NULL 0 0 0 20 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x8
+
+sa16 = INBOUND 0x17 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa17 = OUTBOUND 0x18 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa18 = INBOUND 0x19 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa19 = OUTBOUND 0x20 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa20 = INBOUND 0x21 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa21 = OUTBOUND 0x22 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa22 = INBOUND 0x23 AH TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa23 = OUTBOUND 0x24 AH TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa24 = INBOUND 0x25 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa25 = OUTBOUND 0x26 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa26 = INBOUND 0x27 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa27 = OUTBOUND 0x28 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa28 = INBOUND 0x29 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa29 = OUTBOUND 0x30 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa30 = INBOUND 0x31 AH TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa31 = OUTBOUND 0x32 AH TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa32 = INBOUND 0x33 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa33 = OUTBOUND 0x34 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa34 = INBOUND 0x35 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa35 = OUTBOUND 0x36 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa36 = INBOUND 0x37 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_CCM 0 0 19 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x5
+
+sa37 = OUTBOUND 0x38 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 NULL AES_CCM 0 0 19 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x5
+
+sa38 = INBOUND 0x39 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 3DES_CBC 0 0 24 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x6
+
+sa39 = OUTBOUND 0x40 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 3DES_CBC 0 0 24 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x6
+
+sa40 = INBOUND 0x41 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 AES_XCBC NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x7
+
+sa41 = OUTBOUND 0x42 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 AES_XCBC NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x7
+
+sa42 = INBOUND 0x43 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 GMAC NULL 0 0 0 20 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x8
+
+sa43 = OUTBOUND 0x44 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 GMAC NULL 0 0 0 20 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x8
+
+sa44 = INBOUND 0x45 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa45 = OUTBOUND 0x46 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa46 = INBOUND 0x47 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa47 = OUTBOUND 0x48 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa48 = INBOUND 0x49 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa49 = OUTBOUND 0x50 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa50 = INBOUND 0x51 AH TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa51 = OUTBOUND 0x52 AH TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa52 = INBOUND 0x53 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa53 = OUTBOUND 0x54 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa54 = INBOUND 0x55 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa55 = INBOUND 0x56 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa56 = OUTBOUND 0x57 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA1 AES_CBC 0 0 32 20 55,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x2
+
+sa57 = INBOUND 0x58 AH TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa58 = OUTBOUND 0x59 AH TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_MD5 NULL 0 0 0 16 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x1
+
+sa59 = INBOUND 0x60 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa60 = OUTBOUND 0x61 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa61 = INBOUND 0x62 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa62 = OUTBOUND 0x63 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+sa63 = INBOUND 0x64 ESP TUNNEL IPV4 192.168.1.10 192.168.1.100 64 NULL AES_GCM 0 0 20 0 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x4
+
+sa64 = OUTBOUND 0x65 ESP TUNNEL IPV4 192.168.1.100 192.168.1.10 64 HMAC_SHA2_256 AES_CTR 0 0 20 32 00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF,30,31,32,33 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 0x3
+
+
diff --git a/ti/runtime/netapi/test/net_test_max_params.c b/ti/runtime/netapi/test/net_test_max_params.c
--- /dev/null
@@ -0,0 +1,459 @@
+/******************************************
+ * File: net_test.c
+ * Purpose: Application for testing out max configuration parameters
+ * such as SA's, MACs/IP interfaces
+ **************************************************************
+ * FILE: net_test.c
+ *
+ * DESCRIPTION: netapi user space transport
+ * library test application
+ *
+ * REVISION HISTORY:
+ *
+ * Copyright (c) Texas Instruments Incorporated 2013
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ *****************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+#include <pthread.h>
+
+#include "net_test.h"
+#include "trie.h"
+#include "string.h"
+
+#include <sys/resource.h>
+
+#include <ti/drv/sa/salld.h>
+#include <ti/drv/pa/pa.h>
+
+#include "net_test_utils.h"
+#include "router.h"
+
+extern int QUIT;
+extern STATS_T stats[TUNE_NETAPI_NUM_CORES];
+extern paSysStats_t netcp_stats;
+/* Global definitions */
+#ifdef MULTI_THREAD
+ cpu_set_t cpu_set;
+#endif
+
+
+#define TEST_SA
+//#define TEST_MAC_IP
+#define SA_CREATE_LOOP_COUNT 64
+#define IP_CREATE_LOOP_COUNT 64
+#define MAC_CREATE_LOOP_COUNT 59
+
+
+netTestConfig_t netTestCfg;
+static netTestConfigFile_t config_file;
+
+char input_file_name[] = "net_test_config.txt";
+
+nwal_RetValue nwalRetVal;
+Pktlib_HeapHandle ourHeap;
+
+PKTIO_HANDLE_T *netcp_rx_chan;
+PKTIO_HANDLE_T *netcp_tx_chan_no_crypto;
+PKTIO_HANDLE_T *netcp_tx_chan_esp;
+PKTIO_HANDLE_T *netcp_tx_chan_ah;
+PKTIO_HANDLE_T *netcp_sb_tx_chan;
+PKTIO_HANDLE_T *netcp_sb_rx_chan;
+
+PKTIO_CFG_T our_chan_cfg={PKTIO_RX_TX, PKTIO_LOCAL, PKTIO_Q_ANY, 8};
+PKTIO_CFG_T netcp_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
+PKTIO_CFG_T netcp_rx_cfg2={PKTIO_RX, (PKTIO_GLOBAL|PKTIO_PKT), PKTIO_Q_ANY, 8};
+PKTIO_CFG_T netcp_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
+PKTIO_CFG_T netcp_sb_rx_cfg={PKTIO_RX, PKTIO_NA, PKTIO_NA, 8};
+PKTIO_CFG_T netcp_sb_tx_cfg={PKTIO_TX, PKTIO_NA, PKTIO_NA, 8};
+
+
+NETCP_CFG_EXCEPTION_PKT_T expPkt_appid;
+
+Trie *p_trie_sa_rx;
+Trie *p_trie_sa_tx;
+
+
+/*******************************************
+ *************NETAPI OBJECTS***************
+ *****************************************/
+static NETAPI_CFG_T our_netapi_default_cfg=
+{
+TUNE_NETAPI_PERM_MEM_SZ,
+128, //start of packet offset for hw to place data on rx for default flow
+TUNE_NETAPI_QM_CONFIG_MAX_DESC_NUM, //max number of descriptors in system
+TUNE_NETAPI_NUM_GLOBAL_DESC, //total we will use
+TUNE_NETAPI_DEFAULT_NUM_BUFFERS, //#descriptors+buffers in default heap
+64, //#descriptors w/o buffers in default heap
+TUNE_NETAPI_DEFAULT_BUFFER_SIZE+128+128, //size of buffers in default heap
+128 , //tail room
+256 //extra room
+};
+
+NETAPI_T netapi_handle;
+NETAPI_SCHED_HANDLE_T * our_sched;
+#ifdef MULTI_THREAD
+NETAPI_SCHED_HANDLE_T * scheduler[TUNE_NETAPI_NUM_CORES];
+#endif
+NETAPI_SCHED_CONFIG_T our_sched_cfg={
+ NETAPI_SCHED_DURATION|NETAPI_SCHED_CBV, 0, house, 5000000 //every 5000000 poll loops
+};
+
+NETCP_CFG_IP_T ip_rule[NET_TEST_MAX_IP];
+NETCP_CFG_MACIF_T mac[NET_TEST_MAX_MAC];
+
+
+
+/* security objects. (for loopback mode) */
+netTestSA_t sa_info[MAX_SEC_INDEX];
+
+NETCP_CFG_IPSEC_POLICY_T rx_policy[MAX_SEC_INDEX];
+
+/* stub functions */
+void recv_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
+ PKTIO_METADATA_T meta[], int n_pkts,
+ uint64_t ts )
+{
+ return;
+}
+
+void flip_and_send_pkt(Ti_Pkt *tip, unsigned char * p_pkt, int len, int flag, uint16_t enet_port)
+{
+ return;
+}
+
+
+
+void recv_sb_cb(struct PKTIO_HANDLE_Tag * channel, Ti_Pkt* p_recv[],
+ PKTIO_METADATA_T meta[], int n_pkts,
+ uint64_t ts )
+{
+ return;
+}
+
+Trie * route_init(void)
+{
+}
+void route_add(Trie * Pt, unsigned long * Pdest_ipBE, void * Pour_route)
+{
+}
+
+#ifdef MULTI_THREAD
+NETAPI_T worker_nh[TUNE_NETAPI_NUM_CORES];
+
+void slow_path_thread(uint32_t thread_num)
+{
+ return;
+}
+
+void fast_path_thread(uint32_t thread_num)
+{
+ return;
+}
+
+#endif
+
+/* Templates to build command labels at startup up time, required by open_pktio_tx_channels() */
+nwalTxPktInfo_t txPktInfoESP =
+{
+ NULL, /* p_pkt */
+ NWAL_TX_FLAG1_DO_IPSEC_ESP_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID, /* txFlags */
+ 0, /* lpbackPass */
+ 0, /* enetport */
+ 0, /* msuSize */
+ 0, /* startOffset */
+ netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN, /* saOffBytes */
+ 0, /* saPayLoadLen */
+ 0 , /* saAhIcvOffBytes */
+ 0, /* saAhMacSize */
+ 0, /* etherLenOffBytes */
+ 0, /* ipOffBytes */
+ 0, /* l4OffBytes */
+ netTest_UDP_HEADER_LEN, /* l4HdrLen */
+ 0, /* pseudoHdrChecksum */
+ 0 /* pLoadLen */
+};
+
+
+nwalTxPktInfo_t txPktInfoAH =
+{
+ NULL, /* p_pkt */
+ NWAL_TX_FLAG1_DO_IPSEC_AH_CRYPTO| NWAL_TX_FLAG1_DO_UDP_CHKSUM | NWAL_TX_FLAG1_META_DATA_VALID, /* txFlags */
+ 0, /* lpbackPass */
+ 0, /* enetport */
+ 0, /* msuSize */
+ 0, /* startOffset */
+ netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN, /* saOffBytes */
+ 0, /* saPayLoadLen */
+ netTest_MAC_HEADER_LEN + netTest_IP_HEADER_LEN + netTest_IPSEC_AH_FIXED_HDR_SIZE, /* saAhIcvOffBytes */
+ 12, /* saAhMacSize */
+ 0, /* etherLenOffBytes */
+ 0, /* ipOffBytes */
+ 0, /* l4OffBytes */
+ netTest_UDP_HEADER_LEN, /* l4HdrLen */
+ 0, /* pseudoHdrChecksum */
+ 0 /* pLoadLen */
+};
+
+nwalTxPktInfo_t txPktInfoNoCrypto =
+{
+ NULL, /* p_pkt */
+ NWAL_TX_FLAG1_DO_UDP_CHKSUM| NWAL_TX_FLAG1_META_DATA_VALID, /* txFlags */
+ 0, /* lpbackPass */
+ 0, /* enetport */
+ 0, /* msuSize */
+ 0, /* startOffset */
+ 0, /* saOffBytes */
+ 0, /* saPayLoadLen */
+ 0 , /* saAhIcvOffBytes */
+ 0, /* saAhMacSize */
+ 0, /* etherLenOffBytes */
+ 0, /* ipOffBytes */
+ netTest_MAC_HEADER_LEN +netTest_IP_HEADER_LEN, /* l4OffBytes */
+ netTest_UDP_HEADER_LEN, /* l4HdrLen */
+ 0, /* pseudoHdrChecksum */
+ 0 /* pLoadLen */
+};
+
+
+void close_pktio_channels(void)
+{
+ int err;
+ netapi_pktioClose(netcp_tx_chan_esp ,&err);
+ netapi_pktioClose(netcp_tx_chan_ah ,&err);
+ netapi_pktioClose(netcp_sb_tx_chan ,&err);
+ netapi_pktioClose(netcp_tx_chan_no_crypto,&err);
+}
+
+void open_pktio_tx_channels(void)
+{
+ int err;
+ /* open netcp default TX for ESP packets */
+ netcp_tx_chan_esp= netapi_pktioOpen(netapi_handle, NETCP_TX, NULL, &netcp_tx_cfg, &err);
+ if (!netcp_tx_chan_esp)
+ {
+ printf("pktio open TX failed err=%d\n",err);
+ exit(1);
+ }
+ else
+ {
+ if(netTestCfg.ipsec_mode_tx == IPSEC_MODE_TX_INFLOW)
+ {
+ PKTIO_CONTROL_T control;
+ control.op = PKTIO_UPDATE_FAST_PATH;
+ PKTIO_CFG_T cfg;
+ cfg.fast_path_cfg.fp_send_option = PKTIO_FP_ESP_L4CKSUM_PORT;
+ cfg.fast_path_cfg.txPktInfo= &txPktInfoESP;
+ netapi_pktioControl(netcp_tx_chan_esp, NULL, &cfg, &control, &err);
+ }
+ }
+
+ /*/* open netcp default TX for AH packets */
+ netcp_tx_chan_ah= netapi_pktioOpen(netapi_handle, NETCP_TX, NULL, &netcp_tx_cfg, &err);
+ if (!netcp_tx_chan_ah)
+ {
+ printf("pktio open TX failed err=%d\n",err);
+ exit(1);
+ }
+ else
+ {
+ if(netTestCfg.ipsec_mode_tx == IPSEC_MODE_TX_INFLOW)
+ {
+ PKTIO_CONTROL_T control;
+ control.op = PKTIO_UPDATE_FAST_PATH;
+ PKTIO_CFG_T cfg;
+ cfg.fast_path_cfg.fp_send_option = PKTIO_FP_AH_L4CKSUM_PORT;
+ cfg.fast_path_cfg.txPktInfo= &txPktInfoAH;
+ netapi_pktioControl(netcp_tx_chan_ah, NULL, &cfg, &control, &err);
+ }
+ }
+
+ /* open netcp default TX channels for non-Crypto packets */
+ netcp_tx_chan_no_crypto= netapi_pktioOpen(netapi_handle, NETCP_TX, NULL, &netcp_tx_cfg, &err);
+ if (!netcp_tx_chan_no_crypto)
+ {
+ printf("pktio open TX failed err=%d\n",err);
+ exit(1);
+ }
+ else
+ {
+ if(netTestCfg.ipsec_mode_tx == IPSEC_MODE_TX_INFLOW)
+ {
+ PKTIO_CONTROL_T control;
+ control.op = PKTIO_UPDATE_FAST_PATH;
+ PKTIO_CFG_T cfg;
+ cfg.fast_path_cfg.fp_send_option = PKTIO_FP_L4CKSUM_PORT;
+ cfg.fast_path_cfg.txPktInfo= &txPktInfoNoCrypto;
+ netapi_pktioControl(netcp_tx_chan_no_crypto, NULL, &cfg, &control, &err);
+ }
+ }
+
+ /* open netcp default TX channels for SB crypto */
+ netcp_sb_tx_chan= netapi_pktioOpen(netapi_handle, NETCP_SB_TX, NULL, &netcp_sb_tx_cfg, &err);
+ if (!netcp_sb_tx_chan)
+ {
+ printf("pktio open SB TX failed err=%d\n",err);
+ exit(1);
+ }
+}
+/***************************************
+ ********** test driver*****************
+ ***************************************/
+int main(int argc, char **argv)
+{
+ int err,i;
+ Pktlib_HeapCfg heapCfg;
+ rlim_t oss,ss = 1024*1024;
+ struct rlimit rl;
+ int32_t errCode;
+ Pktlib_HeapIfTable* pPktifTable;
+ /* Local Per Process default resourcese maintained at NWAL */
+ nwalLocCxtInfo_t nwalLocCxt;
+ //nwalSaIpSecId_t nwalSaIpSecId;
+ FILE * fpr = NULL;
+
+ err= getrlimit(RLIMIT_STACK,&rl);
+ if (!err) printf(" stack limit = %d\n",rl.rlim_cur); else printf("getrlimit failed\n");
+
+
+ /* install signal handler for ^c */
+ signal(SIGINT,mysig);
+
+ if (argc == 2)
+ {
+ printf("main: filename1 %s\n", argv[1]);
+ fpr = fopen(argv[1], "r");
+ }
+ else
+ {
+ fpr = fopen(input_file_name, "r");
+ }
+ if (fpr == NULL)
+ {
+ exit(1);
+ }
+ else
+ {
+ memset(&config_file, 0, sizeof(netTestConfigFile_t));
+ memset(&netTestCfg, 0, sizeof(netTestConfig_t));
+ parse_config_file(fpr,&config_file);
+ }
+
+ memset(&sa_info, 0, sizeof(sa_info));
+
+
+#ifdef MULTI_THREAD
+ /* assign main net_test thread to run on core 0 */
+ CPU_ZERO( &cpu_set);
+ CPU_SET( 0, &cpu_set);
+ hplib_utilSetupCore(0, &cpu_set);
+#endif
+
+ /* create netapi */
+ netapi_handle = netapi_init(NETAPI_SYS_MASTER, &our_netapi_default_cfg);
+
+ /* open the main heap */
+ ourHeap = Pktlib_findHeapByName("netapi");
+ if (!ourHeap)
+ {
+ printf("Pktlib_findHeapByName() fail\n");
+ exit(1);
+ }
+
+ open_pktio_tx_channels();
+
+ /* create scheduler instance */
+ our_sched =netapi_schedOpen(netapi_handle,&our_sched_cfg, &err);
+ if (!our_sched) {printf("sched create failed\n"); exit(1);}
+
+
+ /*create net_test MAC interfaces, attach IP to created MAC interfaces */
+//#ifdef TEST_MAC_IP
+ create_interfaces();
+//#endif
+ /* lookup Database for SA context, this is used by packet processing routines to get RX and TX SA information*/
+ p_trie_sa_rx = trie_new();
+ p_trie_sa_tx = trie_new();
+ if (!p_trie_sa_rx || !p_trie_sa_tx)
+ {printf("trie alloc for SA failed\n"); exit(1);}
+
+
+#ifdef TEST_SA
+ /* Create RX SA's, RX Policy and TX SA's, all SA configuration parameters are read from net_test_config.txt file */
+ create_sec_associations();
+#endif
+#ifdef MULTI_THREAD
+{
+ char c;
+ /* create and set affinity of slow path and fast path threads to
+ * specific CPU cores as specified in the net_test_config.txt file */
+ //create_sp_fp_threads();
+
+ //this thread of execution (main) now just waits on user input
+ for(;;)
+ {
+ printf(">");
+ c=getchar();
+ if (c=='q')
+ {
+ QUIT=1;
+ break;
+ }
+ else if (c=='h')
+ printf("'q' to quit, 's' for stats, 'h' for help\n");
+ }
+
+ //sp_fp_thread_cleanup();
+
+}
+#else
+ /*********************************************/
+ /**************Entry point into scheduler ****/
+ /*********************************************/
+ netapi_schedRun(our_sched, &err);
+#endif
+
+ /* cleanup*/
+ delete_sec_associations();
+
+ delete_interfaces();
+
+ /* close pktio channels we opened via open_pktio_tx_channels() */
+ close_pktio_channels();
+
+ netapi_shutdown(netapi_handle);
+
+}
+
index d76ea88113c82e5ccc792f1155c21ccf4a948a52..13dd1f42b87da22e9b826952b7c0eb8a1929fba2 100755 (executable)
/* install signal handler for ^c */
signal(SIGINT,mysig);
- fpr = fopen(input_file_name, "r");
- if (fpr == NULL)
+ if (argc == 2)
+ {
+ fpr = fopen(argv[1], "r");
+ }
+ else
+ {
+ fpr = fopen(input_file_name, "r");
+ }
+ if (fpr == NULL)
{
- netapi_Log("Error in opening %s input file\n", input_file_name);
exit(1);
}
else
diff --git a/ti/runtime/netapi/test/net_test_sa_utils.c b/ti/runtime/netapi/test/net_test_sa_utils.c
index 800841afd6aecbce73560e344bbd5275ed08b594..a7f57d9b8429309c518d9e7a8bd78dafe01a10a7 100755 (executable)
int err,i;
nwalSaIpSecId_t nwalSaIpSecId;
uint32_t saId;
- for (i=0; i < MAX_SEC_INDEX;i++)
+ for (i=0; i < netTestCfg.num_sa;i++)
{
err = 0;
if(netTestCfg.sa_info[i].dir == NWAL_SA_DIR_INBOUND)
&(sa_info[i].rx_inflow_mode_handle),
(void*) saId,
&err);
- if (err) {netapi_Log("addRxSa failed %d\n",err); exit(1);}
+ if (err)
+ {
+ netapi_Log("addRxSa failed %d\n",err);
+ exit(1);
+ }
+
if (netTestCfg.ipsec_mode_rx == IPSEC_MODE_RX_INFLOW)
{
(void*)saId,
&err);
if (err) {netapi_Log("addTxSa failed %d\n",err); exit(1);}
-
}
}
}
void delete_sec_associations()
{
int err,i;
- for (i=0; i < MAX_SEC_INDEX;i++)
+ for (i=0; i < netTestCfg.num_sa;i++)
{
err = 0;
if(sa_info[i].dir == NWAL_SA_DIR_INBOUND)
index 9bc50564f953bea1d7d4a35ba0478c6046b826c8..d7c87db4a565fba1a9c037e6dbe57ac4f5ccee34 100755 (executable)
dump_descr(tip, i);
}
#endif
- for (i = 0; i < MAX_SEC_INDEX; i++)
+ for (i = 0; i < netTestCfg.num_sa; i++)
{
/* Statistics for RX Tunnel */
memset(&netapi_sa_stats, 0, sizeof(netapi_sa_stats));
parse_tunnel_id((char*)&pConfig->sa_config[i].tunnel_id, &netTestCfg.tunnel_id[i]);
-
+ netTestCfg.num_sa++;
+ printf("**************************** parse sa: num_sa %d\n", netTestCfg.num_sa);
}
void delete_interfaces(void)
{
-
int err,i;
//delete IPs and MAC Interfacess
for (i = 0; i < netTestCfg.num_ips; i++)
index 07bf17786f17275e7b72efc26945e7963df1e835..78536fd3dace58777e818115d7d985fe5822fdf9 100755 (executable)
#include "net_test.h"
-#define MAX_SEC_INDEX 16
-#define NET_TEST_MAX_MAC 10
-#define NET_TEST_MAX_IP 10
+#define MAX_SEC_INDEX 64
+#define NET_TEST_MAX_MAC 64
+#define NET_TEST_MAX_IP 64
#define NET_TEST_MAX_FP_THREAD 5
#define MAX_LINE_LENGTH 512
uint8_t encr_key[MAX_SEC_INDEX][36];
uint32_t tunnel_id[MAX_SEC_INDEX];
NETAPI_SEC_SA_INFO_T sa_info[MAX_SEC_INDEX];
+ uint8_t num_sa;
nwalSecKeyParams_t key_params[MAX_SEC_INDEX];
} netTestConfig_t;