SDOCM00107645: ipsecmgr sampe application needs to provide option for user to give...
authorTinku Mannan <tmannan@ti.com>
Tue, 6 May 2014 14:51:23 +0000 (10:51 -0400)
committerTinku Mannan <tmannan@ti.com>
Tue, 6 May 2014 14:51:23 +0000 (10:51 -0400)
ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/src/netapi_ipsecmgr.c
ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/src/netapilib_interface.c
ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/src/netapilib_interface.h

index b6a13ffa34ef998383ede8439f0a1ea1dda23af8..0380089c6b4a4c26514cf53ede82a7670ab27de0 100755 (executable)
@@ -359,6 +359,7 @@ static void offload_sp_req_recv
     offload_sp_req.if_name = req->if_name;
     offload_sp_req.dscp_cfg = req->dscp_cfg;
     offload_sp_req.l5_selector = req->l5_selector;
+    //offload_sp_req.oseq_offset = req->oseq_offset;
 
     memset(&rsp, 0, sizeof(rsp));
     rsp.trans_id = req->trans_id;
@@ -784,8 +785,20 @@ int32_t main (int argc, char* argv[])
     cpu_set_t cpu_set;
     ipsecmgr_syslog_init();
 
+
+
     memset(&globalDB, 0, sizeof(globalDB));
 
+    if (argc == 2)
+    {
+        globalDB.oseq_offset = atoi(argv[1]);
+    }
+    else
+    {
+        globalDB.oseq_offset = 0;
+    }
+
+
     /* assign main net_test thread to run on core 0 */
     CPU_ZERO( &cpu_set);
     CPU_SET( 0, &cpu_set);
index d4a9f142132a671de20ff1da4f8d08d1ff84e176..c147f098855f7f4a9b3050bf5f87ec7633f46070 100755 (executable)
@@ -305,6 +305,8 @@ int netapilib_ifAddSA
     }
     else
     {
+        saInfo.esnLo = sa_info->esnlo + globalDB.oseq_offset;
+
         /* OUTBOUND == TX */
         globalDB.tx_sa[slot].saAppId = netapi_secAddSA(netapi_handle,
                         NETCP_CFG_NO_INTERFACE,
index 99b501c513c284c1ea0948d643748dc2a3b5a550..1c2e06843c93e50bf6e317c0f9869c372044504b 100755 (executable)
@@ -55,6 +55,7 @@ typedef struct {
     ipsecMgrAppId_T rx_sa[64];
     /* list to store offloaded TX SA appIds */
     ipsecMgrAppId_T tx_sa[64];
+    uint32_t        oseq_offset; /* offset to outbound/egress sequence number */
 } ipsecMgrMcb_t;
 
 int netapilib_ifAddSA