blob: 97316b4ba00d7bf5221c2b1895b76fde180a1a51 [file] [log] [blame]
// 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
enum ofp_bsn_vport_status {
OF_BSN_VPORT_STATUS_OK = 0,
OF_BSN_VPORT_STATUS_FAILED = 1,
};
// When the ingress or egress VID has this value, no outer tag should be used.
// In this case, the corresponding TPID is ignored.
enum ofp_bsn_vport_q_in_q_untagged(wire_type=uint16_t, complete=False) {
OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 0xffff,
};
enum ofp_bsn_vport_l2gre_dscp_mode(wire_type=uint8_t) {
OF_BSN_VPORT_L2GRE_DSCP_ASSIGN = 0,
OF_BSN_VPORT_L2GRE_DSCP_COPY = 1,
};
enum ofp_bsn_vport_l2gre_dscp_dont_care(wire_type=uint8_t, complete=False) {
OF_BSN_VPORT_L2GRE_DSCP_DONT_CARE = 0xff,
};
enum ofp_bsn_vport_l2gre_ttl_dont_care(wire_type=uint8_t, complete=False) {
OF_BSN_VPORT_L2GRE_TTL_DONT_CARE = 0xff,
};
// BSN Virtual port object header
// FIXME For now, inheritance is not exercised. See below.
struct of_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 */
};
// Q-in-Q virtual port specification
struct of_bsn_vport_q_in_q : of_bsn_vport {
uint16_t type == 0;
uint16_t length;
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;
of_port_name_t if_name; /* Name to use in create operation */
};
// L2GRE tunnel virtual port specification
struct of_bsn_vport_l2gre : of_bsn_vport {
uint16_t type == 1;
uint16_t length;
of_port_no_t port_no; /* OF port number of parent */
of_mac_addr_t local_mac; /* Local MAC */
of_mac_addr_t nh_mac; /* Next Hop MAC */
of_ipv4_t src_ip; /* Source IP */
of_ipv4_t dst_ip; /* Destination IP */
enum ofp_bsn_vport_l2gre_dscp_mode dscp_mode;
uint8_t dscp;
uint8_t ttl;
pad(1);
uint32_t vpn; /* VPN ID (for GRE Key) */
of_port_name_t if_name; /* Virtual Interface Name */
};
// Request from controller to switch to create vport
struct of_bsn_virtual_port_create_request : of_bsn_header {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid;
uint32_t experimenter == 0x5c16c7;
uint32_t subtype == 15;
of_bsn_vport_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 of_bsn_virtual_port_create_reply : of_bsn_header {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid; // Must match create_request
uint32_t experimenter == 0x5c16c7;
uint32_t subtype == 16;
uint32_t status; // 0 means success
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 of_bsn_virtual_port_remove_request : of_bsn_header {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid;
uint32_t experimenter == 0x5c16c7;
uint32_t subtype == 17;
uint32_t vport_no; // The OF port number to be removed
};
// Request from controller to switch to remove a vport
struct of_bsn_virtual_port_remove_reply : of_bsn_header {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid; // Must match request xid
uint32_t experimenter == 0x5c16c7;
uint32_t subtype == 26;
uint32_t status; // 0 means success
};