blob: 95d5ad11c364d717f686bf5bcd854e6751090082 [file] [log] [blame]
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +01001/* Hey Emacs use -*- mode: C -*- */
2/*
3 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Jakub Grajciar908965d2020-01-31 09:51:41 +010017option version = "2.0.0";
18
19import "vnet/interface_types.api";
20
21enum span_state
22{
23 SPAN_STATE_API_DISABLED = 0,
24 SPAN_STATE_API_RX = 1,
25 SPAN_STATE_API_TX = 2,
26 SPAN_STATE_API_RX_TX = 3,
27};
Dave Barach0d056e52017-09-28 15:11:16 -040028
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010029 /** \brief Enable/Disable span to mirror traffic from one interface to another
30 @param client_index - opaque cookie to identify the sender
31 @param context - sender context which was passed in the request
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -070032 @param sw_if_index_from - interface to be mirrored
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010033 @param sw_if_index_to - interface where the traffic is mirrored
34 @param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
Eyal Bari5b311202017-07-31 13:12:30 +030035 @param is_l2 - 0 = mirror at hw device level, 1 = mirror at L2
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010036*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040037autoreply define sw_interface_span_enable_disable {
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010038 u32 client_index;
39 u32 context;
Jakub Grajciar908965d2020-01-31 09:51:41 +010040 vl_api_interface_index_t sw_if_index_from;
41 vl_api_interface_index_t sw_if_index_to;
42 vl_api_span_state_t state;
43 bool is_l2;
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010044};
45
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010046/** \brief SPAN dump request
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
Eyal Bari5b311202017-07-31 13:12:30 +030049 @param is_l2 - 0 = hw device level, 1 = L2
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010050*/
51define sw_interface_span_dump {
52 u32 client_index;
53 u32 context;
Jakub Grajciar908965d2020-01-31 09:51:41 +010054 bool is_l2;
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010055};
56
57/** \brief Reply to SPAN dump request
58 @param context - sender context which was passed in the request
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -070059 @param sw_if_index_from - mirrored interface
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010060 @param sw_if_index_to - interface where the traffic is mirrored
61 @param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
Jon Loeliger179ab362018-03-12 14:50:08 -050062 @param is_l2 - 0 = mirrored at hw device level, 1 = mirrored at l2
Pavel Kotucek3a2a1c42016-12-06 10:10:10 +010063*/
64define sw_interface_span_details {
65 u32 context;
Jakub Grajciar908965d2020-01-31 09:51:41 +010066 vl_api_interface_index_t sw_if_index_from;
67 vl_api_interface_index_t sw_if_index_to;
68 vl_api_span_state_t state;
69 bool is_l2;
Ole Troan399ca1c2016-12-06 23:00:38 +010070};