/*
 * 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.
 */

option version = "1.0.0";

/** \brief configure global parameter for LLDP
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param system_name - VPP system name
    @param tx_hold - multiplier for tx_interval when setting time-to-live (TTL)
                     value in the LLDP packets
    @param tx_interval - time interval, in seconds, between each LLDP frames
*/
autoreply define lldp_config
{
  u32 client_index;
  u32 context;
  u8 system_name[256];
  u32 tx_hold;
  u32 tx_interval;
};

/** \brief Interface set LLDP request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface for which to enable/disable LLDP
    @param port_desc - local port description
    @param mgmt_ip4_addr - management ip4 address of the interface
    @param mgmt_ip6_addr - management ip6 address of the interface
    @param mgmt_oid - OID(Object Identifier) of the interface
    @param enable - if non-zero enable, else disable
*/
autoreply define sw_interface_set_lldp
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 port_desc[256];
  u8 mgmt_ip4[4];
  u8 mgmt_ip6[16];
  u8 mgmt_oid[128];
  u8 enable;
};
