Skip to content

Commit

Permalink
Merge into master from pull request #272:
Browse files Browse the repository at this point in the history
OF-1.3 OXM TUNNEL_ID (38) support and several enhancements (#272)
  • Loading branch information
abat committed Jun 2, 2014
2 parents 58a7831 + 754c73a commit 030f41a
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 2 deletions.
1 change: 1 addition & 0 deletions c_gen/templates/loci_show.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ typedef int (*loci_obj_show_f)(loci_writer_f writer,
#define LOCI_SHOW_mac_eth_dst(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
#define LOCI_SHOW_mac_ipv6_nd_sll(writer, cookie, val) LOCI_SHOW_mac(writer, cookie, val)
#define LOCI_SHOW_u8_mpls_tc(writer, cookie, val) LOCI_SHOW_x8(writer, cookie, val)
#define LOCI_SHOW_u64_tunnel_id(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
#define LOCI_SHOW_u16_arp_op(writer, cookie, val) LOCI_SHOW_u16(writer, cookie, val)
#define LOCI_SHOW_u16_eth_type(writer, cookie, val) LOCI_SHOW_x16(writer, cookie, val)
#define LOCI_SHOW_ipv6_ipv6_nd_target(writer, cookie, val) LOCI_SHOW_ipv6(writer, cookie, val)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.projectfloodlight.openflow.types.OFVlanVidMatch;
import org.projectfloodlight.openflow.types.TransportPort;
import org.projectfloodlight.openflow.types.U16;
import org.projectfloodlight.openflow.types.U64;
import org.projectfloodlight.openflow.types.U32;
import org.projectfloodlight.openflow.types.U8;
import org.projectfloodlight.openflow.types.UDF;
Expand Down Expand Up @@ -177,6 +178,9 @@ private MatchField(final String name, final MatchFields id, Prerequisite<?>... p
new MatchField<U8>("mpls_tc", MatchFields.MPLS_TC,
new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.MPLS_UNICAST, EthType.MPLS_MULTICAST));

public final static MatchField<U64> TUNNEL_ID =
new MatchField<U64>("tunnel_id", MatchFields.TUNNEL_ID);

public final static MatchField<OFBitMask128> BSN_IN_PORTS_128 =
new MatchField<OFBitMask128>("bsn_in_ports_128", MatchFields.BSN_IN_PORTS_128);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public enum MatchFields {
IPV6_ND_TLL,
MPLS_LABEL,
MPLS_TC,
TUNNEL_ID,
BSN_IN_PORTS_128,
BSN_LAG_ID,
BSN_VRF,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@ public int compareTo(ICMPv4Code o) {
public void putTo(PrimitiveSink sink) {
sink.putShort(code);
}

@Override
public String toString() {
return String.valueOf(this.code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,8 @@ public void putTo(PrimitiveSink sink) {
sink.putShort(type);
}

@Override
public String toString() {
return String.valueOf(this.type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public abstract class IPAddress<F extends IPAddress<F>> implements OFValueType<F

/**
* Perform a low level AND operation on the bits of two IPAddress<?> objects
* @param IPAddress<?> other
* @param other IPAddress<?>
* @return new IPAddress<?> object after the AND oper
*/
public abstract F and(F other);

/**
* Perform a low level OR operation on the bits of two IPAddress<?> objects
* @param IPAddress<?> other
* @param other IPAddress<?>
* @return new IPAddress<?> object after the AND oper
*/
public abstract F or(F other);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class U64 implements Writeable, OFValueType<U64>, HashValue<U64> {
private final static long ZERO_VAL = 0;
public final static U64 ZERO = new U64(ZERO_VAL);

private static final long NO_MASK_VAL = 0xFFffFFffFFffFFffL;
public final static U64 NO_MASK = new U64(NO_MASK_VAL);
public static final U64 FULL_MASK = ZERO;

private final long raw;

protected U64(final long raw) {
Expand Down
42 changes: 42 additions & 0 deletions openflow_input/oxm-1.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2014, 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 4

struct of_oxm_tunnel_id : of_oxm {
uint32_t type_len == 0x80004c08;
uint64_t value;
};

struct of_oxm_tunnel_id_masked : of_oxm {
uint32_t type_len == 0x80004d10;
uint64_t value;
uint64_t value_mask;
};

0 comments on commit 030f41a

Please sign in to comment.