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