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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <vnet/vnet.h>
17 #include <vlib/vlib.h>
18 #include <vlibapi/api.h>
19 #include <vlibmemory/api.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/ip/ip6_hop_by_hop.h>
23 #include <ioam/encap/ip6_ioam_trace.h>
24 #include <ioam/encap/ip6_ioam_e2e.h>
25 #include <ioam/udp-ping/udp_ping_packet.h>
26 #include <ioam/udp-ping/udp_ping.h>
27 #include <ioam/udp-ping/udp_ping_util.h>
28 #include <vnet/srv6/sr_packet.h>
34 UDP_PING_NEXT_UDP_LOOKUP,
36 UDP_PING_NEXT_IP6_LOOKUP,
37 UDP_PING_NEXT_IP6_DROP,
41 #define foreach_udp_ping_error \
42 _(BADHBH, "Malformed hop-by-hop header")
46 #define _(sym,str) UDP_PING_ERROR_##sym,
47 foreach_udp_ping_error
52 static char *udp_ping_error_strings[] = {
53 #define _(sym,string) string,
54 foreach_udp_ping_error
58 udp_ping_main_t udp_ping_main;
61 udp_ping_process (vlib_main_t * vm,
62 vlib_node_runtime_t * rt, vlib_frame_t * f);
65 ip6_hbh_ioam_trace_data_list_handler (vlib_buffer_t * b, ip6_header_t * ip,
66 ip6_hop_by_hop_option_t * opt);
79 /* packet trace format function */
81 format_udp_ping_trace (u8 * s, va_list * args)
83 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
84 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
85 udp_ping_trace_t *t = va_arg (*args, udp_ping_trace_t *);
87 s = format (s, "udp-ping-local: src %U, dst %U, src_port %u, dst_port %u "
88 "handle %u, next_index %u, msg_type %u",
89 format_ip6_address, &t->src,
90 format_ip6_address, &t->dst,
91 t->src_port, t->dst_port,
92 t->handle, t->next_index, t->msg_type);
96 VLIB_REGISTER_NODE (udp_ping_node, static) =
98 .function = udp_ping_process,
99 .type = VLIB_NODE_TYPE_PROCESS,
100 .name = "udp-ping-process",
104 udp_ping_calculate_timer_interval (void)
107 ip46_udp_ping_flow *flow = NULL;
108 u16 min_interval = 0x1e9;
110 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
112 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
115 flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
117 if (min_interval > flow->udp_data.interval)
118 min_interval = flow->udp_data.interval;
121 if (udp_ping_main.timer_interval != min_interval)
123 udp_ping_main.timer_interval = min_interval;
124 vlib_process_signal_event (udp_ping_main.vlib_main,
125 udp_ping_node.index, EVENT_SIG_RECHECK, 0);
130 ip46_udp_ping_set_flow (ip46_address_t src, ip46_address_t dst,
131 u16 start_src_port, u16 end_src_port,
132 u16 start_dst_port, u16 end_dst_port,
133 u16 interval, u8 fault_det, u8 is_disable)
136 ip46_udp_ping_flow *flow = NULL;
139 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
141 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
144 flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
145 if ((0 == udp_ping_compare_flow (src, dst,
146 start_src_port, end_src_port,
147 start_dst_port, end_dst_port, flow)))
159 cur_interval = flow->udp_data.interval;
160 udp_ping_free_flow_data (flow);
161 pool_put_index (udp_ping_main.ip46_flow, i);
162 if (udp_ping_main.timer_interval == interval)
163 udp_ping_calculate_timer_interval ();
167 cur_interval = flow->udp_data.interval;
168 flow->udp_data.interval = interval;
169 if (udp_ping_main.timer_interval > interval)
171 udp_ping_main.timer_interval = interval;
172 vlib_process_signal_event (udp_ping_main.vlib_main,
174 EVENT_SIG_RECHECK, 0);
176 else if (udp_ping_main.timer_interval == cur_interval)
177 udp_ping_calculate_timer_interval ();
182 /* Delete operation and item not found */
186 /* Alloc new session */
187 pool_get_aligned (udp_ping_main.ip46_flow, flow, CLIB_CACHE_LINE_BYTES);
188 udp_ping_populate_flow (src, dst,
189 start_src_port, end_src_port,
190 start_dst_port, end_dst_port,
191 interval, fault_det, flow);
193 udp_ping_create_rewrite (flow, (flow - udp_ping_main.ip46_flow));
195 if (udp_ping_main.timer_interval > interval)
197 udp_ping_main.timer_interval = interval;
198 vlib_process_signal_event (udp_ping_main.vlib_main,
199 udp_ping_node.index, EVENT_SIG_RECHECK, 0);
205 unformat_port_range (unformat_input_t * input, va_list * args)
207 u16 *start_port, *end_port;
209 u8 colon_present = 0;
211 start_port = va_arg (*args, u16 *);
212 end_port = va_arg (*args, u16 *);
214 *start_port = *end_port = 0;
216 while ((c = unformat_get_input (input)) != UNFORMAT_END_OF_INPUT)
221 *start_port = ((*start_port) * 10) + (c - '0');
240 while ((c = unformat_get_input (input)) != UNFORMAT_END_OF_INPUT)
245 *end_port = ((*end_port) * 10) + (c - '0');
253 if (end_port < start_port)
259 static clib_error_t *
260 set_udp_ping_command_fn (vlib_main_t * vm,
261 unformat_input_t * input, vlib_cli_command_t * cmd)
263 ip46_address_t dst, src;
264 u16 start_src_port, end_src_port;
265 u16 start_dst_port, end_dst_port;
270 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
273 (input, "src %U", unformat_ip46_address, &src, IP46_TYPE_ANY))
275 else if (unformat (input, "src-port-range %U",
276 unformat_port_range, &start_src_port, &end_src_port))
280 (input, "dst %U", unformat_ip46_address, &dst, IP46_TYPE_ANY))
282 else if (unformat (input, "dst-port-range %U",
283 unformat_port_range, &start_dst_port, &end_dst_port))
285 else if (unformat (input, "interval %d", &interval))
287 else if (unformat (input, "fault-detect"))
289 else if (unformat (input, "disable"))
295 ip46_udp_ping_set_flow (src, dst, start_src_port, end_src_port,
296 start_dst_port, end_dst_port, (u16) interval,
297 fault_det, is_disable);
302 VLIB_CLI_COMMAND (set_udp_ping_command, static) =
304 .path = "set udp-ping",
306 "set udp-ping src <local IPv6 address> src-port-range <local port range> \
307 dst <remote IPv6 address> dst-port-range <destination port range> \
308 interval <time interval in sec for which ping packet will be sent> \
310 .function = set_udp_ping_command_fn,
313 static clib_error_t *
314 show_udp_ping_summary_cmd_fn (vlib_main_t * vm,
315 unformat_input_t * input,
316 vlib_cli_command_t * cmd)
320 ip46_udp_ping_flow *ip46_flow;
321 u16 src_port, dst_port;
322 udp_ping_flow_data *stats;
324 s = format (s, "UDP-Ping data:\n");
326 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
328 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
331 ip46_flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
332 s = format (s, "Src: %U, Dst: %U\n",
333 format_ip46_address, &ip46_flow->src, IP46_TYPE_ANY,
334 format_ip46_address, &ip46_flow->dst, IP46_TYPE_ANY);
336 s = format (s, "Start src port: %u, End src port: %u\n",
337 ip46_flow->udp_data.start_src_port,
338 ip46_flow->udp_data.end_src_port);
339 s = format (s, "Start dst port: %u, End dst port: %u\n",
340 ip46_flow->udp_data.start_dst_port,
341 ip46_flow->udp_data.end_dst_port);
342 s = format (s, "Interval: %u\n", ip46_flow->udp_data.interval);
345 for (src_port = ip46_flow->udp_data.start_src_port;
346 src_port <= ip46_flow->udp_data.end_src_port; src_port++)
348 for (dst_port = ip46_flow->udp_data.start_dst_port;
349 dst_port <= ip46_flow->udp_data.end_dst_port; dst_port++)
351 stats = ip46_flow->udp_data.stats + j;
353 format (s, "\nSrc Port - %u, Dst Port - %u, Flow CTX - %u\n",
354 src_port, dst_port, stats->flow_ctx);
356 format (s, "Path State - %s\n",
357 (stats->retry > MAX_PING_RETRIES) ? "Down" : "Up");
358 s = format (s, "Path Data:\n");
359 s = print_analyse_flow (s,
360 &ip46_flow->udp_data.
361 stats[j].analyse_data);
365 s = format (s, "\n\n");
368 vlib_cli_output (vm, "%v", s);
373 VLIB_CLI_COMMAND (show_udp_ping_cmd, static) =
375 .path = "show udp-ping summary",
376 .short_help = "Summary of udp-ping",
377 .function = show_udp_ping_summary_cmd_fn,
381 * @brief UDP-Ping Process node.
382 * @node udp-ping-process
384 * This is process node which wakes up when periodically to send
385 * out udp probe packets for all configured sessions.
387 * @param vm vlib_main_t corresponding to the current thread.
388 * @param rt vlib_node_runtime_t data for this node.
389 * @param f vlib_frame_t whose contents should be dispatched.
393 udp_ping_process (vlib_main_t * vm,
394 vlib_node_runtime_t * rt, vlib_frame_t * f)
397 uword *event_data = 0;
399 ip46_udp_ping_flow *ip46_flow;
403 vec_reset_length (event_data);
404 vlib_process_wait_for_event_or_clock (vm, udp_ping_main.timer_interval);
405 (void) vlib_process_get_events (vm, &event_data);
406 now = vlib_time_now (vm);
408 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
410 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
413 ip46_flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
414 if (ip46_flow->udp_data.next_send_time < now)
415 udp_ping_send_ip6_pak (udp_ping_main.vlib_main, ip46_flow);
422 * @brief HopByHop analyse function for udp-ping response.
424 * Walks through all hbh options present in udp-ping response
425 * and uses analyser library for the analysis.
429 udp_ping_analyse_hbh (vlib_buffer_t * b0,
433 ip6_hop_by_hop_option_t * opt0,
434 ip6_hop_by_hop_option_t * limit0, u16 len)
437 ip46_udp_ping_flow *ip46_flow;
439 ioam_analyser_data_t *data;
440 ioam_e2e_option_t *e2e;
441 ioam_trace_option_t *trace;
443 /* If the packet doesnt match UDP session then return */
444 if (PREDICT_FALSE (pool_is_free_index (udp_ping_main.ip46_flow, flow_id)))
447 ip46_flow = udp_ping_main.ip46_flow + flow_id;
448 /* Check port is within range */
449 if (PREDICT_FALSE ((src_port < ip46_flow->udp_data.start_src_port) ||
450 (src_port > ip46_flow->udp_data.end_src_port) ||
451 (dst_port < ip46_flow->udp_data.start_dst_port) ||
452 (dst_port > ip46_flow->udp_data.end_dst_port)))
455 flow_index = (src_port - ip46_flow->udp_data.start_src_port) *
456 (ip46_flow->udp_data.end_dst_port - ip46_flow->udp_data.start_dst_port +
458 flow_index += (dst_port - ip46_flow->udp_data.start_dst_port);
459 data = &(ip46_flow->udp_data.stats[flow_index].analyse_data);
462 data->bytes_counter += len;
464 vnet_buffer (b0)->l2_classify.opaque_index =
465 ip46_flow->udp_data.stats[flow_index].flow_ctx;
467 while (opt0 < limit0)
472 case HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST:
473 /* Add trace for here as it hasnt been done yet */
474 vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
475 trace = (ioam_trace_option_t *) opt0;
477 (trace->trace_hdr.ioam_trace_type & BIT_LOOPBACK_REPLY))
479 ip6_ioam_analyse_hbh_trace_loopback (data, &trace->trace_hdr,
480 (trace->hdr.length - 2));
483 ip6_hbh_ioam_trace_data_list_handler (b0,
484 vlib_buffer_get_current (b0),
486 (void) ip6_ioam_analyse_hbh_trace (data, &trace->trace_hdr, len,
487 (trace->hdr.length - 2));
489 case HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE:
490 e2e = (ioam_e2e_option_t *) opt0;
491 (void) ip6_ioam_analyse_hbh_e2e (data, &e2e->e2e_hdr, len);
494 opt0 = (ip6_hop_by_hop_option_t *) ((u8 *) opt0) + 1;
501 opt0 = (ip6_hop_by_hop_option_t *) (((u8 *) opt0) + opt0->length +
502 sizeof (ip6_hop_by_hop_option_t));
504 ip46_flow->udp_data.stats[flow_index].retry = 0;
508 * @brief UDP-Ping request/response handler function.
510 * Checks udp-ping packet type - request/response and handles them.
511 * If not udp-ping packet then, strips off hbh options and enques
512 * packet to protocol registered node to enable next protocol processing.
516 udp_ping_local_analyse (vlib_node_runtime_t * node, vlib_buffer_t * b0,
517 ip6_header_t * ip0, ip6_hop_by_hop_header_t * hbh0,
520 ip6_main_t *im = &ip6_main;
521 ip_lookup_main_t *lm = &im->lookup_main;
523 *next0 = UDP_PING_NEXT_IP6_DROP;
526 * Sanity check: hbh header length must be less than
527 * b0->current_length.
529 if (PREDICT_FALSE ((hbh0->length + 1) << 3) >= b0->current_length)
531 *next0 = UDP_PING_NEXT_DROP;
532 b0->error = node->errors[UDP_PING_ERROR_BADHBH];
536 if (PREDICT_TRUE (hbh0->protocol == IP_PROTOCOL_UDP))
538 ip6_hop_by_hop_option_t *opt0;
539 ip6_hop_by_hop_option_t *limit0;
543 /* Check for udp ping packet */
544 udp0 = (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
545 opt0 = (ip6_hop_by_hop_option_t *) (hbh0 + 1);
546 if ((udp0->ping_data.probe_marker1 ==
547 clib_host_to_net_u32 (UDP_PING_PROBE_MARKER1)) &&
548 (udp0->ping_data.probe_marker2 ==
549 clib_host_to_net_u32 (UDP_PING_PROBE_MARKER2)))
551 if (udp0->ping_data.msg_type == UDP_PING_PROBE)
553 udp_ping_create_reply_from_probe_ip6 (ip0, hbh0, udp0);
554 /* Skip e2e processing */
555 vnet_buffer (b0)->l2_classify.opaque_index = 0x7FFFFFFF;
556 *next0 = UDP_PING_NEXT_IP6_LOOKUP;
561 opt0 = (ip6_hop_by_hop_option_t *) (hbh0 + 1);
562 limit0 = (ip6_hop_by_hop_option_t *)
563 ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
564 p_len0 = clib_net_to_host_u16 (ip0->payload_length);
565 udp_ping_analyse_hbh (b0,
566 clib_net_to_host_u16 (udp0->
567 ping_data.sender_handle),
568 clib_net_to_host_u16 (udp0->udp.dst_port),
569 clib_net_to_host_u16 (udp0->udp.src_port),
570 opt0, limit0, p_len0);
572 /* UDP Ping packet, so return */
577 /* If next header is SR, then destination may get overwritten to
578 * remote address. So pass it to SR processing as it may be local packet
581 if (PREDICT_FALSE (hbh0->protocol == IPPROTO_IPV6_ROUTE))
584 /* Other case remove hbh-ioam headers */
585 u64 *copy_dst0, *copy_src0;
588 vlib_buffer_advance (b0, (hbh0->length + 1) << 3);
590 new_l0 = clib_net_to_host_u16 (ip0->payload_length) -
591 ((hbh0->length + 1) << 3);
593 ip0->payload_length = clib_host_to_net_u16 (new_l0);
595 ip0->protocol = hbh0->protocol;
597 copy_src0 = (u64 *) ip0;
598 copy_dst0 = copy_src0 + (hbh0->length + 1);
599 copy_dst0[4] = copy_src0[4];
600 copy_dst0[3] = copy_src0[3];
601 copy_dst0[2] = copy_src0[2];
602 copy_dst0[1] = copy_src0[1];
603 copy_dst0[0] = copy_src0[0];
606 *next0 = lm->local_next_by_ip_protocol[hbh0->protocol];
611 * @brief udp ping request/response packet receive node.
612 * @node udp-ping-local
614 * This function receives udp ping request/response packets and process them.
615 * For request packets, response is created and sent.
616 * For response packets, they are analysed and results stored.
618 * @param vm vlib_main_t corresponding to the current thread.
619 * @param node vlib_node_runtime_t data for this node.
620 * @param frame vlib_frame_t whose contents should be dispatched.
622 * @par Graph mechanics: buffer, next index usage
625 * - <code>udp_ping_local_analyse(node, p0, ip0, hbh0, &next0)</code>
626 * - Checks packet type - request/respnse and process them.
628 * <em>Next Index:</em>
629 * - Dispatches the packet to ip6-lookup/ip6-drop depending on type of packet.
632 udp_ping_local_node_fn (vlib_main_t * vm,
633 vlib_node_runtime_t * node, vlib_frame_t * frame)
635 udp_ping_next_t next_index;
636 u32 *from, *to_next, n_left_from, n_left_to_next;
638 from = vlib_frame_vector_args (frame);
639 n_left_from = frame->n_vectors;
640 next_index = node->cached_next_index;
642 while (n_left_from > 0)
644 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
646 while (n_left_from >= 4 && n_left_to_next >= 2)
648 vlib_buffer_t *p0, *p1;
649 ip6_header_t *ip0, *ip1;
650 ip6_hop_by_hop_header_t *hbh0, *hbh1;
654 /* Prefetch next iteration. */
656 vlib_buffer_t *p2, *p3;
658 p2 = vlib_get_buffer (vm, from[2]);
659 p3 = vlib_get_buffer (vm, from[3]);
661 vlib_prefetch_buffer_header (p2, LOAD);
662 vlib_prefetch_buffer_header (p3, LOAD);
664 /* Prefetch 3 cache lines as we need to look deep into packet */
665 CLIB_PREFETCH (p2->data, 3 * CLIB_CACHE_LINE_BYTES, STORE);
666 CLIB_PREFETCH (p3->data, 3 * CLIB_CACHE_LINE_BYTES, STORE);
669 pi0 = to_next[0] = from[0];
670 pi1 = to_next[1] = from[1];
676 p0 = vlib_get_buffer (vm, pi0);
677 p1 = vlib_get_buffer (vm, pi1);
679 ip0 = vlib_buffer_get_current (p0);
680 ip1 = vlib_buffer_get_current (p1);
682 hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
683 hbh1 = (ip6_hop_by_hop_header_t *) (ip1 + 1);
685 udp_ping_local_analyse (node, p0, ip0, hbh0, &next0);
686 udp_ping_local_analyse (node, p1, ip1, hbh1, &next1);
688 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
690 if (p0->flags & VLIB_BUFFER_IS_TRACED)
692 udp_ping_trace_t *t0 =
693 vlib_add_trace (vm, node, p0, sizeof (*t0));
696 /* Check for udp ping packet */
698 (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
699 t0->src = ip0->src_address;
700 t0->dst = ip0->dst_address;
701 t0->src_port = clib_net_to_host_u16 (udp0->udp.src_port);
702 t0->dst_port = clib_net_to_host_u16 (udp0->udp.dst_port);
704 clib_net_to_host_u16 (udp0->ping_data.sender_handle);
705 t0->msg_type = udp0->ping_data.msg_type;
706 t0->next_index = next0;
708 if (p1->flags & VLIB_BUFFER_IS_TRACED)
710 udp_ping_trace_t *t1 =
711 vlib_add_trace (vm, node, p1, sizeof (*t1));
714 /* Check for udp ping packet */
716 (udp_ping_t *) ((u8 *) hbh1 + ((hbh1->length + 1) << 3));
717 t1->src = ip1->src_address;
718 t1->dst = ip1->dst_address;
719 t1->src_port = clib_net_to_host_u16 (udp1->udp.src_port);
720 t1->dst_port = clib_net_to_host_u16 (udp1->udp.dst_port);
722 clib_net_to_host_u16 (udp1->ping_data.sender_handle);
723 t1->msg_type = udp1->ping_data.msg_type;
724 t1->next_index = next1;
728 vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
729 to_next, n_left_to_next,
730 pi0, pi1, next0, next1);
733 while (n_left_from > 0 && n_left_to_next > 0)
737 ip6_hop_by_hop_header_t *hbh0;
748 p0 = vlib_get_buffer (vm, pi0);
749 ip0 = vlib_buffer_get_current (p0);
750 hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
752 udp_ping_local_analyse (node, p0, ip0, hbh0, &next0);
754 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
756 if (p0->flags & VLIB_BUFFER_IS_TRACED)
758 udp_ping_trace_t *t0 =
759 vlib_add_trace (vm, node, p0, sizeof (*t0));
762 /* Check for udp ping packet */
764 (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
765 t0->src = ip0->src_address;
766 t0->dst = ip0->dst_address;
767 t0->src_port = clib_net_to_host_u16 (udp0->udp.src_port);
768 t0->dst_port = clib_net_to_host_u16 (udp0->udp.dst_port);
770 clib_net_to_host_u16 (udp0->ping_data.sender_handle);
771 t0->msg_type = udp0->ping_data.msg_type;
772 t0->next_index = next0;
776 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
777 to_next, n_left_to_next,
781 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
784 return frame->n_vectors;
788 * Node for udp-ping-local
790 VLIB_REGISTER_NODE (udp_ping_local, static) =
792 .function = udp_ping_local_node_fn,
793 .name = "udp-ping-local",
794 .vector_size = sizeof (u32),
795 .format_trace = format_udp_ping_trace,
796 .type = VLIB_NODE_TYPE_INTERNAL,
797 .n_next_nodes = UDP_PING_N_NEXT,
798 .n_errors = UDP_PING_N_ERROR,
799 .error_strings = udp_ping_error_strings,
802 [UDP_PING_NEXT_DROP] = "error-drop",
803 [UDP_PING_NEXT_PUNT] = "error-punt",
804 [UDP_PING_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
805 [UDP_PING_NEXT_ICMP] = "ip6-icmp-input",
806 [UDP_PING_NEXT_IP6_LOOKUP] = "ip6-lookup",
807 [UDP_PING_NEXT_IP6_DROP] = "ip6-drop",
811 static clib_error_t *
812 udp_ping_init (vlib_main_t * vm)
814 udp_ping_main.vlib_main = vm;
815 udp_ping_main.vnet_main = vnet_get_main ();
816 udp_ping_main.timer_interval = 1e9;
818 ip6_local_hop_by_hop_register_protocol (IP_PROTOCOL_UDP,
819 udp_ping_local.index);
823 VLIB_INIT_FUNCTION (udp_ping_init) =
825 .runs_after = VLIB_INITS("ip_main_init"),
829 * fd.io coding-style-patch-verification: ON
832 * eval: (c-set-style "gnu")