FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
proxy.h
Go to the documentation of this file.
1 
2 /*
3  * builtin_proxy.h - skeleton vpp engine plug-in header file
4  *
5  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __included_proxy_h__
19 #define __included_proxy_h__
20 
21 #include <vnet/vnet.h>
22 #include <vnet/ip/ip.h>
23 
24 #include <vppinfra/hash.h>
25 #include <vppinfra/error.h>
26 #include <vnet/session/session.h>
28 
29 typedef struct
30 {
33 
37  volatile int po_disconnected;
38  volatile int ao_disconnected;
40 
41 typedef struct
42 {
43  svm_queue_t *vl_input_queue; /**< vpe input queue */
44  /** per-thread vectors */
47  u8 **rx_buf; /**< intermediate rx buffers */
48 
49  u32 cli_node_index; /**< cli process node index */
50  u32 server_client_index; /**< server API client handle */
51  u32 server_app_index; /**< server app index */
52  u32 active_open_client_index; /**< active open API client handle */
53  u32 active_open_app_index; /**< active open index after attach */
54 
57 
58  /*
59  * Configuration params
60  */
61  u8 *connect_uri; /**< URI for slave's connect */
63  u32 fifo_size; /**< initial fifo size */
64  u32 max_fifo_size; /**< max fifo size */
65  u8 high_watermark; /**< high watermark (%) */
66  u8 low_watermark; /**< low watermark (%) */
67  u32 private_segment_count; /**< Number of private fifo segs */
68  u32 private_segment_size; /**< size of private fifo segs */
72 
74  /*
75  * Test state variables
76  */
77  proxy_session_t *sessions; /**< Session pool, shared */
81 
82  /*
83  * Flags
84  */
86  u8 prealloc_fifos; /**< Request fifo preallocation */
87 } proxy_main_t;
88 
90 
91 #endif /* __included_proxy_h__ */
92 
93 /*
94  * fd.io coding-style-patch-verification: ON
95  *
96  * Local Variables:
97  * eval: (c-set-style "gnu")
98  * End:
99  */
proxy_session_t::ao_disconnected
volatile int ao_disconnected
Definition: proxy.h:38
proxy_main_t::rcv_buffer_size
int rcv_buffer_size
Definition: proxy.h:69
proxy_session_t::po_disconnected
volatile int po_disconnected
Definition: proxy.h:37
proxy_main_t::sessions
proxy_session_t * sessions
Session pool, shared.
Definition: proxy.h:77
proxy_session_t::active_open_establishing
volatile int active_open_establishing
Definition: proxy.h:36
proxy_session_t::server_rx_fifo
svm_fifo_t * server_rx_fifo
Definition: proxy.h:31
proxy_main_t::private_segment_count
u32 private_segment_count
Number of private fifo segs.
Definition: proxy.h:67
proxy_main_t::low_watermark
u8 low_watermark
low watermark (%)
Definition: proxy.h:66
session_endpoint_cfg_t
struct _session_endpoint_cfg session_endpoint_cfg_t
svm_queue_t
struct _svm_queue svm_queue_t
session_handle_t
u64 session_handle_t
Definition: session_types.h:111
proxy_main_t::server_client_index
u32 server_client_index
server API client handle
Definition: proxy.h:50
proxy_session_t::vpp_server_handle
session_handle_t vpp_server_handle
Definition: proxy.h:34
proxy_main_t::proxy_session_by_server_handle
uword * proxy_session_by_server_handle
Definition: proxy.h:55
svm_fifo_t
struct _svm_fifo svm_fifo_t
proxy_main_t::server_event_queue
svm_msg_q_t ** server_event_queue
per-thread vectors
Definition: proxy.h:45
proxy_session_t::vpp_active_open_handle
session_handle_t vpp_active_open_handle
Definition: proxy.h:35
hash.h
error.h
proxy_main_t::vl_input_queue
svm_queue_t * vl_input_queue
vpe input queue
Definition: proxy.h:43
proxy_main_t::client_sep
session_endpoint_cfg_t client_sep
Definition: proxy.h:71
proxy_main_t::fifo_size
u32 fifo_size
initial fifo size
Definition: proxy.h:63
proxy_main_t::active_open_event_queue
svm_msg_q_t ** active_open_event_queue
Definition: proxy.h:46
proxy_main_t::sessions_lock
clib_spinlock_t sessions_lock
Definition: proxy.h:78
proxy_main_t::private_segment_size
u32 private_segment_size
size of private fifo segs
Definition: proxy.h:68
clib_spinlock_s
Definition: lock.h:51
uword
u64 uword
Definition: types.h:112
proxy_main_t::connect_uri
u8 * connect_uri
URI for slave's connect.
Definition: proxy.h:61
proxy_main_t::server_app_index
u32 server_app_index
server app index
Definition: proxy.h:51
proxy_main_t::is_init
u8 is_init
Definition: proxy.h:85
proxy_main_t::cli_node_index
u32 cli_node_index
cli process node index
Definition: proxy.h:49
svm_msg_q_
Definition: message_queue.h:72
proxy_main_t::proxy_session_by_active_open_handle
uword * proxy_session_by_active_open_handle
Definition: proxy.h:56
proxy_main_t::connection_index_by_thread
u32 ** connection_index_by_thread
Definition: proxy.h:79
proxy_main
proxy_main_t proxy_main
Definition: proxy.c:23
proxy_main_t
Definition: proxy.h:41
ip.h
u32
unsigned int u32
Definition: types.h:88
proxy_main_t::configured_segment_size
u32 configured_segment_size
Definition: proxy.h:62
proxy_main_t::max_fifo_size
u32 max_fifo_size
max fifo size
Definition: proxy.h:64
application_interface.h
proxy_main_t::ckpair_index
u32 ckpair_index
Definition: proxy.h:73
u8
unsigned char u8
Definition: types.h:56
proxy_main_t::rx_buf
u8 ** rx_buf
intermediate rx buffers
Definition: proxy.h:47
proxy_session_t
Definition: proxy.h:29
session.h
proxy_session_t::server_tx_fifo
svm_fifo_t * server_tx_fifo
Definition: proxy.h:32
proxy_main_t::client_thread_handle
pthread_t client_thread_handle
Definition: proxy.h:80
proxy_main_t::active_open_client_index
u32 active_open_client_index
active open API client handle
Definition: proxy.h:52
proxy_main_t::high_watermark
u8 high_watermark
high watermark (%)
Definition: proxy.h:65
vnet.h
proxy_main_t::active_open_app_index
u32 active_open_app_index
active open index after attach
Definition: proxy.h:53
proxy_main_t::server_sep
session_endpoint_cfg_t server_sep
Definition: proxy.h:70
proxy_main_t::prealloc_fifos
u8 prealloc_fifos
Request fifo preallocation.
Definition: proxy.h:86