4d24790724fad219753ae8d631f9418fb17ab05a
[keystone-rtos/netapi.git] / ti / runtime / netapi / applications / ipsec_offload / ipsecmgr / src / netapilib_interface.h
1 /*
2 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
35 #ifndef __FPLIB_INTERFACE_H__
36 #define __FPLIB_INTERFACE_H__
38 #include "ti/runtime/netapi/netapi.h"
41 /* Container for applicaion ID's for offloaded SA's */
42 typedef struct {
43 int in_use;
44 uint32_t saAppId;
45 uint32_t spAppId;
46 } ipsecMgrAppId_T;
48 typedef struct {
49 int flowId;
50 PKTIO_HANDLE_T* pktio_channel;
51 int qNum;
52 /* list to store offloaded RX SA appIds and RX Policies */
53 ipsecMgrAppId_T rx_sa[64];
54 /* list to store offloaded TX SA appIds */
55 ipsecMgrAppId_T tx_sa[64];
56 } ipsecMgrMcb_t;
63 int netapilib_ifAddSA
64 (
65 ipsecmgr_af_t af,
66 ipsecmgr_sa_id_t *sa_id,
67 ipsecmgr_sa_info_t *sa_info,
68 ipsecmgr_sa_dscp_map_cfg_t *dscp_map_cfg,
69 ipsecmgr_ifname_t *if_name,
70 ipsecmgr_sa_encap_tmpl_t *encap,
71 ipsecmgr_fp_handle_t *sa_handle
72 );
74 int netapilib_ifAddSP
75 (
76 ipsecmgr_af_t af,
77 ipsecmgr_selector_t *sel,
78 ipsecmgr_dir_t dir,
79 uint32_t reqid,
80 ipsecmgr_fp_handle_t sa_handle,
81 ipsecmgr_policy_id_t policy_id,
82 ipsecmgr_fp_handle_t *sp_handle
83 );
85 int netapilib_ifDeleteSP
86 (
87 ipsecmgr_fp_handle_t sp_handle,
88 ipsecmgr_policy_id_t policy_id,
89 ipsecmgr_dir_t dir
90 );
92 int netapilib_ifDeleteSA
93 (
94 ipsecmgr_fp_handle_t sa_handle
95 );
97 int netapilib_ifGetSACtx
98 (
99 ipsecmgr_fp_handle_t sa_handle,
100 ipsecmgr_sa_hw_ctx_t *hw_ctx
101 );
103 #endif