blob: fd2804c7bafe1a6bd871c453c4402e8063a0b642 [file] [log] [blame]
Florin Corasba7d8f52019-02-22 13:11:38 -08001/*
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
17#ifndef SRC_VNET_SESSION_APPLICATION_LOCAL_H_
18#define SRC_VNET_SESSION_APPLICATION_LOCAL_H_
19
20#include <vnet/session/application.h>
Florin Coras2b81e3c2019-02-27 07:55:46 -080021#include <vnet/session/transport.h>
Florin Corasba7d8f52019-02-22 13:11:38 -080022
Florin Coras374df7a2021-05-13 11:37:43 -070023#define foreach_ct_flags \
24 _ (CLIENT, "client") \
Florin Coras6d14c0c2023-12-14 11:46:11 -080025 _ (HALF_OPEN, "half-open") \
26 _ (RESET, "reset")
Florin Coras374df7a2021-05-13 11:37:43 -070027
28enum
29{
30#define _(sym, str) CT_CONN_BIT_F_##sym,
31 foreach_ct_flags
32#undef _
33};
34
35typedef enum
36{
37#define _(sym, str) CT_CONN_F_##sym = 1 << CT_CONN_BIT_F_##sym,
38 foreach_ct_flags
39#undef _
40} ct_connection_flags_t;
41
Florin Coras2b81e3c2019-02-27 07:55:46 -080042typedef struct ct_connection_
Florin Corasba7d8f52019-02-22 13:11:38 -080043{
Florin Coras2b81e3c2019-02-27 07:55:46 -080044 transport_connection_t connection;
45 u32 client_wrk;
46 u32 server_wrk;
Florin Coras2b81e3c2019-02-27 07:55:46 -080047 u32 client_opaque;
48 u32 peer_index;
49 u64 segment_handle;
Florin Corasda78c5a2021-06-09 14:55:24 -070050 u32 seg_ctx_index;
51 u32 ct_seg_index;
Florin Coras653e43f2019-03-04 10:56:23 -080052 svm_fifo_t *client_rx_fifo;
53 svm_fifo_t *client_tx_fifo;
Florin Corasda78c5a2021-06-09 14:55:24 -070054 transport_proto_t actual_tp;
Florin Coras374df7a2021-05-13 11:37:43 -070055 ct_connection_flags_t flags;
Florin Coras2b81e3c2019-02-27 07:55:46 -080056} ct_connection_t;
57
58session_t *ct_session_get_peer (session_t * s);
59void ct_session_endpoint (session_t * ll, session_endpoint_t * sep);
Florin Coras6973c732021-06-17 15:53:38 -070060int ct_session_connect_notify (session_t *ls, session_error_t err);
Florin Coras653e43f2019-03-04 10:56:23 -080061int ct_session_tx (session_t * s);
Florin Corasba7d8f52019-02-22 13:11:38 -080062
63#endif /* SRC_VNET_SESSION_APPLICATION_LOCAL_H_ */
64
65/*
66 * fd.io coding-style-patch-verification: ON
67 *
68 * Local Variables:
69 * eval: (c-set-style "gnu")
70 * End:
71 */