FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip6_ioam_trace.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 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 <vpp/app/version.h>
19 
20 #include <vnet/ip/ip6.h>
21 #include <vnet/ip/ip6_hop_by_hop.h>
23 
24 #include <vppinfra/hash.h>
25 #include <vppinfra/error.h>
26 #include <vppinfra/elog.h>
27 #include <vnet/plugin/plugin.h>
28 
32 #include <ioam/udp-ping/udp_ping.h>
35 
36 /* Timestamp precision multipliers for seconds, milliseconds, microseconds
37  * and nanoseconds respectively.
38  */
39 static f64 trace_tsp_mul[4] = { 1, 1e3, 1e6, 1e9 };
40 
41 typedef union
42 {
44  u32 as_u32[2];
45 } time_u64_t;
46 
48 extern ip6_main_t ip6_main;
49 
50 #define foreach_ip6_hop_by_hop_ioam_trace_stats \
51  _(PROCESSED, "Pkts with ip6 hop-by-hop trace options") \
52  _(PROFILE_MISS, "Pkts with ip6 hop-by-hop trace options but no profile set") \
53  _(UPDATED, "Pkts with trace updated") \
54  _(FULL, "Pkts with trace options but no space") \
55  _(LOOPBACK, "Pkts with trace options Loopback") \
56  _(LOOPBACK_REPLY, "Pkts with trace options Loopback Reply")
57 
59 #define _(sym,string) string,
61 #undef _
62 };
63 
64 typedef enum
65 {
66 #define _(sym,str) IP6_IOAM_TRACE_##sym,
68 #undef _
71 
72 
73 typedef struct
74 {
75  /* stats */
77 
78  /* convenience */
82 
84 
85 always_inline void
87 {
89 
90  hm->counters[counter_index] += increment;
91 }
92 
93 
94 static u8 *
95 format_ioam_data_list_element (u8 * s, va_list * args)
96 {
97  u32 *elt = va_arg (*args, u32 *);
98  u8 *trace_type_p = va_arg (*args, u8 *);
99  u8 trace_type = *trace_type_p;
100 
101 
102  if (trace_type & BIT_TTL_NODEID)
103  {
104  u32 ttl_node_id_host_byte_order = clib_net_to_host_u32 (*elt);
105  s = format (s, "ttl 0x%x node id 0x%x ",
106  ttl_node_id_host_byte_order >> 24,
107  ttl_node_id_host_byte_order & 0x00FFFFFF);
108 
109  elt++;
110  }
111 
112  if (trace_type & BIT_ING_INTERFACE && trace_type & BIT_ING_INTERFACE)
113  {
114  u32 ingress_host_byte_order = clib_net_to_host_u32 (*elt);
115  s = format (s, "ingress 0x%x egress 0x%x ",
116  ingress_host_byte_order >> 16,
117  ingress_host_byte_order & 0xFFFF);
118  elt++;
119  }
120 
121  if (trace_type & BIT_TIMESTAMP)
122  {
123  u32 ts_in_host_byte_order = clib_net_to_host_u32 (*elt);
124  s = format (s, "ts 0x%x \n", ts_in_host_byte_order);
125  elt++;
126  }
127 
128  if (trace_type & BIT_APPDATA)
129  {
130  u32 appdata_in_host_byte_order = clib_net_to_host_u32 (*elt);
131  s = format (s, "app 0x%x ", appdata_in_host_byte_order);
132  elt++;
133  }
134 
135  return s;
136 }
137 
138 
139 int
141 {
142  u16 size = 0;
143  u8 trace_data_size = 0;
144  trace_profile *profile = NULL;
145 
146  *result = 0;
147 
148  profile = trace_profile_find ();
149 
150  if (PREDICT_FALSE (!profile))
151  {
152  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_PROFILE_MISS, 1);
153  return (-1);
154  }
155 
156  trace_data_size = fetch_trace_data_size (profile->trace_type);
157  if (PREDICT_FALSE (trace_data_size == 0))
158  return VNET_API_ERROR_INVALID_VALUE;
159 
160  if (PREDICT_FALSE (profile->num_elts * trace_data_size > 254))
161  return VNET_API_ERROR_INVALID_VALUE;
162 
163  size +=
164  sizeof (ioam_trace_option_t) + (profile->num_elts * trace_data_size);
165  *result = size;
166 
167  return 0;
168 }
169 
170 
171 
172 int
174  u8 * rewrite_size)
175 {
176  ioam_trace_option_t *trace_option = NULL;
177  u8 trace_data_size = 0;
178  u8 trace_option_elts = 0;
179  trace_profile *profile = NULL;
180 
181 
182  profile = trace_profile_find ();
183 
184  if (PREDICT_FALSE (!profile))
185  {
186  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_PROFILE_MISS, 1);
187  return (-1);
188  }
189 
190  if (PREDICT_FALSE (!rewrite_string))
191  return -1;
192 
193  trace_option_elts = profile->num_elts;
194  trace_data_size = fetch_trace_data_size (profile->trace_type);
195  trace_option = (ioam_trace_option_t *) rewrite_string;
196  trace_option->hdr.type = HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST |
198  trace_option->hdr.length = 2 /*ioam_trace_type,data_list_elts_left */ +
199  trace_option_elts * trace_data_size;
200  trace_option->trace_hdr.ioam_trace_type =
201  profile->trace_type & TRACE_TYPE_MASK;
202  trace_option->trace_hdr.data_list_elts_left = trace_option_elts;
203  *rewrite_size =
204  sizeof (ioam_trace_option_t) + (trace_option_elts * trace_data_size);
205 
206  return 0;
207 }
208 
209 always_inline void
211  ioam_trace_option_t * trace)
212 {
213  u32 buf_index;
215  vlib_buffer_t *b0;
216  vlib_frame_t *nf = 0;
217  u32 *to_next;
218  vlib_node_t *next_node;
219  ip6_header_t *ip6;
221  ioam_trace_option_t *opt;
222  udp_ping_t *udp;
223 
224  b0 = vlib_buffer_copy (hm->vlib_main, b);
225  if (b0 == NULL)
226  return;
227 
228  buf_index = vlib_get_buffer_index (hm->vlib_main, b0);
229  next_node = vlib_get_node_by_name (hm->vlib_main, (u8 *) "ip6-lookup");
230  nf = vlib_get_frame_to_node (hm->vlib_main, next_node->index);
231  nf->n_vectors = 0;
232  to_next = vlib_frame_vector_args (nf);
233 
234  vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;
235  vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
236 
238  hbh = (ip6_hop_by_hop_header_t *) (ip6 + 1);
239  opt = (ioam_trace_option_t *)
241 
242  udp = (udp_ping_t *) ((u8 *) hbh + ((hbh->length + 1) << 3));
245 
246  *to_next = buf_index;
247  nf->n_vectors++;
248  to_next++;
249 
250  vlib_put_frame_to_node (hm->vlib_main, next_node->index, nf);
251  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_LOOPBACK, 1);
252 }
253 
254 int
257 {
259  u8 elt_index = 0;
260  ioam_trace_option_t *trace = (ioam_trace_option_t *) opt;
261  u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX];
262  ip_adjacency_t *adj = adj_get (adj_index);
263  time_u64_t time_u64;
264  u32 *elt;
265  int rv = 0;
266  trace_profile *profile = NULL;
267 
268 
269  profile = trace_profile_find ();
270 
271  if (PREDICT_FALSE (!profile))
272  {
273  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_PROFILE_MISS, 1);
274  return (-1);
275  }
276 
277  /* Don't trace loopback reply packets */
278  if (trace->trace_hdr.ioam_trace_type & BIT_LOOPBACK_REPLY)
279  {
280  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_LOOPBACK_REPLY,
281  1);
282  return rv;
283  }
284 
285  time_u64.as_u64 = 0;
286 
287  if (PREDICT_TRUE (trace->trace_hdr.data_list_elts_left))
288  {
289  trace->trace_hdr.data_list_elts_left--;
290  /* fetch_trace_data_size returns in bytes. Convert it to 4-bytes
291  * to skip to this node's location.
292  */
293  elt_index =
294  trace->trace_hdr.data_list_elts_left *
295  fetch_trace_data_size (trace->trace_hdr.ioam_trace_type) / 4;
296  elt = &trace->trace_hdr.elts[elt_index];
297  if (trace->trace_hdr.ioam_trace_type & BIT_TTL_NODEID)
298  {
299  *elt =
300  clib_host_to_net_u32 ((ip->hop_limit << 24) | profile->node_id);
301  elt++;
302  }
303 
304  if (trace->trace_hdr.ioam_trace_type & BIT_ING_INTERFACE)
305  {
306  *elt =
307  (vnet_buffer (b)->sw_if_index[VLIB_RX] & 0xFFFF) << 16 |
308  (adj->rewrite_header.sw_if_index & 0xFFFF);
309  *elt = clib_host_to_net_u32 (*elt);
310  elt++;
311  }
312 
313  if (trace->trace_hdr.ioam_trace_type & BIT_TIMESTAMP)
314  {
315  /* Send least significant 32 bits */
316  f64 time_f64 =
317  (f64) (((f64) hm->unix_time_0) +
318  (vlib_time_now (hm->vlib_main) - hm->vlib_time_0));
319 
320  time_u64.as_u64 = time_f64 * trace_tsp_mul[profile->trace_tsp];
321  *elt = clib_host_to_net_u32 (time_u64.as_u32[0]);
322  elt++;
323  }
324 
325  if (trace->trace_hdr.ioam_trace_type & BIT_APPDATA)
326  {
327  /* $$$ set elt0->app_data */
328  *elt = clib_host_to_net_u32 (profile->app_data);
329  elt++;
330  }
331 
332 
333  if (PREDICT_FALSE (trace->trace_hdr.ioam_trace_type & BIT_LOOPBACK))
334  {
335  /* if loopback flag set then copy the packet
336  * and send it back to source */
338  }
339 
340  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_UPDATED, 1);
341  }
342  else
343  {
344  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_FULL, 1);
345  }
346  return (rv);
347 }
348 
349 u8 *
352 {
353  ioam_trace_option_t *trace;
354  u8 trace_data_size_in_words = 0;
355  u32 *elt;
356  int elt_index = 0;
357 
358  trace = (ioam_trace_option_t *) opt;
359  s =
360  format (s, " Trace Type 0x%x , %d elts left\n",
361  trace->trace_hdr.ioam_trace_type,
362  trace->trace_hdr.data_list_elts_left);
363  trace_data_size_in_words =
364  fetch_trace_data_size (trace->trace_hdr.ioam_trace_type) / 4;
365  elt = &trace->trace_hdr.elts[0];
366  while ((u8 *) elt <
367  ((u8 *) (&trace->trace_hdr.elts[0]) + trace->hdr.length - 2
368  /* -2 accounts for ioam_trace_type,elts_left */ ))
369  {
370  s = format (s, " [%d] %U\n", elt_index,
372  elt, &trace->trace_hdr.ioam_trace_type);
373  elt_index++;
374  elt += trace_data_size_in_words;
375  }
376  return (s);
377 }
378 
379 
380 static clib_error_t *
382  unformat_input_t * input,
383  vlib_cli_command_t * cmd)
384 {
386  u8 *s = 0;
387  int i = 0;
388 
389  for (i = 0; i < IP6_IOAM_TRACE_N_STATS; i++)
390  {
391  s =
393  hm->counters[i]);
394  }
395 
396  vlib_cli_output (vm, "%v", s);
397  vec_free (s);
398  return 0;
399 }
400 
401 
402 /* *INDENT-OFF* */
404  .path = "show ioam trace",
405  .short_help = "iOAM trace statistics",
406  .function = ip6_show_ioam_trace_cmd_fn,
407 };
408 /* *INDENT-ON* */
409 
410 /* *INDENT-OFF* */
412  .version = VPP_BUILD_VER,
413  .description = "Inbound Operations, Administration, and Maintenance (OAM)",
414 };
415 /* *INDENT-ON* */
416 
417 static clib_error_t *
419 {
421 
422  hm->vlib_main = vm;
423  hm->vnet_main = vnet_get_main ();
424  clib_memset (hm->counters, 0, sizeof (hm->counters));
425 
426 
431  return (clib_error_create
432  ("registration of HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST failed"));
433 
434 
436  sizeof (ioam_trace_option_t),
438  < 0)
439  return (clib_error_create
440  ("registration of HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST for rewrite failed"));
441 
442 
443  return (0);
444 }
445 
446 /* *INDENT-OFF* */
448 {
449  .runs_after = VLIB_INITS ("ip_main_init", "ip6_lookup_init",
450  "ip6_hop_by_hop_ioam_init"),
451 };
452 /* *INDENT-ON* */
453 
454 int
456 {
458 
460 
461  return 0;
462 
463 }
464 
465 
466 int
468 {
469  u32 trace_size = 0;
471 
472  trace_profile *profile = NULL;
473 
474 
475  profile = trace_profile_find ();
476 
477  if (PREDICT_FALSE (!profile))
478  {
479  ip6_ioam_trace_stats_increment_counter (IP6_IOAM_TRACE_PROFILE_MISS, 1);
480  return (-1);
481  }
482 
483 
484  if (ip6_ioam_trace_get_sizeof_handler (&trace_size) < 0)
485  return (-1);
486 
488 
489  return (0);
490 }
491 
492 /*
493  * fd.io coding-style-patch-verification: ON
494  *
495  * Local Variables:
496  * eval: (c-set-style "gnu")
497  * End:
498  */
vlib.h
vlib_frame_t::n_vectors
u16 n_vectors
Definition: node.h:387
udp_ping_t
Definition: udp_ping_packet.h:140
trace
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
Definition: vlib_api_cli.c:899
BIT_TIMESTAMP
#define BIT_TIMESTAMP
Definition: trace_util.h:92
vlib_buffer_copy
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
Definition: buffer_funcs.h:1081
elog.h
ip6_hop_by_hop_ioam_trace_init
static clib_error_t * ip6_hop_by_hop_ioam_trace_init(vlib_main_t *vm)
Definition: ip6_ioam_trace.c:418
trace_profile_find
static trace_profile * trace_profile_find(void)
Definition: trace_config.h:24
udp_ping_create_reply_from_probe_ip6
static void udp_ping_create_reply_from_probe_ip6(ip6_header_t *ip, ip6_hop_by_hop_header_t *hbh, udp_ping_t *udp)
Create and send ipv6 udp-ping response packet.
Definition: udp_ping_util.h:48
ip6_hop_by_hop_ioam_trace_main
ip6_hop_by_hop_ioam_trace_main_t ip6_hop_by_hop_ioam_trace_main
Definition: ip6_ioam_trace.c:83
vlib_cli_command_t::path
char * path
Definition: cli.h:96
foreach_ip6_hop_by_hop_ioam_trace_stats
#define foreach_ip6_hop_by_hop_ioam_trace_stats
Definition: ip6_ioam_trace.c:50
ip6_hop_by_hop_ioam_main_t
Definition: ip6_hop_by_hop.h:48
u16
unsigned short u16
Definition: types.h:57
udp_ping_util.h
ip6_hop_by_hop_ioam_main_t::vlib_main
vlib_main_t * vlib_main
Definition: ip6_hop_by_hop.h:96
ip6_hop_by_hop_packet.h
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
counter_index
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
Definition: drop.c:67
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
trace_profile_::num_elts
u8 num_elts
Definition: trace_util.h:45
ip6_hop_by_hop_option_t
Definition: ip6_hop_by_hop_packet.h:29
ip6_trace_profile_setup
int ip6_trace_profile_setup(void)
Definition: ip6_ioam_trace.c:467
unformat_input_t
struct _unformat_input_t unformat_input_t
trace_profile_::trace_tsp
u32 trace_tsp
Definition: trace_util.h:49
vlib_frame_t
Definition: node.h:372
vlib_get_frame_to_node
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
Definition: main.c:184
ip6_hop_by_hop_header_t
Definition: ip6_hop_by_hop_packet.h:18
trace_tsp_mul
static f64 trace_tsp_mul[4]
Definition: ip6_ioam_trace.c:39
VLIB_PLUGIN_REGISTER
VLIB_PLUGIN_REGISTER()
trace_profile_::node_id
u32 node_id
Definition: trace_util.h:47
trace_profile_
Usage:
Definition: trace_util.h:41
ip6_hbh_ioam_trace_set_bit
static void ip6_hbh_ioam_trace_set_bit(ioam_trace_option_t *trace, u8 trace_bit)
Definition: ip6_ioam_trace.h:32
ip6_hop_by_hop_ioam_trace_rewrite_handler
int ip6_hop_by_hop_ioam_trace_rewrite_handler(u8 *rewrite_string, u8 *rewrite_size)
Definition: ip6_ioam_trace.c:173
ip6_ioam_trace_stats_t
ip6_ioam_trace_stats_t
Definition: ip6_ioam_trace.c:64
IP6_IOAM_TRACE_N_STATS
@ IP6_IOAM_TRACE_N_STATS
Definition: ip6_ioam_trace.c:69
ip6_hbh_register_option
int ip6_hbh_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt), u8 *trace(u8 *s, ip6_hop_by_hop_option_t *opt))
Definition: ip6_forward.c:2731
vlib_put_frame_to_node
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
Definition: main.c:218
clib_error_create
#define clib_error_create(args...)
Definition: error.h:96
trace_util.h
vlib_node_t::index
u32 index
Definition: node.h:269
error.h
ip6_hop_by_hop.h
ip6_hbh_get_option
static ip6_hop_by_hop_option_t * ip6_hbh_get_option(ip6_hop_by_hop_header_t *hbh0, u8 option_to_search)
Definition: ip6_hop_by_hop.h:241
ip6_show_ioam_trace_cmd_fn
static clib_error_t * ip6_show_ioam_trace_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip6_ioam_trace.c:381
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vlib_get_buffer_index
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
Definition: buffer_funcs.h:324
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
ip6_hop_by_hop_ioam_trace_main_t::vnet_main
vnet_main_t * vnet_main
Definition: ip6_ioam_trace.c:80
ip6_hop_by_hop_ioam_trace_main_t::counters
u64 counters[ARRAY_LEN(ip6_hop_by_hop_ioam_trace_stats_strings)]
Definition: ip6_ioam_trace.c:76
ip6_ioam_trace_stats_increment_counter
static void ip6_ioam_trace_stats_increment_counter(u32 counter_index, u64 increment)
Definition: ip6_ioam_trace.c:86
ip6_show_ioam_trace_cmd
static vlib_cli_command_t ip6_show_ioam_trace_cmd
(constructor) VLIB_CLI_COMMAND (ip6_show_ioam_trace_cmd)
Definition: ip6_ioam_trace.c:403
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
f64
double f64
Definition: types.h:142
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
TRACE_TYPE_MASK
#define TRACE_TYPE_MASK
Definition: trace_util.h:96
ip6_ioam_trace.h
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
plugin.h
ip6_main
ip6_main_t ip6_main
Definition: ip6_forward.c:2787
ip6_hop_by_hop_ioam_main
ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main
Definition: ip6_hop_by_hop.c:45
trace_profile_::app_data
u32 app_data
Definition: trace_util.h:48
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
size
u32 size
Definition: vhost_user.h:125
ip6_hbh_ioam_loopback_handler
static void ip6_hbh_ioam_loopback_handler(vlib_buffer_t *b, ip6_header_t *ip, ioam_trace_option_t *trace)
Definition: ip6_ioam_trace.c:210
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
time_u64_t::as_u32
u32 as_u32[2]
Definition: ip6_ioam_trace.c:44
vlib_get_node_by_name
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
Definition: node.c:45
BIT_LOOPBACK_REPLY
#define BIT_LOOPBACK_REPLY
Definition: trace_util.h:95
u64
unsigned long u64
Definition: types.h:89
ip6_hbh_ioam_trace_data_list_handler
int ip6_hbh_ioam_trace_data_list_handler(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt)
Definition: ip6_ioam_trace.c:255
format
description fragment has unexpected format
Definition: map.api:433
ip6_hop_by_hop_ioam_trace_stats_strings
static char * ip6_hop_by_hop_ioam_trace_stats_strings[]
Definition: ip6_ioam_trace.c:58
trace_config.h
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
ip6
vl_api_ip6_address_t ip6
Definition: one.api:424
ip6_hop_by_hop_header_t::length
u8 length
Definition: ip6_hop_by_hop_packet.h:26
udp_ping_packet.h
BIT_ING_INTERFACE
#define BIT_ING_INTERFACE
Definition: trace_util.h:90
format_ioam_data_list_element
static u8 * format_ioam_data_list_element(u8 *s, va_list *args)
Definition: ip6_ioam_trace.c:95
ip6_header_t
Definition: ip6_packet.h:294
elt
app_rx_mq_elt_t * elt
Definition: application.c:488
ip6_main_t
Definition: ip6.h:110
ip6_hop_by_hop_ioam_main_t::unix_time_0
u32 unix_time_0
Definition: ip6_hop_by_hop.h:63
ip6_trace_profile_cleanup
int ip6_trace_profile_cleanup(void)
Definition: ip6_ioam_trace.c:455
HBH_OPTION_TYPE_DATA_CHANGE_ENROUTE
#define HBH_OPTION_TYPE_DATA_CHANGE_ENROUTE
Definition: ip6_hop_by_hop_packet.h:37
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
time_u64_t::as_u64
u64 as_u64
Definition: ip6_ioam_trace.c:43
VLIB_INITS
#define VLIB_INITS(...)
Definition: init.h:352
hash.h
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
BIT_APPDATA
#define BIT_APPDATA
Definition: trace_util.h:93
ip
vl_api_address_t ip
Definition: l2.api:558
trace_profile_::trace_type
u8 trace_type
Definition: trace_util.h:44
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
ip6_hop_by_hop_ioam_trace_main_t::vlib_main
vlib_main_t * vlib_main
Definition: ip6_ioam_trace.c:79
rv
int __clib_unused rv
Definition: application.c:491
udp_ping.h
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
ip6_hop_by_hop_ioam_main_t::options_size
u8 options_size[MAX_IP6_HBH_OPTION]
Definition: ip6_hop_by_hop.h:80
vnet.h
time_u64_t
Definition: ip6_ioam_trace.c:41
ip6_hop_by_hop_ioam_main_t::vlib_time_0
f64 vlib_time_0
Definition: ip6_hop_by_hop.h:64
vlib_cli_command_t
Definition: cli.h:92
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
ip6.h
ip6_hbh_ioam_trace_data_list_trace_handler
u8 * ip6_hbh_ioam_trace_data_list_trace_handler(u8 *s, ip6_hop_by_hop_option_t *opt)
Definition: ip6_ioam_trace.c:350
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
fetch_trace_data_size
static u8 fetch_trace_data_size(u16 trace_type)
Definition: trace_util.h:209
ip6_hbh_add_register_option
int ip6_hbh_add_register_option(u8 option, u8 size, int rewrite_options(u8 *rewrite_string, u8 *rewrite_size))
Definition: ip6_hop_by_hop.c:102
adj_get
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Definition: adj.h:470
ip6_hop_by_hop_ioam_trace_main_t
Definition: ip6_ioam_trace.c:73
BIT_LOOPBACK
#define BIT_LOOPBACK
Definition: trace_util.h:94
HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST
#define HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST
Definition: ip6_hop_by_hop_packet.h:44
BIT_TTL_NODEID
#define BIT_TTL_NODEID
Definition: trace_util.h:89
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
ip6_ioam_trace_get_sizeof_handler
int ip6_ioam_trace_get_sizeof_handler(u32 *result)
Definition: ip6_ioam_trace.c:140