Florin Coras | 04e5344 | 2017-07-16 17:12:15 -0700 | [diff] [blame^] | 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 | |
| 19 | #include <vnet/session/stream_session.h> |
| 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; |
| 31 | } session_lookup_t; |
| 32 | |
| 33 | stream_session_t *stream_session_lookup_listener4 (ip4_address_t * lcl, |
| 34 | u16 lcl_port, u8 proto); |
| 35 | stream_session_t *stream_session_lookup4 (ip4_address_t * lcl, |
| 36 | ip4_address_t * rmt, u16 lcl_port, |
| 37 | u16 rmt_port, u8 proto); |
| 38 | stream_session_t *stream_session_lookup_listener6 (ip6_address_t * lcl, |
| 39 | u16 lcl_port, u8 proto); |
| 40 | stream_session_t *stream_session_lookup6 (ip6_address_t * lcl, |
| 41 | ip6_address_t * rmt, u16 lcl_port, |
| 42 | u16 rmt_port, u8 proto); |
| 43 | transport_connection_t *stream_session_lookup_transport_wt4 (ip4_address_t * |
| 44 | lcl, |
| 45 | ip4_address_t * |
| 46 | rmt, |
| 47 | u16 lcl_port, |
| 48 | u16 rmt_port, |
| 49 | u8 proto, |
| 50 | u32 |
| 51 | thread_index); |
| 52 | transport_connection_t *stream_session_lookup_transport4 (ip4_address_t * lcl, |
| 53 | ip4_address_t * rmt, |
| 54 | u16 lcl_port, |
| 55 | u16 rmt_port, |
| 56 | u8 proto); |
| 57 | transport_connection_t *stream_session_lookup_transport_wt6 (ip6_address_t * |
| 58 | lcl, |
| 59 | ip6_address_t * |
| 60 | rmt, |
| 61 | u16 lcl_port, |
| 62 | u16 rmt_port, |
| 63 | u8 proto, |
| 64 | u32 |
| 65 | thread_index); |
| 66 | transport_connection_t *stream_session_lookup_transport6 (ip6_address_t * lcl, |
| 67 | ip6_address_t * rmt, |
| 68 | u16 lcl_port, |
| 69 | u16 rmt_port, |
| 70 | u8 proto); |
| 71 | |
| 72 | stream_session_t *stream_session_lookup_listener (ip46_address_t * lcl, |
| 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); |
| 78 | transport_connection_t *stream_session_half_open_lookup (ip46_address_t * lcl, |
| 79 | ip46_address_t * rmt, |
| 80 | u16 lcl_port, |
| 81 | u16 rmt_port, |
| 82 | u8 proto); |
| 83 | void stream_session_table_add_for_tc (transport_connection_t * tc, u64 value); |
| 84 | int stream_session_table_del_for_tc (transport_connection_t * tc); |
| 85 | int stream_session_table_del (stream_session_t * s); |
| 86 | void stream_session_half_open_table_del (u8 sst, transport_connection_t * tc); |
| 87 | void stream_session_half_open_table_add (session_type_t sst, |
| 88 | transport_connection_t * tc, |
| 89 | u64 value); |
| 90 | |
| 91 | void session_lookup_init (void); |
| 92 | |
| 93 | #endif /* SRC_VNET_SESSION_SESSION_LOOKUP_H_ */ |
| 94 | |
| 95 | /* |
| 96 | * fd.io coding-style-patch-verification: ON |
| 97 | * |
| 98 | * Local Variables: |
| 99 | * eval: (c-set-style "gnu") |
| 100 | * End: |
| 101 | */ |