FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
cnat_client.c
Go to the documentation of this file.
1 /*
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:
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 #include <vnet/fib/fib_table.h>
17 #include <vnet/dpo/drop_dpo.h>
18 
19 #include <cnat/cnat_client.h>
20 #include <cnat/cnat_translation.h>
21 
23 
25 
27 
30 {
31  return (FIB_NODE_INDEX_INVALID == cc->cc_fei);
32 }
33 
34 static void
36 {
37  if (ip_addr_version (&cc->cc_ip) == AF_IP4)
39  else
41 }
42 
43 static void
45 {
47 
50 
52  dpo_reset (&cc->cc_parent);
54 }
55 
56 void
57 cnat_client_free_by_ip (ip46_address_t * ip, u8 af)
58 {
59  cnat_client_t *cc;
60  cc = (AF_IP4 == af ?
62  ASSERT (NULL != cc);
63 
64  if (0 == cnat_client_uncnt_session (cc) && 0 == cc->tr_refcnt)
66 }
67 
68 void
70 {
71  /* This processes ips stored in the throttle pool
72  to update session refcounts
73  and should be called before cnat_client_free_by_ip */
74  cnat_client_t *cc;
75  ip_address_t *addr, *del_vec = NULL;
76  u32 refcnt;
77 
78  vec_reset_length (del_vec);
81  cc = (AF_IP4 == addr->version ? cnat_client_ip4_find (&ip_addr_v4 (addr)) :
82  cnat_client_ip6_find (&ip_addr_v6 (addr)));
83  /* Client might not already be created */
84  if (NULL != cc)
85  {
86  cnat_client_t *ccp = cnat_client_get (cc->parent_cci);
87  clib_atomic_add_fetch (&ccp->session_refcnt, refcnt);
88  vec_add1 (del_vec, *addr);
89  }
90  });
91  vec_foreach (addr, del_vec)
94 }
95 
96 void
98 {
99  cnat_client_t *cc;
100  if (INDEX_INVALID == cci)
101  return;
102 
103  cc = cnat_client_get (cci);
104  cc->tr_refcnt++;
105 }
106 
107 void
109 {
110  cnat_client_t *cc;
111  if (INDEX_INVALID == cci)
112  return;
113 
114  cc = cnat_client_get (cci);
115  cc->tr_refcnt--;
116 
117  if (0 == cc->tr_refcnt && 0 == cc->session_refcnt)
118  cnat_client_destroy (cc);
119 }
120 
121 static void
123 {
124  index_t cci;
125 
126  cci = cc - cnat_client_pool;
127 
128  if (ip_addr_version (&cc->cc_ip) == AF_IP4)
129  hash_set (cnat_client_db.crd_cip4, ip_addr_v4 (&cc->cc_ip).as_u32, cci);
130  else
132  &ip_addr_v6 (&cc->cc_ip), cci);
133 }
134 
135 
136 index_t
138 {
139  cnat_client_t *cc;
141  fib_node_index_t fei;
142  dpo_proto_t dproto;
143  fib_prefix_t pfx;
144  index_t cci;
145  u32 fib_flags;
146 
147  /* check again if we need this client */
148  cc = (AF_IP4 == ip->version ?
149  cnat_client_ip4_find (&ip->ip.ip4) :
150  cnat_client_ip6_find (&ip->ip.ip6));
151 
152  if (NULL != cc)
153  return (cc - cnat_client_pool);
154 
155 
157  cc->cc_locks = 1;
158  cci = cc - cnat_client_pool;
159  cc->parent_cci = cci;
160  cc->flags = flags;
161  cc->tr_refcnt = 0;
162  cc->session_refcnt = 0;
163 
164  ip_address_copy (&cc->cc_ip, ip);
165  cnat_client_db_add (cc);
166 
167  ip_address_to_fib_prefix (&cc->cc_ip, &pfx);
168 
169  dproto = fib_proto_to_dpo (pfx.fp_proto);
170  dpo_set (&tmp, cnat_client_dpo, dproto, cci);
171  dpo_stack (cnat_client_dpo, dproto, &cc->cc_parent, drop_dpo_get (dproto));
172 
174  fib_flags |= (flags & CNAT_FLAG_EXCLUSIVE) ?
176 
178  &pfx, cnat_fib_source, fib_flags,
179  &tmp);
180 
182  cc->cc_fei = fei;
183 
184  return (cci);
185 }
186 
187 void
189 {
190  /* RPC call to add a client from the dataplane */
191  index_t cci;
192  cnat_client_t *cc;
193  cci = cnat_client_add (addr, 0 /* flags */);
196  /* Process throttled calls if any */
198 }
199 
200 /**
201  * Interpose a policy DPO
202  */
203 static void
205  const dpo_id_t * parent, dpo_id_t * clone)
206 {
207  cnat_client_t *cc, *cc_clone;
208 
209  pool_get_zero (cnat_client_pool, cc_clone);
210  cc = cnat_client_get (original->dpoi_index);
211 
212  cc_clone->cc_fei = FIB_NODE_INDEX_INVALID;
213  cc_clone->parent_cci = cc->parent_cci;
214  cc_clone->flags = cc->flags;
215  ip_address_copy (&cc_clone->cc_ip, &cc->cc_ip);
216 
217  /* stack the clone on the FIB provided parent */
218  dpo_stack (cnat_client_dpo, original->dpoi_proto, &cc_clone->cc_parent,
219  parent);
220 
221  /* return the clone */
222  dpo_set (clone,
224  original->dpoi_proto, cc_clone - cnat_client_pool);
225 }
226 
227 int
229 {
230  int rv = 0, rrv = 0;
232  clib_warning ("len(crd_cip6) isnt 0 but %d", rv);
233  rrv |= rv;
235  clib_warning ("len(crd_cip4) isnt 0 but %d", rv);
236  rrv |= rv;
237  if ((rv = pool_elts (cnat_client_pool)))
238  clib_warning ("len(cnat_client_pool) isnt 0 but %d", rv);
239  rrv |= rv;
241  clib_warning ("len(throttle_mem) isnt 0 but %d", rv);
242  rrv |= rv;
243  return (rrv);
244 }
245 
246 u8 *
247 format_cnat_client (u8 * s, va_list * args)
248 {
249  index_t cci = va_arg (*args, index_t);
250  u32 indent = va_arg (*args, u32);
251 
253 
254  s = format (s, "[%d] cnat-client:[%U] tr:%d sess:%d", cci,
255  format_ip_address, &cc->cc_ip,
256  cc->tr_refcnt, cc->session_refcnt);
257 
258  if (cc->flags & CNAT_FLAG_EXCLUSIVE)
259  s = format (s, " exclusive");
260 
261  if (cnat_client_is_clone (cc))
262  s = format (s, "\n%Uclone of [%d]\n%U%U",
263  format_white_space, indent + 2, cc->parent_cci,
264  format_white_space, indent + 2,
265  format_dpo_id, &cc->cc_parent, indent + 4);
266 
267  return (s);
268 }
269 
270 
271 static clib_error_t *
273  unformat_input_t * input, vlib_cli_command_t * cmd)
274 {
275  index_t cci;
276 
277  cci = INDEX_INVALID;
278 
280  {
281  if (unformat (input, "%d", &cci))
282  ;
283  else
284  return (clib_error_return (0, "unknown input '%U'",
285  format_unformat_error, input));
286  }
287 
288  if (INDEX_INVALID == cci)
289  {
291  vlib_cli_output(vm, "%U", format_cnat_client, cci, 0);
292 
293  vlib_cli_output (vm, "%d clients", pool_elts (cnat_client_pool));
294  vlib_cli_output (vm, "%d timestamps", pool_elts (cnat_timestamps));
295  }
296  else
297  {
298  vlib_cli_output (vm, "Invalid policy ID:%d", cci);
299  }
300 
301  return (NULL);
302 }
303 
305  .path = "show cnat client",
306  .function = cnat_client_show,
307  .short_help = "show cnat client",
308  .is_mp_safe = 1,
309 };
310 
311 const static char *const cnat_client_dpo_ip4_nodes[] = {
312  "ip4-cnat-tx",
313  NULL,
314 };
315 
316 const static char *const cnat_client_dpo_ip6_nodes[] = {
317  "ip6-cnat-tx",
318  NULL,
319 };
320 
321 const static char *const *const cnat_client_dpo_nodes[DPO_PROTO_NUM] = {
324 };
325 
326 static void
328 {
329  cnat_client_t *cc;
330 
331  cc = cnat_client_get (dpo->dpoi_index);
332 
333  cc->cc_locks++;
334 }
335 
336 static void
338 {
339  cnat_client_t *cc;
340 
341  cc = cnat_client_get (dpo->dpoi_index);
342 
343  cc->cc_locks--;
344 
345  if (0 == cc->cc_locks)
346  {
348  dpo_reset (&cc->cc_parent);
350  }
351 }
352 
353 u8 *
354 format_cnat_client_dpo (u8 * s, va_list * ap)
355 {
356  index_t cci = va_arg (*ap, index_t);
357  u32 indent = va_arg (*ap, u32);
358 
359  s = format (s, "%U", format_cnat_client, cci, indent);
360 
361  return (s);
362 }
363 
366  .dv_unlock = cnat_client_dpo_unlock,
367  .dv_format = format_cnat_client_dpo,
368  .dv_mk_interpose = cnat_client_dpo_interpose,
369 };
370 
371 static clib_error_t *
373 {
376 
378  sizeof (ip6_address_t),
379  sizeof (uword));
380 
383  hash_create_mem (0, sizeof (ip_address_t), sizeof (uword));
384 
385  return (NULL);
386 }
387 
389 
390 /*
391  * fd.io coding-style-patch-verification: ON
392  *
393  * Local Variables:
394  * eval: (c-set-style "gnu")
395  * End:
396  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
clib_spinlock_init
static void clib_spinlock_init(clib_spinlock_t *p)
Definition: lock.h:65
ip_address
Definition: ip_types.h:79
cnat_client_ip6_find
static_always_inline cnat_client_t * cnat_client_ip6_find(const ip6_address_t *ip)
Find a client from an IP6 address.
Definition: cnat_client.h:179
tmp
u32 * tmp
Definition: interface_output.c:1078
cnat_translation.h
dpo_register_new_type
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
Definition: dpo.c:349
dpo_id_t_::dpoi_index
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:190
DPO_INVALID
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
Definition: dpo.h:204
fib_table_entry_special_dpo_add
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
Definition: fib_table.c:324
cnat_client_db_add
static void cnat_client_db_add(cnat_client_t *cc)
Definition: cnat_client.c:122
cnat_client_throttle_pool_process
void cnat_client_throttle_pool_process()
Definition: cnat_client.c:69
dpo_proto_t
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
format_cnat_client
u8 * format_cnat_client(u8 *s, va_list *args)
Definition: cnat_client.c:247
CNAT_FLAG_EXCLUSIVE
@ CNAT_FLAG_EXCLUSIVE
Definition: cnat_client.h:124
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
cnat_client_cnt_session
static_always_inline u32 cnat_client_cnt_session(cnat_client_t *cc)
Add a session refcnt to this client.
Definition: cnat_client.h:195
cnat_client_is_clone
static_always_inline u8 cnat_client_is_clone(cnat_client_t *cc)
Definition: cnat_client.c:29
pool_get_aligned
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
Definition: pool.h:249
cnat_client_learn
void cnat_client_learn(const ip_address_t *addr)
Called in the main thread by RPC from the workers to learn a new client.
Definition: cnat_client.c:188
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
vlib_cli_command_t::path
char * path
Definition: cli.h:96
FIB_NODE_INDEX_INVALID
#define FIB_NODE_INDEX_INVALID
Definition: fib_types.h:30
fib_table.h
ip_address_to_fib_prefix
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a IP address to a FIB prefix
Definition: ip_types.c:270
cnat_timestamps
cnat_timestamp_t * cnat_timestamps
Definition: cnat_types.c:20
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
cnat_client_ip4_find
static_always_inline cnat_client_t * cnat_client_ip4_find(const ip4_address_t *ip)
Find a client from an IP4 address.
Definition: cnat_client.h:150
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
AF_IP4
@ AF_IP4
Definition: ip_types.h:23
cnat_client_pool
cnat_client_t * cnat_client_pool
Definition: cnat_client.c:22
FIB_ENTRY_FLAG_EXCLUSIVE
@ FIB_ENTRY_FLAG_EXCLUSIVE
Definition: fib_entry.h:116
unformat_input_t
struct _unformat_input_t unformat_input_t
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
FIB_ENTRY_FLAG_INTERPOSE
@ FIB_ENTRY_FLAG_INTERPOSE
Definition: fib_entry.h:123
drop_dpo.h
cnat_client_translation_added
void cnat_client_translation_added(index_t cci)
A translation that references this VIP was added.
Definition: cnat_client.c:97
cnat_client_dpo_ip4_nodes
const static char *const cnat_client_dpo_ip4_nodes[]
Definition: cnat_client.c:311
cnat_client_t_::cc_ip
ip_address_t cc_ip
the client's IP address
Definition: cnat_client.h:42
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
cnat_client_t_::cc_parent
dpo_id_t cc_parent
How to send packets to this client post translation.
Definition: cnat_client.h:47
cnat_client_dpo_interpose
static void cnat_client_dpo_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Interpose a policy DPO.
Definition: cnat_client.c:204
cnat_client_t_::cc_locks
u32 cc_locks
number of DPO locks
Definition: cnat_client.h:57
FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT
@ FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT
Definition: fib_entry.h:120
hash_set
#define hash_set(h, key, value)
Definition: hash.h:255
ip_addr_version
#define ip_addr_version(_a)
Definition: ip_types.h:93
dpo_stack
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
Definition: dpo.c:535
cnat_client_dpo_ip6_nodes
const static char *const cnat_client_dpo_ip6_nodes[]
Definition: cnat_client.c:316
ip_addr_v6
#define ip_addr_v6(_a)
Definition: ip_types.h:92
cnat_client_t_::parent_cci
index_t parent_cci
Parent cnat_client index if cloned via interpose or own index if vanilla client.
Definition: cnat_client.h:74
cnat_client_destroy
static void cnat_client_destroy(cnat_client_t *cc)
Definition: cnat_client.c:44
cnat_client_t_::session_refcnt
u32 session_refcnt
Session refcount for cleanup.
Definition: cnat_client.h:67
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
clib_spinlock_lock
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
Definition: lock.h:82
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
static_always_inline
#define static_always_inline
Definition: clib.h:112
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
format_ip_address
u8 * format_ip_address(u8 *s, va_list *args)
Definition: ip_types.c:21
cnat_client_free_by_ip
void cnat_client_free_by_ip(ip46_address_t *ip, u8 af)
Definition: cnat_client.c:57
uword
u64 uword
Definition: types.h:112
hash_unset_mem_free
static void hash_unset_mem_free(uword **h, const void *key)
Definition: hash.h:295
hash_create_mem
#define hash_create_mem(elts, key_bytes, value_bytes)
Definition: hash.h:660
ip_addr_v4
#define ip_addr_v4(_a)
Definition: ip_types.h:91
dpo_type_t
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
hash_set_mem_alloc
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
Definition: hash.h:279
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
dpo_vft_t_::dv_lock
dpo_lock_fn_t dv_lock
A reference counting lock function.
Definition: dpo.h:428
format_cnat_client_dpo
u8 * format_cnat_client_dpo(u8 *s, va_list *ap)
Definition: cnat_client.c:354
cnat_client_db_t_::throttle_mem
uword * throttle_mem
Definition: cnat_client.h:141
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
cnat_client_db_t_::crd_cip6
uword * crd_cip6
Definition: cnat_client.h:136
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
dpo_id_t_::dpoi_proto
dpo_proto_t dpoi_proto
the data-path protocol of the type.
Definition: dpo.h:182
fib_proto_to_dpo
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
Definition: fib_types.c:343
cnat_client_db
cnat_client_db_t cnat_client_db
Definition: cnat_client.c:24
format_dpo_id
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
Definition: dpo.c:150
cnat_client_add
index_t cnat_client_add(const ip_address_t *ip, u8 flags)
Definition: cnat_client.c:137
hash_elts
static uword hash_elts(void *v)
Definition: hash.h:118
pool_foreach_index
#define pool_foreach_index(i, v)
Definition: pool.h:576
cnat_client_t_::tr_refcnt
u32 tr_refcnt
Translations refcount for cleanup.
Definition: cnat_client.h:62
fib_entry_is_sourced
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
Definition: fib_entry_src.c:139
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
cnat_client_dpo_nodes
const static char *const *const cnat_client_dpo_nodes[DPO_PROTO_NUM]
Definition: cnat_client.c:321
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
cnat_client_uncnt_session
static_always_inline u32 cnat_client_uncnt_session(cnat_client_t *cc)
Del a session refcnt to this client.
Definition: cnat_client.h:205
cnat_fib_source
fib_source_t cnat_fib_source
Definition: cnat_types.c:19
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
CNAT_FIB_TABLE
#define CNAT_FIB_TABLE
Definition: cnat_types.h:27
cnat_client_t_::cc_fei
fib_node_index_t cc_fei
the FIB entry this client sources
Definition: cnat_client.h:52
cnat_client.h
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
pool_elts
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:127
clib_spinlock_unlock
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
Definition: lock.h:121
fib_prefix_t_::fp_proto
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:211
cnat_client_dpo
dpo_type_t cnat_client_dpo
Definition: cnat_client.c:26
cnat_client_dpo_lock
static void cnat_client_dpo_lock(dpo_id_t *dpo)
Definition: cnat_client.c:327
hash_unset
#define hash_unset(h, key)
Definition: hash.h:261
cnat_client_purge
int cnat_client_purge(void)
Check all the clients were purged by translation & session purge.
Definition: cnat_client.c:228
cnat_client_get
static_always_inline cnat_client_t * cnat_client_get(index_t i)
Definition: cnat_client.h:91
vlib_main_t
Definition: main.h:102
drop_dpo_get
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
Definition: drop_dpo.c:25
dpo_vft_t_
A virtual function table regisitered for a DPO type.
Definition: dpo.h:423
pool_get_zero
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
Definition: pool.h:258
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
ip
vl_api_address_t ip
Definition: l2.api:558
cnat_client_db_remove
static void cnat_client_db_remove(cnat_client_t *cc)
Definition: cnat_client.c:35
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
cnat_client_show_cmd_node
static vlib_cli_command_t cnat_client_show_cmd_node
(constructor) VLIB_CLI_COMMAND (cnat_client_show_cmd_node)
Definition: cnat_client.c:304
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
cnat_client_t_::flags
u8 flags
Client flags.
Definition: cnat_client.h:79
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
rv
int __clib_unused rv
Definition: application.c:491
fib_table_entry_delete_index
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
Definition: fib_table.c:919
cnat_client_init
static clib_error_t * cnat_client_init(vlib_main_t *vm)
Definition: cnat_client.c:372
dpo_set
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
Definition: dpo.c:188
cnat_client_db_t_::crd_cip4
uword * crd_cip4
Definition: cnat_client.h:135
hash_foreach_mem
#define hash_foreach_mem(key_var, value_var, h, body)
Definition: hash.h:460
vlib_cli_command_t
Definition: cli.h:92
INDEX_INVALID
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
Definition: dpo.h:49
ip_address_copy
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
Definition: ip_types.c:133
cnat_client_t_
A client is a representation of an IP address behind the NAT.
Definition: cnat_client.h:35
cnat_client_dpo_unlock
static void cnat_client_dpo_unlock(dpo_id_t *dpo)
Definition: cnat_client.c:337
dpo_reset
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Definition: dpo.c:234
cnat_client_dpo_vft
const static dpo_vft_t cnat_client_dpo_vft
Definition: cnat_client.c:364
DPO_PROTO_NUM
#define DPO_PROTO_NUM
Definition: dpo.h:72
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
cnat_client_db_t_
DB of clients.
Definition: cnat_client.h:133
cnat_client_translation_deleted
void cnat_client_translation_deleted(index_t cci)
A translation that references this VIP was deleted.
Definition: cnat_client.c:108
format_white_space
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:129
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
cnat_client_show
static clib_error_t * cnat_client_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cnat_client.c:272
cnat_client_db_t_::throttle_lock
clib_spinlock_t throttle_lock
Definition: cnat_client.h:140
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105