FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
node.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 <vlib/vlib.h>
16 #include <vnet/vnet.h>
17 #include <vppinfra/error.h>
18 #include <srv6-ad/ad.h>
19 
20 
21 /******************************* Packet tracing *******************************/
22 
23 typedef struct
24 {
27 
28 typedef struct
29 {
33 
34 static u8 *
35 format_srv6_ad_localsid_trace (u8 * s, va_list * args)
36 {
37  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
38  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
40 
41  return format (s, "SRv6-AD-localsid: localsid_index %d", t->localsid_index);
42 }
43 
44 static u8 *
45 format_srv6_ad_rewrite_trace (u8 * s, va_list * args)
46 {
47  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
48  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
49  srv6_ad_rewrite_trace_t *t = va_arg (*args, srv6_ad_rewrite_trace_t *);
50 
51  if (PREDICT_FALSE (t->error != 0))
52  {
53  return format (s, "SRv6-AD-rewrite: cache is empty");
54  }
55 
56  return format (s, "SRv6-AD-rewrite: src %U dst %U",
58 }
59 
60 
61 /***************************** Nodes registration *****************************/
62 
65 
66 
67 /****************************** Packet counters *******************************/
68 
69 #define foreach_srv6_ad_rewrite_counter \
70 _(PROCESSED, "srv6-ad rewritten packets") \
71 _(NO_RW, "(Error) No header for rewriting.")
72 
73 typedef enum
74 {
75 #define _(sym,str) SRV6_AD_REWRITE_COUNTER_##sym,
77 #undef _
80 
82 #define _(sym,string) string,
84 #undef _
85 };
86 
87 
88 /********************************* Next nodes *********************************/
89 
90 typedef enum
91 {
97 
98 typedef enum
99 {
104 
105 
106 /******************************* Local SID node *******************************/
107 
108 /**
109  * @brief Function doing SRH processing for AD behavior
110  */
113  ip6_header_t * ip0,
114  ip6_sr_header_t * sr0,
115  ip6_sr_localsid_t * ls0, u32 * next0)
116 {
117  ip6_address_t *new_dst0;
118  u16 total_size;
119  ip6_ext_header_t *next_ext_header;
120  u8 next_hdr;
121  srv6_ad_localsid_t *ls0_mem;
122 
123  if (PREDICT_FALSE (ip0->protocol != IP_PROTOCOL_IPV6_ROUTE ||
124  sr0->type != ROUTING_HEADER_TYPE_SR))
125  {
126  return;
127  }
128 
129  if (PREDICT_FALSE (sr0->segments_left == 0))
130  {
131  return;
132  }
133 
134  /* Decrement Segments Left and update Destination Address */
135  sr0->segments_left -= 1;
136  new_dst0 = (ip6_address_t *) (sr0->segments) + sr0->segments_left;
137  ip0->dst_address.as_u64[0] = new_dst0->as_u64[0];
138  ip0->dst_address.as_u64[1] = new_dst0->as_u64[1];
139 
140  /* Compute the total size of the IPv6 header and extensions */
141  total_size = sizeof (ip6_header_t);
142  next_ext_header = (ip6_ext_header_t *) (ip0 + 1);
143  next_hdr = ip0->protocol;
144 
145  while (ip6_ext_hdr (next_hdr))
146  {
147  total_size += ip6_ext_header_len (next_ext_header);
148  next_hdr = next_ext_header->next_hdr;
149  next_ext_header = ip6_ext_next_header (next_ext_header);
150  }
151 
152  /* Make sure next header is IP */
153  if (PREDICT_FALSE
154  (next_hdr != IP_PROTOCOL_IPV6 && next_hdr != IP_PROTOCOL_IP_IN_IP))
155  {
156  return;
157  }
158 
159  /* Retrieve SID memory */
160  ls0_mem = ls0->plugin_mem;
161 
162  /* Cache IP header and extensions */
163  if (PREDICT_FALSE (total_size > ls0_mem->rw_len))
164  {
165  vec_validate (ls0_mem->rewrite, total_size - 1);
166  }
167  clib_memcpy (ls0_mem->rewrite, ip0, total_size);
168  ls0_mem->rw_len = total_size;
169 
170  /* Remove IP header and extensions */
171  vlib_buffer_advance (b0, total_size);
172 
173  /* Set Xconnect adjacency to VNF */
174  vnet_buffer (b0)->ip.adj_index[VLIB_TX] = ls0_mem->nh_adj;
175 
176  if (ls0_mem->ip_version == DA_IP4)
178  else if (ls0_mem->ip_version == DA_IP6)
180 }
181 
182 /**
183  * @brief SRv6 AD Localsid graph node
184  */
185 static uword
187  vlib_node_runtime_t * node, vlib_frame_t * frame)
188 {
189  ip6_sr_main_t *sm = &sr_main;
190  u32 n_left_from, next_index, *from, *to_next;
191  u32 cnt_packets = 0;
192 
193  from = vlib_frame_vector_args (frame);
194  n_left_from = frame->n_vectors;
195  next_index = node->cached_next_index;
196 
197  u32 thread_index = vm->thread_index;
198 
199  while (n_left_from > 0)
200  {
201  u32 n_left_to_next;
202 
203  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
204 
205  /* TODO: Dual/quad loop */
206 
207  while (n_left_from > 0 && n_left_to_next > 0)
208  {
209  u32 bi0;
210  vlib_buffer_t *b0;
211  ip6_header_t *ip0 = 0;
212  ip6_sr_header_t *sr0;
213  ip6_sr_localsid_t *ls0;
215 
216  bi0 = from[0];
217  to_next[0] = bi0;
218  from += 1;
219  to_next += 1;
220  n_left_from -= 1;
221  n_left_to_next -= 1;
222 
223  b0 = vlib_get_buffer (vm, bi0);
224  ip0 = vlib_buffer_get_current (b0);
225  sr0 = (ip6_sr_header_t *) (ip0 + 1);
226 
227  /* Lookup the SR End behavior based on IP DA (adj) */
228  ls0 = pool_elt_at_index (sm->localsids,
229  vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
230 
231  /* SRH processing */
232  end_ad_processing (b0, ip0, sr0, ls0, &next0);
233 
234  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
235  {
237  vlib_add_trace (vm, node, b0, sizeof *tr);
238  tr->localsid_index = ls0 - sm->localsids;
239  }
240 
241  /* This increments the SRv6 per LocalSID counters. */
244  &(sm->sr_ls_invalid_counters) :
245  &(sm->sr_ls_valid_counters)),
246  thread_index, ls0 - sm->localsids,
248  b0));
249 
250  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
251  n_left_to_next, bi0, next0);
252 
253  cnt_packets++;
254  }
255 
256  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
257  }
258 
259  return frame->n_vectors;
260 }
261 
262 /* *INDENT-OFF* */
264  .function = srv6_ad_localsid_fn,
265  .name = "srv6-ad-localsid",
266  .vector_size = sizeof (u32),
267  .format_trace = format_srv6_ad_localsid_trace,
268  .type = VLIB_NODE_TYPE_INTERNAL,
269  .n_next_nodes = SRV6_AD_LOCALSID_N_NEXT,
270  .next_nodes = {
271  [SRV6_AD_LOCALSID_NEXT_REWRITE4] = "ip4-rewrite",
272  [SRV6_AD_LOCALSID_NEXT_REWRITE6] = "ip6-rewrite",
273  [SRV6_AD_LOCALSID_NEXT_ERROR] = "error-drop",
274  },
275 };
276 /* *INDENT-ON* */
277 
278 
279 /******************************* Rewriting node *******************************/
280 
281 /**
282  * @brief Graph node for applying a SR policy into an IPv6 packet. Encapsulation
283  */
284 static uword
286  vlib_node_runtime_t * node, vlib_frame_t * frame)
287 {
288  ip6_sr_main_t *srm = &sr_main;
290  u32 n_left_from, next_index, *from, *to_next;
291  u32 cnt_packets = 0;
292 
293  from = vlib_frame_vector_args (frame);
294  n_left_from = frame->n_vectors;
295  next_index = node->cached_next_index;
296 
297  while (n_left_from > 0)
298  {
299  u32 n_left_to_next;
300 
301  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
302 
303  /* TODO: Dual/quad loop */
304 
305  while (n_left_from > 0 && n_left_to_next > 0)
306  {
307  u32 bi0;
308  vlib_buffer_t *b0;
309  ip4_header_t *ip0_encap = 0;
310  ip6_header_t *ip0 = 0;
311  ip6_sr_localsid_t *ls0;
312  srv6_ad_localsid_t *ls0_mem;
314  u16 new_l0 = 0;
315 
316  bi0 = from[0];
317  to_next[0] = bi0;
318  from += 1;
319  to_next += 1;
320  n_left_from -= 1;
321  n_left_to_next -= 1;
322 
323  b0 = vlib_get_buffer (vm, bi0);
324  ip0_encap = vlib_buffer_get_current (b0);
325  ls0 = pool_elt_at_index (srm->localsids,
327  (b0)->sw_if_index
328  [VLIB_RX]]);
329  ls0_mem = ls0->plugin_mem;
330 
331  if (PREDICT_FALSE (ls0_mem == NULL || ls0_mem->rewrite == NULL))
332  {
334  b0->error = node->errors[SRV6_AD_REWRITE_COUNTER_NO_RW];
335  }
336  else
337  {
339  (ls0_mem->rw_len + b0->current_data));
340 
341  clib_memcpy (((u8 *) ip0_encap) - ls0_mem->rw_len,
342  ls0_mem->rewrite, ls0_mem->rw_len);
343  vlib_buffer_advance (b0, -(word) ls0_mem->rw_len);
344 
345  ip0 = vlib_buffer_get_current (b0);
346 
347  /* Update inner IPv4 TTL and checksum */
348  u32 checksum0;
349  ip0_encap->ttl -= 1;
350  checksum0 = ip0_encap->checksum + clib_host_to_net_u16 (0x0100);
351  checksum0 += checksum0 >= 0xffff;
352  ip0_encap->checksum = checksum0;
353 
354  /* Update outer IPv6 length (in case it has changed) */
355  new_l0 = ls0_mem->rw_len - sizeof (ip6_header_t) +
356  clib_net_to_host_u16 (ip0_encap->length);
357  ip0->payload_length = clib_host_to_net_u16 (new_l0);
358  }
359 
360  if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
361  PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
362  {
364  vlib_add_trace (vm, node, b0, sizeof *tr);
365  tr->error = 0;
366 
367  if (next0 == SRV6_AD_REWRITE_NEXT_ERROR)
368  {
369  tr->error = 1;
370  }
371  else
372  {
374  sizeof tr->src.as_u8);
376  sizeof tr->dst.as_u8);
377  }
378  }
379 
380  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
381  n_left_to_next, bi0, next0);
382 
383  cnt_packets++;
384  }
385 
386  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
387  }
388 
389  /* Update counters */
391  SRV6_AD_REWRITE_COUNTER_PROCESSED,
392  cnt_packets);
393 
394  return frame->n_vectors;
395 }
396 
397 /* *INDENT-OFF* */
399  .function = srv6_ad4_rewrite_fn,
400  .name = "srv6-ad4-rewrite",
401  .vector_size = sizeof (u32),
402  .format_trace = format_srv6_ad_rewrite_trace,
403  .type = VLIB_NODE_TYPE_INTERNAL,
404  .n_errors = SRV6_AD_REWRITE_N_COUNTERS,
405  .error_strings = srv6_ad_rewrite_counter_strings,
406  .n_next_nodes = SRV6_AD_REWRITE_N_NEXT,
407  .next_nodes = {
408  [SRV6_AD_REWRITE_NEXT_LOOKUP] = "ip6-lookup",
409  [SRV6_AD_REWRITE_NEXT_ERROR] = "error-drop",
410  },
411 };
412 /* *INDENT-ON* */
413 
414 
415 /**
416  * @brief Graph node for applying a SR policy into an IPv6 packet. Encapsulation
417  */
418 static uword
420  vlib_node_runtime_t * node, vlib_frame_t * frame)
421 {
422  ip6_sr_main_t *srm = &sr_main;
424  u32 n_left_from, next_index, *from, *to_next;
425  u32 cnt_packets = 0;
426 
427  from = vlib_frame_vector_args (frame);
428  n_left_from = frame->n_vectors;
429  next_index = node->cached_next_index;
430 
431  while (n_left_from > 0)
432  {
433  u32 n_left_to_next;
434 
435  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
436 
437  /* TODO: Dual/quad loop */
438 
439  while (n_left_from > 0 && n_left_to_next > 0)
440  {
441  u32 bi0;
442  vlib_buffer_t *b0;
443  ip6_header_t *ip0 = 0, *ip0_encap = 0;
444  ip6_sr_localsid_t *ls0;
445  srv6_ad_localsid_t *ls0_mem;
447  u16 new_l0 = 0;
448 
449  bi0 = from[0];
450  to_next[0] = bi0;
451  from += 1;
452  to_next += 1;
453  n_left_from -= 1;
454  n_left_to_next -= 1;
455 
456  b0 = vlib_get_buffer (vm, bi0);
457  ip0_encap = vlib_buffer_get_current (b0);
458  ls0 = pool_elt_at_index (srm->localsids,
460  (b0)->sw_if_index
461  [VLIB_RX]]);
462  ls0_mem = ls0->plugin_mem;
463 
464  if (PREDICT_FALSE (ls0_mem == NULL || ls0_mem->rewrite == NULL))
465  {
467  b0->error = node->errors[SRV6_AD_REWRITE_COUNTER_NO_RW];
468  }
469  else
470  {
472  (ls0_mem->rw_len + b0->current_data));
473 
474  clib_memcpy (((u8 *) ip0_encap) - ls0_mem->rw_len,
475  ls0_mem->rewrite, ls0_mem->rw_len);
476  vlib_buffer_advance (b0, -(word) ls0_mem->rw_len);
477 
478  ip0 = vlib_buffer_get_current (b0);
479 
480  /* Update inner IPv6 hop limit */
481  ip0_encap->hop_limit -= 1;
482 
483  /* Update outer IPv6 length (in case it has changed) */
484  new_l0 = ls0_mem->rw_len +
485  clib_net_to_host_u16 (ip0_encap->payload_length);
486  ip0->payload_length = clib_host_to_net_u16 (new_l0);
487  }
488 
489  if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
490  PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
491  {
493  vlib_add_trace (vm, node, b0, sizeof *tr);
494  tr->error = 0;
495 
496  if (next0 == SRV6_AD_REWRITE_NEXT_ERROR)
497  {
498  tr->error = 1;
499  }
500  else
501  {
503  sizeof tr->src.as_u8);
505  sizeof tr->dst.as_u8);
506  }
507  }
508 
509  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
510  n_left_to_next, bi0, next0);
511 
512  cnt_packets++;
513  }
514 
515  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
516  }
517 
518  /* Update counters */
520  SRV6_AD_REWRITE_COUNTER_PROCESSED,
521  cnt_packets);
522 
523  return frame->n_vectors;
524 }
525 
526 /* *INDENT-OFF* */
528  .function = srv6_ad6_rewrite_fn,
529  .name = "srv6-ad6-rewrite",
530  .vector_size = sizeof (u32),
531  .format_trace = format_srv6_ad_rewrite_trace,
532  .type = VLIB_NODE_TYPE_INTERNAL,
533  .n_errors = SRV6_AD_REWRITE_N_COUNTERS,
534  .error_strings = srv6_ad_rewrite_counter_strings,
535  .n_next_nodes = SRV6_AD_REWRITE_N_NEXT,
536  .next_nodes = {
537  [SRV6_AD_REWRITE_NEXT_LOOKUP] = "ip6-lookup",
538  [SRV6_AD_REWRITE_NEXT_ERROR] = "error-drop",
539  },
540 };
541 /* *INDENT-ON* */
542 
543 /*
544 * fd.io coding-style-patch-verification: ON
545 *
546 * Local Variables:
547 * eval: (c-set-style "gnu")
548 * End:
549 */
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:437
ip6_sr_main_t sr_main
Definition: sr.c:31
#define CLIB_UNUSED(x)
Definition: clib.h:79
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
Definition: counter.h:213
SR LocalSID.
Definition: sr.h:102
u8 as_u8[16]
Definition: ip6_packet.h:48
u64 as_u64[2]
Definition: ip6_packet.h:51
#define NULL
Definition: clib.h:55
u32 * sw_iface_localsid4
Retrieve local SID from iface.
Definition: ad.h:40
#define VLIB_BUFFER_PRE_DATA_SIZE
Definition: buffer.h:52
u32 thread_index
Definition: main.h:179
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
Definition: ip6_packet.h:494
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
#define ROUTING_HEADER_TYPE_SR
Definition: sr_packet.h:116
vlib_node_registration_t srv6_ad6_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_ad6_rewrite_node)
Definition: node.c:64
vlib_error_t * errors
Vector of errors for this node.
Definition: node.h:451
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
vlib_combined_counter_main_t sr_ls_invalid_counters
Definition: sr.h:229
vlib_combined_counter_main_t sr_ls_valid_counters
Definition: sr.h:228
ip6_address_t src_address
Definition: ip6_packet.h:347
unsigned char u8
Definition: types.h:56
#define DA_IP4
Definition: ad.h:26
static uword srv6_ad_localsid_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
SRv6 AD Localsid graph node.
Definition: node.c:186
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
Definition: buffer.h:104
#define static_always_inline
Definition: clib.h:93
#define DA_IP6
Definition: ad.h:27
i64 word
Definition: types.h:111
u8 ip_version
Definition: ad.h:53
unsigned int u32
Definition: types.h:88
u32 nh_adj
Adjacency index for out.
Definition: ad.h:52
static u8 * format_srv6_ad_localsid_trace(u8 *s, va_list *args)
Definition: node.c:35
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:464
static uword srv6_ad6_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying a SR policy into an IPv6 packet.
Definition: node.c:419
unsigned short u16
Definition: types.h:57
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:202
u32 rw_len
Number of bits to be rewritten.
Definition: ad.h:56
#define PREDICT_FALSE(x)
Definition: clib.h:105
u8 * rewrite
Headers to be rewritten.
Definition: ad.h:57
#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
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:1168
#define ip6_ext_header_len(p)
Definition: ip6_packet.h:490
vlib_node_registration_t srv6_ad_localsid_node
(constructor) VLIB_REGISTER_NODE (srv6_ad_localsid_node)
Definition: node.c:263
ip6_sr_localsid_t * localsids
Definition: sr.h:204
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:153
u16 n_vectors
Definition: node.h:380
format_function_t format_ip6_address
Definition: format.h:99
vlib_main_t * vm
Definition: buffer.c:294
static u8 * format_srv6_ad_rewrite_trace(u8 *s, va_list *args)
Definition: node.c:45
ip6_address_t src
Definition: node.c:31
#define foreach_srv6_ad_rewrite_counter
Definition: node.c:69
#define clib_memcpy(a, b, c)
Definition: string.h:75
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
static u8 ip6_ext_hdr(u8 nexthdr)
Definition: ip6_packet.h:478
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)
ip6_address_t dst
Definition: node.c:31
void * plugin_mem
Memory to be used by the plugin callback functions.
Definition: sr.h:124
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:215
srv6_ad_rewrite_counters
Definition: node.c:73
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
Definition: defs.h:47
srv6_ad_localsid_next_t
Definition: node.c:90
srv6_ad_rewrite_next_t
Definition: node.c:98
u32 * sw_iface_localsid6
Retrieve local SID from iface.
Definition: ad.h:41
u16 payload_length
Definition: ip6_packet.h:338
static uword srv6_ad4_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying a SR policy into an IPv6 packet.
Definition: node.c:285
ip6_address_t segments[0]
Definition: sr_packet.h:148
srv6_ad_main_t srv6_ad_main
Definition: ad.h:60
u64 uword
Definition: types.h:112
static char * srv6_ad_rewrite_counter_strings[]
Definition: node.c:81
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:267
#define vnet_buffer(b)
Definition: buffer.h:360
Segment Routing main datastructure.
Definition: sr.h:189
u16 flags
Copy of main node flags.
Definition: node.h:486
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:295
vlib_node_registration_t srv6_ad4_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_ad4_rewrite_node)
Definition: node.c:63
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_always_inline void end_ad_processing(vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, ip6_sr_localsid_t *ls0, u32 *next0)
Function doing SRH processing for AD behavior.
Definition: node.c:112
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
Definition: defs.h:46
ip6_address_t dst_address
Definition: ip6_packet.h:347