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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <vnet/session/transport.h>
19 transport_endpoint_lookup (transport_endpoint_table_t *ht, ip46_address_t *ip,
22 clib_bihash_kv_24_8_t kv;
25 kv.key[0] = ip->as_u64[0];
26 kv.key[1] = ip->as_u64[1];
29 rv = clib_bihash_search_inline_24_8 (ht, &kv);
33 return TRANSPORT_ENDPOINT_INVALID_INDEX;
37 transport_endpoint_table_add (transport_endpoint_table_t *ht,
38 transport_endpoint_t *te, u32 value)
40 clib_bihash_kv_24_8_t kv;
42 kv.key[0] = te->ip.as_u64[0];
43 kv.key[1] = te->ip.as_u64[1];
47 clib_bihash_add_del_24_8 (ht, &kv, 1);
51 transport_endpoint_table_del (transport_endpoint_table_t *ht,
52 transport_endpoint_t *te)
54 clib_bihash_kv_24_8_t kv;
56 kv.key[0] = te->ip.as_u64[0];
57 kv.key[1] = te->ip.as_u64[1];
60 clib_bihash_add_del_24_8 (ht, &kv, 0);