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 #ifndef PLUGINS_IOAM_PLUGIN_IOAM_ANALYSE_IP6_IOAM_ANALYSE_NODE_H_
17 #define PLUGINS_IOAM_PLUGIN_IOAM_ANALYSE_IP6_IOAM_ANALYSE_NODE_H_
19 #include <ioam/analyse/ioam_analyse.h>
20 #include <vnet/ip/ip6_hop_by_hop.h>
22 /** @brief IP6-iOAM analyser main structure.
27 /** Array of function pointer to analyse each hop-by-hop option. */
28 int (*analyse_hbh_handler[MAX_IP6_HBH_OPTION]) (u32 flow_id,
29 ip6_hop_by_hop_option_t *
32 /** This contains the aggregated data from the time VPP started analysing. */
33 ioam_analyser_data_t *aggregated_data;
35 } ip6_ioam_analyser_main_t;
37 extern ip6_ioam_analyser_main_t ioam_analyser_main;
39 extern vlib_node_registration_t analyse_node_local;
40 extern vlib_node_registration_t analyse_node_remote;
42 void ip6_ioam_analyse_register_handlers (void);
44 void ip6_ioam_analyse_unregister_handlers (void);
46 clib_error_t *ip6_ioam_analyse_init (vlib_main_t * vm);
48 inline static ioam_analyser_data_t *
49 ioam_analyse_get_data_from_flow_id (u32 flow_id)
51 if (flow_id >= vec_len (ioam_analyser_main.aggregated_data))
54 if (ioam_analyser_main.aggregated_data[flow_id].is_free)
55 ioam_analyser_main.aggregated_data[flow_id].is_free = 0;
57 return (ioam_analyser_main.aggregated_data + flow_id);
60 #endif /* PLUGINS_IOAM_PLUGIN_IOAM_ANALYSE_IP6_IOAM_ANALYSE_NODE_H_ */
63 * fd.io coding-style-patch-verification: ON
66 * eval: (c-set-style "gnu")