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);
97 VLIB_REGISTER_NODE (udp_ping_node, static) =
99 .function = udp_ping_process,
100 .type = VLIB_NODE_TYPE_PROCESS,
101 .name = "udp-ping-process",
106 udp_ping_calculate_timer_interval (void)
109 ip46_udp_ping_flow *flow = NULL;
110 u16 min_interval = 0x1e9;
112 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
114 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
117 flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
119 if (min_interval > flow->udp_data.interval)
120 min_interval = flow->udp_data.interval;
123 if (udp_ping_main.timer_interval != min_interval)
125 udp_ping_main.timer_interval = min_interval;
126 vlib_process_signal_event (udp_ping_main.vlib_main,
127 udp_ping_node.index, EVENT_SIG_RECHECK, 0);
132 ip46_udp_ping_set_flow (ip46_address_t src, ip46_address_t dst,
133 u16 start_src_port, u16 end_src_port,
134 u16 start_dst_port, u16 end_dst_port,
135 u16 interval, u8 fault_det, u8 is_disable)
138 ip46_udp_ping_flow *flow = NULL;
141 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
143 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
146 flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
147 if ((0 == udp_ping_compare_flow (src, dst,
148 start_src_port, end_src_port,
149 start_dst_port, end_dst_port, flow)))
161 cur_interval = flow->udp_data.interval;
162 udp_ping_free_flow_data (flow);
163 pool_put_index (udp_ping_main.ip46_flow, i);
164 if (udp_ping_main.timer_interval == interval)
165 udp_ping_calculate_timer_interval ();
169 cur_interval = flow->udp_data.interval;
170 flow->udp_data.interval = interval;
171 if (udp_ping_main.timer_interval > interval)
173 udp_ping_main.timer_interval = interval;
174 vlib_process_signal_event (udp_ping_main.vlib_main,
176 EVENT_SIG_RECHECK, 0);
178 else if (udp_ping_main.timer_interval == cur_interval)
179 udp_ping_calculate_timer_interval ();
184 /* Delete operation and item not found */
188 /* Alloc new session */
189 pool_get_aligned (udp_ping_main.ip46_flow, flow, CLIB_CACHE_LINE_BYTES);
190 udp_ping_populate_flow (src, dst,
191 start_src_port, end_src_port,
192 start_dst_port, end_dst_port,
193 interval, fault_det, flow);
195 udp_ping_create_rewrite (flow, (flow - udp_ping_main.ip46_flow));
197 if (udp_ping_main.timer_interval > interval)
199 udp_ping_main.timer_interval = interval;
200 vlib_process_signal_event (udp_ping_main.vlib_main,
201 udp_ping_node.index, EVENT_SIG_RECHECK, 0);
207 unformat_port_range (unformat_input_t * input, va_list * args)
209 u16 *start_port, *end_port;
211 u8 colon_present = 0;
213 start_port = va_arg (*args, u16 *);
214 end_port = va_arg (*args, u16 *);
216 *start_port = *end_port = 0;
218 while ((c = unformat_get_input (input)) != UNFORMAT_END_OF_INPUT)
223 *start_port = ((*start_port) * 10) + (c - '0');
242 while ((c = unformat_get_input (input)) != UNFORMAT_END_OF_INPUT)
247 *end_port = ((*end_port) * 10) + (c - '0');
255 if (end_port < start_port)
261 static clib_error_t *
262 set_udp_ping_command_fn (vlib_main_t * vm,
263 unformat_input_t * input, vlib_cli_command_t * cmd)
265 ip46_address_t dst, src;
266 u16 start_src_port, end_src_port;
267 u16 start_dst_port, end_dst_port;
272 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
275 (input, "src %U", unformat_ip46_address, &src, IP46_TYPE_ANY))
277 else if (unformat (input, "src-port-range %U",
278 unformat_port_range, &start_src_port, &end_src_port))
282 (input, "dst %U", unformat_ip46_address, &dst, IP46_TYPE_ANY))
284 else if (unformat (input, "dst-port-range %U",
285 unformat_port_range, &start_dst_port, &end_dst_port))
287 else if (unformat (input, "interval %d", &interval))
289 else if (unformat (input, "fault-detect"))
291 else if (unformat (input, "disable"))
297 ip46_udp_ping_set_flow (src, dst, start_src_port, end_src_port,
298 start_dst_port, end_dst_port, (u16) interval,
299 fault_det, is_disable);
305 VLIB_CLI_COMMAND (set_udp_ping_command, static) =
307 .path = "set udp-ping",
309 "set udp-ping src <local IPv6 address> src-port-range <local port range> \
310 dst <remote IPv6 address> dst-port-range <destination port range> \
311 interval <time interval in sec for which ping packet will be sent> \
313 .function = set_udp_ping_command_fn,
317 static clib_error_t *
318 show_udp_ping_summary_cmd_fn (vlib_main_t * vm,
319 unformat_input_t * input,
320 vlib_cli_command_t * cmd)
324 ip46_udp_ping_flow *ip46_flow;
325 u16 src_port, dst_port;
326 udp_ping_flow_data *stats;
328 s = format (s, "UDP-Ping data:\n");
330 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
332 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
335 ip46_flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
336 s = format (s, "Src: %U, Dst: %U\n",
337 format_ip46_address, &ip46_flow->src, IP46_TYPE_ANY,
338 format_ip46_address, &ip46_flow->dst, IP46_TYPE_ANY);
340 s = format (s, "Start src port: %u, End src port: %u\n",
341 ip46_flow->udp_data.start_src_port,
342 ip46_flow->udp_data.end_src_port);
343 s = format (s, "Start dst port: %u, End dst port: %u\n",
344 ip46_flow->udp_data.start_dst_port,
345 ip46_flow->udp_data.end_dst_port);
346 s = format (s, "Interval: %u\n", ip46_flow->udp_data.interval);
349 for (src_port = ip46_flow->udp_data.start_src_port;
350 src_port <= ip46_flow->udp_data.end_src_port; src_port++)
352 for (dst_port = ip46_flow->udp_data.start_dst_port;
353 dst_port <= ip46_flow->udp_data.end_dst_port; dst_port++)
355 stats = ip46_flow->udp_data.stats + j;
357 format (s, "\nSrc Port - %u, Dst Port - %u, Flow CTX - %u\n",
358 src_port, dst_port, stats->flow_ctx);
360 format (s, "Path State - %s\n",
361 (stats->retry > MAX_PING_RETRIES) ? "Down" : "Up");
362 s = format (s, "Path Data:\n");
363 s = print_analyse_flow (s,
364 &ip46_flow->udp_data.
365 stats[j].analyse_data);
369 s = format (s, "\n\n");
372 vlib_cli_output (vm, "%v", s);
378 VLIB_CLI_COMMAND (show_udp_ping_cmd, static) =
380 .path = "show udp-ping summary",
381 .short_help = "Summary of udp-ping",
382 .function = show_udp_ping_summary_cmd_fn,
387 * @brief UDP-Ping Process node.
388 * @node udp-ping-process
390 * This is process node which wakes up when periodically to send
391 * out udp probe packets for all configured sessions.
393 * @param vm vlib_main_t corresponding to the current thread.
394 * @param node vlib_node_runtime_t data for this node.
395 * @param frame vlib_frame_t whose contents should be dispatched.
399 udp_ping_process (vlib_main_t * vm,
400 vlib_node_runtime_t * rt, vlib_frame_t * f)
403 uword *event_data = 0;
405 ip46_udp_ping_flow *ip46_flow;
409 vec_reset_length (event_data);
410 vlib_process_wait_for_event_or_clock (vm, udp_ping_main.timer_interval);
411 (void) vlib_process_get_events (vm, &event_data);
412 now = vlib_time_now (vm);
414 for (i = 0; i < vec_len (udp_ping_main.ip46_flow); i++)
416 if (pool_is_free_index (udp_ping_main.ip46_flow, i))
419 ip46_flow = pool_elt_at_index (udp_ping_main.ip46_flow, i);
420 if (ip46_flow->udp_data.next_send_time < now)
421 udp_ping_send_ip6_pak (udp_ping_main.vlib_main, ip46_flow);
428 * @brief HopByHop analyse function for udp-ping response.
430 * Walks through all hbh options present in udp-ping response
431 * and uses analyser library for the analysis.
435 udp_ping_analyse_hbh (vlib_buffer_t * b0,
439 ip6_hop_by_hop_option_t * opt0,
440 ip6_hop_by_hop_option_t * limit0, u16 len)
443 ip46_udp_ping_flow *ip46_flow;
445 ioam_analyser_data_t *data;
446 ioam_e2e_option_t *e2e;
447 ioam_trace_option_t *trace;
449 /* If the packet doesnt match UDP session then return */
450 if (PREDICT_FALSE (pool_is_free_index (udp_ping_main.ip46_flow, flow_id)))
453 ip46_flow = udp_ping_main.ip46_flow + flow_id;
454 /* Check port is within range */
455 if (PREDICT_FALSE ((src_port < ip46_flow->udp_data.start_src_port) ||
456 (src_port > ip46_flow->udp_data.end_src_port) ||
457 (dst_port < ip46_flow->udp_data.start_dst_port) ||
458 (dst_port > ip46_flow->udp_data.end_dst_port)))
461 flow_index = (src_port - ip46_flow->udp_data.start_src_port) *
462 (ip46_flow->udp_data.end_dst_port - ip46_flow->udp_data.start_dst_port +
464 flow_index += (dst_port - ip46_flow->udp_data.start_dst_port);
465 data = &(ip46_flow->udp_data.stats[flow_index].analyse_data);
468 data->bytes_counter += len;
470 vnet_buffer (b0)->l2_classify.opaque_index =
471 ip46_flow->udp_data.stats[flow_index].flow_ctx;
473 while (opt0 < limit0)
478 case HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST:
479 /* Add trace for here as it hasnt been done yet */
480 vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
481 trace = (ioam_trace_option_t *) opt0;
483 (trace->trace_hdr.ioam_trace_type & BIT_LOOPBACK_REPLY))
485 ip6_ioam_analyse_hbh_trace_loopback (data, &trace->trace_hdr,
486 (trace->hdr.length - 2));
489 ip6_hbh_ioam_trace_data_list_handler (b0,
490 vlib_buffer_get_current (b0),
492 (void) ip6_ioam_analyse_hbh_trace (data, &trace->trace_hdr, len,
493 (trace->hdr.length - 2));
495 case HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE:
496 e2e = (ioam_e2e_option_t *) opt0;
497 (void) ip6_ioam_analyse_hbh_e2e (data, &e2e->e2e_hdr, len);
500 opt0 = (ip6_hop_by_hop_option_t *) ((u8 *) opt0) + 1;
507 opt0 = (ip6_hop_by_hop_option_t *) (((u8 *) opt0) + opt0->length +
508 sizeof (ip6_hop_by_hop_option_t));
510 ip46_flow->udp_data.stats[flow_index].retry = 0;
514 * @brief UDP-Ping request/response handler function.
516 * Checks udp-ping packet type - request/response and handles them.
517 * If not udp-ping packet then, strips off hbh options and enques
518 * packet to protocol registered node to enable next protocol processing.
522 udp_ping_local_analyse (vlib_node_runtime_t * node, vlib_buffer_t * b0,
523 ip6_header_t * ip0, ip6_hop_by_hop_header_t * hbh0,
526 ip6_main_t *im = &ip6_main;
527 ip_lookup_main_t *lm = &im->lookup_main;
529 *next0 = UDP_PING_NEXT_IP6_DROP;
532 * Sanity check: hbh header length must be less than
533 * b0->current_length.
535 if (PREDICT_FALSE ((hbh0->length + 1) << 3) >= b0->current_length)
537 *next0 = UDP_PING_NEXT_DROP;
538 b0->error = node->errors[UDP_PING_ERROR_BADHBH];
542 if (PREDICT_TRUE (hbh0->protocol == IP_PROTOCOL_UDP))
544 ip6_hop_by_hop_option_t *opt0;
545 ip6_hop_by_hop_option_t *limit0;
549 /* Check for udp ping packet */
550 udp0 = (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
551 opt0 = (ip6_hop_by_hop_option_t *) (hbh0 + 1);
552 if ((udp0->ping_data.probe_marker1 ==
553 clib_host_to_net_u32 (UDP_PING_PROBE_MARKER1)) &&
554 (udp0->ping_data.probe_marker2 ==
555 clib_host_to_net_u32 (UDP_PING_PROBE_MARKER2)))
557 if (udp0->ping_data.msg_type == UDP_PING_PROBE)
559 udp_ping_create_reply_from_probe_ip6 (ip0, hbh0, udp0);
560 /* Skip e2e processing */
561 vnet_buffer (b0)->l2_classify.opaque_index = 0x7FFFFFFF;
562 *next0 = UDP_PING_NEXT_IP6_LOOKUP;
567 opt0 = (ip6_hop_by_hop_option_t *) (hbh0 + 1);
568 limit0 = (ip6_hop_by_hop_option_t *)
569 ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
570 p_len0 = clib_net_to_host_u16 (ip0->payload_length);
571 udp_ping_analyse_hbh (b0,
572 clib_net_to_host_u16 (udp0->
573 ping_data.sender_handle),
574 clib_net_to_host_u16 (udp0->udp.dst_port),
575 clib_net_to_host_u16 (udp0->udp.src_port),
576 opt0, limit0, p_len0);
578 /* UDP Ping packet, so return */
583 /* If next header is SR, then destination may get overwritten to
584 * remote address. So pass it to SR processing as it may be local packet
587 if (PREDICT_FALSE (hbh0->protocol == IPPROTO_IPV6_ROUTE))
590 /* Other case remove hbh-ioam headers */
591 u64 *copy_dst0, *copy_src0;
594 vlib_buffer_advance (b0, (hbh0->length + 1) << 3);
596 new_l0 = clib_net_to_host_u16 (ip0->payload_length) -
597 ((hbh0->length + 1) << 3);
599 ip0->payload_length = clib_host_to_net_u16 (new_l0);
601 ip0->protocol = hbh0->protocol;
603 copy_src0 = (u64 *) ip0;
604 copy_dst0 = copy_src0 + (hbh0->length + 1);
605 copy_dst0[4] = copy_src0[4];
606 copy_dst0[3] = copy_src0[3];
607 copy_dst0[2] = copy_src0[2];
608 copy_dst0[1] = copy_src0[1];
609 copy_dst0[0] = copy_src0[0];
612 *next0 = lm->local_next_by_ip_protocol[hbh0->protocol];
617 * @brief udp ping request/response packet receive node.
618 * @node udp-ping-local
620 * This function receives udp ping request/response packets and process them.
621 * For request packets, response is created and sent.
622 * For response packets, they are analysed and results stored.
624 * @param vm vlib_main_t corresponding to the current thread.
625 * @param node vlib_node_runtime_t data for this node.
626 * @param frame vlib_frame_t whose contents should be dispatched.
628 * @par Graph mechanics: buffer, next index usage
631 * - <code>udp_ping_local_analyse(node, p0, ip0, hbh0, &next0)</code>
632 * - Checks packet type - request/respnse and process them.
634 * <em>Next Index:</em>
635 * - Dispatches the packet to ip6-lookup/ip6-drop depending on type of packet.
638 udp_ping_local_node_fn (vlib_main_t * vm,
639 vlib_node_runtime_t * node, vlib_frame_t * frame)
641 udp_ping_next_t next_index;
642 u32 *from, *to_next, n_left_from, n_left_to_next;
644 from = vlib_frame_vector_args (frame);
645 n_left_from = frame->n_vectors;
646 next_index = node->cached_next_index;
648 while (n_left_from > 0)
650 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
652 while (n_left_from >= 4 && n_left_to_next >= 2)
654 vlib_buffer_t *p0, *p1;
655 ip6_header_t *ip0, *ip1;
656 ip6_hop_by_hop_header_t *hbh0, *hbh1;
660 /* Prefetch next iteration. */
662 vlib_buffer_t *p2, *p3;
664 p2 = vlib_get_buffer (vm, from[2]);
665 p3 = vlib_get_buffer (vm, from[3]);
667 vlib_prefetch_buffer_header (p2, LOAD);
668 vlib_prefetch_buffer_header (p3, LOAD);
670 /* Prefetch 3 cache lines as we need to look deep into packet */
671 CLIB_PREFETCH (p2->data, 3 * CLIB_CACHE_LINE_BYTES, STORE);
672 CLIB_PREFETCH (p3->data, 3 * CLIB_CACHE_LINE_BYTES, STORE);
675 pi0 = to_next[0] = from[0];
676 pi1 = to_next[1] = from[1];
682 p0 = vlib_get_buffer (vm, pi0);
683 p1 = vlib_get_buffer (vm, pi1);
685 ip0 = vlib_buffer_get_current (p0);
686 ip1 = vlib_buffer_get_current (p1);
688 hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
689 hbh1 = (ip6_hop_by_hop_header_t *) (ip1 + 1);
691 udp_ping_local_analyse (node, p0, ip0, hbh0, &next0);
692 udp_ping_local_analyse (node, p1, ip1, hbh1, &next1);
694 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
696 if (p0->flags & VLIB_BUFFER_IS_TRACED)
698 udp_ping_trace_t *t0 =
699 vlib_add_trace (vm, node, p0, sizeof (*t0));
702 /* Check for udp ping packet */
704 (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
705 t0->src = ip0->src_address;
706 t0->dst = ip0->dst_address;
707 t0->src_port = clib_net_to_host_u16 (udp0->udp.src_port);
708 t0->dst_port = clib_net_to_host_u16 (udp0->udp.dst_port);
710 clib_net_to_host_u16 (udp0->ping_data.sender_handle);
711 t0->msg_type = udp0->ping_data.msg_type;
712 t0->next_index = next0;
714 if (p1->flags & VLIB_BUFFER_IS_TRACED)
716 udp_ping_trace_t *t1 =
717 vlib_add_trace (vm, node, p1, sizeof (*t1));
720 /* Check for udp ping packet */
722 (udp_ping_t *) ((u8 *) hbh1 + ((hbh1->length + 1) << 3));
723 t1->src = ip1->src_address;
724 t1->dst = ip1->dst_address;
725 t1->src_port = clib_net_to_host_u16 (udp1->udp.src_port);
726 t1->dst_port = clib_net_to_host_u16 (udp1->udp.dst_port);
728 clib_net_to_host_u16 (udp1->ping_data.sender_handle);
729 t1->msg_type = udp1->ping_data.msg_type;
730 t1->next_index = next1;
734 vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
735 to_next, n_left_to_next,
736 pi0, pi1, next0, next1);
739 while (n_left_from > 0 && n_left_to_next > 0)
743 ip6_hop_by_hop_header_t *hbh0;
754 p0 = vlib_get_buffer (vm, pi0);
755 ip0 = vlib_buffer_get_current (p0);
756 hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
758 udp_ping_local_analyse (node, p0, ip0, hbh0, &next0);
760 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
762 if (p0->flags & VLIB_BUFFER_IS_TRACED)
764 udp_ping_trace_t *t0 =
765 vlib_add_trace (vm, node, p0, sizeof (*t0));
768 /* Check for udp ping packet */
770 (udp_ping_t *) ((u8 *) hbh0 + ((hbh0->length + 1) << 3));
771 t0->src = ip0->src_address;
772 t0->dst = ip0->dst_address;
773 t0->src_port = clib_net_to_host_u16 (udp0->udp.src_port);
774 t0->dst_port = clib_net_to_host_u16 (udp0->udp.dst_port);
776 clib_net_to_host_u16 (udp0->ping_data.sender_handle);
777 t0->msg_type = udp0->ping_data.msg_type;
778 t0->next_index = next0;
782 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
783 to_next, n_left_to_next,
787 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
790 return frame->n_vectors;
795 * Node for udp-ping-local
797 VLIB_REGISTER_NODE (udp_ping_local, static) =
799 .function = udp_ping_local_node_fn,
800 .name = "udp-ping-local",
801 .vector_size = sizeof (u32),
802 .format_trace = format_udp_ping_trace,
803 .type = VLIB_NODE_TYPE_INTERNAL,
804 .n_next_nodes = UDP_PING_N_NEXT,
805 .n_errors = UDP_PING_N_ERROR,
806 .error_strings = udp_ping_error_strings,
809 [UDP_PING_NEXT_DROP] = "error-drop",
810 [UDP_PING_NEXT_PUNT] = "error-punt",
811 [UDP_PING_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
812 [UDP_PING_NEXT_ICMP] = "ip6-icmp-input",
813 [UDP_PING_NEXT_IP6_LOOKUP] = "ip6-lookup",
814 [UDP_PING_NEXT_IP6_DROP] = "ip6-drop",
819 static clib_error_t *
820 udp_ping_init (vlib_main_t * vm)
822 udp_ping_main.vlib_main = vm;
823 udp_ping_main.vnet_main = vnet_get_main ();
824 udp_ping_main.timer_interval = 1e9;
826 ip6_local_hop_by_hop_register_protocol (IP_PROTOCOL_UDP,
827 udp_ping_local.index);
832 VLIB_INIT_FUNCTION (udp_ping_init) =
834 .runs_after = VLIB_INITS("ip_main_init"),
839 * fd.io coding-style-patch-verification: ON
842 * eval: (c-set-style "gnu")