Merge into master from pull request #304:
modified java_gen to support list of IPv4 and IPv6 addresses (https://github.com/floodlight/loxigen/pull/304)
diff --git a/README.md b/README.md
index 98ec28e..18357d4 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,11 @@
LoxiGen currently supports OpenFlow Versions **1.0**, **1.1**, **1.2**, and **1.3.1**. Versions 1.0
and 1.3.1 are actively used in production. Support for versions 1.1 and 1.2 is considered experimental.
+Loxigen is free and open source software. The Loxigen tool itself is licensed under the [Eclipse Public
+License, version 1.0](http://www.eclipse.org/legal/epl-v10.html) (EPL), with an exception allowing for the distribution of the generated artifacts
+under terms of your choice (copyright notices must be retained, see the [loxigen.py](loxigen.py)
+header for details.)
+
Prerequisites
=============
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index 191fcd3..6556d3b 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -426,6 +426,14 @@
#endif /* OF_DEBUG_DUMP */
""")
+ out.write("""
+static inline const char *
+of_class_name(of_object_t *obj)
+{
+ return of_object_id_str[obj->object_id];
+}
+""")
+
out.write("\n#endif /* Top header file */\n")
def match_c_gen(out, name):
diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h
index 370dca0..3624bcd 100644
--- a/c_gen/templates/loci_show.h
+++ b/c_gen/templates/loci_show.h
@@ -408,6 +408,7 @@
#define LOCI_SHOW_u8_dscp(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
#define LOCI_SHOW_u8_ttl(writer, cookie, val) LOCI_SHOW_u8(writer, cookie, val)
#define LOCI_SHOW_u32_vpn(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_rate_limit(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
#define LOCI_SHOW_u32_flags(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
#define LOCI_SHOW_desc_str_image_checksum(write, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
#define LOCI_SHOW_desc_str_startup_config_checksum(write, cookie, val) LOCI_SHOW_desc_str(writer, cookie, val)
diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml
index a7fae3e..f45e39f 100644
--- a/java_gen/pre-written/pom.xml
+++ b/java_gen/pre-written/pom.xml
@@ -10,7 +10,7 @@
<groupId>org.projectfloodlight</groupId>
<artifactId>openflowj</artifactId>
- <version>0.3.7-SNAPSHOT</version>
+ <version>0.3.8-SNAPSHOT</version>
<packaging>jar</packaging>
<name>OpenFlowJ-Loxi</name>
diff --git a/openflow_input/bsn_span_destination b/openflow_input/bsn_span_destination
new file mode 100644
index 0000000..7fd900d
--- /dev/null
+++ b/openflow_input/bsn_span_destination
@@ -0,0 +1,40 @@
+// 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 2014, 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 Open Networking Foundation
+
+#version 4
+
+struct of_instruction_bsn_span_destination : of_instruction_bsn {
+ uint16_t type == 65535;
+ uint16_t len;
+ uint32_t experimenter == 0x5c16c7;
+ uint32_t subtype == 10;
+ pad(4);
+};
diff --git a/openflow_input/bsn_vport b/openflow_input/bsn_vport
index 4f06462..6137a57 100644
--- a/openflow_input/bsn_vport
+++ b/openflow_input/bsn_vport
@@ -50,6 +50,8 @@
OF_BSN_VPORT_L2GRE_DSCP_COPY = 0x4,
OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID = 0x8,
+
+ OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID = 0x10,
};
// BSN Virtual port object header
@@ -91,6 +93,7 @@
uint8_t ttl;
pad(2);
uint32_t vpn; /* VPN ID (for GRE Key) */
+ uint32_t rate_limit; /* Rate limit in Kbps */
of_port_name_t if_name; /* Virtual Interface Name */
};
diff --git a/test_data/of13/bsn_virtual_port_create_request__l2gre.data b/test_data/of13/bsn_virtual_port_create_request__l2gre.data
index 9d90293..661fea1 100644
--- a/test_data/of13/bsn_virtual_port_create_request__l2gre.data
+++ b/test_data/of13/bsn_virtual_port_create_request__l2gre.data
@@ -1,12 +1,12 @@
-- binary
04 04 # version, type
-00 4c # len
+00 50 # len
01 02 03 04 # xid
00 5c 16 c7 # experimenter
00 00 00 0f # subtype
00 01 # vport type
-00 3c # vport len
-00 00 00 03 # vport flags
+00 40 # vport len
+00 00 00 1b # vport flags
00 00 00 01 # parent port no
00 00 00 02 # loopback port no
0a 0b 0c 0d 0e 0f # local mac
@@ -15,11 +15,13 @@
c0 00 10 02 # dst ip
01 40 00 00 # dscp, ttl, pad(2)
00 00 be ef # vpn
+00 00 04 00 # rate limit
66 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # vport if name
-- python
ofp.message.bsn_virtual_port_create_request(
xid=0x01020304, vport=ofp.bsn_vport_l2gre(
-flags=ofp.OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_DSCP_ASSIGN,
+flags=ofp.OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_DSCP_ASSIGN | \
+ofp.OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID,
port_no=1,
loopback_port_no=2,
local_mac=[0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],
@@ -29,6 +31,7 @@
dscp=1,
ttl=64,
vpn=0xbeef,
+rate_limit=0x400,
if_name="foo"
))
-- c
@@ -42,7 +45,9 @@
of_mac_addr_t nh_mac = { { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 } };
of_bsn_vport_l2gre_flags_set(vport,
OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID |
- OF_BSN_VPORT_L2GRE_DSCP_ASSIGN);
+ OF_BSN_VPORT_L2GRE_DSCP_ASSIGN |
+ OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID |
+ OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID);
of_bsn_vport_l2gre_port_no_set(vport, 1);
of_bsn_vport_l2gre_loopback_port_no_set(vport, 2);
of_bsn_vport_l2gre_local_mac_set(vport, local_mac);
@@ -52,6 +57,7 @@
of_bsn_vport_l2gre_dscp_set(vport, 1);
of_bsn_vport_l2gre_ttl_set(vport, 64);
of_bsn_vport_l2gre_vpn_set(vport, 0xbeef);
+ of_bsn_vport_l2gre_rate_limit_set(vport, 0x400);
of_bsn_vport_l2gre_if_name_set(vport, if_name);
}
of_bsn_virtual_port_create_request_vport_set(obj, vport);
@@ -64,7 +70,9 @@
.setFlags(
ImmutableSet.<OFBsnVportL2GreFlags>of(
OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID,
- OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_DSCP_ASSIGN
+ OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_DSCP_ASSIGN,
+ OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOOPBACK_IS_VALID,
+ OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID
)
)
.setPortNo(OFPort.of(1))
@@ -76,6 +84,7 @@
.setDscp((short)1)
.setTtl((short)64)
.setVpn(0xbeef)
+ .setRateLimit(0x400)
.setIfName("foo")
.build()
);