FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
session_lookup.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_SESSION_LOOKUP_H_
17 #define SRC_VNET_SESSION_SESSION_LOOKUP_H_
18 
20 #include <vnet/session/transport.h>
21 
22 typedef struct _session_lookup
23 {
24  /** Lookup tables for established sessions and listeners */
25  clib_bihash_16_8_t v4_session_hash;
26  clib_bihash_48_8_t v6_session_hash;
27 
28  /** Lookup tables for half-open sessions */
29  clib_bihash_16_8_t v4_half_open_hash;
30  clib_bihash_48_8_t v6_half_open_hash;
32 
34  u16 lcl_port, u8 proto);
36  ip4_address_t * rmt, u16 lcl_port,
37  u16 rmt_port, u8 proto);
39  u16 lcl_port, u8 proto);
41  ip6_address_t * rmt, u16 lcl_port,
42  u16 rmt_port, u8 proto);
44  lcl,
46  rmt,
47  u16 lcl_port,
48  u16 rmt_port,
49  u8 proto,
50  u32
51  thread_index);
53  ip4_address_t * rmt,
54  u16 lcl_port,
55  u16 rmt_port,
56  u8 proto);
58  lcl,
60  rmt,
61  u16 lcl_port,
62  u16 rmt_port,
63  u8 proto,
64  u32
65  thread_index);
67  ip6_address_t * rmt,
68  u16 lcl_port,
69  u16 rmt_port,
70  u8 proto);
71 
73  u16 lcl_port, u8 proto);
74 u64 stream_session_half_open_lookup_handle (ip46_address_t * lcl,
75  ip46_address_t * rmt,
76  u16 lcl_port,
77  u16 rmt_port, u8 proto);
79  ip46_address_t * rmt,
80  u16 lcl_port,
81  u16 rmt_port,
82  u8 proto);
88  u64 value);
89 
90 void session_lookup_init (void);
91 
92 #endif /* SRC_VNET_SESSION_SESSION_LOOKUP_H_ */
93 
94 /*
95  * fd.io coding-style-patch-verification: ON
96  *
97  * Local Variables:
98  * eval: (c-set-style "gnu")
99  * End:
100  */
struct _transport_connection transport_connection_t
stream_session_t * stream_session_lookup_listener4(ip4_address_t *lcl, u16 lcl_port, u8 proto)
int stream_session_table_del(stream_session_t *s)
transport_connection_t * stream_session_lookup_transport_wt4(ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto, u32 thread_index)
stream_session_t * stream_session_lookup_listener(ip46_address_t *lcl, u16 lcl_port, u8 proto)
transport_connection_t * stream_session_lookup_transport_wt6(ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto, u32 thread_index)
unsigned long u64
Definition: types.h:89
stream_session_t * stream_session_lookup6(ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
struct _stream_session_t stream_session_t
void stream_session_half_open_table_del(transport_connection_t *tc)
struct _session_lookup session_lookup_t
transport_connection_t * stream_session_lookup_transport4(ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
void stream_session_half_open_table_add(transport_connection_t *tc, u64 value)
void stream_session_table_add_for_tc(transport_connection_t *tc, u64 value)
stream_session_t * stream_session_lookup_listener6(ip6_address_t *lcl, u16 lcl_port, u8 proto)
transport_connection_t * stream_session_half_open_lookup(ip46_address_t *lcl, ip46_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
int stream_session_table_del_for_tc(transport_connection_t *tc)
unsigned int u32
Definition: types.h:88
stream_session_t * stream_session_lookup4(ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
Looks up a session based on the 5-tuple passed as argument.
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56
u64 stream_session_half_open_lookup_handle(ip46_address_t *lcl, ip46_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)
void session_lookup_init(void)
transport_connection_t * stream_session_lookup_transport6(ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto)