blob: af0b5794af09744d6cca9995ee1c60c87ba7abba [file] [log] [blame]
Dan Talaycoc0e802e2013-05-18 23:52:39 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
Dan Talaycof76f7112013-05-19 23:32:12 -07003// LoxiGen is licensed under the Eclipse Public License,
Dan Talaycoba506722013-05-21 14:33:33 -07004// version 1.0 (EPL), with the following special exception:
Dan Talaycoc0e802e2013-05-18 23:52:39 -07005//
6// LOXI Exception
7//
Dan Talaycof76f7112013-05-19 23:32:12 -07008// As a special exception to the terms of the EPL, you may
9// distribute libraries generated by LoxiGen (LoxiGen Libraries)
10// under the terms of your choice, provided that copyright and
11// licensing notices generated by LoxiGen are not altered or removed
12// from the LoxiGen Libraries and the notice provided below is (i)
13// included in the LoxiGen Libraries, if distributed in source code
14// form and (ii) included in any documentation for the LoxiGen
15// Libraries, if distributed in binary form.
Dan Talaycoc0e802e2013-05-18 23:52:39 -070016//
Dan Talaycof76f7112013-05-19 23:32:12 -070017// Notice: "Copyright 2013, Big Switch Networks, Inc.
18// This library was generated by the LoxiGen Compiler."
Dan Talaycoc0e802e2013-05-18 23:52:39 -070019//
Dan Talaycof76f7112013-05-19 23:32:12 -070020// You may not use this file except in compliance with the EPL or
21// LOXI Exception. You may obtain a copy of the EPL at:
Dan Talaycoc0e802e2013-05-18 23:52:39 -070022//
23// http://www.eclipse.org/legal/epl-v10.html
24//
Dan Talaycof76f7112013-05-19 23:32:12 -070025// Unless required by applicable law or agreed to in writing,
26// software distributed under the License is distributed on an "AS
27// IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
28// express or implied. See the EPL for the specific language
29// governing permissions and limitations under the EPL.
Dan Talaycoc0e802e2013-05-18 23:52:39 -070030
31#version any
32
Dan Talayco78654ff2013-05-24 11:41:55 -070033// When the ingress or egress VID has this value, no outer tag should be used.
34// In this case, the corresponding TPID is ignored.
35
36enum ofp_bsn_vport_q_in_q_untagged {
37 OF_BSN_VPORT_Q_IN_Q_UNTAGGED = 0xffff,
38};
39
Dan Talaycoc0e802e2013-05-18 23:52:39 -070040// BSN Virtual port object header
41// FIXME For now, inheritance is not exercised. See below.
42struct ofp_bsn_vport {
43 uint16_t type; /* Discriminate virtual port type */
44 uint16_t length; /* Length in bytes of this structure with this header */
45 /* Remainder of data is specific to the port type */
46};
47
48
Dan Talaycoc0e802e2013-05-18 23:52:39 -070049// Q-in-Q virtual port specification
50
51struct of_bsn_vport_q_in_q {
52 uint16_t type; /* 0 */
53 uint16_t length; /* 16 */
54 uint32_t port_no; /* OF port number of parent; usually phys port */
55 uint16_t ingress_tpid;
56 uint16_t ingress_vlan_id;
57 uint16_t egress_tpid;
58 uint16_t egress_vlan_id;
59};
60
61// Request from controller to switch to create vport
62struct ofp_bsn_virtual_port_create_request {
63 uint8_t version;
64 uint8_t type;
65 uint16_t length;
66 uint32_t xid;
67 uint32_t experimenter; // OF_EXPERIMENTER_ID_BSN
68 uint32_t subtype; // BSN_VIRTUAL_PORT_CREATE_REQUEST
69 // FIXME This should be an instance of the inheritance superclass
70 of_bsn_vport_q_in_q_t vport; // Description of vport to create
71 // Additional data follows depending on header type
72};
73
74// Reply from switch to controller indicating port number created
75// vport_no must be 16 bits to be compatible with 1.0
76struct ofp_bsn_virtual_port_create_reply {
77 uint8_t version;
78 uint8_t type;
79 uint16_t length;
80 uint32_t xid; // Must match create_request
81 uint32_t experimenter; // OF_EXPERIMENTER_ID_BSN
82 uint32_t subtype; // BSN_VIRTUAL_PORT_CREATE_REPLY
83 uint32_t vport_no; // The OF port number created. 16-bits for OF 1.0
84};
85
86// Request from controller to switch to remove a vport
87struct ofp_bsn_virtual_port_remove {
88 uint8_t version;
89 uint8_t type;
90 uint16_t length;
91 uint32_t xid;
92 uint32_t experimenter; // OF_EXPERIMENTER_ID_BSN
93 uint32_t subtype; // BSN_VIRTUAL_PORT_REMOVE
94 uint32_t vport_no; // The OF port number to be removed
95};