Jimmy Jin | 4fd3902 | 2016-01-15 12:39:01 -0800 | [diff] [blame] | 1 | // Copyright 2016, Big Switch Networks, Inc. |
| 2 | // |
| 3 | // LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with |
| 4 | // the following special exception: |
| 5 | // |
| 6 | // LOXI Exception |
| 7 | // |
| 8 | // As a special exception to the terms of the EPL, you may distribute libraries |
| 9 | // generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided |
| 10 | // that copyright and licensing notices generated by LoxiGen are not altered or removed |
| 11 | // from the LoxiGen Libraries and the notice provided below is (i) included in |
| 12 | // the LoxiGen Libraries, if distributed in source code form and (ii) included in any |
| 13 | // documentation for the LoxiGen Libraries, if distributed in binary form. |
| 14 | // |
| 15 | // Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." |
| 16 | // |
| 17 | // You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain |
| 18 | // a copy of the EPL at: |
| 19 | // |
| 20 | // http://www.eclipse.org/legal/epl-v10.html |
| 21 | // |
| 22 | // Unless required by applicable law or agreed to in writing, software |
| 23 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 24 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 25 | // EPL for the specific language governing permissions and limitations |
| 26 | // under the EPL. |
| 27 | // |
| 28 | // Also derived from the OpenFlow header files which have these copyrights: |
| 29 | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 30 | // Copyright (c) 2011, 2012, 2015 Open Networking Foundation |
| 31 | |
| 32 | #version 4 |
| 33 | |
| 34 | /* Oplink experimenter message header*/ |
| 35 | struct of_oplink_exp_header : of_experimenter { |
| 36 | uint8_t version; |
| 37 | uint8_t type == 4; |
| 38 | uint16_t length; |
| 39 | uint32_t xid; |
| 40 | uint32_t experimenter == 0xFF000088; |
| 41 | uint32_t exp_type == ?; |
| 42 | }; |
| 43 | |
| 44 | /* this message is used for OFP_SET_POWER */ |
| 45 | struct of_oplink_port_power_set : of_oplink_exp_header { |
| 46 | uint8_t version; |
| 47 | uint8_t type == 4; |
| 48 | uint16_t length; |
| 49 | uint32_t xid; |
| 50 | uint32_t experimenter == 0xFF000088; |
| 51 | uint32_t exp_type == 10; |
| 52 | uint16_t port; |
| 53 | uint16_t power_value; |
| 54 | }; |
| 55 | |
| 56 | enum ofp_oplink_stat_exp_subtype (wire_type=uint32_t, bitmask=True){ |
| 57 | OFP_PD_POWER = 20, |
| 58 | OFP_CH_POWER = 21 |
| 59 | }; |
| 60 | |
| 61 | struct of_oplink_stats_request : of_experimenter_stats_request { |
| 62 | uint8_t version; |
| 63 | uint8_t type == 18; |
| 64 | uint16_t length; |
| 65 | uint32_t xid; |
| 66 | uint16_t stats_type == 0xffff; |
| 67 | enum ofp_stats_request_flags flags; |
| 68 | pad(4); |
| 69 | uint32_t experimenter == 0xFF000088; |
| 70 | uint32_t subtype == ?; |
| 71 | }; |
| 72 | |
| 73 | struct of_oplink_stats_reply : of_experimenter_stats_reply { |
| 74 | uint8_t version; |
| 75 | uint8_t type == 19; |
| 76 | uint16_t length; |
| 77 | uint32_t xid; |
| 78 | uint16_t stats_type == 0xffff; |
| 79 | enum ofp_stats_reply_flags flags; |
| 80 | pad(4); |
| 81 | uint32_t experimenter == 0xFF000088; |
| 82 | uint32_t subtype == ?; |
| 83 | }; |
| 84 | |
| 85 | struct of_oplink_port_power_request : of_oplink_stats_request { |
| 86 | uint8_t version; |
| 87 | uint8_t type == 18; |
| 88 | uint16_t length; |
| 89 | uint32_t xid; |
| 90 | uint16_t stats_type == 0xffff; |
| 91 | enum ofp_stats_request_flags flags; |
| 92 | pad(4); |
| 93 | uint32_t experimenter == 0xFF000088; |
| 94 | uint32_t subtype == 20; |
| 95 | }; |
| 96 | |
| 97 | struct of_oplink_port_power { |
| 98 | uint16_t port; |
| 99 | uint16_t power_value; |
| 100 | }; |
| 101 | |
| 102 | struct of_oplink_port_power_reply : of_oplink_stats_reply { |
| 103 | uint8_t version; |
| 104 | uint8_t type == 19; |
| 105 | uint16_t length; |
| 106 | uint32_t xid; |
| 107 | uint16_t stats_type == 0xffff; |
| 108 | enum ofp_stats_reply_flags flags; |
| 109 | pad(4); |
| 110 | uint32_t experimenter == 0xFF000088; |
| 111 | uint32_t subtype == 20; |
| 112 | list(of_oplink_port_power_t) entries; |
| 113 | }; |
| 114 | |
| 115 | |
| 116 | struct of_oplink_channel_power { |
| 117 | uint16_t in_port; |
| 118 | uint16_t out_port; |
| 119 | uint16_t channel; |
| 120 | uint16_t power_value; |
| 121 | }; |
| 122 | |
| 123 | struct of_oplink_channel_power_request : of_oplink_stats_request { |
| 124 | uint8_t version; |
| 125 | uint8_t type == 18; |
| 126 | uint16_t length; |
| 127 | uint32_t xid; |
| 128 | uint16_t stats_type == 0xffff; |
| 129 | enum ofp_stats_request_flags flags; |
| 130 | pad(4); |
| 131 | uint32_t experimenter == 0xFF000088; |
| 132 | uint32_t subtype == 21; |
| 133 | }; |
| 134 | |
| 135 | struct of_oplink_channel_power_reply : of_oplink_stats_reply { |
| 136 | uint8_t version; |
| 137 | uint8_t type == 19; |
| 138 | uint16_t length; |
| 139 | uint32_t xid; |
| 140 | uint16_t stats_type == 0xffff; |
| 141 | enum ofp_stats_reply_flags flags; |
| 142 | pad(4); |
| 143 | uint32_t experimenter == 0xFF000088; |
| 144 | uint32_t subtype == 21; |
| 145 | list(of_oplink_channel_power_t) entries; |
| 146 | }; |
| 147 | |
| 148 | /* Oplink roadm attenuation defined with ONOS type */ |
| 149 | struct of_oxm_och_sigatt : of_oxm { |
| 150 | uint32_t type_len == 0x00085C04; |
| 151 | uint32_t value; |
| 152 | }; |
| 153 | |
| 154 | /* Oplink roadm attenuation defined with standard type */ |
| 155 | struct of_oxm_och_sigatt_basic : of_oxm { |
| 156 | uint32_t type_len == 0x80005C04; |
| 157 | uint32_t value; |
| 158 | }; |
| 159 | |
| 160 | /* Oplink roadm attenuation action */ |
| 161 | struct of_action_oplink_att : of_action_experimenter { |
| 162 | uint16_t type == 65535; |
| 163 | uint16_t len; |
| 164 | uint32_t experimenter == 0xFF000088; |
| 165 | uint16_t subtype == 1; |
| 166 | uint16_t hlength == 16; // fix length of OXM field |
| 167 | of_oxm_t field; |
| 168 | pad(4); |
| 169 | }; |