Per-packet IPFIX record generation plugin
[vpp.git] / plugins / flowperpkt-plugin / flowperpkt / flowperpkt.h
1 /*
2  * flowperpkt.h - skeleton vpp engine plug-in header file
3  *
4  * Copyright (c) <current-year> <your-organization>
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __included_flowperpkt_h__
18 #define __included_flowperpkt_h__
19
20 #include <vnet/vnet.h>
21 #include <vnet/ip/ip.h>
22 #include <vnet/ethernet/ethernet.h>
23
24 #include <vppinfra/hash.h>
25 #include <vppinfra/error.h>
26 #include <vnet/flow/flow_report.h>
27 #include <vnet/flow/flow_report_classify.h>
28
29 /**
30  * @file
31  * @brief flow-per-packet plugin header file
32  */
33 typedef struct
34 {
35   /** API message ID base */
36   u16 msg_id_base;
37
38   /** ip4 feature index */
39   u32 ip4_tx_feature_index;
40
41   /** Has the report been created? */
42   int report_created;
43
44   /** ipfix buffers under construction, per-worker thread */
45   vlib_buffer_t **buffers_per_worker;
46   /** frames containing ipfix buffers, per-worker thread */
47   vlib_frame_t **frames_per_worker;
48   /** next record offset, per worker thread */
49   u16 *next_record_offset_per_worker;
50
51   /** convenience vlib_main_t pointer */
52   vlib_main_t *vlib_main;
53   /** convenience vnet_main_t pointer */
54   vnet_main_t *vnet_main;
55 } flowperpkt_main_t;
56
57 extern flowperpkt_main_t flowperpkt_main;
58
59 vlib_node_registration_t flowperpkt_node;
60
61 void flowperpkt_flush_callback (void);
62
63 #endif /* __included_flowperpkt_h__ */
64
65 /*
66  * fd.io coding-style-patch-verification: ON
67  *
68  * Local Variables:
69  * eval: (c-set-style "gnu")
70  * End:
71  */