Skip to content

Commit

Permalink
Add Oplink experimenter messages
Browse files Browse the repository at this point in the history
Change-Id: I6b0c912fe78fb01081205dc689d3d65dfa151614
  • Loading branch information
jjin62 committed Jan 27, 2016
1 parent ba8da4a commit 4fd3902
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 0 deletions.
3 changes: 3 additions & 0 deletions java_gen/java_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@ def gen_fixed_length_string_jtype(length):
'of_oxm_och_sigid' : {'value' : sig_id},
'of_oxm_och_sigid_basic' : {'value' : sig_id},

'of_oxm_och_sigatt' : { 'value' : u32obj },
'of_oxm_och_sigatt_basic' : { 'value' : u32obj },

'of_bundle_add_msg' : { 'data' : of_message },

'of_oxm_exp_odu_sigtype' : { 'value' : u8obj },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ private MatchField(final String name, final MatchFields id, Prerequisite<?>... p
new MatchField<CircuitSignalID>("och_sigid_basic",
MatchFields.OCH_SIGID);

public final static MatchField<U32> OCH_SIGATT =
new MatchField<U32>("och_sigatt",
MatchFields.OCH_SIGATT);

public final static MatchField<U32> OCH_SIGATT_BASIC =
new MatchField<U32>("och_sigatt_basic",
MatchFields.OCH_SIGATT_BASIC);

public final static MatchField<OFBooleanValue> BSN_L2_CACHE_HIT =
new MatchField<OFBooleanValue>("bsn_l2_cache_hit", MatchFields.BSN_L2_CACHE_HIT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public enum MatchFields {
OCH_SIGTYPE_BASIC,
OCH_SIGID,
OCH_SIGID_BASIC,
OCH_SIGATT,
OCH_SIGATT_BASIC,
EXP_ODU_SIG_ID,
EXP_ODU_SIGTYPE,
EXP_OCH_SIG_ID,
Expand Down
169 changes: 169 additions & 0 deletions openflow_input/oplink
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// Copyright 2016, 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.
//
// Also derived from the OpenFlow header files which have these copyrights:
// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012, 2015 Open Networking Foundation

#version 4

/* Oplink experimenter message header*/
struct of_oplink_exp_header : of_experimenter {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid;
uint32_t experimenter == 0xFF000088;
uint32_t exp_type == ?;
};

/* this message is used for OFP_SET_POWER */
struct of_oplink_port_power_set : of_oplink_exp_header {
uint8_t version;
uint8_t type == 4;
uint16_t length;
uint32_t xid;
uint32_t experimenter == 0xFF000088;
uint32_t exp_type == 10;
uint16_t port;
uint16_t power_value;
};

enum ofp_oplink_stat_exp_subtype (wire_type=uint32_t, bitmask=True){
OFP_PD_POWER = 20,
OFP_CH_POWER = 21
};

struct of_oplink_stats_request : of_experimenter_stats_request {
uint8_t version;
uint8_t type == 18;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_request_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == ?;
};

struct of_oplink_stats_reply : of_experimenter_stats_reply {
uint8_t version;
uint8_t type == 19;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_reply_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == ?;
};

struct of_oplink_port_power_request : of_oplink_stats_request {
uint8_t version;
uint8_t type == 18;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_request_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == 20;
};

struct of_oplink_port_power {
uint16_t port;
uint16_t power_value;
};

struct of_oplink_port_power_reply : of_oplink_stats_reply {
uint8_t version;
uint8_t type == 19;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_reply_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == 20;
list(of_oplink_port_power_t) entries;
};


struct of_oplink_channel_power {
uint16_t in_port;
uint16_t out_port;
uint16_t channel;
uint16_t power_value;
};

struct of_oplink_channel_power_request : of_oplink_stats_request {
uint8_t version;
uint8_t type == 18;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_request_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == 21;
};

struct of_oplink_channel_power_reply : of_oplink_stats_reply {
uint8_t version;
uint8_t type == 19;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 0xffff;
enum ofp_stats_reply_flags flags;
pad(4);
uint32_t experimenter == 0xFF000088;
uint32_t subtype == 21;
list(of_oplink_channel_power_t) entries;
};

/* Oplink roadm attenuation defined with ONOS type */
struct of_oxm_och_sigatt : of_oxm {
uint32_t type_len == 0x00085C04;
uint32_t value;
};

/* Oplink roadm attenuation defined with standard type */
struct of_oxm_och_sigatt_basic : of_oxm {
uint32_t type_len == 0x80005C04;
uint32_t value;
};

/* Oplink roadm attenuation action */
struct of_action_oplink_att : of_action_experimenter {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0xFF000088;
uint16_t subtype == 1;
uint16_t hlength == 16; // fix length of OXM field
of_oxm_t field;
pad(4);
};

0 comments on commit 4fd3902

Please sign in to comment.