FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
dslite_in2out.c
Go to the documentation of this file.
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 #include <nat/dslite.h>
16 
19 
20 typedef enum
21 {
28 
29 static char *dslite_in2out_error_strings[] = {
30 #define _(sym,string) string,
32 #undef _
33 };
34 
35 static u32
37  dslite_session_t ** sp, u32 next, u8 * error, u32 thread_index)
38 {
39  dslite_b4_t *b4;
40  clib_bihash_kv_16_8_t b4_kv, b4_value;
41  clib_bihash_kv_24_8_t in2out_kv;
42  clib_bihash_kv_8_8_t out2in_kv;
43  dlist_elt_t *head_elt, *oldest_elt, *elt;
44  u32 oldest_index;
45  dslite_session_t *s;
46  snat_session_key_t out2in_key;
47  u32 address_index;
48 
49  out2in_key.protocol = in2out_key->proto;
50  out2in_key.fib_index = 0;
51 
52  b4_kv.key[0] = in2out_key->softwire_id.as_u64[0];
53  b4_kv.key[1] = in2out_key->softwire_id.as_u64[1];
54 
55  if (clib_bihash_search_16_8
56  (&dm->per_thread_data[thread_index].b4_hash, &b4_kv, &b4_value))
57  {
58  pool_get (dm->per_thread_data[thread_index].b4s, b4);
59  memset (b4, 0, sizeof (*b4));
60  b4->addr.as_u64[0] = in2out_key->softwire_id.as_u64[0];
61  b4->addr.as_u64[1] = in2out_key->softwire_id.as_u64[1];
62 
63  pool_get (dm->per_thread_data[thread_index].list_pool, head_elt);
65  head_elt - dm->per_thread_data[thread_index].list_pool;
66  clib_dlist_init (dm->per_thread_data[thread_index].list_pool,
68 
69  b4_kv.value = b4 - dm->per_thread_data[thread_index].b4s;
70  clib_bihash_add_del_16_8 (&dm->per_thread_data[thread_index].b4_hash,
71  &b4_kv, 1);
72  }
73  else
74  {
75  b4 =
76  pool_elt_at_index (dm->per_thread_data[thread_index].b4s,
77  b4_value.value);
78  }
79 
80  //TODO configurable quota
81  if (b4->nsessions >= 1000)
82  {
83  oldest_index =
86  ASSERT (oldest_index != ~0);
87  clib_dlist_addtail (dm->per_thread_data[thread_index].list_pool,
88  b4->sessions_per_b4_list_head_index, oldest_index);
89  oldest_elt =
90  pool_elt_at_index (dm->per_thread_data[thread_index].list_pool,
91  oldest_index);
92  s =
93  pool_elt_at_index (dm->per_thread_data[thread_index].sessions,
94  oldest_elt->value);
95 
96  in2out_kv.key[0] = s->in2out.as_u64[0];
97  in2out_kv.key[1] = s->in2out.as_u64[1];
98  in2out_kv.key[2] = s->in2out.as_u64[2];
99  clib_bihash_add_del_24_8 (&dm->per_thread_data[thread_index].in2out,
100  &in2out_kv, 0);
101  out2in_kv.key = s->out2in.as_u64;
102  clib_bihash_add_del_8_8 (&dm->per_thread_data[thread_index].out2in,
103  &out2in_kv, 0);
105  &s->out2in,
106  s->outside_address_index);
107  s->outside_address_index = ~0;
108 
110  (dm->addr_pool, 0, thread_index, &out2in_key,
111  &s->outside_address_index, dm->port_per_thread, thread_index))
112  ASSERT (0);
113  }
114  else
115  {
117  (dm->addr_pool, 0, thread_index, &out2in_key, &address_index,
118  dm->port_per_thread, thread_index))
119  {
120  *error = DSLITE_ERROR_OUT_OF_PORTS;
122  }
123  pool_get (dm->per_thread_data[thread_index].sessions, s);
124  memset (s, 0, sizeof (*s));
125  s->outside_address_index = address_index;
126  b4->nsessions++;
127 
128  pool_get (dm->per_thread_data[thread_index].list_pool, elt);
129  clib_dlist_init (dm->per_thread_data[thread_index].list_pool,
130  elt - dm->per_thread_data[thread_index].list_pool);
131  elt->value = s - dm->per_thread_data[thread_index].sessions;
132  s->per_b4_index = elt - dm->per_thread_data[thread_index].list_pool;
133  s->per_b4_list_head_index = b4->sessions_per_b4_list_head_index;
134  clib_dlist_addtail (dm->per_thread_data[thread_index].list_pool,
135  s->per_b4_list_head_index,
136  elt - dm->per_thread_data[thread_index].list_pool);
137  }
138 
139  s->in2out = *in2out_key;
140  s->out2in = out2in_key;
141  *sp = s;
142  in2out_kv.key[0] = s->in2out.as_u64[0];
143  in2out_kv.key[1] = s->in2out.as_u64[1];
144  in2out_kv.key[2] = s->in2out.as_u64[2];
145  in2out_kv.value = s - dm->per_thread_data[thread_index].sessions;
146  clib_bihash_add_del_24_8 (&dm->per_thread_data[thread_index].in2out,
147  &in2out_kv, 1);
148  out2in_kv.key = s->out2in.as_u64;
149  out2in_kv.value = s - dm->per_thread_data[thread_index].sessions;
150  clib_bihash_add_del_8_8 (&dm->per_thread_data[thread_index].out2in,
151  &out2in_kv, 1);
152 
153  return next;
154 }
155 
156 static inline u32
158  ip4_header_t * ip4, dslite_session_t ** sp, u32 next,
159  u8 * error, u32 thread_index)
160 {
161  dslite_session_t *s = 0;
162  icmp46_header_t *icmp = ip4_next_header (ip4);
163  clib_bihash_kv_24_8_t kv, value;
165  u32 n = next;
166  icmp_echo_header_t *echo;
167  u32 new_addr, old_addr;
168  u16 old_id, new_id;
169  ip_csum_t sum;
170 
171  if (icmp_is_error_message (icmp))
172  {
174  *error = DSLITE_ERROR_BAD_ICMP_TYPE;
175  goto done;
176  }
177 
178  echo = (icmp_echo_header_t *) (icmp + 1);
179 
180  key.addr = ip4->src_address;
181  key.port = echo->identifier;
182  key.proto = SNAT_PROTOCOL_ICMP;
183  key.softwire_id.as_u64[0] = ip6->src_address.as_u64[0];
184  key.softwire_id.as_u64[1] = ip6->src_address.as_u64[1];
185  key.pad = 0;
186  kv.key[0] = key.as_u64[0];
187  kv.key[1] = key.as_u64[1];
188  kv.key[2] = key.as_u64[2];
189 
190  if (clib_bihash_search_24_8
191  (&dm->per_thread_data[thread_index].in2out, &kv, &value))
192  {
193  n = slow_path (dm, &key, &s, next, error, thread_index);
195  goto done;
196  }
197  else
198  {
199  s =
200  pool_elt_at_index (dm->per_thread_data[thread_index].sessions,
201  value.value);
202  }
203 
204  old_addr = ip4->src_address.as_u32;
205  ip4->src_address = s->out2in.addr;
206  new_addr = ip4->src_address.as_u32;
207  sum = ip4->checksum;
208  sum = ip_csum_update (sum, old_addr, new_addr, ip4_header_t, src_address);
209  ip4->checksum = ip_csum_fold (sum);
210 
211  old_id = echo->identifier;
212  echo->identifier = new_id = s->out2in.port;
213  sum = icmp->checksum;
214  sum = ip_csum_update (sum, old_id, new_id, icmp_echo_header_t, identifier);
215  icmp->checksum = ip_csum_fold (sum);
216 
217 done:
218  *sp = s;
219  return n;
220 }
221 
222 static inline uword
224  vlib_frame_t * frame, u8 is_slow_path)
225 {
226  u32 n_left_from, *from, *to_next;
227  dslite_in2out_next_t next_index;
228  u32 node_index;
229  vlib_node_runtime_t *error_node;
230  u32 thread_index = vlib_get_thread_index ();
231  f64 now = vlib_time_now (vm);
232  dslite_main_t *dm = &dslite_main;
233 
234  node_index =
235  is_slow_path ? dslite_in2out_slowpath_node.
236  index : dslite_in2out_node.index;
237 
238  error_node = vlib_node_get_runtime (vm, node_index);
239 
240  from = vlib_frame_vector_args (frame);
241  n_left_from = frame->n_vectors;
242  next_index = node->cached_next_index;
243 
244  while (n_left_from > 0)
245  {
246  u32 n_left_to_next;
247 
248  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
249 
250  while (n_left_from > 0 && n_left_to_next > 0)
251  {
252  u32 bi0;
253  vlib_buffer_t *b0;
255  ip4_header_t *ip40;
256  ip6_header_t *ip60;
257  u8 error0 = DSLITE_ERROR_IN2OUT;
258  u32 proto0;
259  dslite_session_t *s0 = 0;
260  clib_bihash_kv_24_8_t kv0, value0;
262  udp_header_t *udp0;
263  tcp_header_t *tcp0;
264  ip_csum_t sum0;
265  u32 new_addr0, old_addr0;
266  u16 old_port0, new_port0;
267 
268  /* speculatively enqueue b0 to the current next frame */
269  bi0 = from[0];
270  to_next[0] = bi0;
271  from += 1;
272  to_next += 1;
273  n_left_from -= 1;
274  n_left_to_next -= 1;
275 
276  b0 = vlib_get_buffer (vm, bi0);
277  ip60 = vlib_buffer_get_current (b0);
278 
279  if (PREDICT_FALSE (ip60->protocol != IP_PROTOCOL_IP_IN_IP))
280  {
281  if (ip60->protocol == IP_PROTOCOL_ICMP6)
282  {
284  goto trace0;
285  }
286  error0 = DSLITE_ERROR_BAD_IP6_PROTOCOL;
287  next0 = DSLITE_IN2OUT_NEXT_DROP;
288  goto trace0;
289  }
290 
291  ip40 = vlib_buffer_get_current (b0) + sizeof (ip6_header_t);
292  proto0 = ip_proto_to_snat_proto (ip40->protocol);
293 
294  if (PREDICT_FALSE (proto0 == ~0))
295  {
296  error0 = DSLITE_ERROR_UNSUPPORTED_PROTOCOL;
297  next0 = DSLITE_IN2OUT_NEXT_DROP;
298  goto trace0;
299  }
300 
301  udp0 = ip4_next_header (ip40);
302  tcp0 = (tcp_header_t *) udp0;
303 
304  if (is_slow_path)
305  {
306  if (PREDICT_FALSE (proto0 == SNAT_PROTOCOL_ICMP))
307  {
308  next0 =
309  dslite_icmp_in2out (dm, ip60, ip40, &s0, next0, &error0,
310  thread_index);
311  if (PREDICT_FALSE (next0 == DSLITE_IN2OUT_NEXT_DROP))
312  goto trace0;
313 
314  goto accounting0;
315  }
316  }
317  else
318  {
319  if (PREDICT_FALSE (proto0 == SNAT_PROTOCOL_ICMP))
320  {
322  goto trace0;
323  }
324  }
325 
326  key0.addr = ip40->src_address;
327  key0.port = udp0->src_port;
328  key0.proto = proto0;
329  key0.softwire_id.as_u64[0] = ip60->src_address.as_u64[0];
330  key0.softwire_id.as_u64[1] = ip60->src_address.as_u64[1];
331  key0.pad = 0;
332  kv0.key[0] = key0.as_u64[0];
333  kv0.key[1] = key0.as_u64[1];
334  kv0.key[2] = key0.as_u64[2];
335 
336  if (clib_bihash_search_24_8
337  (&dm->per_thread_data[thread_index].in2out, &kv0, &value0))
338  {
339  if (is_slow_path)
340  {
341  next0 =
342  slow_path (dm, &key0, &s0, next0, &error0, thread_index);
343  if (PREDICT_FALSE (next0 == DSLITE_IN2OUT_NEXT_DROP))
344  goto trace0;
345  }
346  else
347  {
349  goto trace0;
350  }
351  }
352  else
353  {
354  s0 =
355  pool_elt_at_index (dm->per_thread_data[thread_index].sessions,
356  value0.value);
357  }
358 
359  old_addr0 = ip40->src_address.as_u32;
360  ip40->src_address = s0->out2in.addr;
361  new_addr0 = ip40->src_address.as_u32;
362  sum0 = ip40->checksum;
363  sum0 =
364  ip_csum_update (sum0, old_addr0, new_addr0, ip4_header_t,
365  src_address);
366  ip40->checksum = ip_csum_fold (sum0);
367  if (PREDICT_TRUE (proto0 == SNAT_PROTOCOL_TCP))
368  {
369  old_port0 = tcp0->src_port;
370  tcp0->src_port = s0->out2in.port;
371  new_port0 = tcp0->src_port;
372 
373  sum0 = tcp0->checksum;
374  sum0 =
375  ip_csum_update (sum0, old_addr0, new_addr0, ip4_header_t,
376  dst_address);
377  sum0 =
378  ip_csum_update (sum0, old_port0, new_port0, ip4_header_t,
379  length);
380  tcp0->checksum = ip_csum_fold (sum0);
381  }
382  else
383  {
384  old_port0 = udp0->src_port;
385  udp0->src_port = s0->out2in.port;
386  udp0->checksum = 0;
387  }
388 
389  accounting0:
390  /* Accounting */
391  s0->last_heard = now;
392  s0->total_pkts++;
393  s0->total_bytes += vlib_buffer_length_in_chain (vm, b0);
394  /* Per-B4 LRU list maintenance */
395  clib_dlist_remove (dm->per_thread_data[thread_index].list_pool,
396  s0->per_b4_index);
397  clib_dlist_addtail (dm->per_thread_data[thread_index].list_pool,
398  s0->per_b4_list_head_index, s0->per_b4_index);
399 
400  ip40->tos =
401  (clib_net_to_host_u32
402  (ip60->ip_version_traffic_class_and_flow_label) & 0x0ff00000) >>
403  20;
404  vlib_buffer_advance (b0, sizeof (ip6_header_t));
405 
406  trace0:
408  && (b0->flags & VLIB_BUFFER_IS_TRACED)))
409  {
410  dslite_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
411  t->next_index = next0;
412  t->session_index = ~0;
413  if (s0)
414  t->session_index =
415  s0 - dm->per_thread_data[thread_index].sessions;
416  }
417 
418  b0->error = error_node->errors[error0];
419 
420  /* verify speculative enqueue, maybe switch current next frame */
421  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
422  n_left_to_next, bi0, next0);
423  }
424  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
425  }
426 
427  return frame->n_vectors;
428 }
429 
430 static uword
432  vlib_frame_t * frame)
433 {
434  return dslite_in2out_node_fn_inline (vm, node, frame, 0);
435 }
436 
437 /* *INDENT-OFF* */
439  .function = dslite_in2out_node_fn,
440  .name = "dslite-in2out",
441  .vector_size = sizeof (u32),
442  .format_trace = format_dslite_trace,
443  .type = VLIB_NODE_TYPE_INTERNAL,
445  .error_strings = dslite_in2out_error_strings,
446  .n_next_nodes = DSLITE_IN2OUT_N_NEXT,
447  /* edit / add dispositions here */
448  .next_nodes = {
449  [DSLITE_IN2OUT_NEXT_DROP] = "error-drop",
450  [DSLITE_IN2OUT_NEXT_IP4_LOOKUP] = "ip4-lookup",
451  [DSLITE_IN2OUT_NEXT_IP6_ICMP] = "ip6-icmp-input",
452  [DSLITE_IN2OUT_NEXT_SLOWPATH] = "dslite-in2out-slowpath",
453  },
454 };
455 /* *INDENT-ON* */
456 
458 
459 static uword
461  vlib_frame_t * frame)
462 {
463  return dslite_in2out_node_fn_inline (vm, node, frame, 1);
464 }
465 
466 /* *INDENT-OFF* */
468  .function = dslite_in2out_slowpath_node_fn,
469  .name = "dslite-in2out-slowpath",
470  .vector_size = sizeof (u32),
471  .format_trace = format_dslite_trace,
472  .type = VLIB_NODE_TYPE_INTERNAL,
474  .error_strings = dslite_in2out_error_strings,
475  .n_next_nodes = DSLITE_IN2OUT_N_NEXT,
476  /* edit / add dispositions here */
477  .next_nodes = {
478  [DSLITE_IN2OUT_NEXT_DROP] = "error-drop",
479  [DSLITE_IN2OUT_NEXT_IP4_LOOKUP] = "ip4-lookup",
480  [DSLITE_IN2OUT_NEXT_IP6_ICMP] = "ip6-lookup",
481  [DSLITE_IN2OUT_NEXT_SLOWPATH] = "dslite-in2out-slowpath",
482  },
483 };
484 /* *INDENT-ON* */
485 
488 
489 /*
490  * fd.io coding-style-patch-verification: ON
491  *
492  * Local Variables:
493  * eval: (c-set-style "gnu")
494  * End:
495  */
static void clib_dlist_init(dlist_elt_t *pool, u32 index)
Definition: dlist.h:36
ip4_address_t src_address
Definition: ip4_packet.h:164
u16 port_per_thread
Definition: dslite.h:87
u8 * format_dslite_trace(u8 *s, va_list *args)
Definition: dslite.c:146
#define PREDICT_TRUE(x)
Definition: clib.h:106
u64 as_u64[2]
Definition: ip6_packet.h:51
dslite_in2out_next_t
Definition: dslite_in2out.c:20
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:224
struct _vlib_node_registration vlib_node_registration_t
uword ip_csum_t
Definition: ip_packet.h:90
vlib_error_t * errors
Vector of errors for this node.
Definition: node.h:415
u32 session_index
Definition: dslite.h:93
clib_bihash_16_8_t b4_hash
Definition: dslite.h:67
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:107
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:225
struct _tcp_header tcp_header_t
ip6_address_t src_address
Definition: ip6_packet.h:341
u16 identifier
Definition: nat.h:474
static uword dslite_in2out_node_fn_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_slow_path)
static u32 slow_path(dslite_main_t *dm, dslite_session_key_t *in2out_key, dslite_session_t **sp, u32 next, u8 *error, u32 thread_index)
Definition: dslite_in2out.c:36
ip6_address_t addr
Definition: dslite.h:55
static void * ip4_next_header(ip4_header_t *i)
Definition: ip4_packet.h:233
static char * dslite_in2out_error_strings[]
Definition: dslite_in2out.c:29
dlist_elt_t * list_pool
Definition: dslite.h:76
clib_bihash_8_8_t out2in
Definition: dslite.h:63
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:459
u64 key
the key
Definition: bihash_8_8.h:35
static void clib_dlist_addtail(dlist_elt_t *pool, u32 head_index, u32 new_index)
Definition: dlist.h:43
u16 protocol
Definition: nat.h:50
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:195
#define PREDICT_FALSE(x)
Definition: clib.h:105
snat_address_t * addr_pool
Definition: dslite.h:84
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definition: buffer_node.h:218
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:364
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:113
u64 value
the value
Definition: bihash_8_8.h:36
u16 n_vectors
Definition: node.h:344
void snat_free_outside_address_and_port(snat_address_t *addresses, u32 thread_index, snat_session_key_t *k, u32 address_index)
Definition: nat.c:1741
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:221
vlib_main_t * vm
Definition: buffer.c:283
#define VLIB_BUFFER_IS_TRACED
Definition: buffer.h:93
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
Definition: node_funcs.h:89
VLIB_NODE_FUNCTION_MULTIARCH(dslite_in2out_node, dslite_in2out_node_fn)
dslite_main_t dslite_main
Definition: dslite.c:19
8 octet key, 8 octet key value pair
Definition: bihash_8_8.h:33
#define ARRAY_LEN(x)
Definition: clib.h:59
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
Definition: main.c:454
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
Definition: node.h:456
#define ASSERT(truth)
static u32 dslite_icmp_in2out(dslite_main_t *dm, ip6_header_t *ip6, ip4_header_t *ip4, dslite_session_t **sp, u32 next, u8 *error, u32 thread_index)
u32 nsessions
Definition: dslite.h:57
unsigned int u32
Definition: types.h:88
static uword dslite_in2out_slowpath_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u32 ip_proto_to_snat_proto(u8 ip_proto)
Definition: nat.h:479
static uword dslite_in2out_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:208
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:259
static void clib_dlist_remove(dlist_elt_t *pool, u32 index)
Definition: dlist.h:99
dslite_b4_t * b4s
Definition: dslite.h:70
u32 value
Definition: dlist.h:32
u64 uword
Definition: types.h:112
dslite_per_thread_data_t * per_thread_data
Definition: dslite.h:83
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
u32 ip_version_traffic_class_and_flow_label
Definition: ip6_packet.h:328
unsigned short u16
Definition: types.h:57
u32 next_index
Definition: dslite.h:92
int snat_alloc_outside_address_and_port(snat_address_t *addresses, u32 fib_index, u32 thread_index, snat_session_key_t *k, u32 *address_indexp, u16 port_per_thread, u32 snat_thread_index)
Definition: nat.c:1873
double f64
Definition: types.h:142
unsigned char u8
Definition: types.h:56
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:267
#define ip_csum_update(sum, old, new, type, field)
Definition: ip_packet.h:139
ip6_address_t softwire_id
Definition: dslite.h:29
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:143
dslite_session_t * sessions
Definition: dslite.h:73
vlib_node_registration_t dslite_in2out_node
(constructor) VLIB_REGISTER_NODE (dslite_in2out_node)
Definition: dslite_in2out.c:17
vlib_node_registration_t dslite_in2out_slowpath_node
(constructor) VLIB_REGISTER_NODE (dslite_in2out_slowpath_node)
Definition: dslite_in2out.c:18
#define foreach_dslite_error
Definition: dslite.h:96
u16 flags
Copy of main node flags.
Definition: node.h:450
clib_bihash_24_8_t in2out
Definition: dslite.h:64
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:75
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:57
u32 sessions_per_b4_list_head_index
Definition: dslite.h:56
static u16 ip_csum_fold(ip_csum_t c)
Definition: ip_packet.h:145
ip4_address_t addr
Definition: dslite.h:30
u16 fib_index
Definition: nat.h:50
static_always_inline u8 icmp_is_error_message(icmp46_header_t *icmp)
Definition: nat.h:569
static u32 clib_dlist_remove_head(dlist_elt_t *pool, u32 head_index)
Definition: dlist.h:117