Merge into master from pull request #302:
wireshark: dissect OpenFlow payload of error messages (https://github.com/floodlight/loxigen/pull/302)
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPAddress.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPAddress.java
index 4cb0fa5..cee9ad1 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPAddress.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPAddress.java
@@ -142,9 +142,9 @@
public static IPAddress<?> of(@Nonnull InetAddress address) {
Preconditions.checkNotNull(address, "address must not be null");
if(address instanceof Inet4Address)
- return IPv4Address.of(address);
+ return IPv4Address.of((Inet4Address) address);
else if (address instanceof Inet6Address)
- return IPv6Address.of(address);
+ return IPv6Address.of((Inet6Address) address);
else
return IPAddress.of(address.getHostAddress());
}
diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPAddressTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPAddressTest.java
index 63c9c8f..2ba4528 100644
--- a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPAddressTest.java
+++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/IPAddressTest.java
@@ -1,10 +1,12 @@
package org.projectfloodlight.openflow.types;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.net.InetAddress;
import java.net.UnknownHostException;
import org.junit.Test;
@@ -56,6 +58,28 @@
}
}
+ @Test
+ public void testOfString() {
+ IPAddress<?> ip0 = IPAddress.of("1.2.3.4");
+ IPAddress<?> ip1 = IPAddress.of("abcd::1234");
+ assertTrue(ip0 instanceof IPv4Address);
+ assertTrue(ip1 instanceof IPv6Address);
+ assertEquals(ip0, IPv4Address.of("1.2.3.4"));
+ assertEquals(ip1, IPv6Address.of("abcd::1234"));
+ }
+
+ @Test
+ public void testOfInetAddress() throws Exception {
+ InetAddress ia0 = InetAddress.getByName("192.168.1.123");
+ InetAddress ia1 = InetAddress.getByName("fd00::4321");
+ IPAddress<?> ip0 = IPAddress.of(ia0);
+ IPAddress<?> ip1 = IPAddress.of(ia1);
+ assertTrue(ip0 instanceof IPv4Address);
+ assertTrue(ip1 instanceof IPv6Address);
+ assertEquals(ip0, IPv4Address.of(ia0));
+ assertEquals(ip1, IPv6Address.of(ia1));
+ }
+
@SuppressWarnings("deprecation")
@Test
public void testFromInetAddressException() throws UnknownHostException {
diff --git a/openflow_input/bsn_disable_vlan_counters b/openflow_input/bsn_disable_vlan_counters
new file mode 100644
index 0000000..068db64
--- /dev/null
+++ b/openflow_input/bsn_disable_vlan_counters
@@ -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_disable_vlan_counters : of_instruction_bsn {
+ uint16_t type == 65535;
+ uint16_t len;
+ uint32_t experimenter == 0x5c16c7;
+ uint32_t subtype == 9;
+ pad(4);
+};
diff --git a/openflow_input/standard-1.0 b/openflow_input/standard-1.0
index 1df03bb..1e4750b 100644
--- a/openflow_input/standard-1.0
+++ b/openflow_input/standard-1.0
@@ -341,7 +341,6 @@
uint16_t length;
uint32_t xid;
uint32_t experimenter == ?;
- uint32_t subtype;
of_octets_t data;
};
diff --git a/openflow_input/standard-1.1 b/openflow_input/standard-1.1
index a9aac6b..6765fe7 100644
--- a/openflow_input/standard-1.1
+++ b/openflow_input/standard-1.1
@@ -447,7 +447,6 @@
uint16_t length;
uint32_t xid;
uint32_t experimenter == ?;
- uint32_t subtype;
of_octets_t data;
};