99b501c513c284c1ea0948d643748dc2a3b5a550
[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"
39 #include <netdb.h>
42 /* Container for applicaion ID's for offloaded SA's */
43 typedef struct {
44 int in_use;
45 uint32_t saAppId;
46 uint32_t spAppId;
47 } ipsecMgrAppId_T;
49 typedef struct {
50 int flowId;
51 int qNum;
52 PKTIO_HANDLE_T* pktio_channel;
54 /* list to store offloaded RX SA appIds and RX Policies */
55 ipsecMgrAppId_T rx_sa[64];
56 /* list to store offloaded TX SA appIds */
57 ipsecMgrAppId_T tx_sa[64];
58 } ipsecMgrMcb_t;
60 int netapilib_ifAddSA
61 (
62 ipsecmgr_af_t af,
63 ipsecmgr_sa_id_t *sa_id,
64 ipsecmgr_sa_info_t *sa_info,
65 ipsecmgr_sa_dscp_map_cfg_t *dscp_map_cfg,
66 ipsecmgr_ifname_t *if_name,
67 ipsecmgr_sa_encap_tmpl_t *encap,
68 ipsecmgr_fp_handle_t *sa_handle
69 );
71 int netapilib_ifAddSP
72 (
73 ipsecmgr_af_t af,
74 ipsecmgr_selector_t *sel,
75 ipsecmgr_dir_t dir,
76 uint32_t reqid,
77 ipsecmgr_fp_handle_t sa_handle,
78 ipsecmgr_policy_id_t policy_id,
79 ipsecmgr_fp_handle_t *sp_handle
80 );
82 int netapilib_ifDeleteSP
83 (
84 ipsecmgr_fp_handle_t sp_handle,
85 ipsecmgr_policy_id_t policy_id,
86 ipsecmgr_dir_t dir
87 );
89 int netapilib_ifDeleteSA
90 (
91 ipsecmgr_fp_handle_t sa_handle
92 );
94 int netapilib_ifGetSACtx
95 (
96 ipsecmgr_fp_handle_t sa_handle,
97 ipsecmgr_sa_hw_ctx_t *hw_ctx
98 );
100 #endif