Florin Coras | ba7d8f5 | 2019-02-22 13:11:38 -0800 | [diff] [blame] | 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 | |
| 17 | #ifndef SRC_VNET_SESSION_APPLICATION_LOCAL_H_ |
| 18 | #define SRC_VNET_SESSION_APPLICATION_LOCAL_H_ |
| 19 | |
| 20 | #include <vnet/session/application.h> |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 21 | #include <vnet/session/transport.h> |
Florin Coras | ba7d8f5 | 2019-02-22 13:11:38 -0800 | [diff] [blame] | 22 | |
Florin Coras | 374df7a | 2021-05-13 11:37:43 -0700 | [diff] [blame^] | 23 | #define foreach_ct_flags \ |
| 24 | _ (CLIENT, "client") \ |
| 25 | _ (HALF_OPEN, "half-open") |
| 26 | |
| 27 | enum |
| 28 | { |
| 29 | #define _(sym, str) CT_CONN_BIT_F_##sym, |
| 30 | foreach_ct_flags |
| 31 | #undef _ |
| 32 | }; |
| 33 | |
| 34 | typedef enum |
| 35 | { |
| 36 | #define _(sym, str) CT_CONN_F_##sym = 1 << CT_CONN_BIT_F_##sym, |
| 37 | foreach_ct_flags |
| 38 | #undef _ |
| 39 | } ct_connection_flags_t; |
| 40 | |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 41 | typedef struct ct_connection_ |
Florin Coras | ba7d8f5 | 2019-02-22 13:11:38 -0800 | [diff] [blame] | 42 | { |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 43 | transport_connection_t connection; |
| 44 | u32 client_wrk; |
| 45 | u32 server_wrk; |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 46 | transport_proto_t actual_tp; |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 47 | u32 client_opaque; |
| 48 | u32 peer_index; |
| 49 | u64 segment_handle; |
Florin Coras | 653e43f | 2019-03-04 10:56:23 -0800 | [diff] [blame] | 50 | svm_fifo_t *client_rx_fifo; |
| 51 | svm_fifo_t *client_tx_fifo; |
Florin Coras | 374df7a | 2021-05-13 11:37:43 -0700 | [diff] [blame^] | 52 | ct_connection_flags_t flags; |
Florin Coras | 2b81e3c | 2019-02-27 07:55:46 -0800 | [diff] [blame] | 53 | } ct_connection_t; |
| 54 | |
| 55 | session_t *ct_session_get_peer (session_t * s); |
| 56 | void ct_session_endpoint (session_t * ll, session_endpoint_t * sep); |
| 57 | int ct_session_connect_notify (session_t * ls); |
Florin Coras | 653e43f | 2019-03-04 10:56:23 -0800 | [diff] [blame] | 58 | int ct_session_tx (session_t * s); |
Florin Coras | ba7d8f5 | 2019-02-22 13:11:38 -0800 | [diff] [blame] | 59 | |
| 60 | #endif /* SRC_VNET_SESSION_APPLICATION_LOCAL_H_ */ |
| 61 | |
| 62 | /* |
| 63 | * fd.io coding-style-patch-verification: ON |
| 64 | * |
| 65 | * Local Variables: |
| 66 | * eval: (c-set-style "gnu") |
| 67 | * End: |
| 68 | */ |