]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blobdiff - ti/runtime/netapi/test/net_test.h
Changes to compile with devkit
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / net_test.h
index 4adb72c1ba7ee84309529fda2a57d246bf78d9c0..f65d9e9bea448b4823c1ab152ca60bf2223a0911 100755 (executable)
  */
 /* ============================================================= */
 
+#ifndef __NET_TEST_H__
+#define __NET_TEST_H__
 
-#define MAX_SEC_INDEX                   7
+#include "ti/runtime/netapi/netapi.h"
+#include "trie.h"
 
+#include "net_test_sa_utils.h"
+#include "net_test_utils.h"
+#include "net_test_thread_utils.h"
 
-//IPSEC MODE(only choose one rx and one tx)
-#define IPSEC_MODE_RX_INFLOW            1
-#define IPSEC_MODE_TX_INFLOW            2
-#define IPSEC_MODE_RX_SIDEBAND          3
-#define IPSEC_MODE_TX_SIDEBAND          4
+//#include "net_test_sa_utils.h"
+//define this for multi-thread
+#define netTest_MULTI_THREAD
 
 
-#define netTest_MAC_HEADER_LEN          14
-#define netTest_IP_HEADER_LEN           20
-#define netTest_UDP_HEADER_LEN          8
-#define netTest_ESP_HEADER_LEN          8
-#define netTest_AES_CBC_IV_LEN          16
-#define netTest_AES_CTR_IV_LEN   8
-#define netTest_3DES_CBC_IV_LEN         8
-#define netTest_AES_GCM_IV_LEN          8
-#define netTest_AES_CCM_IV_LEN          8
-#define netTest_AES_GMAC_IV_LEN          8
-#define netTest_NULL_IV_LEN             0
-#define netTest_ICV_LEN                 12
-#define netTest_AES_GCM_CCM_ICV_LEN     16
-#define netTest_AES_GMAC_ICV_LEN     16
+#define netTest_DSP_FASTPATH
 
-#define IPSEC_AH_PKT    1
-#define IPSEC_ESP_PKT   2
 
-
-#define netTest_IPSEC_AH_FIXED_HDR_SIZE 12
-
-
-#define netTest_NULL_ESP_HEADER_LEN 0
-
-/* The input strings for the input config file is given below */
-#define INIT_CONFIG_MAC0            "mac0"
-#define INIT_CONFIG_MAC1            "mac1"
-#define INIT_CONFIG_IP0             "ip0"
-#define INIT_CONFIG_IP1             "ip1"
-#define INIT_CONFIG_IP2             "ip2"
-#define INIT_CONFIG_LOCAL_IPSEC_IP  "local_ipsec_ip"
-#define INIT_CONFIG_REMOTE_IPSEC_IP "remote_ipsec_ip"
-#define INIT_CONFIG_IPSEC_MODE_RX   "ipsec_mode_rx"
-#define INIT_CONFIG_IPSEC_MODE_TX   "ipsec_mode_tx"
-#define INIT_CONFIG_IPSEC_IF_NO     "ipsec_if"
-#define INIT_CONFIG_AUTH_KEY  "authkey"
-#define INIT_CONFIG_ENCR_KEY  "encrkey"
-#define CONFIG_STRING_LEN 128
-
-
-
-#define MAX_ROUTES 16
-/* tmannan - begin */
-
-typedef struct {
-    nwalDmTxPayloadInfo_t   tx_payload_info;
-    uint8_t inner_ip_offset;
-    NETCP_CFG_SA_T rx_tunnel;
-    void * rx_data_mode_handle;
-    void * rx_inflow_mode_handle;
-    NETCP_CFG_SA_T tx_tunnel;
-    void * tx_data_mode_handle;
-    void * tx_inflow_mode_handle;
-    uint8_t enc_key_length;
-    uint8_t auth_tag_size;
-    nwalTxPktInfo_t tx_pkt_info;
-    nwal_saEALG         cipherMode;
-    nwal_saAALG         authMode;
-    /*stuff for routing use case */
-    unsigned int src;  //BE
-    unsigned int dst;  //BE
-    unsigned int spi;  //BE
-    unsigned int seq;  //BE
-    int iv_len; //iv len (size of iv in pkt)
-    int bl; //block len (for padding calc)
-#ifdef NET_TEST_ENABLE_SIDE_BAND_LOW_LEVEL_API
-   /* Save NETCP CMD details during create time */
-    nwalTxDmPSCmdInfo_t     rx_dmPSCmdInfo;
-    nwalTxDmPSCmdInfo_t     tx_dmPSCmdInfo;
-#endif
-#ifdef NET_TEST_ENABLE_INFLOW_LOW_LEVEL_API
-    nwalTxPSCmdInfo_t          tx_psCmdInfo;
-    uint32_t                           swInfo0;
-    uint32_t                           swInfo1;
 #endif
-} netTestSA_t;
-
-
-
-typedef struct{
-    char mac0[CONFIG_STRING_LEN];
-    char mac1[CONFIG_STRING_LEN];
-    char ip0[CONFIG_STRING_LEN];
-    char ip1[CONFIG_STRING_LEN];
-    char ip2[CONFIG_STRING_LEN];
-    char local_ipsec_ip[CONFIG_STRING_LEN];
-    char remote_ipsec_ip[CONFIG_STRING_LEN];
-    char ipsec_mode_rx[CONFIG_STRING_LEN];
-    char ipsec_mode_tx[CONFIG_STRING_LEN];
-    char routes[MAX_ROUTES][CONFIG_STRING_LEN];
-    char ports[MAX_ROUTES][CONFIG_STRING_LEN];
-    char dst_ips[MAX_ROUTES][CONFIG_STRING_LEN];
-    char paths[MAX_ROUTES][CONFIG_STRING_LEN];
-    char ipsec_if_no[CONFIG_STRING_LEN];
-    char auth_key[CONFIG_STRING_LEN];
-    char encr_key[CONFIG_STRING_LEN];
-    
-} netTestConfigFile_t;
-
-
-
-
-typedef struct {
-unsigned char mac0[6];
-unsigned char mac1[6];
-nwalIpAddr_t ip0;
-nwalIpAddr_t ip1;
-nwalIpAddr_t ip2;
-nwalIpAddr_t local_ipsec_ip;
-nwalIpAddr_t remote_ipsec_ip;
-uint8_t ipsec_mode_rx;
-uint8_t ipsec_mode_tx;
-int ipsec_if_no;  /* 0 if mac0, 1 if mac 1 */
-uint8_t auth_key[36];
-uint8_t encr_key[36];
-} netTestConfig_t;
-
-
-typedef struct {
-unsigned char mac0[2][6];
-unsigned char mac1[2][6];
-nwalIpAddr_t ip0[2];
-nwalIpAddr_t ip1[2];
-nwalIpAddr_t ip2[2];
-nwalIpAddr_t local_ipsec_ip;
-nwalIpAddr_t remote_ipsec_ip;
-uint8_t ipsec_mode_rx;
-uint8_t ipsec_mode_tx;
-int ipsec_if_no;  /* 0 if mac0, 1 if mac 1 */
-
-} netTestConfigMax_t;
-
-typedef struct stats_t
-{
-        long itx;  //initially generated
-        long itx2;
-    long rx;
-    long tx;
-    long n_bad;
-    long n_new;
-    long n_class0_rx;   //count of pkts classified 
-    long n_class1_rx;   //count of pkts classified 
-    long n_class2_rx;   //count of pkts classified 
-    long n_t1;
-    long n_t2;
-    long n_t3;
-    long sec_tx;
-    long sec_rx;
-    long sb_tx;
-    long sb_rx;
-    long secp_rx;
-    long n_auth_ok;
-    unsigned long long  app_cycles;
-    unsigned long long  send_cycles;
-    unsigned long long  tx_cache_cycles;
-    unsigned long long total_decrypt_time;
-    unsigned long long total_encrypt_time;
-    long rx_min;
-    long tx_min;
-    long if_rx[TUNE_NETAPI_MAX_NUM_MAC];
-    long  core_rx;
-    long  n_stats_cb;
-    long  ip;
-    long exceptionPktsFrag;
-    long exceptionPktsOther;
-} STATS_T; 
-
-typedef struct head_t
-{
-       long ip[5];
-       long udp[2];
-} HEAD_T;
-
-typedef struct key_t
-{
-  long src_ip;
-  long dst_ip;
-  short src_port;
-  short dst_port;
-} KEY_T;
-
-#define IPSEC_AH_PKT 1
-#define  IPSEC_ESP_PKT 2
-