/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "2.0.0";

import "vnet/interface_types.api";

enum span_state
{
	SPAN_STATE_API_DISABLED = 0,
	SPAN_STATE_API_RX = 1,
	SPAN_STATE_API_TX = 2,
	SPAN_STATE_API_RX_TX = 3,
};

 /** \brief Enable/Disable span to mirror traffic from one interface to another
    @param client_index - opaque cookie to identify the sender
    @param context - sender context which was passed in the request
    @param sw_if_index_from - interface to be mirrored
    @param sw_if_index_to - interface where the traffic is mirrored
    @param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
    @param is_l2 - 0 = mirror at hw device level, 1 = mirror at L2
*/
autoreply define sw_interface_span_enable_disable {
    u32 client_index;
    u32 context;
    vl_api_interface_index_t sw_if_index_from;
    vl_api_interface_index_t sw_if_index_to;
    vl_api_span_state_t state;
    bool is_l2;
};

/** \brief SPAN dump request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_l2 - 0 = hw device level, 1 = L2
*/
define sw_interface_span_dump {
    u32 client_index;
    u32 context;
    bool is_l2;
};

/** \brief Reply to SPAN dump request
    @param context - sender context which was passed in the request
    @param sw_if_index_from - mirrored interface
    @param sw_if_index_to - interface where the traffic is mirrored
    @param state - 0 = disabled, 1 = rx enabled, 2 = tx enabled, 3 tx & rx enabled
    @param is_l2 - 0 = mirrored at hw device level, 1 = mirrored at l2
*/
define sw_interface_span_details {
    u32 context;
    vl_api_interface_index_t sw_if_index_from;
    vl_api_interface_index_t sw_if_index_to;
    vl_api_span_state_t state;
    bool is_l2;
};
