FD.io VPP  v21.06-1-gbb7418cf9
Vector Packet Processing
srtp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <vnet/plugin/plugin.h>
17 #include <vpp/app/version.h>
18 
21 
22 #include <srtp2/srtp.h>
23 
24 #ifndef SRC_PLUGINS_SRTP_SRTP_H_
25 #define SRC_PLUGINS_SRTP_SRTP_H_
26 
27 #define SRTP_DEBUG 0
28 
29 #if SRTP_DEBUG
30 #define SRTP_DBG(_lvl, _fmt, _args...) \
31  if (_lvl <= SRTP_DEBUG) \
32  clib_warning (_fmt, ##_args)
33 #else
34 #define SRTP_DBG(_lvl, _fmt, _args...)
35 #endif
36 
37 typedef struct srtp_cxt_id_
38 {
39  union
40  {
43  };
50 
52  "ctx id must be less than TRANSPORT_CONN_ID_LEN");
53 
54 #define SRTP_MAX_KEYLEN 46 /**< libsrtp AES 256 key len with salt */
55 
57 {
65 
67 {
70 
71 typedef struct srtp_ctx_
72 {
73  union
74  {
77  };
78 #define parent_app_wrk_index c_srtp_ctx_id.parent_app_wrk_index
79 #define app_session_handle c_srtp_ctx_id.app_session_handle
80 #define srtp_session_handle c_srtp_ctx_id.srtp_session_handle
81 #define listener_ctx_index c_srtp_ctx_id.listener_ctx_index
82 #define udp_is_ip4 c_srtp_ctx_id.udp_is_ip4
83 #define srtp_ctx_engine c_srtp_ctx_id.srtp_engine_id
84 #define srtp_ssl_ctx c_srtp_ctx_id.ssl_ctx
85 #define srtp_ctx_handle c_c_index
86  /* Temporary storage for session open opaque. Overwritten once
87  * underlying tcp connection is established */
88 #define parent_app_api_context c_srtp_ctx_id.parent_app_api_ctx
89 
95  srtp_t srtp_ctx;
96  srtp_policy_t srtp_policy[2];
97 } srtp_tc_t;
98 
99 typedef struct srtp_main_
100 {
105  /*
106  * Config
107  */
110 } srtp_main_t;
111 
112 #endif /* SRC_PLUGINS_SRTP_SRTP_H_ */
113 
114 /*
115  * fd.io coding-style-patch-verification: ON
116  *
117  * Local Variables:
118  * eval: (c-set-style "gnu")
119  * End:
120  */
srtp_t srtp_ctx
Definition: srtp.h:95
u8 is_migrated
Definition: srtp.h:94
u8 resume
Definition: srtp.h:91
u32 fifo_size
Definition: srtp.h:109
srtp_tc_t ** ctx_pool
Definition: srtp.h:101
struct transport_endpt_cfg_srtp_policy transport_endpt_cfg_srtp_policy_t
unsigned long u64
Definition: types.h:89
STATIC_ASSERT(sizeof(srtp_ctx_id_t)<=TRANSPORT_CONN_ID_LEN, "ctx id must be less than TRANSPORT_CONN_ID_LEN")
unsigned char u8
Definition: types.h:56
unsigned int u32
Definition: types.h:88
u32 app_index
Definition: srtp.h:103
u64 first_seg_size
Definition: srtp.h:108
u8 udp_is_ip4
Definition: srtp.h:48
transport_connection_t connection
Definition: srtp.h:75
u32 parent_app_api_ctx
Definition: srtp.h:42
#define SRTP_MAX_KEYLEN
libsrtp AES 256 key len with salt
Definition: srtp.h:54
srtp_ctx_id_t c_srtp_ctx_id
Definition: srtp.h:76
u32 listener_ctx_index
Definition: srtp.h:47
clib_rwlock_t half_open_rwlock
Definition: srtp.h:104
session_handle_t srtp_session_handle
Definition: srtp.h:44
u32 parent_app_wrk_index
Definition: srtp.h:45
struct srtp_ctx_ srtp_tc_t
struct transport_endpt_cfg_srtp transport_endpt_cfg_srtp_t
struct _transport_connection transport_connection_t
#define TRANSPORT_CONN_ID_LEN
u32 srtp_ctx
Definition: srtp.h:46
Definition: srtp.h:71
srtp_tc_t * listener_ctx_pool
Definition: srtp.h:102
struct srtp_cxt_id_ srtp_ctx_id_t
u8 is_passive_close
Definition: srtp.h:90
struct srtp_main_ srtp_main_t
typedef key
Definition: ipsec_types.api:88
session_handle_t app_session_handle
Definition: srtp.h:41
u64 session_handle_t
u8 app_closed
Definition: srtp.h:92
u8 no_app_session
Definition: srtp.h:93