// Copyright 2013, Big Switch Networks, Inc.
//
// LoxiGen is licensed under the Eclipse Public License,
// version 1.0 (EPL), with the following special exception:
//
// LOXI Exception
//
// As a special exception to the terms of the EPL, you may
// distribute libraries generated by LoxiGen (LoxiGen Libraries)
// under the terms of your choice, provided that copyright and
// licensing notices generated by LoxiGen are not altered or removed
// from the LoxiGen Libraries and the notice provided below is (i)
// included in the LoxiGen Libraries, if distributed in source code
// form and (ii) included in any documentation for the LoxiGen
// Libraries, if distributed in binary form.
//
// Notice: "Copyright 2013, Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler."
//
// You may not use this file except in compliance with the EPL or
// LOXI Exception. You may obtain a copy of the EPL at:
//
// http://www.eclipse.org/legal/epl-v10.html
//
// 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 EPL for the specific language
// governing permissions and limitations under the EPL.

#version any

// LACP Convergence Status set in of_bsn_lacp_convergence_notif message
enum of_bsn_lacp_convergence_status_t(wire_type=uint16_t, complete=False) {
    LACP_SUCCESS = 0,
    LACP_TIMEDOUT = 1,
    LACP_OUT_OF_SYNC = 2,
};

struct of_bsn_set_lacp_request : of_bsn_header {
    uint8_t version;
    uint8_t type == 4;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter == 0x5c16c7;
    uint32_t subtype == 41;
    uint8_t enabled;
    pad(1);
    of_port_no_t port_no;
    uint16_t actor_sys_priority;
    of_mac_addr_t actor_sys_mac;
    uint16_t actor_port_priority;
    uint16_t actor_port_num;
    uint16_t actor_key;
};

struct of_bsn_set_lacp_reply : of_bsn_header {
    uint8_t version;
    uint8_t type == 4;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter == 0x5c16c7;
    uint32_t subtype == 42;
    uint32_t status;
    of_port_no_t port_no;
    uint16_t actor_sys_priority;
    of_mac_addr_t actor_sys_mac;
    uint16_t actor_port_priority;
    uint16_t actor_port_num;
    uint16_t actor_key;
};

struct of_bsn_lacp_convergence_notif : of_bsn_header {
    uint8_t version;
    uint8_t type == 4;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter == 0x5c16c7;
    uint32_t subtype == 43;
    uint16_t convergence_status;
    of_port_no_t port_no;

    uint16_t actor_sys_priority;
    of_mac_addr_t actor_sys_mac;
    uint16_t actor_port_priority;
    uint16_t actor_port_num;
    uint16_t actor_key;

    uint16_t partner_sys_priority;
    of_mac_addr_t partner_sys_mac;
    uint16_t partner_port_priority;
    uint16_t partner_port_num;
    uint16_t partner_key;
};
