2 * Copyright (c) 2020 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 * @brief The NAT44 inline functions
19 #ifndef included_nat44_inlines_h__
20 #define included_nat44_inlines_h__
22 #include <vnet/fib/ip4_fib.h>
25 static_always_inline u8
26 nat44_ed_maximum_sessions_exceeded (snat_main_t * sm,
27 u32 fib_index, u32 thread_index)
30 translations = pool_elts (sm->per_thread_data[thread_index].sessions);
31 if (vec_len (sm->max_translations_per_fib) <= fib_index)
33 return translations >= sm->max_translations_per_fib[fib_index];
36 #endif /* included_nat44_inlines_h__ */
39 * fd.io coding-style-patch-verification: ON
42 * eval: (c-set-style "gnu")