FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
stream_session.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 SRC_VNET_SESSION_STREAM_SESSION_H_
17 #define SRC_VNET_SESSION_STREAM_SESSION_H_
18 
19 #include <vnet/vnet.h>
20 #include <svm/svm_fifo.h>
21 
22 #define foreach_session_type \
23  _(IP4_TCP, ip4_tcp) \
24  _(IP4_UDP, ip4_udp) \
25  _(IP6_TCP, ip6_tcp) \
26  _(IP6_UDP, ip6_udp)
27 
28 typedef enum
29 {
30 #define _(A, a) SESSION_TYPE_##A,
32 #undef _
35 
36 /*
37  * Application session state
38  */
39 typedef enum
40 {
48 
49 typedef struct _stream_session_t
50 {
51  /** fifo pointers. Once allocated, these do not move */
52  svm_fifo_t *server_rx_fifo;
53  svm_fifo_t *server_tx_fifo;
54 
55  /** Type */
56  u8 session_type;
57 
58  /** State */
59  volatile u8 session_state;
60 
61  u8 thread_index;
62 
63  /** To avoid n**2 "one event per frame" check */
64  u8 enqueue_epoch;
65 
66  /** svm segment index where fifos were allocated */
67  u32 svm_segment_index;
68 
69  /** Session index in per_thread pool */
70  u32 session_index;
71 
72  /** Transport specific */
73  u32 connection_index;
74 
75  /** stream server pool index */
76  u32 app_index;
77 
78  /** Parent listener session if the result of an accept */
79  u32 listener_index;
80 
83 
84 #endif /* SRC_VNET_SESSION_STREAM_SESSION_H_ */
85 
86 /*
87  * fd.io coding-style-patch-verification: ON
88  *
89  * Local Variables:
90  * eval: (c-set-style "gnu")
91  * End:
92  */
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:68
struct _svm_fifo svm_fifo_t
stream_session_state_t
struct _stream_session_t stream_session_t
session_type_t
#define foreach_session_type
unsigned int u32
Definition: types.h:88
unsigned char u8
Definition: types.h:56