span: add feature (rx only) (VPP-185)
[vpp.git] / vnet / vnet / span / span.h
1 /*
2  * Copyright (c) 2016 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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 #ifndef __span_h__
17 #define __span_h__
18
19 #include <vnet/vnet.h>
20 #include <vnet/ip/ip.h>
21
22 typedef struct
23 {
24   /* destination interface index by source interface index */
25   u32 *dst_by_src_sw_if_index;
26
27   /* convenience */
28   vlib_main_t *vlib_main;
29   vnet_main_t *vnet_main;
30 } span_main_t;
31
32 span_main_t span_main;
33
34 typedef struct
35 {
36   u32 src_sw_if_index;          /* mirrored interface index */
37   u32 mirror_sw_if_index;       /* output interface index */
38 } span_trace_t;
39
40 #endif /* __span_h__ */
41
42 int
43 span_add_delete_entry (vlib_main_t * vm, u32 src_sw_if_index,
44                        u32 dst_sw_if_index, u8 is_add);
45 /*
46  * fd.io coding-style-patch-verification: ON
47  *
48  * Local Variables:
49  * eval: (c-set-style "gnu")
50  * End:
51  */