OF Aux
diff --git a/Makefile b/Makefile
index 80b81eb..3767fba 100644
--- a/Makefile
+++ b/Makefile
@@ -84,6 +84,7 @@
ln -sf ../java_gen/pre-written/pom.xml ${OPENFLOWJ_ECLIPSE_WORKSPACE}/pom.xml
ln -sf ../java_gen/pre-written/LICENSE.txt ${OPENFLOWJ_ECLIPSE_WORKSPACE}/LICENSE.txt
ln -sf ../java_gen/pre-written/src ${OPENFLOWJ_ECLIPSE_WORKSPACE}
+ rsync --checksum --delete -rv ${LOXI_OUTPUT_DIR}/openflowj/gen-src/ ${OPENFLOWJ_ECLIPSE_WORKSPACE}/gen-src
cd ${OPENFLOWJ_ECLIPSE_WORKSPACE} && mvn eclipse:eclipse
# Unfortunately, mvn eclipse:eclipse resolves the symlink, which doesn't work with eclipse
cd ${OPENFLOWJ_ECLIPSE_WORKSPACE} && perl -pi -e 's{<classpathentry kind="src" path="[^"]*/java_gen/pre-written/src/}{<classpathentry kind="src" path="src/}' .classpath
diff --git a/c_gen/templates/_push_wire_types.c b/c_gen/templates/_push_wire_types.c
index b7b6288..5b16e24 100644
--- a/c_gen/templates/_push_wire_types.c
+++ b/c_gen/templates/_push_wire_types.c
@@ -41,6 +41,8 @@
*(uint16_t *)(buf + ${m.offset}) = htobe16(${m.value}); /* ${m.name} */
:: elif m.length == 4:
*(uint32_t *)(buf + ${m.offset}) = htobe32(${m.value}); /* ${m.name} */
+:: elif m.length == 8:
+ *(uint64_t *)(buf + ${m.offset}) = htobe64(${m.value}); /* ${m.name} */
:: else:
:: raise("unsupported push_wire_types length %d" % m.length)
:: #endif
diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h
index 1856ae5..0c9a2c6 100644
--- a/c_gen/templates/loci_show.h
+++ b/c_gen/templates/loci_show.h
@@ -382,5 +382,8 @@
#define LOCI_SHOW_checksum_128_checksum_mask(writer, cookie, val) LOCI_SHOW_checksum_128(writer, cookie, val)
#define LOCI_SHOW_u32_buckets_size(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
#define LOCI_SHOW_u32_entry_count(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u32_num_aux(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
+#define LOCI_SHOW_u64_selectors(writer, cookie, val) LOCI_SHOW_u64(writer, cookie, val)
+#define LOCI_SHOW_u32_selector_class(writer, cookie, val) LOCI_SHOW_u32(writer, cookie, val)
#endif /* _LOCI_SHOW_H_ */
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 87cd6e8..4e1306b 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -308,8 +308,9 @@
.op(read='U8.of(bb.readByte())', write='bb.writeByte($name.getRaw())', default="U8.ZERO")
u32obj = JType('U32', 'U32') \
.op(read='U32.of(bb.readInt())', write='bb.writeInt($name.getRaw())', default="U32.ZERO")
-u64 = JType('U64', 'U64') \
- .op(read='U64.ofRaw(bb.readLong())', write='bb.writeLong($name.getValue())', default="U64.ZERO")
+u64 = JType('U64', 'long') \
+ .op(read='U64.ofRaw(bb.readLong())', write='bb.writeLong($name.getValue())', default="U64.ZERO", pub_type=True) \
+ .op(read='bb.readLong()', write='bb.writeLong($name)', pub_type=False)
of_port = JType("OFPort") \
.op(version=1, read="OFPort.read2Bytes(bb)", write="$name.write2Bytes(bb)", default="OFPort.ANY") \
.op(version=ANY, read="OFPort.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="OFPort.ANY")
diff --git a/openflow_input/bsn_aux_cxns b/openflow_input/bsn_aux_cxns
new file mode 100644
index 0000000..247f81b
--- /dev/null
+++ b/openflow_input/bsn_aux_cxns
@@ -0,0 +1,54 @@
+// Copyright 2013, 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.
+
+// Request that the switch spawn and configure auxiliary OF connections.
+//
+#version 4
+// Set the number of desired aux connections num_aux=(0-16) accompanying this main connection
+// This message is only allowed on the main connection.
+struct of_bsn_set_aux_cxns_request : of_bsn_header {
+ uint8_t version;
+ uint8_t type == 4;
+ uint16_t length;
+ uint32_t xid;
+ uint32_t experimenter == 0x5c16c7;
+ uint32_t subtype == 58;
+ uint32_t num_aux;
+};
+
+// Synchronous reply. Confirms that the aux_cxn_set_request has been received and that the
+// the requested num_aux value is supported by the switch.
+struct of_bsn_set_aux_cxns_reply : of_bsn_header {
+ uint8_t version;
+ uint8_t type == 4;
+ uint16_t length;
+ uint32_t xid;
+ uint32_t experimenter == 0x5c16c7;
+ uint32_t subtype == 59;
+ uint32_t num_aux;
+ uint32_t status; //0 = Success, !0 = Failure
+};
diff --git a/test_data/of13/bsn_set_aux_cxns_reply.data b/test_data/of13/bsn_set_aux_cxns_reply.data
new file mode 100644
index 0000000..d385d84
--- /dev/null
+++ b/test_data/of13/bsn_set_aux_cxns_reply.data
@@ -0,0 +1,20 @@
+-- binary
+04 04 # version, type
+00 18 # length
+12 34 56 78 # xid
+00 5c 16 c7 # experimenter
+00 00 00 3b # subtype
+00 00 00 01 # num_aux
+00 00 00 00 # status
+-- python
+ofp.message.bsn_set_aux_cxns_reply(
+ xid=0x12345678, num_aux=1, status=0)
+-- java
+builder.setXid(0x12345678)
+ .setNumAux(1)
+ .setStatus(0)
+-- c
+obj = of_bsn_set_aux_cxns_reply_new(OF_VERSION_1_3);
+of_bsn_set_aux_cxns_reply_xid_set(obj, 0x12345678);
+of_bsn_set_aux_cxns_reply_num_aux_set(obj, 1);
+of_bsn_set_aux_cxns_reply_status_set(obj, 0);
diff --git a/test_data/of13/bsn_set_aux_cxns_request.data b/test_data/of13/bsn_set_aux_cxns_request.data
new file mode 100644
index 0000000..ee48d98
--- /dev/null
+++ b/test_data/of13/bsn_set_aux_cxns_request.data
@@ -0,0 +1,17 @@
+-- binary
+04 04 # version, type
+00 14 # length
+12 34 56 78 # xid
+00 5c 16 c7 # experimenter
+00 00 00 3A # subtype
+00 00 00 01 # num_aux
+-- python
+ofp.message.bsn_set_aux_cxns_request(
+ xid=0x12345678, num_aux=1)
+-- java
+builder.setXid(0x12345678)
+ .setNumAux(1)
+-- c
+obj = of_bsn_set_aux_cxns_request_new(OF_VERSION_1_3);
+of_bsn_set_aux_cxns_request_xid_set(obj, 0x12345678);
+of_bsn_set_aux_cxns_request_num_aux_set(obj, 1);