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.
15 #ifndef __included_ip6_ioam_flow_report_h__
16 #define __included_ip6_ioam_flow_report_h__
18 #include <ioam/analyse/ioam_analyse.h>
19 #include <vnet/ipfix-export/flow_report.h>
21 #define foreach_ioam_ipfix_info_element \
22 _(ioamPacketSent, 5239, u32) \
23 _(ioamPacketCount, 5237, u32) \
24 _(ioamByteCount, 5238, u32) \
25 _(ioamPathMap, 5262, u32) \
26 _(ioamNumberOfPaths, 5264, u16) \
27 _(ioamSfcValidatedCount, 5278, u32) \
28 _(ioamSfcInValidatedCount, 5279, u32) \
29 _(ioamSeqnoRxCount, 5280, u32) \
30 _(ioamSeqnoLostCount, 5281, u32) \
31 _(ioamSeqnoReorderedCount, 5282, u32) \
32 _(ioamSeqnoDupCount, 5283, u32)
37 #define _(n,v,t) n = v,
38 foreach_ioam_ipfix_info_element
40 } ioam_ipfix_info_element_id_t;
42 #define foreach_ioam_ipfix_field \
43 _(pkt_sent, 0xffffffff, ioamPacketSent, 4) \
44 _(pkt_counter, 0xffffffff, ioamPacketCount, 4) \
45 _(bytes_counter, 0xffffffff, ioamByteCount, 4) \
46 _(pot_data.sfc_validated_count, 0xffffffff, ioamSfcValidatedCount, 4) \
47 _(pot_data.sfc_invalidated_count, 0xffffffff, ioamSfcInValidatedCount, 4) \
48 _(seqno_data.rx_packets, 0xffffffff, ioamSeqnoRxCount, 4) \
49 _(seqno_data.lost_packets, 0xffffffff, ioamSeqnoLostCount, 4) \
50 _(seqno_data.reordered_packets, 0xffffffff, ioamSeqnoReorderedCount, 4) \
51 _(seqno_data.dup_packets, 0xffffffff, ioamSeqnoDupCount, 4)
53 clib_error_t *ioam_flow_report_init (vlib_main_t * vm);
63 ioam_path_map_t path[0];
66 clib_error_t *ioam_flow_create (u8 del);
68 u8 *ioam_template_rewrite (flow_report_main_t * frm, flow_report_t * fr,
69 ip4_address_t * collector_address,
70 ip4_address_t * src_address, u16 collector_port,
71 ipfix_report_element_t * elts,
72 u32 n_elts, u32 * stream_index);
74 u16 ioam_analyse_add_ipfix_record (flow_report_t * fr,
75 ioam_analyser_data_t * record,
76 vlib_buffer_t * b0, u16 offset,
77 ip6_address_t * src, ip6_address_t * dst,
78 u16 src_port, u16 dst_port);
80 #endif /* __included_ip6_ioam_flow_report_h__ */
83 * fd.io coding-style-patch-verification: ON
86 * eval: (c-set-style "gnu")