/*
 * Copyright (c) 2017 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.
 */

/** \file

    This file defines vpe control-plane API messages for
    the bonding device driver
*/

option version = "2.0.0";
import "vnet/ethernet/ethernet_types.api";
import "vnet/interface_types.api";

/** \brief Dump lacp interfaces request */
define sw_interface_lacp_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for lacp dump request
    @param sw_if_index - software index of member interface
    @param interface_name - name of member interface
    @param rx_state - rx machine state
    @param tx_state - tx machine state
    @param mux_state - mux machine state
    @param ptx_state - ptx machine state
    @param bond_interface_name - name of bond interface
    @param actor_system_priority - actor system priority
    @param actor_system - actor system
    @param actor_key - actor key
    @param actor_port_priority - actor port priority
    @param actor_port_number - actor port number
    @param actor_state - actor state
    @param partner_system_priority - partner system priority
    @param partner_system - partner system
    @param partner_key - partner key
    @param partner_port_priority - partner port priority
    @param partner_port_number - partner port number
    @param partner_state - partner state
*/
define sw_interface_lacp_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  string interface_name[64];
  u32 rx_state;
  u32 tx_state;
  u32 mux_state;
  u32 ptx_state;
  string bond_interface_name[64];
  u16 actor_system_priority;
  vl_api_mac_address_t actor_system;
  u16 actor_key;
  u16 actor_port_priority;
  u16 actor_port_number;
  u8 actor_state;
  u16 partner_system_priority;
  vl_api_mac_address_t partner_system;
  u16 partner_key;
  u16 partner_port_priority;
  u16 partner_port_number;
  u8 partner_state;
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
