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 #ifndef __included_nat44_ei_inlines_h__
17 #define __included_nat44_ei_inlines_h__
19 #include <nat/nat44-ei/nat44_ei_ha.h>
21 static_always_inline u8
22 nat44_ei_maximum_sessions_exceeded (snat_main_t *sm, u32 thread_index)
24 if (pool_elts (sm->per_thread_data[thread_index].sessions) >=
25 sm->max_translations_per_thread)
31 nat44_ei_session_update_counters (snat_session_t *s, f64 now, uword bytes,
36 s->total_bytes += bytes;
37 nat_ha_sref (&s->out2in.addr, s->out2in.port, &s->ext_host_addr,
38 s->ext_host_port, s->nat_proto, s->out2in.fib_index,
39 s->total_pkts, s->total_bytes, thread_index,
40 &s->ha_last_refreshed, now);
43 #endif /* __included_nat44_ei_inlines_h__ */
46 * fd.io coding-style-patch-verification: ON
49 * eval: (c-set-style "gnu")