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

// BSN Virtual port object header
// FIXME For now, inheritance is not exercised.  See below.
struct ofp_bsn_vport {
    uint16_t type;  /* Discriminate virtual port type */
    uint16_t length; /* Length in bytes of this structure with this header */
    /* Remainder of data is specific to the port type */
};


// When the ingress or egress VID has this value, no outer tag should be used.
// In this case, the corresponding TPID is ignored.
// #define OF_BSN_VPORT_Q_IN_Q_UNTAGGED 0xffff

// Q-in-Q virtual port specification

struct of_bsn_vport_q_in_q {
    uint16_t type;    /* 0 */
    uint16_t length;  /* 16 */
    uint32_t port_no;     /* OF port number of parent; usually phys port */
    uint16_t ingress_tpid;
    uint16_t ingress_vlan_id;
    uint16_t egress_tpid;
    uint16_t egress_vlan_id;
};

// Request from controller to switch to create vport
struct ofp_bsn_virtual_port_create_request {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter;  // OF_EXPERIMENTER_ID_BSN
    uint32_t subtype;       // BSN_VIRTUAL_PORT_CREATE_REQUEST
    // FIXME This should be an instance of the inheritance superclass
    of_bsn_vport_q_in_q_t vport;   // Description of vport to create
    // Additional data follows depending on header type
};

// Reply from switch to controller indicating port number created
// vport_no must be 16 bits to be compatible with 1.0
struct ofp_bsn_virtual_port_create_reply {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;           // Must match create_request
    uint32_t experimenter;  // OF_EXPERIMENTER_ID_BSN
    uint32_t subtype;       // BSN_VIRTUAL_PORT_CREATE_REPLY
    uint32_t vport_no;      // The OF port number created.  16-bits for OF 1.0
};

// Request from controller to switch to remove a vport
struct ofp_bsn_virtual_port_remove {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter;  // OF_EXPERIMENTER_ID_BSN
    uint32_t subtype;       // BSN_VIRTUAL_PORT_REMOVE
    uint32_t vport_no;      // The OF port number to be removed
};
