FD.io VPP
v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
quic.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 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
#ifndef __included_quic_h__
17
#define __included_quic_h__
18
19
#include <
vnet/session/application_interface.h
>
20
21
#include <
vppinfra/lock.h
>
22
#include <
vppinfra/tw_timer_1t_3w_1024sl_ov.h
>
23
24
#include <quicly.h>
25
26
#define QUIC_DEBUG 1
27
#define QUIC_DEBUG_LEVEL_CLIENT 0
28
#define QUIC_DEBUG_LEVEL_SERVER 0
29
30
#define QUIC_DEFAULT_CA_CERT_PATH "/etc/ssl/certs/ca-certificates.crt"
31
32
#define QUIC_TIMER_HANDLE_INVALID ((u32) ~0)
33
34
#define QUIC_TSTAMP_RESOLUTION 0.001
/* QUIC tick resolution (1ms) */
35
36
37
#if QUIC_DEBUG
38
#define QUIC_DBG(_lvl, _fmt, _args...) \
39
if (_lvl <= QUIC_DEBUG) \
40
clib_warning (_fmt, ##_args)
41
#else
42
#define QUIC_DBG(_lvl, _fmt, _args...)
43
#endif
44
45
#define QUIC_CONN_STATE_HANDSHAKE 0
46
#define QUIC_CONN_STATE_READY 1
47
48
49
/* *INDENT-OFF* */
50
typedef
CLIB_PACKED
(
struct
quic_ctx_id_
51
{
52
session_handle_t
app_session;
53
session_handle_t
quic_session;
54
u32
parent_app_wrk_idx;
55
u32
parent_app_id;
56
u32
listener_ctx_id;
57
u32
timer_handle;
58
quicly_conn_t *conn;
59
u8
udp_is_ip4;
60
u8
conn_state;
61
}) quic_ctx_id_t;
62
/* *INDENT-ON* */
63
64
STATIC_ASSERT
(
sizeof
(quic_ctx_id_t) <= 42,
"ctx id must be less than 42"
);
65
66
typedef
struct
quic_ctx_
67
{
68
union
69
{
70
transport_connection_t
connection
;
71
quic_ctx_id_t
c_quic_ctx_id
;
72
};
73
74
quicly_stream_t *
stream
;
75
u8
*
srv_hostname
;
76
u32
client_opaque
;
77
u8
is_listener
;
78
}
quic_ctx_t
;
79
80
typedef
struct
quic_worker_ctx_
81
{
82
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
83
u32
time_now
;
/**< worker time */
84
tw_timer_wheel_1t_3w_1024sl_ov_t
timer_wheel
;
/**< worker timer wheel */
85
u32
*
tx_buffers
;
/**< tx buffer free list */
86
}
quic_worker_ctx_t
;
87
88
typedef
struct
quic_main_
89
{
90
u32
app_index
;
91
quic_ctx_t
*
half_open_ctx_pool
;
92
quic_ctx_t
**
ctx_pool
;
93
clib_rwlock_t
half_open_rwlock
;
94
quic_worker_ctx_t
*
wrk_ctx
;
95
f64
tstamp_ticks_per_clock
;
96
97
98
/*
99
* Config
100
*/
101
quicly_context_t
quicly_ctx
;
102
ptls_handshake_properties_t
hs_properties
;
103
quicly_cid_plaintext_t
next_cid
;
104
u8
use_test_cert_in_ca
;
105
char
*
ca_cert_path
;
106
}
quic_main_t
;
107
108
quic_main_t
*
vnet_quic_get_main
(
void
);
109
110
#endif
/* __included_quic_h__ */
111
112
/*
113
* fd.io coding-style-patch-verification: ON
114
*
115
* Local Variables:
116
* eval: (c-set-style "gnu")
117
* End:
118
*/
quic_main_::use_test_cert_in_ca
u8 use_test_cert_in_ca
Definition:
quic.h:104
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition:
cache.h:60
lock.h
quic_main_::wrk_ctx
quic_worker_ctx_t * wrk_ctx
Definition:
quic.h:94
quic_ctx_::stream
quicly_stream_t * stream
Definition:
quic.h:74
quic_main_::half_open_rwlock
clib_rwlock_t half_open_rwlock
Definition:
quic.h:93
quic_main_::next_cid
quicly_cid_plaintext_t next_cid
Definition:
quic.h:103
quic_main_::ca_cert_path
char * ca_cert_path
Definition:
quic.h:105
application_interface.h
quic_ctx_::client_opaque
u32 client_opaque
Definition:
quic.h:76
quic_ctx_t
struct quic_ctx_ quic_ctx_t
quic_worker_ctx_t
struct quic_worker_ctx_ quic_worker_ctx_t
quic_main_::tstamp_ticks_per_clock
f64 tstamp_ticks_per_clock
Definition:
quic.h:95
clib_rw_lock_
Definition:
lock.h:108
u8
unsigned char u8
Definition:
types.h:56
f64
double f64
Definition:
types.h:142
u32
unsigned int u32
Definition:
types.h:88
quic_worker_ctx_::time_now
u32 time_now
worker time
Definition:
quic.h:83
quic_main_::hs_properties
ptls_handshake_properties_t hs_properties
Definition:
quic.h:102
quic_ctx_::c_quic_ctx_id
quic_ctx_id_t c_quic_ctx_id
Definition:
quic.h:71
quic_main_::app_index
u32 app_index
Definition:
quic.h:90
quic_ctx_
Definition:
quic.h:66
STATIC_ASSERT
STATIC_ASSERT(sizeof(quic_ctx_id_t)<=42, "ctx id must be less than 42")
quic_ctx_::connection
transport_connection_t connection
Definition:
quic.h:70
quic_worker_ctx_
Definition:
quic.h:80
quic_main_::quicly_ctx
quicly_context_t quicly_ctx
Definition:
quic.h:101
quic_main_t
struct quic_main_ quic_main_t
transport_connection_t
struct _transport_connection transport_connection_t
quic_worker_ctx_::tx_buffers
u32 * tx_buffers
tx buffer free list
Definition:
quic.h:85
quic_worker_ctx_::timer_wheel
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel
worker timer wheel
Definition:
quic.h:84
vnet_quic_get_main
quic_main_t * vnet_quic_get_main(void)
Definition:
quic.c:1577
quic_ctx_::srv_hostname
u8 * srv_hostname
Definition:
quic.h:75
tw_timer_1t_3w_1024sl_ov.h
session_handle_t
u64 session_handle_t
Definition:
session_types.h:110
quic_ctx_::is_listener
u8 is_listener
Definition:
quic.h:77
quic_main_
Definition:
quic.h:88
quic_main_::ctx_pool
quic_ctx_t ** ctx_pool
Definition:
quic.h:92
CLIB_PACKED
typedef CLIB_PACKED(struct quic_ctx_id_ { session_handle_t app_session;session_handle_t quic_session;u32 parent_app_wrk_idx;u32 parent_app_id;u32 listener_ctx_id;u32 timer_handle;quicly_conn_t *conn;u8 udp_is_ip4;u8 conn_state;}) quic_ctx_id_t
quic_main_::half_open_ctx_pool
quic_ctx_t * half_open_ctx_pool
Definition:
quic.h:91
src
plugins
quic
quic.h
Generated on Mon Jun 29 2020 14:36:18 for FD.io VPP by
1.8.13