getCipherSuites() {
+ return cipherSuites;
+ }
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/AlienMessageListener.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/AlienMessageListener.java
new file mode 100644
index 00000000..a3cd7c6c
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/AlienMessageListener.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
+
+public interface AlienMessageListener {
+
+ /**
+ * Handler for alien but successfully deserialized messages for device
+ * @param message alien message
+ */
+ void onAlienMessage(OfHeader message);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java
new file mode 100644
index 00000000..5a0658eb
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerExtensionProvider.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.keys.TypeToClassKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.property.header.QueueProperty;
+
+/**
+ * Provides methods for deserialization part of extensibility.
+ * In case of handling multiple multiple structures of same type (actions,
+ * instructions, match entries, ... ) which are differentiated by
+ * vendor / experimenter subtype, vendor has to switch / choose between
+ * these subtypes.
+ *
+ * This has to be done in this way because of experimenter headers, which
+ * provide only vendor / experimenter ID. Subtype position may be different
+ * for different vendors (or not present at all) - that's why vendor has to
+ * handle it in his own implementations.
+ * @author michal.polkorab
+ */
+public interface DeserializerExtensionProvider {
+
+ /**
+ * Registers deserializer.
+ * Throws IllegalStateException when there is
+ * a deserializer already registered under given key.
+ *
+ * If the deserializer implements {@link DeserializerRegistryInjector} interface,
+ * the deserializer is injected with DeserializerRegistry instance.
+ *
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerDeserializer(MessageCodeKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Unregisters custom deserializer
+ * @param key used for deserializer lookup
+ * @return true if deserializer was removed,
+ * false if no deserializer was found under specified key
+ */
+ boolean unregisterDeserializer(ExperimenterDeserializerKey key);
+
+ /**
+ * Registers action deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerActionDeserializer(ExperimenterActionDeserializerKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Registers instruction deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerInstructionDeserializer(ExperimenterInstructionDeserializerKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Registers match entry deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerMatchEntryDeserializer(MatchEntryDeserializerKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Registers error message deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerErrorDeserializer(ExperimenterIdDeserializerKey key,
+ OFDeserializer deserializer);
+
+ /**
+ * Registers experimenter (vendor) message deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerExperimenterMessageDeserializer(ExperimenterIdDeserializerKey key,
+ OFDeserializer extends ExperimenterDataOfChoice> deserializer);
+
+ /**
+ * Registers multipart-reply (stats) message deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerMultipartReplyMessageDeserializer(ExperimenterIdDeserializerKey key,
+ OFDeserializer extends ExperimenterDataOfChoice> deserializer);
+
+ /**
+ * Registers multipart-reply table-features message deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerMultipartReplyTFDeserializer(ExperimenterIdDeserializerKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Registers meter band deserializer (used in multipart-reply meter-config)
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerMeterBandDeserializer(ExperimenterIdDeserializerKey key,
+ OFDeserializer deserializer);
+
+ /**
+ * Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerQueuePropertyDeserializer(ExperimenterIdDeserializerKey key,
+ OFDeserializer deserializer);
+
+ /**
+ * Registers type to class mapping used to assign return type when deserializing message
+ * @param key type to class key
+ * @param clazz return class
+ */
+ void registerDeserializerMapping(TypeToClassKey key, Class> clazz);
+
+ /**
+ * Unregisters type to class mapping used to assign return type when deserializing message
+ * @param key type to class key
+ * @return true if mapping was successfully removed
+ */
+ boolean unregisterDeserializerMapping(TypeToClassKey key);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java
index 665fa574..27660398 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistry.java
@@ -1,34 +1,53 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-
-/**
- * @author michal.polkorab
- *
- */
-public interface DeserializerRegistry {
-
- /**
- * Initializes deserializers
- */
- public void init();
-
- /**
- * @param key used for deserializer lookup
- * @return deserializer found
- */
- public
- SERIALIZER_TYPE getDeserializer(MessageCodeKey key);
-
- /**
- * @param key used to registry lookup
- * @param deserializer deserializer instance
- */
- public void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer);
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public interface DeserializerRegistry {
+
+ /**
+ * Initializes deserializers
+ */
+ void init();
+
+ /**
+ * @param type of particular deserializer
+ * @param key used for deserializer lookup
+ * @return deserializer found
+ */
+
+ T getDeserializer(MessageCodeKey key);
+
+ /**
+ * Registers deserializer.
+ * Throws IllegalStateException when there is
+ * a deserializer already registered under given key.
+ *
+ * If the deserializer implements {@link DeserializerRegistryInjector} interface,
+ * the deserializer is injected with DeserializerRegistry instance.
+ *
+ * @param key used for deserializer lookup
+ * @param deserializer deserializer instance
+ */
+ void registerDeserializer(MessageCodeKey key,
+ OFGeneralDeserializer deserializer);
+
+ /**
+ * Unregisters deserializer
+ * @param key used for deserializer lookup
+ * @return true if deserializer was removed,
+ * false if no deserializer was found under specified key
+ */
+ boolean unregisterDeserializer(MessageCodeKey key);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistryInjector.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistryInjector.java
index 5f029a2d..98e83633 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistryInjector.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/DeserializerRegistryInjector.java
@@ -1,21 +1,21 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-/**
- * Injects registry
- * @author michal.polkorab
- */
-public interface DeserializerRegistryInjector {
-
- /**
- * Injects deserializer registry into deserializer
- * @param deserializerRegistry
- */
- public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry);
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+/**
+ * Injects registry
+ * @author michal.polkorab
+ */
+public interface DeserializerRegistryInjector {
+
+ /**
+ * Injects deserializer registry into deserializer
+ * @param deserializerRegistry registry of deserializers
+ */
+ void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java
index 509c3863..b8a7ec0d 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKey.java
@@ -1,48 +1,62 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-/**
- * @author michal.polkorab
- *
- */
-public class EnhancedMessageCodeKey extends MessageCodeKey {
-
- private int msgType2;
-
- /**
- * Constructor
- * @param version wire protocol version
- * @param value used as distinguisher
- * @param value2 used as detailed distinguisher
- * @param clazz class of object that is going to be deserialized
- */
- public EnhancedMessageCodeKey(short version, int value, int value2, Class> clazz) {
- super(version, value, clazz);
- this.msgType2 = value2;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- EnhancedMessageCodeKey other = (EnhancedMessageCodeKey) obj;
- if (msgType2 != other.msgType2)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return super.toString() + " msgType2: " + msgType2;
- }
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class EnhancedMessageCodeKey extends MessageCodeKey {
+
+ private int msgType2;
+
+ /**
+ * Constructor
+ * @param version wire protocol version
+ * @param value used as distinguisher
+ * @param value2 used as detailed distinguisher
+ * @param clazz class of object that is going to be deserialized
+ */
+ public EnhancedMessageCodeKey(short version, int value, int value2, Class> clazz) {
+ super(version, value, clazz);
+ this.msgType2 = value2;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + msgType2;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ EnhancedMessageCodeKey other = (EnhancedMessageCodeKey) obj;
+ if (msgType2 != other.msgType2) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " msgType2: " + msgType2;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java
index 15919e4f..3a9fffc2 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKey.java
@@ -1,53 +1,68 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-
-/**
- * More specific key for {@link SerializerRegistry}
- * @author michal.polkorab
- * @param main type
- * @param specific type
- */
-public class EnhancedMessageTypeKey extends MessageTypeKey {
-
- private final Class msgType2;
-
- /**
- * @param msgVersion
- * @param msgType
- * @param msgType2
- */
- public EnhancedMessageTypeKey(short msgVersion, Class msgType, Class msgType2) {
- super(msgVersion, msgType);
- this.msgType2 = msgType2;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- @SuppressWarnings("rawtypes")
- EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj;
- if (msgType2 == null) {
- if (other.msgType2 != null)
- return false;
- } else if (!msgType2.getName().equals(other.msgType2.getName()))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return super.toString() + " msgType2: " + msgType2.getName();
- }
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+
+
+/**
+ * More specific key for {@link SerializerRegistry}
+ * @author michal.polkorab
+ * @param main type
+ * @param specific type
+ */
+public class EnhancedMessageTypeKey extends MessageTypeKey {
+
+ private final Class msgType2;
+
+ /**
+ * @param msgVersion protocol version
+ * @param msgType main type
+ * @param msgType2 subtype
+ */
+ public EnhancedMessageTypeKey(short msgVersion, Class msgType, Class msgType2) {
+ super(msgVersion, msgType);
+ this.msgType2 = msgType2;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((msgType2 == null) ? 0 : msgType2.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ @SuppressWarnings("rawtypes")
+ EnhancedMessageTypeKey other = (EnhancedMessageTypeKey) obj;
+ if (msgType2 == null) {
+ if (other.msgType2 != null) {
+ return false;
+ }
+ } else if (!msgType2.getName().equals(other.msgType2.getName())) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " msgType2: " + msgType2.getName();
+ }
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java
index 205c7692..c80df7b9 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderDeserializer.java
@@ -1,27 +1,26 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-/**
- * @author michal.polkorab
- * @param
- */
-public interface HeaderDeserializer extends OFGeneralDeserializer {
-
- /**
- * Deserializes byte message headers
- *
- * @param rawMessage message as bytes in ByteBuf
- * @return POJO/DTO
- */
- public E deserializeHeader(ByteBuf rawMessage);
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * @author michal.polkorab
+ * @param output message type
+ */
+public interface HeaderDeserializer extends OFGeneralDeserializer {
+
+ /**
+ * Deserializes byte message headers
+ *
+ * @param rawMessage message as bytes in ByteBuf
+ * @return POJO/DTO
+ */
+ E deserializeHeader(ByteBuf rawMessage);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderSerializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderSerializer.java
index 3392f817..427d84ce 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderSerializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/HeaderSerializer.java
@@ -1,27 +1,26 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-import io.netty.buffer.ByteBuf;
-
-/**
- * Does only-header serialization (such as oxm_ids, action_ids, instruction_ids)
- * @author michal.polkorab
- * @param
- */
-public interface HeaderSerializer extends OFGeneralSerializer {
-
- /**
- * Serializes object headers (e.g. for Multipart message - Table Features)
- * @param input object whose headers should be serialized
- * @param outBuffer output buffer
- */
- public void serializeHeader(SERIALIZER_TYPE input, ByteBuf outBuffer);
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import io.netty.buffer.ByteBuf;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * Does only-header serialization (such as oxm_ids, action_ids, instruction_ids)
+ * @author michal.polkorab
+ * @param input message type
+ */
+public interface HeaderSerializer extends OFGeneralSerializer {
+
+ /**
+ * Serializes object headers (e.g. for Multipart message - Table Features)
+ * @param input object whose headers should be serialized
+ * @param outBuffer output buffer
+ */
+ void serializeHeader(T input, ByteBuf outBuffer);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java
index a514e00f..06c54f9d 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFDeserializer.java
@@ -9,8 +9,7 @@
package org.opendaylight.openflowjava.protocol.api.extensibility;
import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Uniform interface for deserializing factories
@@ -18,13 +17,13 @@
* @author timotej.kubas
* @param message code type
*/
-public interface OFDeserializer extends OFGeneralDeserializer {
+public interface OFDeserializer extends OFGeneralDeserializer {
/**
* Transforms byte message into POJO/DTO (of type E).
- *
+ *
* @param message message as bytes in ByteBuf
* @return POJO/DTO
*/
- public E deserialize(ByteBuf message);
+ E deserialize(ByteBuf message);
}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralDeserializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralDeserializer.java
index bedb267a..c4132cc6 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralDeserializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralDeserializer.java
@@ -1,17 +1,17 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-
-/**
- * @author michal.polkorab
- */
-public interface OFGeneralDeserializer {
-
- // empty unifying interface
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+
+/**
+ * @author michal.polkorab
+ */
+public interface OFGeneralDeserializer {
+
+ // empty unifying interface
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralSerializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralSerializer.java
index 0001c3e9..6dd5d3f0 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralSerializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFGeneralSerializer.java
@@ -1,17 +1,17 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-/**
- * Unifying superinterface
- * @author michal.polkorab
- * */
-public interface OFGeneralSerializer {
-
- // empty unifying superinterface
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+/**
+ * Unifying superinterface
+ * @author michal.polkorab
+ * */
+public interface OFGeneralSerializer {
+
+ // empty unifying superinterface
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFSerializer.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFSerializer.java
index 2572a6f2..ec63be53 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFSerializer.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/OFSerializer.java
@@ -8,23 +8,22 @@
package org.opendaylight.openflowjava.protocol.api.extensibility;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
import io.netty.buffer.ByteBuf;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
* Uniform interface for serializers
* @author michal.polkorab
* @author timotej.kubas
- * @param message type
+ * @param message type
*/
-public interface OFSerializer extends OFGeneralSerializer {
+public interface OFSerializer extends OFGeneralSerializer {
/**
* Transforms POJO/DTO into byte message (ByteBuf).
* @param input object to be serialized
* @param outBuffer output buffer
*/
- public void serialize(SERIALIZER_TYPE input, ByteBuf outBuffer);
+ void serialize(T input, ByteBuf outBuffer);
}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java
new file mode 100755
index 00000000..366cd3ab
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerExtensionProvider.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdMeterSubTypeSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.InstructionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
+
+
+/**
+ * Provides methods for serialization part of extensibility.
+ * In case of handling multiple structures of same type (actions,
+ * instructions, match entries, ... ) which are differentiated by
+ * vendor / experimenter subtype, vendor has to switch / choose between
+ * these subtypes.
+ *
+ * This has to be done in this way because of unknown augmentations
+ * - that's why vendor has to handle it in his own implementations.
+ * @author michal.polkorab
+ */
+public interface SerializerExtensionProvider {
+
+ /**
+ * Registers serializer
+ * Throws IllegalStateException when there is
+ * a serializer already registered under given key.
+ *
+ * If the serializer implements {@link SerializerRegistryInjector} interface,
+ * the serializer is injected with SerializerRegistry instance.
+ *
+ * @param serializer key type
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerSerializer(MessageTypeKey key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * Unregisters custom serializer
+ * @param key used for serializer lookup
+ * @return true if serializer was removed,
+ * false if no serializer was found under specified key
+ */
+ boolean unregisterSerializer(ExperimenterSerializerKey key);
+
+ /**
+ * Registers action serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerActionSerializer(ActionSerializerKey> key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * Registers instruction serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerInstructionSerializer(InstructionSerializerKey> key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * Registers match entry serializer
+ * @param oxm type
+ * @param match field type
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerMatchEntrySerializer(
+ MatchEntrySerializerKey key,OFGeneralSerializer serializer);
+
+ /**
+ * Registers experimenter (vendor) message serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerExperimenterMessageSerializer(ExperimenterIdSerializerKey extends ExperimenterDataOfChoice> key,
+ OFSerializer extends ExperimenterDataOfChoice> serializer);
+
+ /**
+ * Registers multipart-request (stats-request) serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerMultipartRequestSerializer(ExperimenterIdSerializerKey extends ExperimenterDataOfChoice> key,
+ OFSerializer extends ExperimenterDataOfChoice> serializer);
+
+ /**
+ * Registers multipart-request table-features serializer
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerMultipartRequestTFSerializer(ExperimenterIdSerializerKey key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * @deprecated Since we use ExperimenterIdMeterSubTypeSerializerKey as MeterBandSerializer's key, in order to avoid
+ * the occurrence of an error,we should discard this function
+ * Registers meter band serializer (used in meter-mod messages)
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ @Deprecated
+ void registerMeterBandSerializer(ExperimenterIdSerializerKey key,
+ OFSerializer serializer);
+
+ /**
+ * Registers meter band serializer (used in meter-mod messages)
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerMeterBandSerializer(ExperimenterIdMeterSubTypeSerializerKey key,
+ OFSerializer serializer);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java
index b5eec47f..1ddc4856 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistry.java
@@ -1,37 +1,56 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-
-/**
- * Stores and handles serializers
- * @author michal.polkorab
- *
- */
-public interface SerializerRegistry {
-
- /**
- * Serializer registry provisioning
- */
- public void init();
-
- /**
- * @param msgTypeKey lookup key
- * @return serializer or NullPointerException if no serializer was found
- */
- public SERIALIZER_TYPE
- getSerializer(MessageTypeKey msgTypeKey);
-
- /**
- * Registers serializer under key
- * @param msgTypeKey lookup key
- * @param serializer serializer implementation
- */
- public void
- registerSerializer(MessageTypeKey msgTypeKey, OFGeneralSerializer serializer);
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+
+/**
+ * Stores and handles serializers
+ * K - {@link MessageTypeKey} parameter type,
+ * S - returned serializer type
+ * @author michal.polkorab
+ */
+public interface SerializerRegistry {
+
+ /**
+ * Serializer registry provisioning
+ */
+ void init();
+
+ /**
+ * @param input key type
+ * @param type of resulting serializer
+ * @param msgTypeKey lookup key
+ * @return serializer or NullPointerException if no serializer was found
+ */
+ S getSerializer(MessageTypeKey msgTypeKey);
+
+ /**
+ * Registers serializer
+ * Throws IllegalStateException when there is
+ * a serializer already registered under given key.
+ *
+ * If the serializer implements {@link SerializerRegistryInjector} interface,
+ * the serializer is injected with SerializerRegistry instance.
+ *
+ * @param serializer key type
+ * @param key used for serializer lookup
+ * @param serializer serializer implementation
+ */
+ void registerSerializer(MessageTypeKey key,
+ OFGeneralSerializer serializer);
+
+ /**
+ * Unregisters serializer
+ * @param serializer key type
+ * @param key used for serializer lookup
+ * @return true if serializer was removed,
+ * false if no serializer was found under specified key
+ */
+ boolean unregisterSerializer(MessageTypeKey key);
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistryInjector.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistryInjector.java
index 260c2cc4..b074b15f 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistryInjector.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/SerializerRegistryInjector.java
@@ -1,22 +1,22 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-/**
- * Serializer registry injector
- * @author michal.polkorab
- */
-public interface SerializerRegistryInjector {
-
- /**
- * Injects serializer registry
- * @param serializerRegistry registry instance
- */
- public void injectSerializerRegistry(SerializerRegistry serializerRegistry);
-
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+/**
+ * Serializer registry injector
+ * @author michal.polkorab
+ */
+public interface SerializerRegistryInjector {
+
+ /**
+ * Injects serializer registry
+ * @param serializerRegistry registry instance
+ */
+ void injectSerializerRegistry(SerializerRegistry serializerRegistry);
+
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java
new file mode 100644
index 00000000..208a1227
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKey.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ActionDeserializerKey extends MessageCodeKey {
+
+ private Long experimenterId;
+ /**
+ * @param version protocol wire version
+ * @param type action type
+ * @param experimenterId experimenter / vendor ID
+ */
+ public ActionDeserializerKey(short version,
+ int type, Long experimenterId) {
+ super(version, type, Action.class);
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof ActionDeserializerKey)) {
+ return false;
+ }
+ ActionDeserializerKey other = (ActionDeserializerKey) obj;
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java
new file mode 100644
index 00000000..7d096f84
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKey.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+
+/**
+ * @author michal.polkorab
+ * @param action type
+ */
+public class ActionSerializerKey extends MessageTypeKey
+ implements ExperimenterSerializerKey {
+
+ private Class actionType;
+ private Long experimenterId;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param actionType type of action
+ * @param experimenterId experimenter / vendor ID
+ */
+ public ActionSerializerKey(short msgVersion, Class actionType,
+ Long experimenterId) {
+ super(msgVersion, Action.class);
+ this.actionType = actionType;
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((actionType == null) ? 0 : actionType.hashCode());
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ActionSerializerKey> other = (ActionSerializerKey>) obj;
+ if (actionType == null) {
+ if (other.actionType != null) {
+ return false;
+ }
+ } else if (!actionType.equals(other.actionType)) {
+ return false;
+ }
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " action type: " + actionType.getName() + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionDeserializerKey.java
new file mode 100644
index 00000000..40f21d76
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionDeserializerKey.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public final class ExperimenterActionDeserializerKey extends ActionDeserializerKey
+ implements ExperimenterDeserializerKey {
+
+ /**
+ * @param version protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ */
+ public ExperimenterActionDeserializerKey(short version, Long experimenterId) {
+ super(version, EncodeConstants.EXPERIMENTER_VALUE, experimenterId);
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionSerializerKey.java
new file mode 100644
index 00000000..b07c696a
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterActionSerializerKey.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
+
+/**
+ * @author michal.polkorab
+ */
+public final class ExperimenterActionSerializerKey extends ActionSerializerKey
+ implements ExperimenterSerializerKey {
+
+ private Class extends ExperimenterActionSubType> actionSubType;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param actionSubType vendor defined subtype
+ */
+ public ExperimenterActionSerializerKey(short msgVersion, Long experimenterId, Class extends ExperimenterActionSubType> actionSubType) {
+ super(msgVersion, ExperimenterIdCase.class, experimenterId);
+ this.actionSubType = actionSubType;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((actionSubType == null) ? 0 : actionSubType.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ExperimenterActionSerializerKey other = (ExperimenterActionSerializerKey) obj;
+ if (actionSubType == null) {
+ if (other.actionSubType != null) {
+ return false;
+ }
+ } else if (!actionSubType.equals(other.actionSubType)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterDeserializerKey.java
new file mode 100644
index 00000000..3169de76
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterDeserializerKey.java
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+/**
+ * Marker interface - marks keys appropriate for experimenter deserializer registration
+ * @author michal.polkorab
+ */
+public interface ExperimenterDeserializerKey {
+ // only empty marker interface - to ease extensions registration
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdDeserializerKey.java
new file mode 100644
index 00000000..ec2cf3e1
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdDeserializerKey.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * @author michal.polkorab
+ */
+public class ExperimenterIdDeserializerKey extends MessageCodeKey implements ExperimenterDeserializerKey {
+
+ private long experimenterId;
+
+ /**
+ * @param type of target experimenter object
+ * @param version protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param objectClass class of created object
+ */
+ public ExperimenterIdDeserializerKey(final short version, final long experimenterId,
+ final Class objectClass) {
+ super(version, EncodeConstants.EXPERIMENTER_VALUE, objectClass);
+ this.experimenterId = experimenterId;
+ }
+
+ protected int hashCodeOfLong(long longValue) {
+ return (int) (longValue ^ (longValue >>> 32));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + hashCodeOfLong(experimenterId);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof ExperimenterIdDeserializerKey)) {
+ return false;
+ }
+ ExperimenterIdDeserializerKey other = (ExperimenterIdDeserializerKey) obj;
+ if (experimenterId != other.experimenterId) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdMeterSubTypeSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdMeterSubTypeSerializerKey.java
new file mode 100755
index 00000000..f568a028
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdMeterSubTypeSerializerKey.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 ZTE, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterMeterBandSubType;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * Created by hyy on 2016/9/8.
+ */
+public class ExperimenterIdMeterSubTypeSerializerKey extends ExperimenterIdSerializerKey {
+
+ private Class extends ExperimenterMeterBandSubType> meterSubType;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param objectClass class of object to be serialized
+ * @param meterSubType vendor defined subtype
+ */
+ public ExperimenterIdMeterSubTypeSerializerKey(short msgVersion, long experimenterId,
+ Class objectClass, Class extends ExperimenterMeterBandSubType> meterSubType) {
+ super(msgVersion, experimenterId, objectClass);
+ this.meterSubType = meterSubType;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((meterSubType == null) ? 0 : meterSubType.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ExperimenterIdMeterSubTypeSerializerKey other = (ExperimenterIdMeterSubTypeSerializerKey) obj;
+ if (meterSubType == null) {
+ if (other.meterSubType != null) {
+ return false;
+ }
+ } else if (!meterSubType.equals(other.meterSubType)) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdSerializerKey.java
new file mode 100644
index 00000000..8a900e34
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdSerializerKey.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * @author michal.polkorab
+ * @param class of object to be serialized
+ */
+public class ExperimenterIdSerializerKey extends MessageTypeKey
+ implements ExperimenterSerializerKey {
+
+ private long experimenterId;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param objectClass class of object to be serialized
+ */
+ public ExperimenterIdSerializerKey(short msgVersion,
+ long experimenterId, Class objectClass) {
+ super(msgVersion, objectClass);
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + hashCodeOfLong(experimenterId);
+ return result;
+ }
+
+ protected int hashCodeOfLong(long longValue) {
+ return (int) (longValue ^ (longValue >>> 32));
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof ExperimenterIdSerializerKey)) {
+ return false;
+ }
+ ExperimenterIdSerializerKey> other = (ExperimenterIdSerializerKey>) obj;
+ if (experimenterId != other.experimenterId) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeDeserializerKey.java
new file mode 100644
index 00000000..c956feb0
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeDeserializerKey.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * @author michal.polkorab
+ */
+public class ExperimenterIdTypeDeserializerKey extends ExperimenterIdDeserializerKey {
+
+ private long type;
+
+ /**
+ * @param type of target experimenter object
+ * @param version protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param type data type according to vendor implementation
+ * @param objectClass class of object to be serialized
+ */
+ public ExperimenterIdTypeDeserializerKey(final short version, final long experimenterId,
+ final long type, Class objectClass) {
+ super(version, experimenterId, objectClass);
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + hashCodeOfLong(type);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof ExperimenterIdTypeDeserializerKey)) {
+ return false;
+ }
+ ExperimenterIdTypeDeserializerKey other = (ExperimenterIdTypeDeserializerKey) obj;
+ if (type != other.type) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + "; type: " + type;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeSerializerKey.java
new file mode 100644
index 00000000..b8f6ac93
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterIdTypeSerializerKey.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+
+/**
+ * @param class of object to be serialized
+ * @author michal.polkorab
+ */
+public class ExperimenterIdTypeSerializerKey extends ExperimenterIdSerializerKey {
+
+ private long type;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ * @param type data type according to vendor implementation
+ * @param objectClass class of object to be serialized
+ */
+ public ExperimenterIdTypeSerializerKey(short msgVersion,
+ long experimenterId, long type, Class objectClass) {
+ super(msgVersion, experimenterId, objectClass);
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + hashCodeOfLong(type);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof ExperimenterIdTypeSerializerKey)) {
+ return false;
+ }
+ ExperimenterIdTypeSerializerKey> other = (ExperimenterIdTypeSerializerKey>) obj;
+ if (type != other.type) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + "; type: " + type;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionDeserializerKey.java
new file mode 100644
index 00000000..eea3e4ef
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionDeserializerKey.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public final class ExperimenterInstructionDeserializerKey extends InstructionDeserializerKey
+ implements ExperimenterDeserializerKey {
+
+ /**
+ * @param version protocol wire version
+ * @param experimenterId experimenter (vendor) identifier
+ */
+ public ExperimenterInstructionDeserializerKey(short version, Long experimenterId) {
+ super(version, EncodeConstants.EXPERIMENTER_VALUE, experimenterId);
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionSerializerKey.java
new file mode 100644
index 00000000..15ee03a0
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterInstructionSerializerKey.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.instruction.container.instruction.choice.ExperimenterIdCase;
+
+/**
+ * @author michal.polkorab
+ */
+public final class ExperimenterInstructionSerializerKey extends InstructionSerializerKey
+ implements ExperimenterSerializerKey {
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param experimenterId experimenter / vendor ID
+ */
+ public ExperimenterInstructionSerializerKey(short msgVersion, Long experimenterId) {
+ super(msgVersion, ExperimenterIdCase.class, experimenterId);
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterSerializerKey.java
new file mode 100644
index 00000000..d027155a
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/ExperimenterSerializerKey.java
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+/**
+ * Marker interface - marks keys appropriate for experimenter serializer registration
+ * @author michal.polkorab
+ */
+public interface ExperimenterSerializerKey {
+ // only empty marker interface - to ease extensions registration
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java
new file mode 100644
index 00000000..8482f6ef
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKey.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class InstructionDeserializerKey extends MessageCodeKey {
+
+ private Long experimenterId;
+ /**
+ * @param version protocol wire version
+ * @param type instruction type
+ * @param experimenterId experimenter (vendor) identifier
+ */
+ public InstructionDeserializerKey(short version, int type,
+ Long experimenterId) {
+ super(version, type, Instruction.class);
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof InstructionDeserializerKey)) {
+ return false;
+ }
+ InstructionDeserializerKey other = (InstructionDeserializerKey) obj;
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java
new file mode 100644
index 00000000..213b22db
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.InstructionChoice;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
+
+/**
+ * @author michal.polkorab
+ * @param instruction type
+ */
+public class InstructionSerializerKey
+ extends MessageTypeKey implements ExperimenterSerializerKey {
+
+ private Class instructionType;
+ private Long experimenterId;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param instructionType type of instruction
+ * @param experimenterId experimenter / vendor ID
+ */
+ public InstructionSerializerKey(short msgVersion, Class instructionType,
+ Long experimenterId) {
+ super(msgVersion, Instruction.class);
+ this.instructionType = instructionType;
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ result = prime * result + ((instructionType == null) ? 0 : instructionType.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof InstructionSerializerKey)) {
+ return false;
+ }
+ InstructionSerializerKey> other = (InstructionSerializerKey>) obj;
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ if (instructionType == null) {
+ if (other.instructionType != null) {
+ return false;
+ }
+ } else if (!instructionType.equals(other.instructionType)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " instructionType type: " + instructionType.getName()
+ + " vendorID: " + experimenterId;
+ }
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java
new file mode 100644
index 00000000..4f995959
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKey.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public final class MatchEntryDeserializerKey extends MessageCodeKey
+ implements ExperimenterDeserializerKey {
+
+ private int oxmField;
+ private Long experimenterId;
+
+ /**
+ * @param version protocol wire version
+ * @param oxmClass oxm_class (see specification)
+ * @param oxmField oxm_field (see specification)
+ */
+ public MatchEntryDeserializerKey(short version,
+ int oxmClass, int oxmField) {
+ super(version, oxmClass, MatchEntry.class);
+ this.oxmField = oxmField;
+ }
+
+ /**
+ * @param experimenterId experimenter / vendor ID
+ */
+ public void setExperimenterId(Long experimenterId) {
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ result = prime * result + oxmField;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ MatchEntryDeserializerKey other = (MatchEntryDeserializerKey) obj;
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ if (oxmField != other.oxmField) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " oxm_field: " + oxmField + " experimenterID: " + experimenterId;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java
new file mode 100644
index 00000000..75fcd3e6
--- /dev/null
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKey.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+
+/**
+ * @author michal.polkorab
+ * @param oxm_class (see specification)
+ * @param oxm_field (see specification)
+ */
+public final class MatchEntrySerializerKey
+ extends MessageTypeKey implements ExperimenterSerializerKey {
+
+ private Class oxmClass;
+ private Class oxmField;
+ private Long experimenterId;
+
+ /**
+ * @param msgVersion protocol wire version
+ * @param oxmClass oxm_class (see specification)
+ * @param oxmField oxm_field (see specification)
+ */
+ public MatchEntrySerializerKey(short msgVersion, Class oxmClass,
+ Class oxmField) {
+ super(msgVersion, MatchEntry.class);
+ this.oxmClass = oxmClass;
+ this.oxmField = oxmField;
+ }
+
+ /**
+ * @param experimenterId experimenter / vendor ID
+ */
+ public void setExperimenterId(Long experimenterId) {
+ this.experimenterId = experimenterId;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode());
+ result = prime * result + ((oxmClass == null) ? 0 : oxmClass.hashCode());
+ result = prime * result + ((oxmField == null) ? 0 : oxmField.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ MatchEntrySerializerKey, ?> other = (MatchEntrySerializerKey, ?>) obj;
+ if (experimenterId == null) {
+ if (other.experimenterId != null) {
+ return false;
+ }
+ } else if (!experimenterId.equals(other.experimenterId)) {
+ return false;
+ }
+ if (oxmClass == null) {
+ if (other.oxmClass != null) {
+ return false;
+ }
+ } else if (!oxmClass.equals(other.oxmClass)) {
+ return false;
+ }
+ if (oxmField == null) {
+ if (other.oxmField != null) {
+ return false;
+ }
+ } else if (!oxmField.equals(other.oxmField)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " oxm_class: " + oxmClass.getName() + " oxm_field: "
+ + oxmField.getName() + " experimenterID: " + experimenterId;
+ }
+}
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageCodeKey.java
similarity index 65%
rename from openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java
rename to openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageCodeKey.java
index 5ebcde21..566b3623 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKey.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageCodeKey.java
@@ -1,65 +1,81 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
-/**
- * @author michal.polkorab
- */
-public class MessageCodeKey {
-
- private short msgVersion;
- private int msgType;
- private Class> clazz;
-
- /**
- * Constructor
- * @param version wire protocol version
- * @param value used as distinguisher
- * @param clazz class of object that is going to be deserialized
- */
- public MessageCodeKey(short version, int value, Class> clazz) {
- this.msgVersion = version;
- this.msgType = value;
- this.clazz = clazz;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
- result = prime * result + msgType;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- MessageCodeKey other = (MessageCodeKey) obj;
- if (clazz == null) {
- if (other.clazz != null)
- return false;
- } else if (!clazz.equals(other.clazz))
- return false;
- if (msgType != other.msgType)
- return false;
- if (msgVersion != other.msgVersion)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "msgVersion: " + msgVersion + " class: " + clazz.getName() + " msgType: " + msgType;
- }
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+/**
+ * @author michal.polkorab
+ */
+public class MessageCodeKey {
+
+ private short msgVersion;
+ private int msgType;
+ private Class> clazz;
+
+ /**
+ * Constructor
+ * @param version wire protocol version
+ * @param value used as distinguisher (read from binary data / buffer)
+ * @param clazz class of object that is going to be deserialized
+ */
+ public MessageCodeKey(short version, int value, Class> clazz) {
+ this.msgVersion = version;
+ this.msgType = value;
+ this.clazz = clazz;
+ }
+
+ public int getMsgType() {
+ return this.msgType;
+ }
+
+ public Class> getClazz() {
+ return this.clazz;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
+ result = prime * result + msgType;
+ result = prime * result + msgVersion;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (!(obj instanceof MessageCodeKey)) {
+ return false;
+ }
+ MessageCodeKey other = (MessageCodeKey) obj;
+ if (clazz == null) {
+ if (other.clazz != null) {
+ return false;
+ }
+ } else if (!clazz.equals(other.clazz)) {
+ return false;
+ }
+ if (msgType != other.msgType) {
+ return false;
+ }
+ if (msgVersion != other.msgVersion) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "msgVersion: " + msgVersion + " objectClass: " + clazz.getName() + " msgType: " + msgType;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageTypeKey.java
similarity index 59%
rename from openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java
rename to openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageTypeKey.java
index 7885b7e1..5a130cb1 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKey.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/MessageTypeKey.java
@@ -5,61 +5,64 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
-package org.opendaylight.openflowjava.protocol.api.extensibility;
-
+package org.opendaylight.openflowjava.protocol.api.keys;
/**
- * Class used as a key in {@link SerializerRegistry}
+ * Class used as a key in {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry}
* @author michal.polkorab
* @author timotej.kubas
* @param message type (class)
*/
public class MessageTypeKey {
- private final Class msgType;
+ private final Class extends E> msgType;
private final short msgVersion;
-
+
/**
* @param msgVersion protocol version
- * @param msgType type of message
+ * @param msgType type of message - class of serialized object
*/
- public MessageTypeKey(short msgVersion, Class msgType) {
- super();
+ public MessageTypeKey(short msgVersion, Class extends E> msgType) {
this.msgType = msgType;
this.msgVersion = msgVersion;
}
-
+
@Override
public String toString() {
- return "msgVersion: " + msgVersion + " msgType: " + msgType.getName();
+ return "msgVersion: " + msgVersion + " objectType: " + msgType.getName();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((msgType == null) ? 0 : msgType.getName().hashCode());
+ result = prime * result + ((msgType == null) ? 0 : msgType.hashCode());
+ result = prime * result + msgVersion;
return result;
}
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (!(obj instanceof MessageTypeKey)) {
return false;
+ }
MessageTypeKey> other = (MessageTypeKey>) obj;
if (msgType == null) {
- if (other.msgType != null)
+ if (other.msgType != null) {
return false;
- } else if (!other.msgType.getName().equals(msgType.getName()))
+ }
+ } else if (!msgType.equals(other.msgType)) {
return false;
- if (msgVersion != other.msgVersion)
+ }
+ if (msgVersion != other.msgVersion) {
return false;
+ }
return true;
}
-
}
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKey.java
similarity index 79%
rename from openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java
rename to openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKey.java
index 8be2df3e..71eed094 100644
--- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/TypeToClassKey.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKey.java
@@ -1,52 +1,57 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.deserialization;
-
-/**
- * @author michal.polkorab
- *
- */
-public class TypeToClassKey {
-
- private short version;
- private int type;
-
- /**
- * Constructor
- * @param version wire protocol version
- * @param type message type / code
- */
- public TypeToClassKey(short version, int type) {
- this.version = version;
- this.type = type;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + type;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- TypeToClassKey other = (TypeToClassKey) obj;
- if (type != other.type)
- return false;
- if (version != other.version)
- return false;
- return true;
- }
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class TypeToClassKey {
+
+ private short version;
+ private int type;
+
+ /**
+ * Constructor
+ * @param version wire protocol version
+ * @param type message type / code
+ */
+ public TypeToClassKey(short version, int type) {
+ this.version = version;
+ this.type = type;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + type;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TypeToClassKey other = (TypeToClassKey) obj;
+ if (type != other.type) {
+ return false;
+ }
+ if (version != other.version) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java
index 171a684d..995fd350 100644
--- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/BinContent.java
@@ -14,16 +14,20 @@
*/
public abstract class BinContent {
+ private BinContent() {
+ //not called
+ }
+
/**
- * @param value
- * @return int part wrapped in long
+ * @param value input integer value (might be negative)
+ * @return int part wrapped in long (always positive)
*/
public static long intToUnsignedLong(int value) {
return value & 0x00000000ffffffffL;
}
-
+
/**
- * @param value
+ * @param value input long value
* @return long cut into int
*/
public static int longToSignedInt(long value) {
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/EncodeConstants.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java
similarity index 71%
rename from openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/EncodeConstants.java
rename to openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java
index 711152f9..58d6ccd4 100644
--- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/EncodeConstants.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/EncodeConstants.java
@@ -6,10 +6,10 @@
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.openflowjava.protocol.impl.util;
+package org.opendaylight.openflowjava.protocol.api.util;
/**
- * Stores common constants
+ * Stores common constants.
* @author michal.polkorab
*/
public abstract class EncodeConstants {
@@ -18,15 +18,23 @@ public abstract class EncodeConstants {
public static final byte PADDING = 8;
/** OpenFlow v1.0 wire protocol number */
public static final byte OF10_VERSION_ID = 0x01;
- /** OpenFlow v1.0 wire protocol number */
+ /** OpenFlow v1.3 wire protocol number */
public static final byte OF13_VERSION_ID = 0x04;
+ /** OpenFlow v1.4 wire protocol number */
+ public static final byte OF14_VERSION_ID = 0x05;
+ /** OpenFlow v1.5 wire protocol number */
+ public static final byte OF15_VERSION_ID = 0x06;
+ /** OpenFlow Hello message type value */
+ public static final byte OF_HELLO_MESSAGE_TYPE_VALUE = 0;
+ /** OpenFlow PacketIn message type value */
+ public static final byte OF_PACKETIN_MESSAGE_TYPE_VALUE = 10;
/** Index of length in Openflow header */
public static final int OFHEADER_LENGTH_INDEX = 2;
/** Size of Openflow header */
public static final int OFHEADER_SIZE = 8;
/** Zero length - used when the length is updated later */
public static final int EMPTY_LENGTH = 0;
-
+
/** Length of mac address */
public static final byte MAC_ADDRESS_LENGTH = 6;
/** Number of groups in ipv4 address */
@@ -52,10 +60,16 @@ public abstract class EncodeConstants {
/** Common experimenter value */
public static final int EXPERIMENTER_VALUE = 0xFFFF;
-
/** OF v1.0 maximal port name length */
public static final byte MAX_PORT_NAME_LENGTH = 16;
- /** OF v1.3 lenght of experimenter_ids - see Multipart TableFeatures (properties) message */
- public static final byte EXPERIMENTER_IDS_LENGTH = 8;
+ /** ONF Approved Extensions Constants */
+ /** Experimenter ID of ONF approved extensions */
+ public static final long ONF_EXPERIMENTER_ID = 0x4F4E4600;
+ /** ONFOXM_ET_TCP_FLAGS value */
+ public static final int ONFOXM_ET_TCP_FLAGS = 42;
+
+ private EncodeConstants() {
+ //not called
+ }
}
diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OxmMatchConstants.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/OxmMatchConstants.java
similarity index 88%
rename from openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OxmMatchConstants.java
rename to openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/OxmMatchConstants.java
index 408cbb69..e47b70d6 100644
--- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OxmMatchConstants.java
+++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/util/OxmMatchConstants.java
@@ -1,106 +1,120 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.openflowjava.protocol.impl.util;
-
-/**
- * Stores oxm_match constants
- * @author michal.polkorab
- *
- */
-public abstract class OxmMatchConstants {
-
- /** Backward compatibility with NXM */
- public static final int NXM_0_CLASS = 0x0000;
- /** Backward compatibility with NXM */
- public static final int NXM_1_CLASS = 0x0001;
- /** Basic class for OpenFlow */
- public static final int OPENFLOW_BASIC_CLASS = 0x8000;
- /** Experimenter class */
- public static final int EXPERIMENTER_CLASS = 0xFFFF;
-
- /** Switch input port */
- public static final int IN_PORT = 0;
- /** Switch physical input port */
- public static final int IN_PHY_PORT = 1;
- /** Metadata passed between tables */
- public static final int METADATA = 2;
- /** Ethernet destination address */
- public static final int ETH_DST = 3;
- /** Ethernet source address */
- public static final int ETH_SRC = 4;
- /** Ethernet frame type */
- public static final int ETH_TYPE = 5;
- /** VLAN id. */
- public static final int VLAN_VID = 6;
- /** VLAN priority. */
- public static final int VLAN_PCP = 7;
- /** IP DSCP (6 bits in ToS field). */
- public static final int IP_DSCP = 8;
- /** IP ECN (2 bits in ToS field). */
- public static final int IP_ECN = 9;
- /** IP protocol. */
- public static final int IP_PROTO = 10;
- /** IPv4 source address. */
- public static final int IPV4_SRC = 11;
- /** IPv4 destination address. */
- public static final int IPV4_DST = 12;
- /** TCP source port. */
- public static final int TCP_SRC = 13;
- /** TCP destination port. */
- public static final int TCP_DST = 14;
- /** UDP source port. */
- public static final int UDP_SRC = 15;
- /** UDP destination port. */
- public static final int UDP_DST = 16;
- /** SCTP source port. */
- public static final int SCTP_SRC = 17;
- /** SCTP destination port. */
- public static final int SCTP_DST = 18;
- /** ICMP type. */
- public static final int ICMPV4_TYPE = 19;
- /** ICMP code. */
- public static final int ICMPV4_CODE = 20;
- /** ARP opcode. */
- public static final int ARP_OP = 21;
- /** ARP source IPv4 address. */
- public static final int ARP_SPA = 22;
- /** ARP target IPv4 address. */
- public static final int ARP_TPA = 23;
- /** ARP source hardware address. */
- public static final int ARP_SHA = 24;
- /** ARP target hardware address. */
- public static final int ARP_THA = 25;
- /** IPv6 source address. */
- public static final int IPV6_SRC = 26;
- /** IPv6 destination address. */
- public static final int IPV6_DST = 27;
- /** IPv6 Flow Label */
- public static final int IPV6_FLABEL = 28;
- /** ICMPv6 type. */
- public static final int ICMPV6_TYPE = 29;
- /** ICMPv6 code. */
- public static final int ICMPV6_CODE = 30;
- /** Target address for ND. */
- public static final int IPV6_ND_TARGET = 31;
- /** Source link-layer for ND. */
- public static final int IPV6_ND_SLL = 32;
- /** Target link-layer for ND. */
- public static final int IPV6_ND_TLL = 33;
- /** MPLS label. */
- public static final int MPLS_LABEL = 34;
- /** MPLS TC. */
- public static final int MPLS_TC = 35;
- /** MPLS BoS bit. */
- public static final int MPLS_BOS = 36;
- /** PBB I-SID. */
- public static final int PBB_ISID = 37;
- /** Logical Port Metadata. */
- public static final int TUNNEL_ID = 38;
- /** IPv6 Extension Header pseudo-field */
- public static final int IPV6_EXTHDR = 39;
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.util;
+
+/**
+ * Stores oxm_match constants.
+ * @author michal.polkorab
+ */
+public abstract class OxmMatchConstants {
+
+ /** Backward compatibility with NXM */
+ public static final int NXM_0_CLASS = 0x0000;
+ /** Backward compatibility with NXM */
+ public static final int NXM_1_CLASS = 0x0001;
+ /** Basic class for OpenFlow */
+ public static final int OPENFLOW_BASIC_CLASS = 0x8000;
+ /** Experimenter class */
+ public static final int EXPERIMENTER_CLASS = 0xFFFF;
+
+ /** Switch input port */
+ public static final int IN_PORT = 0;
+ /** Switch physical input port */
+ public static final int IN_PHY_PORT = 1;
+ /** Metadata passed between tables */
+ public static final int METADATA = 2;
+ /** Ethernet destination address */
+ public static final int ETH_DST = 3;
+ /** Ethernet source address */
+ public static final int ETH_SRC = 4;
+ /** Ethernet frame type */
+ public static final int ETH_TYPE = 5;
+ /** VLAN id. */
+ public static final int VLAN_VID = 6;
+ /** VLAN priority. */
+ public static final int VLAN_PCP = 7;
+ /** IP DSCP (6 bits in ToS field). */
+ public static final int IP_DSCP = 8;
+ /** IP ECN (2 bits in ToS field). */
+ public static final int IP_ECN = 9;
+ /** IP protocol. */
+ public static final int IP_PROTO = 10;
+ /** IPv4 source address. */
+ public static final int IPV4_SRC = 11;
+ /** IPv4 destination address. */
+ public static final int IPV4_DST = 12;
+ /** TCP source port. */
+ public static final int TCP_SRC = 13;
+ /** TCP destination port. */
+ public static final int TCP_DST = 14;
+ /** UDP source port. */
+ public static final int UDP_SRC = 15;
+ /** UDP destination port. */
+ public static final int UDP_DST = 16;
+ /** SCTP source port. */
+ public static final int SCTP_SRC = 17;
+ /** SCTP destination port. */
+ public static final int SCTP_DST = 18;
+ /** ICMP type. */
+ public static final int ICMPV4_TYPE = 19;
+ /** ICMP code. */
+ public static final int ICMPV4_CODE = 20;
+ /** ARP opcode. */
+ public static final int ARP_OP = 21;
+ /** ARP source IPv4 address. */
+ public static final int ARP_SPA = 22;
+ /** ARP target IPv4 address. */
+ public static final int ARP_TPA = 23;
+ /** ARP source hardware address. */
+ public static final int ARP_SHA = 24;
+ /** ARP target hardware address. */
+ public static final int ARP_THA = 25;
+ /** IPv6 source address. */
+ public static final int IPV6_SRC = 26;
+ /** IPv6 destination address. */
+ public static final int IPV6_DST = 27;
+ /** IPv6 Flow Label */
+ public static final int IPV6_FLABEL = 28;
+ /** ICMPv6 type. */
+ public static final int ICMPV6_TYPE = 29;
+ /** ICMPv6 code. */
+ public static final int ICMPV6_CODE = 30;
+ /** Target address for ND. */
+ public static final int IPV6_ND_TARGET = 31;
+ /** Source link-layer for ND. */
+ public static final int IPV6_ND_SLL = 32;
+ /** Target link-layer for ND. */
+ public static final int IPV6_ND_TLL = 33;
+ /** MPLS label. */
+ public static final int MPLS_LABEL = 34;
+ /** MPLS TC. */
+ public static final int MPLS_TC = 35;
+ /** MPLS BoS bit. */
+ public static final int MPLS_BOS = 36;
+ /** PBB I-SID. */
+ public static final int PBB_ISID = 37;
+ /** Logical Port Metadata. */
+ public static final int TUNNEL_ID = 38;
+ /** IPv6 Extension Header pseudo-field */
+ public static final int IPV6_EXTHDR = 39;
+
+ /**
+ * OFPXMC_NXM_1 class Constants
+ */
+
+ /** NXM IPv4 Tunnel Endpoint Source */
+ public static final int NXM_NX_TUN_IPV4_SRC = 31;
+ /** NXM IPv4 Tunnel Endpoint Destination */
+ public static final int NXM_NX_TUN_IPV4_DST = 32;
+ /** NXM TCP_Flag value */
+ public static final int NXM_NX_TCP_FLAG = 34;
+
+ private OxmMatchConstants() {
+ //not called
+ }
}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-action.yang b/openflow-protocol-api/src/main/yang/openflow-action.yang
index 9cc200c4..d2ae42f6 100644
--- a/openflow-protocol-api/src/main/yang/openflow-action.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-action.yang
@@ -5,145 +5,207 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
+
module openflow-action {
namespace "urn:opendaylight:openflow:common:action";
prefix "ofaction";
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+
import openflow-types { prefix oft; }
+ import openflow-extensible-match { prefix oxm;}
- revision "2013-07-31" {
- description "OpenFlow 1.3 - action model";
+ revision "2015-02-03" {
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - action model";
}
- identity output {
- description " Output to switch port. (both OF v1.0 and v1.3)";
- base oft:action-base;
- }
- identity copy_ttl_out {
- description " Copy TTL \"outwards\" -- from next-to-outermost to outermost ";
- base oft:action-base;
- }
- identity copy_ttl_in {
- description " Copy TTL \"inwards\" -- from outermost to next-to-outermost ";
- base oft:action-base;
- }
- identity set_mpls_ttl {
- description " MPLS TTL ";
- base oft:action-base;
- }
- identity dec_mpls_ttl {
- description " Decrement MPLS TTL ";
- base oft:action-base;
- }
- identity push_vlan {
- description " Push a new VLAN tag ";
- base oft:action-base;
- }
- identity pop_vlan {
- description " Pop the outer VLAN tag ";
- base oft:action-base;
- }
- identity push_mpls {
- description " Push a new MPLS tag ";
- base oft:action-base;
- }
- identity pop_mpls {
- description " Pop the outer MPLS tag ";
- base oft:action-base;
+ identity experimenter-action-sub-type {
+ description "The base identity for vendor's actions.";
}
- identity set_queue {
- description " Set queue id when outputting to a port ";
- base oft:action-base;
- }
- identity group {
- description " Apply group. ";
- base oft:action-base;
- }
- identity set_nw_ttl {
- description " IP TTL. ";
- base oft:action-base;
- }
- identity dec_nw_ttl {
- description " Decrement IP TTL. ";
- base oft:action-base;
- }
- identity set_field {
- description " Set a header field using OXM TLV format. ";
- base oft:action-base;
- }
- identity push_pbb {
- description " Push a new PBB service tag (I-TAG) ";
- base oft:action-base;
- }
- identity pop_pbb {
- description " Pop the outer PBB service tag (I-TAG) ";
- base oft:action-base;
- }
- identity experimenter {
- description "";
- base oft:action-base;
- }
-
- container actions-container {
- uses actions-grouping;
+
+ container action-container {
+ uses action-grouping;
}
-
+
grouping actions-grouping {
list action {
- config false;
- leaf type {
- type identityref {
- base oft:action-base;
- }
+ uses action-grouping;
+ leaf experimenter-id {
+ type oft:experimenter-id;
}
}
}
-
- // OF1.0 structures
- identity set_vlan_vid {
- description "Set the 802.1q VLAN id (OF v1.0).";
- base oft:action-base;
- }
- identity set_vlan_pcp {
- description "Set the 802.1q priority (OF v1.0).";
- base oft:action-base;
- }
- identity strip_vlan {
- description "Strip the 802.1q header (OF v1.0).";
- base oft:action-base;
- }
- identity set_dl_src {
- description "Ethernet source address (OF v1.0).";
- base oft:action-base;
- }
- identity set_dl_dst {
- description "Ethernet destination address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_src {
- description "IP source address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_dst {
- description "IP destination address (OF v1.0).";
- base oft:action-base;
- }
- identity set_nw_tos {
- description "IP ToS (DSCP field, 6 bits) (OF v1.0).";
- base oft:action-base;
- }
- identity set_tp_src {
- description "TCP/UDP source port (OF v1.0).";
- base oft:action-base;
- }
- identity set_tp_dst {
- description "TCP/UDP destination port (OF v1.0).";
- base oft:action-base;
- }
- identity enqueue {
- description "Output to queue (OF v1.0).";
- base oft:action-base;
+
+ grouping action-grouping {
+ choice action-choice {
+ case output-action-case {
+ container output-action {
+ leaf port {
+ type oft:port-number;
+ }
+ leaf max-length {
+ type uint16;
+ }
+ }
+ }
+ case copy-ttl-out-case {
+ // empty action
+ }
+ case copy-ttl-in-case {
+ // empty action
+ }
+ case set-mpls-ttl-case {
+ container set-mpls-ttl-action {
+ leaf mpls-ttl {
+ type uint8;
+ }
+ }
+ }
+ case dec-mpls-ttl-case {
+ // empty action
+ }
+ case push-vlan-case {
+ container push-vlan-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-vlan-case {
+ // empty action
+ }
+ case push-mpls-case {
+ container push-mpls-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-mpls-case {
+ container pop-mpls-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case set-queue-case {
+ container set-queue-action {
+ leaf queue-id {
+ type uint32;
+ }
+ }
+ }
+ case group-case {
+ container group-action {
+ leaf group-id {
+ type uint32;
+ }
+ }
+ }
+ case set-nw-ttl-case {
+ container set-nw-ttl-action {
+ leaf nw-ttl {
+ type uint8;
+ }
+ }
+ }
+ case dec-nw-ttl-case {
+ // empty action
+ }
+ case set-field-case {
+ container set-field-action {
+ uses oxm:match-entries-grouping;
+ }
+ }
+ case push-pbb-case {
+ container push-pbb-action {
+ leaf ethertype {
+ type oft:ether-type;
+ }
+ }
+ }
+ case pop-pbb-case {
+ // empty action
+ }
+ // OF1.0 structures
+ case set-vlan-vid-case {
+ container set-vlan-vid-action {
+ leaf vlan-vid {
+ type uint16;
+ }
+ }
+ }
+ case set-vlan-pcp-case {
+ container set-vlan-pcp-action {
+ leaf vlan-pcp {
+ type uint8;
+ }
+ }
+ }
+ case strip-vlan-case {
+ // empty action
+ }
+ case set-dl-src-case {
+ container set-dl-src-action {
+ leaf dl-src-address {
+ type yang:mac-address;
+ }
+ }
+ }
+ case set-dl-dst-case {
+ container set-dl-dst-action {
+ leaf dl-dst-address {
+ type yang:mac-address;
+ }
+ }
+ }
+ case set-nw-src-case {
+ container set-nw-src-action {
+ leaf ip-address {
+ type inet:ipv4-address;
+ }
+ }
+ }
+ case set-nw-dst-case {
+ container set-nw-dst-action {
+ leaf ip-address {
+ type inet:ipv4-address;
+ }
+ }
+ }
+ case set-nw-tos-case {
+ container set-nw-tos-action {
+ leaf nw-tos {
+ type uint8;
+ }
+ }
+ }
+ case set-tp-src-case {
+ container set-tp-src-action {
+ leaf port {
+ type oft:port-number;
+ }
+ }
+ }
+ case set-tp-dst-case {
+ container set-tp-dst-action {
+ leaf port {
+ type oft:port-number;
+ }
+ }
+ }
+ case enqueue-case {
+ container enqueue-action {
+ leaf port {
+ type oft:port-number;
+ }
+ leaf queue-id {
+ type oft:queue-id;
+ }
+ }
+ }
+ }
}
}
diff --git a/openflow-protocol-api/src/main/yang/openflow-approved-extensions.yang b/openflow-protocol-api/src/main/yang/openflow-approved-extensions.yang
new file mode 100644
index 00000000..29a20351
--- /dev/null
+++ b/openflow-protocol-api/src/main/yang/openflow-approved-extensions.yang
@@ -0,0 +1,32 @@
+module openflow-approved-extensions {
+ namespace "urn:opendaylight:openflow:approved:extensions";
+ prefix "ofext";
+
+ import yang-ext {prefix ext;}
+ import openflow-extensible-match {prefix oxm;}
+ import openflow-augments {prefix aug;}
+
+ revision "2016-08-02" {
+ description "Openflow approved extensions definition";
+ }
+
+ //ONF Approved OpenFlow Extensions
+ // Extension 109 - TCP FLAGS
+ identity tcp_flags {
+ base oxm:match-field;
+ description "TCP flags from the TCP header";
+ }
+
+ augment "/oxm:oxm-container/oxm:match-entry-value/aug:experimenter-id-case" {
+ ext:augment-identifier "tcp-flags-container";
+ container tcp-flags {
+ leaf flags {
+ type uint16;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-augments.yang b/openflow-protocol-api/src/main/yang/openflow-augments.yang
old mode 100644
new mode 100755
index a3ee05a9..4a60c37e
--- a/openflow-protocol-api/src/main/yang/openflow-augments.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-augments.yang
@@ -1,366 +1,136 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
- module openflow-augments {
- namespace "urn:opendaylight:openflow:augments";
- prefix "aug";
-
- import yang-ext {prefix ext;}
- import ietf-inet-types {prefix inet;}
- import ietf-yang-types {prefix yang;}
-
- import openflow-types {prefix oft;}
- import openflow-protocol {prefix ofproto;}
- import openflow-action {prefix ofaction;}
- import openflow-instruction {prefix ofinstruction;}
- import openflow-extensible-match {prefix oxm;}
-
- revision "2013-10-02" {
- description "OpenFlow 1.3 - augments model.
- Please visit
- https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf
- - Augmentation Tables chapter";
- }
-
-// OFP_MATCH AUGMENTS
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "port-number-match-entry";
- leaf port-number {
- type oft:port-number;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "metadata-match-entry";
- leaf metadata {
- type binary;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "mask-match-entry";
- leaf mask {
- type binary;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "mac-address-match-entry";
- leaf mac-address {
- type yang:mac-address;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "eth-type-match-entry";
- leaf eth-type {
- type oft:ether-type;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "vlan-vid-match-entry";
- leaf vlan-vid {
- type uint16;
- }
- leaf cfi-bit {
- type boolean;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "vlan-pcp-match-entry";
- leaf vlan-pcp {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "dscp-match-entry";
- leaf dscp {
- type inet:dscp;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "ecn-match-entry";
- leaf ecn {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "protocol-number-match-entry";
- leaf protocol-number {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "port-match-entry";
- leaf port {
- type inet:port-number;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "icmpv4-type-match-entry";
- leaf icmpv4-type {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "icmpv4-code-match-entry";
- leaf icmpv4-code {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "op-code-match-entry";
- leaf op-code {
- type uint16;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "ipv6-flabel-match-entry";
- leaf ipv6-flabel {
- type inet:ipv6-flow-label;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "icmpv6-type-match-entry";
- leaf icmpv6-type {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "icmpv6-code-match-entry";
- leaf icmpv6-code {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "ipv6-address-match-entry";
- leaf ipv6-address {
- type inet:ipv6-address;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "ipv4-address-match-entry";
- leaf ipv4-address {
- type inet:ipv4-address;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "mpls-label-match-entry";
- leaf mpls-label {
- type uint32;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "tc-match-entry";
- leaf tc {
- type uint8;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "bos-match-entry";
- leaf bos {
- type boolean;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "isid-match-entry";
- leaf isid {
- type uint32;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "pseudo-field-match-entry";
- leaf pseudo-field {
- type oft:ipv6-exthdr-flags;
- }
- }
-
-// OFP_ACTION AUGMENTS
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "port-action";
- leaf port {
- type oft:port-number;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "max-length-action";
- leaf max-length {
- type uint16;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "mpls-ttl-action";
- leaf mpls-ttl {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "ethertype-action";
- leaf ethertype {
- type oft:ether-type;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "queue-id-action";
- leaf queue-id {
- type uint32;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "group-id-action";
- leaf group-id {
- type uint32;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "nw-ttl-action";
- leaf nw-ttl {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "oxm-fields-action";
- uses oxm:oxm-fields-grouping;
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "experimenter-action";
- leaf experimenter {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
- // OF1.0 structures
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "vlan-vid-action";
- leaf vlan-vid {
- type uint16;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "vlan-pcp-action";
- leaf vlan-pcp {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "dl-address-action";
- leaf dl-address {
- type yang:mac-address;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "nw-tos-action";
- leaf nw-tos {
- type uint8;
- }
- }
- augment "/ofaction:actions-container/ofaction:action" {
- ext:augment-identifier "ip-address-action";
- leaf ip-address {
- type inet:ipv4-address;
- }
- }
-
-// OFP_TABLE_FEATURES_PROPERTIES AUGMENTS
- augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
- ext:augment-identifier "instruction-related-table-feature-property";
- uses ofinstruction:instructions-grouping;
- }
- augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
- ext:augment-identifier "next-table-related-table-feature-property";
- list next-table-ids {
- config false;
- leaf table-id {
- type uint8;
- }
- }
- }
- augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
- ext:augment-identifier "action-related-table-feature-property";
- uses ofaction:actions-grouping;
- }
- augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
- ext:augment-identifier "oxm-related-table-feature-property";
- uses oxm:oxm-fields-grouping;
- }
- augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
- ext:augment-identifier "experimenter-related-table-feature-property";
- leaf experimenter {
- type uint32;
- }
- leaf exp-type {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
-
-// OFP_INSTRUCTION AUGMENTS
- augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
- ext:augment-identifier "table-id-instruction";
- leaf table-id {
- type uint8;
- }
- }
- augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
- ext:augment-identifier "metadata-instruction";
- leaf metadata {
- type binary;
- }
- leaf metadata-mask {
- type binary;
- }
- }
- augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
- ext:augment-identifier "actions-instruction";
- uses ofaction:actions-grouping;
- }
- augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
- ext:augment-identifier "meter-id-instruction";
- leaf meter-id {
- type uint32;
- }
- }
- augment "/ofinstruction:instruction-container/ofinstruction:instruction" {
- ext:augment-identifier "experimenter-instruction";
- leaf experimenter {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
-
-// OFP_QUEUE_PROP AUGMENTS
- augment "/ofproto:queue-prop-container/ofproto:queue-property" {
- ext:augment-identifier "rate-queue-property";
- leaf rate {
- type uint16;
- }
- }
- augment "/ofproto:queue-prop-container/ofproto:queue-property" {
- ext:augment-identifier "experimenter-queue-property";
- leaf experimenter {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
-
-// OFP_ERROR_AUGMENTS (only experimenter till OpenFlow v1.3)
- augment "/ofproto:error-message" {
- ext:augment-identifier "experimenter-error";
- leaf exp_type {
- type uint16;
- }
- leaf experimenter {
- type uint32;
- }
- }
-
-}
\ No newline at end of file
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+ module openflow-augments {
+ namespace "urn:opendaylight:openflow:augments";
+ prefix "aug";
+
+ import yang-ext {prefix ext;}
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+
+ import openflow-types {prefix oft;}
+ import openflow-protocol {prefix ofproto;}
+ import openflow-action {prefix ofaction;}
+ import openflow-instruction {prefix ofinstruction;}
+ import openflow-extensible-match {prefix oxm;}
+
+ revision "2015-02-25" {
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - augments model.
+ Please visit
+ https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf
+ - Augmentation Tables chapter";
+ }
+
+// OFP_MATCH AUGMENTS
+ augment "/oxm:oxm-container/oxm:match-entry-value" {
+ ext:augment-identifier "experimenter-id-match-entry";
+ case experimenter-id-case {
+ container experimenter {
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ }
+ }
+ }
+
+// OFP_ACTION AUGMENTS
+ augment "/ofaction:action-container/ofaction:action-choice" {
+ ext:augment-identifier "experimenter-id-action";
+ case experimenter-id-case {
+ container experimenter {
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ leaf sub-type {
+ type identityref {
+ base ofaction:experimenter-action-sub-type;
+ }
+ }
+ }
+ }
+ }
+
+// OFP_TABLE_FEATURES_PROPERTIES AUGMENTS
+ augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
+ ext:augment-identifier "instruction-related-table-feature-property";
+ uses ofinstruction:instructions-grouping;
+ }
+ augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
+ ext:augment-identifier "next-table-related-table-feature-property";
+ list next-table-ids {
+ config false;
+ leaf table-id {
+ type uint8;
+ }
+ }
+ }
+ augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
+ ext:augment-identifier "action-related-table-feature-property";
+ uses ofaction:actions-grouping;
+ }
+ augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
+ ext:augment-identifier "oxm-related-table-feature-property";
+ uses oxm:match-entries-grouping;
+ }
+ augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
+ ext:augment-identifier "experimenter-id-table-feature-property";
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ leaf exp-type {
+ type uint32;
+ }
+ }
+
+// OFP_INSTRUCTION AUGMENTS
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction-choice" {
+ case experimenter-id-case {
+ container experimenter {
+ leaf experimenter-id {
+ type oft:experimenter-id;
+ }
+ }
+ }
+ }
+
+// OFP_QUEUE_PROP AUGMENTS
+ augment "/ofproto:queue-prop-container/ofproto:queue-property" {
+ ext:augment-identifier "rate-queue-property";
+ leaf rate {
+ type uint16;
+ }
+ }
+ augment "/ofproto:queue-prop-container/ofproto:queue-property" {
+ ext:augment-identifier "experimenter-id-queue-property";
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ }
+
+// OFP_ERROR_AUGMENTS (only experimenter till OpenFlow v1.3)
+ augment "/ofproto:error-message" {
+ ext:augment-identifier "experimenter-id-error";
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ }
+
+// OFP_METER_BAND AUGMENTS
+ augment "/ofproto:meter-band-container/ofproto:meter-band/ofproto:meter-band-experimenter-case/ofproto:meter-band-experimenter" {
+ ext:augment-identifier "experimenter-id-meter-band";
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ leaf sub-type {
+ type identityref {
+ base oft:experimenter-meter-band-sub-type;
+ }
+ }
+ }
+}
diff --git a/openflow-protocol-api/src/main/yang/openflow-configuration.yang b/openflow-protocol-api/src/main/yang/openflow-configuration.yang
new file mode 100644
index 00000000..790a151b
--- /dev/null
+++ b/openflow-protocol-api/src/main/yang/openflow-configuration.yang
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+ module openflow-configuration {
+ namespace "urn:opendaylight:openflow:config";
+ prefix "of-config";
+
+ revision "2014-06-30" {
+ description "Library configuration classes";
+ }
+
+ typedef path-type {
+ type enumeration {
+ enum CLASSPATH {
+ value 0;
+ description "Keystore file is located on classpath.";
+ }
+ enum PATH {
+ value 1;
+ description "Keystore file is located on absolute or relative path.";
+ }
+ }
+ }
+
+ typedef keystore-type {
+ type enumeration {
+ enum JKS {
+ value 0;
+ description "Keystore type - JKS.";
+ }
+ enum PKCS12 {
+ value 1;
+ description "Keystore type - PKCS12.";
+ }
+ }
+ }
+
+ typedef transport-protocol {
+ type enumeration {
+ enum TCP {
+ value 0;
+ description "Communication over TCP protocol.";
+ }
+ enum TLS {
+ value 1;
+ description "Communication over TLS protocol.";
+ }
+ enum UDP {
+ value 2;
+ description "Communication over UDP protocol.";
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang b/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang
index 92b94e7a..f1f9e9b9 100644
--- a/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-extensible-match.yang
@@ -5,7 +5,7 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
+
module openflow-extensible-match {
namespace "urn:opendaylight:openflow:oxm";
prefix "oxm";
@@ -14,310 +14,649 @@
import ietf-inet-types {prefix inet;}
import openflow-types {prefix oft;}
- revision "2013-07-31" {
- description "OpenFlow 1.3 - match model";
+ revision "2015-02-25" {
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - match model";
}
identity oxm-match-type {
- description
+ description
"The OpenFlow Extensible Match type must be supported by all OpenFlow
switches.";
base oft:match-type-base;
}
-
+
// oxm classes
- identity clazz {
- description "Base identity for OXM classes";
- }
+ identity oxm-class-base {
+ description "Base identity for OXM classes";
+ }
- identity nxm-0-class {
- description "Match class for backward compatibility with NXM";
- base clazz;
- }
- identity nxm-1-class {
- description "Match class for backward compatibility with NXM";
- base clazz;
- }
- identity openflow-basic-class {
- description "Basic class for OpenFlow";
- base clazz;
- }
- identity experimenter-class {
- description
- "Marks Experimenter match type class.
- All experimenter match classes MUST use this class as a base.";
- base clazz;
- }
+ identity nxm-0-class {
+ description "Match class for backward compatibility with NXM";
+ base oxm-class-base;
+ }
+ identity nxm-1-class {
+ description "Match class for backward compatibility with NXM";
+ base oxm-class-base;
+ }
+ identity openflow-basic-class {
+ description "Basic class for OpenFlow";
+ base oxm-class-base;
+ }
+ identity experimenter-class {
+ description
+ "Marks Experimenter match type class.
+ All experimenter match classes MUST use this class as a base.";
+ base oxm-class-base;
+ }
- // field types
- identity match-field {
- description "Base identity for OXM Fields";
- }
+ // match-field types
+ identity match-field {
+ description "Base identity for OXM Fields";
+ }
- identity in_port {
- base match-field;
- description "OXM field for Switch input port.";
- }
- identity in_phy_port {
- base match-field;
- description "OXM field for Switch physical input port.";
- }
- identity metadata {
- base match-field;
- description "OXM field for Metadata passed between tables.";
- }
- identity eth_dst {
- base match-field;
- description "OXM field for Ethernet destination address.";
- }
- identity eth_src {
- base match-field;
- description "OXM field for Ethernet source address.";
- }
- identity eth_type {
- base match-field;
- description "OXM field for Ethernet frame type.";
- }
- identity vlan_vid {
- base match-field;
- description "OXM field for VLAN id.";
- }
- identity vlan_pcp {
- base match-field;
- description "OXM field for VLAN priority.";
- }
- identity ip_dscp {
- base match-field;
- description "OXM field for IP DSCP (6 bits in ToS field).";
- }
- identity ip_ecn {
- base match-field;
- description "OXM field for IP ECN (2 bits in ToS field).";
- }
- identity ip_proto {
- base match-field;
- description "OXM field for IP protocol.";
- }
- identity ipv4_src {
- base match-field;
- description "OXM field for IPv4 source address.";
- }
- identity ipv4_dst {
- base match-field;
- description "OXM field for IPv4 destination address.";
- }
- identity tcp_src {
- base match-field;
- description "OXM field for TCP source port.";
- }
- identity tcp_dst {
- base match-field;
- description "OXM field for TCP destination port.";
- }
- identity udp_src {
- base match-field;
- description "OXM field for UDP source port.";
- }
- identity udp_dst {
- base match-field;
- description "OXM field for UDP destination port.";
- }
- identity sctp_src {
- base match-field;
- description "OXM field for SCTP source port.";
- }
- identity sctp_dst {
- base match-field;
- description "OXM field for SCTP destination port.";
- }
- identity icmpv4_type {
- base match-field;
- description "OXM field for ICMP type.";
- }
- identity icmpv4_code {
- base match-field;
- description "OXM field for ICMP code.";
- }
- identity arp_op {
- base match-field;
- description "OXM field for ARP opcode.";
- }
- identity arp_spa {
- base match-field;
- description "OXM field for ARP source IPv4 address.";
- }
- identity arp_tpa {
- base match-field;
- description "OXM field for ARP target IPv4 address.";
- }
- identity arp_sha {
- base match-field;
- description "OXM field for ARP source hardware address.";
- }
- identity arp_tha {
- base match-field;
- description "OXM field for ARP target hardware address.";
- }
- identity ipv6_src {
- base match-field;
- description "OXM field for IPv6 source address.";
- }
- identity ipv6_dst {
- base match-field;
- description "OXM field for IPv6 destination address.";
- }
- identity ipv6_flabel {
- base match-field;
- description "OXM field for IPv6 Flow Label";
- }
- identity icmpv6_type {
- base match-field;
- description "OXM field for ICMPv6 type.";
- }
- identity icmpv6_code {
- base match-field;
- description "OXM field for ICMPv6 code.";
- }
- identity ipv6_nd_target {
- base match-field;
- description "OXM field for Target address for ND.";
- }
- identity ipv6_nd_sll {
- base match-field;
- description "OXM field for Source link-layer for ND.";
- }
- identity ipv6_nd_tll {
- base match-field;
- description "OXM field for Target link-layer for ND.";
- }
- identity mpls_label {
- base match-field;
- description "OXM field for MPLS label.";
- }
- identity mpls_tc {
- base match-field;
- description "OXM field for MPLS TC.";
+ identity in_port {
+ base match-field;
+ description "OXM field for Switch input port.";
+ }
+ identity in_phy_port {
+ base match-field;
+ description "OXM field for Switch physical input port.";
+ }
+ identity metadata {
+ base match-field;
+ description "OXM field for Metadata passed between tables.";
+ }
+ identity eth_dst {
+ base match-field;
+ description "OXM field for Ethernet destination address.";
+ }
+ identity eth_src {
+ base match-field;
+ description "OXM field for Ethernet source address.";
+ }
+ identity eth_type {
+ base match-field;
+ description "OXM field for Ethernet frame type.";
+ }
+ identity vlan_vid {
+ base match-field;
+ description "OXM field for VLAN id.";
+ }
+ identity vlan_pcp {
+ base match-field;
+ description "OXM field for VLAN priority.";
+ }
+ identity ip_dscp {
+ base match-field;
+ description "OXM field for IP DSCP (6 bits in ToS field).";
+ }
+ identity ip_ecn {
+ base match-field;
+ description "OXM field for IP ECN (2 bits in ToS field).";
+ }
+ identity ip_proto {
+ base match-field;
+ description "OXM field for IP protocol.";
+ }
+ identity ipv4_src {
+ base match-field;
+ description "OXM field for IPv4 source address.";
+ }
+ identity ipv4_dst {
+ base match-field;
+ description "OXM field for IPv4 destination address.";
+ }
+ identity tcp_src {
+ base match-field;
+ description "OXM field for TCP source port.";
+ }
+ identity tcp_dst {
+ base match-field;
+ description "OXM field for TCP destination port.";
+ }
+ identity udp_src {
+ base match-field;
+ description "OXM field for UDP source port.";
+ }
+ identity udp_dst {
+ base match-field;
+ description "OXM field for UDP destination port.";
+ }
+ identity sctp_src {
+ base match-field;
+ description "OXM field for SCTP source port.";
+ }
+ identity sctp_dst {
+ base match-field;
+ description "OXM field for SCTP destination port.";
+ }
+ identity icmpv4_type {
+ base match-field;
+ description "OXM field for ICMP type.";
+ }
+ identity icmpv4_code {
+ base match-field;
+ description "OXM field for ICMP code.";
+ }
+ identity arp_op {
+ base match-field;
+ description "OXM field for ARP opcode.";
+ }
+ identity arp_spa {
+ base match-field;
+ description "OXM field for ARP source IPv4 address.";
+ }
+ identity arp_tpa {
+ base match-field;
+ description "OXM field for ARP target IPv4 address.";
+ }
+ identity arp_sha {
+ base match-field;
+ description "OXM field for ARP source hardware address.";
+ }
+ identity arp_tha {
+ base match-field;
+ description "OXM field for ARP target hardware address.";
+ }
+ identity ipv6_src {
+ base match-field;
+ description "OXM field for IPv6 source address.";
+ }
+ identity ipv6_dst {
+ base match-field;
+ description "OXM field for IPv6 destination address.";
+ }
+ identity ipv6_flabel {
+ base match-field;
+ description "OXM field for IPv6 Flow Label";
+ }
+ identity icmpv6_type {
+ base match-field;
+ description "OXM field for ICMPv6 type.";
+ }
+ identity icmpv6_code {
+ base match-field;
+ description "OXM field for ICMPv6 code.";
+ }
+ identity ipv6_nd_target {
+ base match-field;
+ description "OXM field for Target address for ND.";
+ }
+ identity ipv6_nd_sll {
+ base match-field;
+ description "OXM field for Source link-layer for ND.";
+ }
+ identity ipv6_nd_tll {
+ base match-field;
+ description "OXM field for Target link-layer for ND.";
+ }
+ identity mpls_label {
+ base match-field;
+ description "OXM field for MPLS label.";
+ }
+ identity mpls_tc {
+ base match-field;
+ description "OXM field for MPLS TC.";
+ }
+ identity mpls_bos {
+ base match-field;
+ description "OXM field for MPLS BoS bit.";
+ }
+ identity pbb_isid {
+ base match-field;
+ description "OXM field for PBB I-SID.";
+ }
+ identity tunnel_id {
+ base match-field;
+ description "OXM field for Logical Port Metadata";
+ }
+ identity ipv6_exthdr {
+ base match-field;
+ description "OXM field for IPv6 Extension Header pseudo-field";
+ }
+
+ grouping match-grouping {
+ container match {
+ description "Match structure (OF v1.3)";
+ leaf type {
+ type identityref {
+ base oft:match-type-base;
+ }
+ }
+ uses match-entries-grouping;
}
- identity mpls_bos {
- base match-field;
- description "OXM field for MPLS BoS bit.";
+ }
+
+ grouping match-entries-grouping {
+ list match-entry {
+ config false;
+ uses match-entry-fields-grouping;
+ uses match-entry-value-grouping;
}
- identity pbb_isid {
- base match-field;
- description "OXM field for PBB I-SID.";
+ }
+
+ grouping match-entry-fields-grouping {
+ leaf oxm-class {
+ type identityref {
+ base oxm-class-base;
+ }
}
- identity tunnel_id {
- base match-field;
- description "OXM field for Logical Port Metadata";
+ leaf oxm-match-field {
+ type identityref {
+ base match-field;
+ }
}
- identity ipv6_exthdr {
- base match-field;
- description "OXM field for IPv6 Extension Header pseudo-field";
+ leaf has-mask {
+ type boolean;
}
+ }
- container oxm-container {
- uses oxm-fields-grouping;
- }
-
- grouping oxm-fields-grouping {
- list match-entries {
- description "OXM TLV-structures (Type Length Value)";
- config false;
- leaf oxm-class {
- type identityref {
- base clazz;
+ container oxm-container {
+ uses match-entry-value-grouping;
+ }
+
+ grouping match-entry-value-grouping {
+ choice match-entry-value {
+ case in-port-case {
+ container in-port {
+ leaf port-number {
+ type oft:port-number;
}
}
- leaf oxm-match-field {
- type identityref {
- base match-field;
+ }
+ case in-phy-port-case {
+ container in-phy-port {
+ leaf port-number {
+ type oft:port-number;
}
}
- leaf has-mask {
- type boolean;
- }
}
- }
-
- grouping match-grouping {
- container match {
- description "Match structure (OF v1.3)";
- leaf type {
- type identityref {
- base oft:match-type-base;
+ case metadata-case {
+ container metadata {
+ leaf metadata {
+ type binary;
+ }
+ leaf mask {
+ type binary;
}
}
- uses oxm-fields-grouping;
}
- }
-
- // OF1.0 structures
- grouping match-v10-grouping {
- container match-v10 {
- description "OF v1.0 match structure";
- leaf wildcards {
- description "Wildcard fields (only flags).";
- type oft:flow-wildcards-v10;
+ case eth-src-case {
+ container eth-src {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf nw-src-mask {
- description "IP source address mask (definition differs from OF v1.0.0 spec to ease
- understanding, library does the transformation into OF v1.0 spec correct data)";
- type uint8;
+ }
+ case eth-dst-case {
+ container eth-dst {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf nw-dst-mask {
- description "IP destination address mask (definition differs from OF v1.0.0 spec to ease
- understanding, library does the transformation into OF v1.0 spec correct data)";
- type uint8;
+ }
+ case eth-type-case {
+ container eth-type {
+ leaf eth-type {
+ type oft:ether-type;
+ }
}
- leaf in-port {
- description "Input switch port.";
- type uint16;
+ }
+ case vlan-vid-case {
+ container vlan-vid {
+ leaf vlan-vid {
+ type uint16;
+ }
+ leaf cfi-bit {
+ type boolean;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-src {
- description "Ethernet source address.";
- type yang:mac-address;
+ }
+ case vlan-pcp-case {
+ container vlan-pcp {
+ leaf vlan-pcp {
+ type uint8;
+ }
+ }
+ }
+ case ip-dscp-case {
+ container ip-dscp {
+ leaf dscp {
+ type inet:dscp;
+ }
+ }
+ }
+ case ip-ecn-case {
+ container ip-ecn {
+ leaf ecn {
+ type uint8;
+ }
+ }
+ }
+ case ip-proto-case {
+ container ip-proto {
+ leaf protocol-number {
+ type uint8;
+ }
+ }
+ }
+ case ipv4-src-case {
+ container ipv4-src {
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case ipv4-dst-case {
+ container ipv4-dst {
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case tcp-src-case {
+ container tcp-src {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case tcp-dst-case {
+ container tcp-dst {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case udp-src-case {
+ container udp-src {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case udp-dst-case {
+ container udp-dst {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case sctp-src-case {
+ container sctp-src {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case sctp-dst-case {
+ container sctp-dst {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ }
+ case icmpv4-type-case {
+ container icmpv4-type {
+ leaf icmpv4-type {
+ type uint8;
+ }
+ }
+ }
+ case icmpv4-code-case {
+ container icmpv4-code {
+ leaf icmpv4-code {
+ type uint8;
+ }
+ }
+ }
+ case arp-op-case {
+ container arp-op {
+ leaf op-code {
+ type uint16;
+ }
+ }
+ }
+ case arp-spa-case {
+ container arp-spa {
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case arp-tpa-case {
+ container arp-tpa {
+ leaf ipv4-address {
+ type inet:ipv4-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case arp-sha-case {
+ container arp-sha {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case arp-tha-case {
+ container arp-tha {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-dst {
- description "Ethernet destination address.";
- type yang:mac-address;
+ }
+ case ipv6-src-case {
+ container ipv6-src {
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-vlan {
- description "Input VLAN id.";
- type uint16;
+ }
+ case ipv6-dst-case {
+ container ipv6-dst {
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-vlan-pcp {
- description "Input VLAN priority.";
- type uint8;
+ }
+ case ipv6-flabel-case {
+ container ipv6-flabel {
+ leaf ipv6-flabel {
+ type inet:ipv6-flow-label;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case icmpv6-type-case {
+ container icmpv6-type {
+ leaf icmpv6-type {
+ type uint8;
+ }
}
- leaf dl-type {
- description "Ethernet frame type.";
- type uint16;
+ }
+ case icmpv6-code-case {
+ container icmpv6-code {
+ leaf icmpv6-code {
+ type uint8;
+ }
}
- leaf nw-tos {
- description "IP ToS (actually DSCP field, 6 bits).";
- type uint8;
+ }
+ case ipv6-nd-target-case {
+ container ipv6-nd-target {
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
}
- leaf nw-proto {
- description "IP protocol or lower 8 bits of ARP opcode.";
- type uint8;
+ }
+ case ipv6-nd-sll-case {
+ container ipv6-nd-sll {
+ leaf mac-address {
+ type yang:mac-address;
+ }
}
- leaf nw-src {
- description "IP source address.";
- type inet:ipv4-address;
+ }
+ case ipv6-nd-tll-case {
+ container ipv6-nd-tll {
+ leaf mac-address {
+ type yang:mac-address;
+ }
}
- leaf nw-dst {
- description "IP destination address.";
- type inet:ipv4-address;
+ }
+ case mpls-label-case {
+ container mpls-label {
+ leaf mpls-label {
+ type uint32;
+ }
}
- leaf tp-src {
- description "TCP/UDP source port.";
- type uint16;
+ }
+ case mpls-tc-case {
+ container mpls-tc {
+ leaf tc {
+ type uint8;
+ }
}
- leaf tp-dst {
- description "TCP/UDP destination port.";
- type uint16;
+ }
+ case mpls-bos-case {
+ container mpls-bos {
+ leaf bos {
+ type boolean;
+ }
+ }
+ }
+ case pbb-isid-case {
+ container pbb-isid {
+ leaf isid {
+ type uint32;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case tunnel-id-case {
+ container tunnel-id {
+ leaf tunnel-id {
+ type binary;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ case ipv6-exthdr-case {
+ container ipv6-exthdr {
+ leaf pseudo-field {
+ type oft:ipv6-exthdr-flags;
+ }
+ leaf mask {
+ type binary;
+ }
}
}
}
-
+ }
+
+ // OF1.0 structures
+ grouping match-v10-grouping {
+ container match-v10 {
+ description "OF v1.0 match structure";
+ leaf wildcards {
+ description "Wildcard fields (only flags).";
+ type oft:flow-wildcards-v10;
+ }
+ leaf nw-src-mask {
+ description "IP source address mask (definition differs from OF v1.0.0 spec to ease
+ understanding, library does the transformation into OF v1.0 spec correct data)";
+ type uint8;
+ }
+ leaf nw-dst-mask {
+ description "IP destination address mask (definition differs from OF v1.0.0 spec to ease
+ understanding, library does the transformation into OF v1.0 spec correct data)";
+ type uint8;
+ }
+ leaf in-port {
+ description "Input switch port.";
+ type uint16;
+ }
+ leaf dl-src {
+ description "Ethernet source address.";
+ type yang:mac-address;
+ }
+ leaf dl-dst {
+ description "Ethernet destination address.";
+ type yang:mac-address;
+ }
+ leaf dl-vlan {
+ description "Input VLAN id.";
+ type uint16;
+ }
+ leaf dl-vlan-pcp {
+ description "Input VLAN priority.";
+ type uint8;
+ }
+ leaf dl-type {
+ description "Ethernet frame type.";
+ type uint16;
+ }
+ leaf nw-tos {
+ description "IP ToS (actually DSCP field, 6 bits).";
+ type uint8;
+ }
+ leaf nw-proto {
+ description "IP protocol or lower 8 bits of ARP opcode.";
+ type uint8;
+ }
+ leaf nw-src {
+ description "IP source address.";
+ type inet:ipv4-address;
+ }
+ leaf nw-dst {
+ description "IP destination address.";
+ type inet:ipv4-address;
+ }
+ leaf tp-src {
+ description "TCP/UDP source port.";
+ type uint16;
+ }
+ leaf tp-dst {
+ description "TCP/UDP destination port.";
+ type uint16;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-instruction.yang b/openflow-protocol-api/src/main/yang/openflow-instruction.yang
index 80f74a83..b9e515b3 100644
--- a/openflow-protocol-api/src/main/yang/openflow-instruction.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-instruction.yang
@@ -5,59 +5,71 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
+
module openflow-instruction {
namespace "urn:opendaylight:openflow:common:instruction";
prefix "ofinstruction";
import openflow-types { prefix oft; }
+ import openflow-action {prefix ofaction;}
revision "2013-07-31" {
- description "OpenFlow 1.3 - instruction model";
- }
-
- identity goto_table {
- description " Setup the next table in the lookup pipeline";
- base oft:instruction-base;
- }
- identity write_metadata {
- description " Setup the metadata field for use later in pipeline";
- base oft:instruction-base;
- }
- identity write_actions {
- description " Write the action(s) onto the datapath action set";
- base oft:instruction-base;
- }
- identity apply_actions {
- description " Applies the action(s) immediately";
- base oft:instruction-base;
- }
- identity clear_actions {
- description " Clears all actions from the datapath action set";
- base oft:instruction-base;
- }
- identity meter {
- description " Apply meter (rate limiter)";
- base oft:instruction-base;
- }
- identity experimenter {
- description "Experimenter instruction";
- base oft:instruction-base;
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - instruction model";
}
container instruction-container {
- uses instructions-grouping;
+ uses instruction-grouping;
}
grouping instructions-grouping {
list instruction {
config false;
- leaf type {
- type identityref {
- base oft:instruction-base;
- }
+ uses instruction-grouping;
+ leaf experimenter-id {
+ type oft:experimenter-id;
}
}
}
+ grouping instruction-grouping {
+ choice instruction-choice {
+ case goto-table-case {
+ container goto-table {
+ leaf table-id {
+ type uint8;
+ }
+ }
+ }
+ case write-metadata-case {
+ container write-metadata {
+ leaf metadata {
+ type binary;
+ }
+ leaf metadata-mask {
+ type binary;
+ }
+ }
+ }
+ case write-actions-case {
+ container write-actions {
+ uses ofaction:actions-grouping;
+ }
+ }
+ case apply-actions-case {
+ container apply-actions {
+ uses ofaction:actions-grouping;
+ }
+ }
+ case clear-actions-case {
+ // empty instruction
+ }
+ case meter-case {
+ container meter {
+ leaf meter-id {
+ type uint32;
+ }
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-protocol.yang b/openflow-protocol-api/src/main/yang/openflow-protocol.yang
index 300dd7fe..7e42a2b9 100644
--- a/openflow-protocol-api/src/main/yang/openflow-protocol.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-protocol.yang
@@ -1,1451 +1,1438 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
- module openflow-protocol {
- namespace "urn:opendaylight:openflow:protocol";
- prefix "ofproto";
-
- import ietf-yang-types {prefix yang;}
-
- import openflow-types {prefix oft;}
- import openflow-extensible-match { prefix oxm;}
- import openflow-instruction { prefix ofinstruction;}
- import openflow-action {prefix ofaction;}
-
- revision "2013-07-31" {
- description "OpenFlow 1.3 - protocol objects model";
- }
-
- // Generic Structures
- grouping port-grouping {
- reference "ofp_port";
- leaf port-no {
- type uint32;
- }
- leaf hw-addr {
- type yang:mac-address;
- }
- leaf name {
- type string;
- }
- leaf config {
- description "Bitmap of OFPPC_* flags.";
- type oft:port-config;
- }
- leaf state {
- description "Bitmap of OFPPS_* flags.";
- type oft:port-state;
- }
- leaf current-features {
- description "Current features.";
- type oft:port-features;
- }
- leaf advertised-features {
- description "Features being advertised by the port.";
- type oft:port-features;
- }
- leaf supported-features {
- description "Features supported by the port.";
- type oft:port-features;
- }
- leaf peer-features {
- description "Features advertised by peer.";
- type oft:port-features;
- }
- leaf curr-speed {
- description "Current port bitrate in kbps.";
- type uint32;
- units "kbps";
- }
- leaf max-speed {
- description "Max port bitrate in kbps";
- type uint32;
- units "kbps";
- }
-
- // OF1.0 structures
- leaf config-v10 {
- type oft:port-config-v10;
- }
- leaf state-v10 {
- type oft:port-state-v10;
- }
- leaf current-features-v10 {
- description "Current features.";
- type oft:port-features-v10;
- }
- leaf advertised-features-v10 {
- description "Features being advertised by the port.";
- type oft:port-features-v10;
- }
- leaf supported-features-v10 {
- description "Features supported by the port.";
- type oft:port-features-v10;
- }
- leaf peer-features-v10 {
- description "Features advertised by peer.";
- type oft:port-features-v10;
- }
- }
-
- grouping buckets-grouping {
- list buckets-list {
- uses bucket-grouping;
- }
- }
-
- grouping bucket-grouping {
- description "Bucket for use in groups.";
- leaf weight {
- description "Relative weight of bucket. Only
- defined for select groups.";
- type uint16;
- }
- leaf watch-port {
- description "Port whose state affects whether this
- bucket is live. Only required for fast
- failover groups.";
- type oft:port-number;
- }
- leaf watch-group {
- description "Group whose state affects whether this
- bucket is live. Only required for fast
- failover groups.";
- type uint32;
- }
-
- uses ofaction:actions-grouping;
- }
-
- container table-features-properties-container {
- uses table-features-properties-grouping;
- }
-
- grouping table-features-properties-grouping {
- list table-feature-properties {
- config false;
- leaf type {
- type oft:table-features-prop-type;
- }
- }
- }
-
- // # MESSAGE Structures
- /* Immutable messages. */
- grouping ofHeader {
- reference "ofp_header struct in Openflow Switch 1.3 Spec";
- leaf version {
- type uint8;
- description "OpenFlow version";
- }
- leaf xid {
- type uint32;
- description "Transaction ID";
- }
- }
- grouping ofHelloElementHeader {
- reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec";
- leaf type {
- type oft:hello-element-type;
- //reference "OpenFlow Header element type - OFPHET_*";
- }
- }
- grouping hello {
- reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
- /* Symmetric message */
- uses ofHeader;
-
- list elements {
- uses ofHelloElementHeader;
-
- leaf-list version-bitmap {
- type boolean;
- }
- }
- }
- grouping error {
- reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
- /* Symmetric message */
- uses ofHeader;
-
- leaf type {
- type uint16;
- }
- leaf code {
- type uint16;
- }
- leaf type-string {
- type string;
- }
- leaf code-string {
- type string;
- }
- leaf data {
- type binary;
- }
- }
- grouping echo-request {
- reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
- /* Symmetric message */
- uses ofHeader;
-
- leaf data {
- type binary;
- }
- }
- grouping echo-reply {
- reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec";
- /* Symmetric message */
- uses ofHeader;
-
- leaf data {
- type binary;
- }
- }
- grouping experimenter {
- reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
- /* Symmetric message */
- uses ofHeader;
-
- leaf experimenter {
- type uint32;
- }
- leaf exp_type {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
- /* Switch configuration messages. */
- grouping features-request {
- reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
- }
- grouping features-reply {
- reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
-
- leaf datapathId {
- type uint64;
- }
- leaf buffers {
- type uint32;
- }
- leaf tables {
- type uint8;
- }
- leaf auxiliaryId {
- type uint8;
- }
- leaf capabilities {
- type oft:capabilities;
- }
- leaf reserved {
- type uint32;
- }
- // OF1.0 structures
- leaf capabilities-v10 {
- type oft:capabilities-v10;
- }
- leaf actions-v10 {
- type oft:action-type-v10;
- }
- list phy-port {
- uses port-grouping;
- }
- }
- grouping get-config-request {
- reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
- }
- grouping get-config-reply {
- reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
-
- leaf flags {
- type oft:switch-config-flag;
- }
- leaf miss-send-len {
- type uint16;
- }
- }
- grouping set-config {
- reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf flags {
- type oft:switch-config-flag;
- }
- leaf miss-send-len {
- type uint16;
- }
- }
- /* Asynchronous messages. */
- grouping packet-in {
- reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec";
- /* Async message */
-
- uses ofHeader;
-
- leaf buffer-id {
- // ID assigned by datapath.
- type uint32;
- }
- leaf total-len {
- // Full length of frame.
- type uint16;
- }
- leaf reason {
- // Reason packet is being sent (one of OFPR_*)
- type oft:packet-in-reason;
- }
- leaf table-id {
- // ID of the table that was looked up
- type oft:table-id;
- }
- leaf cookie {
- // Cookie of the flow entry that was looked up.
- type uint64;
- }
- uses oxm:match-grouping;
-
- leaf data {
- type binary;
- }
-
- // OF1.0 structures
- leaf in-port {
- type uint16;
- }
- }
- grouping flow-removed {
- reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec";
- /* Async message */
- uses ofHeader;
-
- leaf cookie {
- type uint64;
- }
- leaf priority {
- type uint16;
- }
- leaf reason {
- type oft:flow-removed-reason;
- }
- leaf table-id {
- type oft:table-id;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- leaf idle-timeout {
- type uint16;
- }
- leaf hard-timeout {
- type uint16;
- }
- leaf packet-count {
- type uint64;
- }
- leaf byte-count {
- type uint64;
- }
- uses oxm:match-grouping;
-
- // OF1.0 structures
- uses oxm:match-v10-grouping;
- }
- grouping port-status {
- reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec";
-
- uses ofHeader;
-
- uses port-grouping;
-
- leaf reason {
- type oft:port-reason;
- }
- }
- /* Controller command messages. */
- grouping packet-out {
- reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- uses ofaction:actions-grouping;
-
- leaf data {
- type binary;
- }
- leaf buffer-id {
- type uint32;
- }
- leaf in-port {
- type oft:port-number;
- }
- }
- grouping flow-mod {
- reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf cookie {
- type uint64;
- }
- leaf cookie-mask {
- type uint64;
- }
- leaf table-id {
- type oft:table-id;
- }
- leaf command {
- type oft:flow-mod-command;
- }
- leaf idle-timeout {
- type uint16;
- }
- leaf hard-timeout {
- type uint16;
- }
- leaf priority {
- type uint16;
- }
- leaf buffer-id {
- type uint32;
- }
- leaf out-port {
- type oft:port-number;
- }
- leaf out-group {
- type uint32;
- }
- leaf flags {
- type oft:flow-mod-flags;
- }
- uses oxm:match-grouping;
-
- uses ofinstruction:instructions-grouping;
-
- // OF1.0 structures
- leaf flags-v10 {
- type oft:flow-mod-flags-v10;
- }
- uses oxm:match-v10-grouping;
- uses ofaction:actions-grouping;
- }
- grouping group-mod {
- reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf command {
- type oft:group-mod-command;
- }
- leaf type {
- type oft:group-type;
- }
- leaf group-id {
- type oft:group-id;
- }
-
- uses buckets-grouping;
- }
-
- grouping port-mod {
- reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf port-no {
- type oft:port-number;
- }
- leaf hw-address {
- type yang:mac-address;
- }
- leaf config {
- type oft:port-config;
- }
- leaf mask {
- type oft:port-config;
- }
- leaf advertise {
- type oft:port-features;
- }
- // OF1.0 structures
- leaf config-v10 {
- type oft:port-config-v10;
- }
- leaf mask-v10 {
- type oft:port-config-v10;
- }
- leaf advertise-v10 {
- type oft:port-features-v10;
- }
- }
- grouping table-mod {
- reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf table-id {
- type oft:table-id;
- }
- leaf config {
- type oft:table-config;
- }
- }
-
- /* Multipart messages. */
- grouping multipart-request {
- reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf type {
- type oft:multipart-type;
- }
- leaf flags {
- type oft:multipart-request-flags;
- }
- choice multipart-request-body {
- case multipart-request-desc-case {
- container multipart-request-desc {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-flow-case {
- container multipart-request-flow {
- leaf table-id {
- type uint8;
- }
- leaf out-port {
- type uint32;
- }
- leaf out-group {
- type uint32;
- }
- leaf cookie {
- type uint64;
- }
- leaf cookie-mask {
- type uint64;
- }
- uses oxm:match-grouping;
-
- // OF1.0 structures
- uses oxm:match-v10-grouping;
- }
- }
- case multipart-request-aggregate-case {
- container multipart-request-aggregate {
- leaf table-id {
- type uint8;
- }
- leaf out-port {
- type uint32;
- }
- leaf out-group {
- type uint32;
- }
- leaf cookie {
- type uint64;
- }
- leaf cookie-mask {
- type uint64;
- }
- uses oxm:match-grouping;
-
- // OF1.0 structures
- uses oxm:match-v10-grouping;
- }
- }
- case multipart-request-table-case {
- container multipart-request-table {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-port-stats-case {
- container multipart-request-port-stats {
- leaf port-no {
- type uint32;
- }
- }
- }
- case multipart-request-queue-case {
- container multipart-request-queue {
- leaf port-no {
- type uint32;
- }
- leaf queue-id {
- type uint32;
- }
- }
- }
- case multipart-request-group-case {
- container multipart-request-group {
- leaf group-id {
- type oft:group-id;
- }
- }
- }
- case multipart-request-group-desc-case {
- container multipart-request-group-desc {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-group-features-case {
- container multipart-request-group-features {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-meter-case {
- container multipart-request-meter {
- leaf meter-id {
- type oft:meter-id;
- }
- }
- }
- case multipart-request-meter-config-case {
- container multipart-request-meter-config {
- leaf meter-id {
- type oft:meter-id;
- }
- }
- }
- case multipart-request-meter-features-case {
- container multipart-request-meter-features {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-table-features-case {
- container multipart-request-table-features {
- list table-features {
- leaf table-id {
- type uint8;
- }
- leaf name {
- type string;
- }
- leaf metadata-match {
- type uint64;
- }
- leaf metadata-write {
- type uint64;
- }
- leaf config {
- type oft:table-config;
- }
- leaf max-entries {
- type uint32;
- }
- uses table-features-properties-grouping;
- }
- }
- }
- case multipart-request-port-desc-case {
- container multipart-request-port-desc {
- leaf empty {
- type empty;
- }
- }
- }
- case multipart-request-experimenter-case {
- container multipart-request-experimenter {
- leaf experimenter {
- type uint32;
- }
- leaf exp-type {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
- }
- }
- }
- grouping multipart-reply {
- reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf type {
- type oft:multipart-type;
- }
- leaf flags {
- type oft:multipart-request-flags;
- }
- choice multipart-reply-body {
- case multipart-reply-desc-case {
- container multipart-reply-desc {
- leaf mfr_desc {
- type string;
- }
- leaf hw_desc {
- type string;
- }
- leaf sw_desc {
- type string;
- }
- leaf serial_num {
- type string;
- }
- leaf dp_desc {
- type string;
- }
- }
- }
- case multipart-reply-flow-case {
- container multipart-reply-flow {
- list flow-stats {
- leaf table-id {
- type uint8;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- leaf priority {
- type uint16;
- }
- leaf idle-timeout {
- type uint16;
- }
- leaf hard-timeout {
- type uint16;
- }
- leaf flags {
- type oft:flow-mod-flags;
- }
- leaf cookie {
- type uint64;
- }
- leaf packet-count {
- type uint64;
- }
- leaf byte-count {
- type uint64;
- }
- uses oxm:match-grouping;
-
- uses ofinstruction:instructions-grouping;
-
- // OF1.0 structures
- uses oxm:match-v10-grouping;
- uses ofaction:actions-grouping;
- }
- }
- }
- case multipart-reply-aggregate-case {
- container multipart-reply-aggregate {
- leaf packet-count {
- type uint64;
- }
- leaf byte-count {
- type uint64;
- }
- leaf flow-count {
- type uint32;
- }
- }
- }
- case multipart-reply-table-case {
- container multipart-reply-table {
- list table-stats {
- leaf table-id {
- type uint8;
- }
- leaf active-count {
- type uint32;
- }
- leaf lookup-count {
- type uint64;
- }
- leaf matched-count {
- type uint64;
- }
-
- // OF1.0 structures
- leaf name {
- type string;
- }
- leaf wildcards {
- type oft:flow-wildcards-v10;
- }
- leaf nw-src-mask {
- type uint8;
- }
- leaf nw-dst-mask {
- type uint8;
- }
- leaf max-entries {
- type uint32;
- }
- }
- }
- }
- case multipart-reply-port-stats-case {
- container multipart-reply-port-stats {
- list port-stats {
- leaf port-no {
- type uint32;
- }
- leaf rx-packets {
- type uint64;
- }
- leaf tx-packets {
- type uint64;
- }
- leaf rx-bytes {
- type uint64;
- }
- leaf tx-bytes {
- type uint64;
- }
- leaf rx-dropped {
- type uint64;
- }
- leaf tx-dropped {
- type uint64;
- }
- leaf rx-errors {
- type uint64;
- }
- leaf tx-errors {
- type uint64;
- }
- leaf rx-frame-err {
- type uint64;
- }
- leaf rx-over-err {
- type uint64;
- }
- leaf rx-crc-err {
- type uint64;
- }
- leaf collisions {
- type uint64;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- }
- }
- }
- case multipart-reply-queue-case {
- container multipart-reply-queue {
- list queue-stats {
- leaf port-no {
- type uint32;
- }
- leaf queue-id {
- type uint32;
- }
- leaf tx-bytes {
- type uint64;
- }
- leaf tx-packets {
- type uint64;
- }
- leaf tx-errors {
- type uint64;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- }
- }
- }
- case multipart-reply-group-case {
- container multipart-reply-group {
- list group-stats {
- leaf group-id {
- type oft:group-id;
- }
- leaf ref-count {
- type uint32;
- }
- leaf packet-count {
- type uint64;
- }
- leaf byte-count {
- type uint64;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- list bucket-stats {
- leaf packet-count {
- type uint64;
- }
- leaf byte-count {
- type uint64;
- }
- }
- }
- }
- }
- case multipart-reply-group-desc-case {
- container multipart-reply-group-desc {
- list group-desc {
- leaf type {
- type oft:group-type;
- }
- leaf group-id {
- type oft:group-id;
- }
- uses buckets-grouping;
- }
- }
- }
- case multipart-reply-group-features-case {
- container multipart-reply-group-features {
- leaf types {
- type oft:group-types;
- }
- leaf capabilities {
- type oft:group-capabilities;
- }
- leaf-list max_groups {
- type uint32;
- }
- leaf-list actions-bitmap {
- type oft:action-type;
- }
- }
- }
- case multipart-reply-meter-case {
- container multipart-reply-meter {
- list meter-stats {
- leaf meter-id {
- type oft:meter-id;
- }
- leaf flow-count {
- type uint32;
- }
- leaf packet-in-count {
- type uint64;
- }
- leaf byte-in-count {
- type uint64;
- }
- leaf duration-sec {
- type uint32;
- }
- leaf duration-nsec {
- type uint32;
- }
- list meter-band-stats {
- leaf packet-band-count {
- type uint64;
- }
- leaf byte-band-count {
- type uint64;
- }
- }
- }
- }
- }
- case multipart-reply-meter-config-case {
- container multipart-reply-meter-config {
- list meter-config {
- leaf flags {
- type oft:meter-flags;
- }
- leaf meter-id {
- type oft:meter-id;
- }
- list bands {
- uses meter-band-header;
- }
- }
- }
- }
- case multipart-reply-meter-features-case {
- container multipart-reply-meter-features {
- leaf max-meter {
- type uint32;
- }
- leaf band-types {
- type oft:meter-band-type-bitmap;
- }
- leaf capabilities {
- type oft:meter-flags;
- }
- leaf max-bands {
- type uint8;
- }
- leaf max-color {
- type uint8;
- }
- }
- }
- case multipart-reply-table-features-case {
- container multipart-reply-table-features {
- list table-features {
- leaf table-id {
- type uint8;
- }
- leaf name {
- type string;
- }
- leaf metadata-match {
- type binary;
- }
- leaf metadata-write {
- type binary;
- }
- leaf config {
- type oft:table-config;
- }
- leaf max-entries {
- type uint32;
- }
- uses table-features-properties-grouping;
- }
- }
- }
- case multipart-reply-port-desc-case {
- container multipart-reply-port-desc {
- list ports {
- uses port-grouping;
- }
- }
- }
- case multipart-reply-experimenter-case {
- container multipart-reply-experimenter {
- leaf experimenter {
- type uint32;
- }
- leaf exp-type {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
- }
- }
- }
- /* Barrier messages. */
- grouping barrier-request {
- reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
- }
- grouping barrier-reply {
- reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
- uses ofHeader;
- }
- /* Queue Configuration messages. */
- grouping queue-get-config-request {
- reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf port {
- type oft:port-number;
- }
- }
- grouping queue-get-config-reply {
- reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf port {
- type oft:port-number;
- }
- list queues {
- uses packet-queue;
- }
- }
- grouping packet-queue {
- leaf queue-id {
- type oft:queue-id;
- }
- leaf port {
- type oft:port-number;
- }
- uses queue-property-header;
- }
- container queue-prop-container {
- uses queue-property-header;
- }
- grouping queue-property-header {
- list queue-property {
- config false;
- leaf property {
- type oft:queue-properties;
- }
- }
- }
- /* Controller role change request messages. */
- grouping role-request {
- reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf role {
- type oft:controller-role;
- }
- leaf generation-id {
- type uint64;
- }
- }
- grouping role-reply {
- reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf role {
- type oft:controller-role;
- }
- leaf generation-id {
- type uint64;
- }
- }
- /* Asynchronous message configuration. */
- grouping get-async-request {
- reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
- }
- grouping get-async-reply {
- reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
- uses async-body-grouping;
- }
- grouping set-async {
- reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
- uses async-body-grouping;
- }
-
- grouping async-body-grouping {
- list packet-in-mask {
- leaf-list mask {
- type oft:packet-in-reason;
- }
- }
- list port-status-mask {
- leaf-list mask {
- type oft:port-reason;
- }
- }
- list flow-removed-mask {
- leaf-list mask {
- type oft:flow-removed-reason;
- }
- }
- }
- /* Meters and rate limiters configuration messages. */
- grouping meter-mod {
- reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec";
- /* Controller/switch message */
-
- uses ofHeader;
-
- leaf command {
- type oft:meter-mod-command;
- }
- leaf flags {
- type oft:meter-flags;
- }
- leaf meter-id {
- type oft:meter-id;
- }
- list bands {
- uses meter-band-header;
- }
- }
-
- grouping meter-band-header {
- choice meter-band {
- case meter-band-drop-case {
- container meter-band-drop {
- uses meter-band-commons;
- }
- }
- case meter-band-dscp-remark-case {
- container meter-band-dscp-remark {
- uses meter-band-commons;
- leaf prec-level {
- type uint8;
- }
- }
- }
- case meter-band-experimenter-case {
- container meter-band-experimenter {
- uses meter-band-commons;
- leaf experimenter {
- type uint32;
- }
- leaf data {
- type binary;
- }
- }
- }
- }
- }
-
- grouping meter-band-commons {
- leaf type {
- type oft:meter-band-type;
- }
- leaf rate {
- type uint32;
- }
- leaf burst-size {
- type uint32;
- }
- }
-
- /* Immutable messages. */
- notification hello-message {
- uses hello;
- reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
-
- /* Symmetric message */
- }
- notification error-message {
- uses error;
- reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
-
- /* Symmetric message */
- }
- notification echo-request-message {
- uses echo-request;
- reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
-
- /* Symmetric message */
- }
- notification experimenter-message {
- uses experimenter;
- reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
- // TODO:: does switch send this when understood experimenter msg from lib?
- /* Symmetric message */
- }
- // # Notification and RPCs
- /* Symmetric RPC. */
- rpc echo {
- input {
- uses echo-request;
- }
- /* Controller/switch message */
- output {
- uses echo-reply;
- }
- }
-
- rpc echo-reply {
- input {
- uses echo-reply;
- }
- }
-
- rpc hello {
- input {
- uses hello;
- }
- }
-
- rpc experimenter {
- input {
- uses experimenter;
- }
- }
-
- /* Switch configuration messages. */
- rpc get-features {
- input {
- uses features-request;
- }
- /* Controller/switch message */
- output {
- uses features-reply;
- }
- }
-
- rpc get-config {
- input {
- uses get-config-request;
- }
- output {
- uses get-config-reply;
- }
- /* Controller/switch message */
- }
-
- rpc set-config {
- input {
- uses set-config;
- }
- /* Controller/switch message */
- }
- /* Asynchronous messages. */
- notification packet-in-message {
- uses packet-in;
-
- /* Async message */
- }
- notification flow-removed-message {
- uses flow-removed;
-
- /* Async message */
- }
- notification port-status-message {
- uses port-status;
-
- } /* Async message */
-
- /* Controller command messages. */
- rpc packet-out {
- input {
- uses packet-out;
- }
- /* Controller/switch message */
- }
- rpc flow-mod {
- input {
- uses flow-mod;
- }
- /* Controller/switch message */
- }
- rpc group-mod {
- input {
- uses group-mod;
- }
- /* Controller/switch message */
- }
- rpc port-mod {
- input {
- uses port-mod;
- }
- } /* Controller/switch message */
-
- rpc table-mod {
- input {
- uses table-mod;
- }
- } /* Controller/switch message */
-
- /* Multipart messages. */
-
- rpc multipart-request {
- input {
- uses multipart-request;
- }
- }
-
- /* Controller/switch message */
- notification multipart-reply-message {
- uses multipart-reply;
- // notification because of multiple following responses
- } /* Controller/switch message */
-
-
- /* Barrier messages. */
- rpc barrier {
- input {
- uses barrier-request;
- }
- output {
- uses barrier-reply;
- }
- }
- /* Queue Configuration messages. */
- rpc get-queue-config {
- input {
- uses queue-get-config-request;
- }
- output {
- uses queue-get-config-reply;
- }
- }
-
- /* Controller role change request messages. */
- rpc role-request {
- input {
- uses role-request;
- }
- output {
- uses role-reply;
- }
- } /* Controller/switch message */
-
- /* Asynchronous message configuration. */
- rpc get-async {
- input {
- uses get-async-request;
- }
- output {
- uses get-async-reply;
- }
- }
- /* Controller/switch message */
- rpc set-async {
- input {
- uses set-async;
- }
-
- }
- /* Meters and rate limiters configuration messages. */
- rpc meter-mod {
- input {
- uses meter-mod;
- }
- } /* Controller/switch message */
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+ module openflow-protocol {
+ namespace "urn:opendaylight:openflow:protocol";
+ prefix "ofproto";
+
+ import ietf-yang-types {prefix yang;}
+
+ import openflow-types {prefix oft;}
+ import openflow-extensible-match { prefix oxm;}
+ import openflow-instruction { prefix ofinstruction;}
+ import openflow-action {prefix ofaction;}
+
+ revision "2013-07-31" {
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - protocol objects model";
+ }
+
+ // Generic Structures
+ grouping port-grouping {
+ reference "ofp_port";
+ leaf port-no {
+ type uint32;
+ }
+ leaf hw-addr {
+ type yang:mac-address;
+ }
+ leaf name {
+ type string;
+ }
+ leaf config {
+ description "Bitmap of OFPPC_* flags.";
+ type oft:port-config;
+ }
+ leaf state {
+ description "Bitmap of OFPPS_* flags.";
+ type oft:port-state;
+ }
+ leaf current-features {
+ description "Current features.";
+ type oft:port-features;
+ }
+ leaf advertised-features {
+ description "Features being advertised by the port.";
+ type oft:port-features;
+ }
+ leaf supported-features {
+ description "Features supported by the port.";
+ type oft:port-features;
+ }
+ leaf peer-features {
+ description "Features advertised by peer.";
+ type oft:port-features;
+ }
+ leaf curr-speed {
+ description "Current port bitrate in kbps.";
+ type uint32;
+ units "kbps";
+ }
+ leaf max-speed {
+ description "Max port bitrate in kbps";
+ type uint32;
+ units "kbps";
+ }
+
+ // OF1.0 structures
+ leaf config-v10 {
+ type oft:port-config-v10;
+ }
+ leaf state-v10 {
+ type oft:port-state-v10;
+ }
+ leaf current-features-v10 {
+ description "Current features.";
+ type oft:port-features-v10;
+ }
+ leaf advertised-features-v10 {
+ description "Features being advertised by the port.";
+ type oft:port-features-v10;
+ }
+ leaf supported-features-v10 {
+ description "Features supported by the port.";
+ type oft:port-features-v10;
+ }
+ leaf peer-features-v10 {
+ description "Features advertised by peer.";
+ type oft:port-features-v10;
+ }
+ }
+
+ grouping buckets-grouping {
+ list buckets-list {
+ uses bucket-grouping;
+ }
+ }
+
+ grouping bucket-grouping {
+ description "Bucket for use in groups.";
+ leaf weight {
+ description "Relative weight of bucket. Only
+ defined for select groups.";
+ type uint16;
+ }
+ leaf watch-port {
+ description "Port whose state affects whether this
+ bucket is live. Only required for fast
+ failover groups.";
+ type oft:port-number;
+ }
+ leaf watch-group {
+ description "Group whose state affects whether this
+ bucket is live. Only required for fast
+ failover groups.";
+ type uint32;
+ }
+
+ uses ofaction:actions-grouping;
+ }
+
+ container table-features-properties-container {
+ uses table-features-properties-grouping;
+ }
+
+ grouping table-features-properties-grouping {
+ list table-feature-properties {
+ config false;
+ leaf type {
+ type oft:table-features-prop-type;
+ }
+ }
+ }
+
+ // # MESSAGE Structures
+ /* Immutable messages. */
+ grouping ofHeader {
+ reference "ofp_header struct in Openflow Switch 1.3 Spec";
+ leaf version {
+ type uint8;
+ description "OpenFlow version";
+ }
+ leaf xid {
+ type uint32;
+ description "Transaction ID";
+ }
+ }
+ grouping ofHelloElementHeader {
+ reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec";
+ leaf type {
+ type oft:hello-element-type;
+ //reference "OpenFlow Header element type - OFPHET_*";
+ }
+ }
+ grouping hello {
+ reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
+ /* Symmetric message */
+ uses ofHeader;
+
+ list elements {
+ uses ofHelloElementHeader;
+
+ leaf-list version-bitmap {
+ type boolean;
+ }
+ }
+ }
+ grouping error {
+ reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
+ /* Symmetric message */
+ uses ofHeader;
+
+ leaf type {
+ type uint16;
+ }
+ leaf code {
+ type uint16;
+ }
+ leaf type-string {
+ type string;
+ }
+ leaf code-string {
+ type string;
+ }
+ leaf data {
+ type binary;
+ }
+ }
+ grouping echo-request {
+ reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Symmetric message */
+ uses ofHeader;
+
+ leaf data {
+ type binary;
+ }
+ }
+ grouping echo-reply {
+ reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec";
+ /* Symmetric message */
+ uses ofHeader;
+
+ leaf data {
+ type binary;
+ }
+ }
+
+ grouping experimenter-core {
+ description "General experimenter message content suitable for symmetric and multipart message";
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ leaf exp_type {
+ type uint32;
+ }
+ choice experimenter-data-of-choice {
+ // to be augmented by vendors
+ }
+ }
+ grouping experimenter-of-message {
+ reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
+ /* Symmetric message */
+ uses ofHeader;
+ uses experimenter-core;
+ }
+
+ /* Switch configuration messages. */
+ grouping features-request {
+ reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+ }
+ grouping features-reply {
+ reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+
+ leaf datapathId {
+ type uint64;
+ }
+ leaf buffers {
+ type uint32;
+ }
+ leaf tables {
+ type uint8;
+ }
+ leaf auxiliaryId {
+ type uint8;
+ }
+ leaf capabilities {
+ type oft:capabilities;
+ }
+ leaf reserved {
+ type uint32;
+ }
+ // OF1.0 structures
+ leaf capabilities-v10 {
+ type oft:capabilities-v10;
+ }
+ leaf actions-v10 {
+ type oft:action-type-v10;
+ }
+ list phy-port {
+ uses port-grouping;
+ }
+ }
+ grouping get-config-request {
+ reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+ }
+ grouping get-config-reply {
+ reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+
+ leaf flags {
+ type oft:switch-config-flag;
+ }
+ leaf miss-send-len {
+ type uint16;
+ }
+ }
+ grouping set-config {
+ reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf flags {
+ type oft:switch-config-flag;
+ }
+ leaf miss-send-len {
+ type uint16;
+ }
+ }
+ /* Asynchronous messages. */
+ grouping packet-in {
+ reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec";
+ /* Async message */
+
+ uses ofHeader;
+
+ leaf buffer-id {
+ // ID assigned by datapath.
+ type uint32;
+ }
+ leaf total-len {
+ // Full length of frame.
+ type uint16;
+ }
+ leaf reason {
+ // Reason packet is being sent (one of OFPR_*)
+ type oft:packet-in-reason;
+ }
+ leaf table-id {
+ // ID of the table that was looked up
+ type oft:table-id;
+ }
+ leaf cookie {
+ // Cookie of the flow entry that was looked up.
+ type uint64;
+ }
+ uses oxm:match-grouping;
+
+ leaf data {
+ type binary;
+ }
+
+ // OF1.0 structures
+ leaf in-port {
+ type uint16;
+ }
+ }
+ grouping flow-removed {
+ reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec";
+ /* Async message */
+ uses ofHeader;
+
+ leaf cookie {
+ type uint64;
+ }
+ leaf priority {
+ type uint16;
+ }
+ leaf reason {
+ type oft:flow-removed-reason;
+ }
+ leaf table-id {
+ type oft:table-id;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ leaf idle-timeout {
+ type uint16;
+ }
+ leaf hard-timeout {
+ type uint16;
+ }
+ leaf packet-count {
+ type uint64;
+ }
+ leaf byte-count {
+ type uint64;
+ }
+ uses oxm:match-grouping;
+
+ // OF1.0 structures
+ uses oxm:match-v10-grouping;
+ }
+ grouping port-status {
+ reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec";
+
+ uses ofHeader;
+
+ uses port-grouping;
+
+ leaf reason {
+ type oft:port-reason;
+ }
+ }
+ /* Controller command messages. */
+ grouping packet-out {
+ reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ uses ofaction:actions-grouping;
+ leaf data {
+ type binary;
+ }
+ leaf buffer-id {
+ type uint32;
+ }
+ leaf in-port {
+ type oft:port-number;
+ }
+ }
+ grouping flow-mod {
+ reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf cookie {
+ type uint64;
+ }
+ leaf cookie-mask {
+ type uint64;
+ }
+ leaf table-id {
+ type oft:table-id;
+ }
+ leaf command {
+ type oft:flow-mod-command;
+ }
+ leaf idle-timeout {
+ type uint16;
+ }
+ leaf hard-timeout {
+ type uint16;
+ }
+ leaf priority {
+ type uint16;
+ }
+ leaf buffer-id {
+ type uint32;
+ }
+ leaf out-port {
+ type oft:port-number;
+ }
+ leaf out-group {
+ type uint32;
+ }
+ leaf flags {
+ type oft:flow-mod-flags;
+ }
+ uses oxm:match-grouping;
+
+ uses ofinstruction:instructions-grouping;
+
+ // OF1.0 structures
+ leaf flags-v10 {
+ type oft:flow-mod-flags-v10;
+ }
+ uses oxm:match-v10-grouping;
+ uses ofaction:actions-grouping;
+ }
+ grouping group-mod {
+ reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf command {
+ type oft:group-mod-command;
+ }
+ leaf type {
+ type oft:group-type;
+ }
+ leaf group-id {
+ type oft:group-id;
+ }
+
+ uses buckets-grouping;
+ }
+
+ grouping port-mod {
+ reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf port-no {
+ type oft:port-number;
+ }
+ leaf hw-address {
+ type yang:mac-address;
+ }
+ leaf config {
+ type oft:port-config;
+ }
+ leaf mask {
+ type oft:port-config;
+ }
+ leaf advertise {
+ type oft:port-features;
+ }
+ // OF1.0 structures
+ leaf config-v10 {
+ type oft:port-config-v10;
+ }
+ leaf mask-v10 {
+ type oft:port-config-v10;
+ }
+ leaf advertise-v10 {
+ type oft:port-features-v10;
+ }
+ }
+ grouping table-mod {
+ reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf table-id {
+ type oft:table-id;
+ }
+ leaf config {
+ type oft:table-config;
+ }
+ }
+
+ /* Multipart messages. */
+ grouping multipart-request {
+ reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf type {
+ type oft:multipart-type;
+ }
+ leaf flags {
+ type oft:multipart-request-flags;
+ }
+ choice multipart-request-body {
+ case multipart-request-desc-case {
+ container multipart-request-desc {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-flow-case {
+ container multipart-request-flow {
+ leaf table-id {
+ type uint8;
+ }
+ leaf out-port {
+ type uint32;
+ }
+ leaf out-group {
+ type uint32;
+ }
+ leaf cookie {
+ type uint64;
+ }
+ leaf cookie-mask {
+ type uint64;
+ }
+ uses oxm:match-grouping;
+
+ // OF1.0 structures
+ uses oxm:match-v10-grouping;
+ }
+ }
+ case multipart-request-aggregate-case {
+ container multipart-request-aggregate {
+ leaf table-id {
+ type uint8;
+ }
+ leaf out-port {
+ type uint32;
+ }
+ leaf out-group {
+ type uint32;
+ }
+ leaf cookie {
+ type uint64;
+ }
+ leaf cookie-mask {
+ type uint64;
+ }
+ uses oxm:match-grouping;
+
+ // OF1.0 structures
+ uses oxm:match-v10-grouping;
+ }
+ }
+ case multipart-request-table-case {
+ container multipart-request-table {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-port-stats-case {
+ container multipart-request-port-stats {
+ leaf port-no {
+ type uint32;
+ }
+ }
+ }
+ case multipart-request-queue-case {
+ container multipart-request-queue {
+ leaf port-no {
+ type uint32;
+ }
+ leaf queue-id {
+ type uint32;
+ }
+ }
+ }
+ case multipart-request-group-case {
+ container multipart-request-group {
+ leaf group-id {
+ type oft:group-id;
+ }
+ }
+ }
+ case multipart-request-group-desc-case {
+ container multipart-request-group-desc {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-group-features-case {
+ container multipart-request-group-features {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-meter-case {
+ container multipart-request-meter {
+ leaf meter-id {
+ type oft:meter-id;
+ }
+ }
+ }
+ case multipart-request-meter-config-case {
+ container multipart-request-meter-config {
+ leaf meter-id {
+ type oft:meter-id;
+ }
+ }
+ }
+ case multipart-request-meter-features-case {
+ container multipart-request-meter-features {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-table-features-case {
+ container multipart-request-table-features {
+ list table-features {
+ leaf table-id {
+ type uint8;
+ }
+ leaf name {
+ type string;
+ }
+ leaf metadata-match {
+ type uint64;
+ }
+ leaf metadata-write {
+ type uint64;
+ }
+ leaf config {
+ type oft:table-config;
+ }
+ leaf max-entries {
+ type uint32;
+ }
+ uses table-features-properties-grouping;
+ }
+ }
+ }
+ case multipart-request-port-desc-case {
+ container multipart-request-port-desc {
+ leaf empty {
+ type empty;
+ }
+ }
+ }
+ case multipart-request-experimenter-case {
+ container multipart-request-experimenter {
+ uses experimenter-core;
+ }
+ }
+ }
+ }
+ grouping multipart-reply {
+ reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf type {
+ type oft:multipart-type;
+ }
+ leaf flags {
+ type oft:multipart-request-flags;
+ }
+ choice multipart-reply-body {
+ case multipart-reply-desc-case {
+ container multipart-reply-desc {
+ leaf mfr_desc {
+ type string;
+ }
+ leaf hw_desc {
+ type string;
+ }
+ leaf sw_desc {
+ type string;
+ }
+ leaf serial_num {
+ type string;
+ }
+ leaf dp_desc {
+ type string;
+ }
+ }
+ }
+ case multipart-reply-flow-case {
+ container multipart-reply-flow {
+ list flow-stats {
+ leaf table-id {
+ type uint8;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ leaf priority {
+ type uint16;
+ }
+ leaf idle-timeout {
+ type uint16;
+ }
+ leaf hard-timeout {
+ type uint16;
+ }
+ leaf flags {
+ type oft:flow-mod-flags;
+ }
+ leaf cookie {
+ type uint64;
+ }
+ leaf packet-count {
+ type uint64;
+ }
+ leaf byte-count {
+ type uint64;
+ }
+ uses oxm:match-grouping;
+
+ uses ofinstruction:instructions-grouping;
+
+ // OF1.0 structures
+ uses oxm:match-v10-grouping;
+ uses ofaction:actions-grouping;
+ }
+ }
+ }
+ case multipart-reply-aggregate-case {
+ container multipart-reply-aggregate {
+ leaf packet-count {
+ type uint64;
+ }
+ leaf byte-count {
+ type uint64;
+ }
+ leaf flow-count {
+ type uint32;
+ }
+ }
+ }
+ case multipart-reply-table-case {
+ container multipart-reply-table {
+ list table-stats {
+ leaf table-id {
+ type uint8;
+ }
+ leaf active-count {
+ type uint32;
+ }
+ leaf lookup-count {
+ type uint64;
+ }
+ leaf matched-count {
+ type uint64;
+ }
+
+ // OF1.0 structures
+ leaf name {
+ type string;
+ }
+ leaf wildcards {
+ type oft:flow-wildcards-v10;
+ }
+ leaf nw-src-mask {
+ type uint8;
+ }
+ leaf nw-dst-mask {
+ type uint8;
+ }
+ leaf max-entries {
+ type uint32;
+ }
+ }
+ }
+ }
+ case multipart-reply-port-stats-case {
+ container multipart-reply-port-stats {
+ list port-stats {
+ leaf port-no {
+ type uint32;
+ }
+ leaf rx-packets {
+ type uint64;
+ }
+ leaf tx-packets {
+ type uint64;
+ }
+ leaf rx-bytes {
+ type uint64;
+ }
+ leaf tx-bytes {
+ type uint64;
+ }
+ leaf rx-dropped {
+ type uint64;
+ }
+ leaf tx-dropped {
+ type uint64;
+ }
+ leaf rx-errors {
+ type uint64;
+ }
+ leaf tx-errors {
+ type uint64;
+ }
+ leaf rx-frame-err {
+ type uint64;
+ }
+ leaf rx-over-err {
+ type uint64;
+ }
+ leaf rx-crc-err {
+ type uint64;
+ }
+ leaf collisions {
+ type uint64;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ }
+ }
+ }
+ case multipart-reply-queue-case {
+ container multipart-reply-queue {
+ list queue-stats {
+ leaf port-no {
+ type uint32;
+ }
+ leaf queue-id {
+ type uint32;
+ }
+ leaf tx-bytes {
+ type uint64;
+ }
+ leaf tx-packets {
+ type uint64;
+ }
+ leaf tx-errors {
+ type uint64;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ }
+ }
+ }
+ case multipart-reply-group-case {
+ container multipart-reply-group {
+ list group-stats {
+ leaf group-id {
+ type oft:group-id;
+ }
+ leaf ref-count {
+ type uint32;
+ }
+ leaf packet-count {
+ type uint64;
+ }
+ leaf byte-count {
+ type uint64;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ list bucket-stats {
+ leaf packet-count {
+ type uint64;
+ }
+ leaf byte-count {
+ type uint64;
+ }
+ }
+ }
+ }
+ }
+ case multipart-reply-group-desc-case {
+ container multipart-reply-group-desc {
+ list group-desc {
+ leaf type {
+ type oft:group-type;
+ }
+ leaf group-id {
+ type oft:group-id;
+ }
+ uses buckets-grouping;
+ }
+ }
+ }
+ case multipart-reply-group-features-case {
+ container multipart-reply-group-features {
+ leaf types {
+ type oft:group-types;
+ }
+ leaf capabilities {
+ type oft:group-capabilities;
+ }
+ leaf-list max_groups {
+ type uint32;
+ }
+ leaf-list actions-bitmap {
+ type oft:action-type;
+ }
+ }
+ }
+ case multipart-reply-meter-case {
+ container multipart-reply-meter {
+ list meter-stats {
+ leaf meter-id {
+ type oft:meter-id;
+ }
+ leaf flow-count {
+ type uint32;
+ }
+ leaf packet-in-count {
+ type uint64;
+ }
+ leaf byte-in-count {
+ type uint64;
+ }
+ leaf duration-sec {
+ type uint32;
+ }
+ leaf duration-nsec {
+ type uint32;
+ }
+ list meter-band-stats {
+ leaf packet-band-count {
+ type uint64;
+ }
+ leaf byte-band-count {
+ type uint64;
+ }
+ }
+ }
+ }
+ }
+ case multipart-reply-meter-config-case {
+ container multipart-reply-meter-config {
+ list meter-config {
+ leaf flags {
+ type oft:meter-flags;
+ }
+ leaf meter-id {
+ type oft:meter-id;
+ }
+ list bands {
+ uses meter-band-header;
+ }
+ }
+ }
+ }
+ case multipart-reply-meter-features-case {
+ container multipart-reply-meter-features {
+ leaf max-meter {
+ type uint32;
+ }
+ leaf band-types {
+ type oft:meter-band-type-bitmap;
+ }
+ leaf capabilities {
+ type oft:meter-flags;
+ }
+ leaf max-bands {
+ type uint8;
+ }
+ leaf max-color {
+ type uint8;
+ }
+ }
+ }
+ case multipart-reply-table-features-case {
+ container multipart-reply-table-features {
+ list table-features {
+ leaf table-id {
+ type uint8;
+ }
+ leaf name {
+ type string;
+ }
+ leaf metadata-match {
+ type binary;
+ }
+ leaf metadata-write {
+ type binary;
+ }
+ leaf config {
+ type oft:table-config;
+ }
+ leaf max-entries {
+ type uint32;
+ }
+ uses table-features-properties-grouping;
+ }
+ }
+ }
+ case multipart-reply-port-desc-case {
+ container multipart-reply-port-desc {
+ list ports {
+ uses port-grouping;
+ }
+ }
+ }
+ case multipart-reply-experimenter-case {
+ container multipart-reply-experimenter {
+ uses experimenter-core;
+ }
+ }
+ }
+ }
+ /* Barrier messages. */
+ grouping barrier-request {
+ reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+ }
+ grouping barrier-reply {
+ reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+ uses ofHeader;
+ }
+ /* Queue Configuration messages. */
+ grouping queue-get-config-request {
+ reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf port {
+ type oft:port-number;
+ }
+ }
+ grouping queue-get-config-reply {
+ reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf port {
+ type oft:port-number;
+ }
+ list queues {
+ uses packet-queue;
+ }
+ }
+ grouping packet-queue {
+ leaf queue-id {
+ type oft:queue-id;
+ }
+ leaf port {
+ type oft:port-number;
+ }
+ uses queue-property-header;
+ }
+ container queue-prop-container {
+ uses queue-property-header;
+ }
+ grouping queue-property-header {
+ list queue-property {
+ config false;
+ leaf property {
+ type oft:queue-properties;
+ }
+ }
+ }
+ /* Controller role change request messages. */
+ grouping role-request {
+ reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf role {
+ type oft:controller-role;
+ }
+ leaf generation-id {
+ type uint64;
+ }
+ }
+ grouping role-reply {
+ reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf role {
+ type oft:controller-role;
+ }
+ leaf generation-id {
+ type uint64;
+ }
+ }
+ /* Asynchronous message configuration. */
+ grouping get-async-request {
+ reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+ }
+ grouping get-async-reply {
+ reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+ uses async-body-grouping;
+ }
+ grouping set-async {
+ reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+ uses async-body-grouping;
+ }
+
+ grouping async-body-grouping {
+ list packet-in-mask {
+ leaf-list mask {
+ type oft:packet-in-reason;
+ }
+ }
+ list port-status-mask {
+ leaf-list mask {
+ type oft:port-reason;
+ }
+ }
+ list flow-removed-mask {
+ leaf-list mask {
+ type oft:flow-removed-reason;
+ }
+ }
+ }
+ /* Meters and rate limiters configuration messages. */
+ grouping meter-mod {
+ reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec";
+ /* Controller/switch message */
+
+ uses ofHeader;
+
+ leaf command {
+ type oft:meter-mod-command;
+ }
+ leaf flags {
+ type oft:meter-flags;
+ }
+ leaf meter-id {
+ type oft:meter-id;
+ }
+ list bands {
+ uses meter-band-header;
+ }
+ }
+
+ container meter-band-container {
+ uses meter-band-header;
+ }
+ grouping meter-band-header {
+ choice meter-band {
+ case meter-band-drop-case {
+ container meter-band-drop {
+ uses meter-band-commons;
+ }
+ }
+ case meter-band-dscp-remark-case {
+ container meter-band-dscp-remark {
+ uses meter-band-commons;
+ leaf prec-level {
+ type uint8;
+ }
+ }
+ }
+ case meter-band-experimenter-case {
+ container meter-band-experimenter {
+ uses meter-band-commons;
+ }
+ }
+ }
+ }
+
+ grouping meter-band-commons {
+ leaf type {
+ type oft:meter-band-type;
+ }
+ leaf rate {
+ type uint32;
+ }
+ leaf burst-size {
+ type uint32;
+ }
+ }
+
+ /* Immutable messages. */
+ notification hello-message {
+ uses hello;
+ reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
+
+ /* Symmetric message */
+ }
+ notification error-message {
+ uses error;
+ reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
+
+ /* Symmetric message */
+ }
+ notification echo-request-message {
+ uses echo-request;
+ reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
+
+ /* Symmetric message */
+ }
+ notification experimenter-message {
+ description "Experimenter request message from device.";
+ uses experimenter-of-message;
+ reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
+ // TODO:: does switch send this when understood experimenter msg from lib?
+ /* Symmetric message */
+ }
+ // # Notification and RPCs
+ /* Symmetric RPC. */
+ rpc echo {
+ input {
+ uses echo-request;
+ }
+ /* Controller/switch message */
+ output {
+ uses echo-reply;
+ }
+ }
+
+ rpc echo-reply {
+ input {
+ uses echo-reply;
+ }
+ }
+
+ rpc hello {
+ input {
+ uses hello;
+ }
+ }
+
+ rpc experimenter {
+ description "Send experimenter message to device, reply is not solicitated.";
+ input {
+ uses experimenter-of-message;
+ }
+ }
+
+ /* Switch configuration messages. */
+ rpc get-features {
+ input {
+ uses features-request;
+ }
+ /* Controller/switch message */
+ output {
+ uses features-reply;
+ }
+ }
+
+ rpc get-config {
+ input {
+ uses get-config-request;
+ }
+ output {
+ uses get-config-reply;
+ }
+ /* Controller/switch message */
+ }
+
+ rpc set-config {
+ input {
+ uses set-config;
+ }
+ /* Controller/switch message */
+ }
+ /* Asynchronous messages. */
+ notification packet-in-message {
+ uses packet-in;
+
+ /* Async message */
+ }
+ notification flow-removed-message {
+ uses flow-removed;
+
+ /* Async message */
+ }
+ notification port-status-message {
+ uses port-status;
+
+ } /* Async message */
+
+ /* Controller command messages. */
+ rpc packet-out {
+ input {
+ uses packet-out;
+ }
+ /* Controller/switch message */
+ }
+ rpc flow-mod {
+ input {
+ uses flow-mod;
+ }
+ /* Controller/switch message */
+ }
+ rpc group-mod {
+ input {
+ uses group-mod;
+ }
+ /* Controller/switch message */
+ }
+ rpc port-mod {
+ input {
+ uses port-mod;
+ }
+ } /* Controller/switch message */
+
+ rpc table-mod {
+ input {
+ uses table-mod;
+ }
+ } /* Controller/switch message */
+
+ /* Multipart messages. */
+
+ rpc multipart-request {
+ input {
+ uses multipart-request;
+ }
+ }
+
+ /* Controller/switch message */
+ notification multipart-reply-message {
+ uses multipart-reply;
+ // notification because of multiple following responses
+ } /* Controller/switch message */
+
+
+ /* Barrier messages. */
+ rpc barrier {
+ input {
+ uses barrier-request;
+ }
+ output {
+ uses barrier-reply;
+ }
+ }
+ /* Queue Configuration messages. */
+ rpc get-queue-config {
+ input {
+ uses queue-get-config-request;
+ }
+ output {
+ uses queue-get-config-reply;
+ }
+ }
+
+ /* Controller role change request messages. */
+ rpc role-request {
+ input {
+ uses role-request;
+ }
+ output {
+ uses role-reply;
+ }
+ } /* Controller/switch message */
+
+ /* Asynchronous message configuration. */
+ rpc get-async {
+ input {
+ uses get-async-request;
+ }
+ output {
+ uses get-async-reply;
+ }
+ }
+ /* Controller/switch message */
+ rpc set-async {
+ input {
+ uses set-async;
+ }
+
+ }
+ /* Meters and rate limiters configuration messages. */
+ rpc meter-mod {
+ input {
+ uses meter-mod;
+ }
+ } /* Controller/switch message */
}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/main/yang/openflow-types.yang b/openflow-protocol-api/src/main/yang/openflow-types.yang
old mode 100644
new mode 100755
index 669c86f0..7d11bafa
--- a/openflow-protocol-api/src/main/yang/openflow-types.yang
+++ b/openflow-protocol-api/src/main/yang/openflow-types.yang
@@ -5,13 +5,13 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
+
module openflow-types {
namespace "urn:opendaylight:openflow:common:types";
prefix "oft";
revision "2013-07-31" {
- description "OpenFlow 1.3 - common types model";
+ description "#NOT_PUBLISHED# OpenFlow 1.3 - common types model";
}
typedef port-number {
@@ -19,7 +19,7 @@
supports special / reserved values (in OF v1.3)";
type uint32;
}
-
+
typedef port-number-values {
description "Reserved OpenFlow Port (fake output \"ports\") (OF v1.3).";
type enumeration {
@@ -38,20 +38,20 @@
description "Submit the packet to the first flow table
NB: This destination port can only be
used in packet-out messages.";
- value -7; // 0xfffffff9
+ value -7; // 0xfffffff9
}
enum NORMAL {
description "Process with normal L2/L3 switching.";
- value -6; // 0xfffffffa
+ value -6; // 0xfffffffa
}
enum FLOOD {
description "All physical ports in VLAN, except input
port and those blocked or link down.";
- value -5; // 0xfffffffb
+ value -5; // 0xfffffffb
}
enum ALL {
description "All physical ports except input port.";
- value -4; // 0xfffffffc
+ value -4; // 0xfffffffc
}
enum CONTROLLER {
description "Send to controller.";
@@ -63,7 +63,7 @@
}
enum ANY {
description "Wildcard port used only for flow mod
- (delete) and flow stats requests. Selects
+ (delete) and flow stats requests. Selects
all flows regardless of output port
(including flows with no output port).";
value -1; // 0xffffffff
@@ -74,67 +74,67 @@
typedef port-features {
description "Features of ports available in datapath.";
type bits {
- bit _10mb_hd {
+ bit _10mb_hd {
position 0;
description "10 Mb half-duplex rate support.";
}
- bit _10mb-fd {
+ bit _10mb-fd {
position 1;
description "10 Mb full-duplex rate support.";
}
- bit _100mb-hd {
+ bit _100mb-hd {
position 2;
description "100 Mb half-duplex rate support.";
}
- bit _100mb-fd {
+ bit _100mb-fd {
position 3;
description "100 Mb full-duplex rate support.";
}
- bit _1gb-hd {
+ bit _1gb-hd {
position 4;
description "1 Gb half-duplex rate support.";
}
- bit _1gb-fd {
+ bit _1gb-fd {
position 5;
description "1 Gb full-duplex rate support.";
}
- bit _10gb-fd {
+ bit _10gb-fd {
position 6;
description "10 Gb full-duplex rate support.";
}
- bit _40gb-fd {
+ bit _40gb-fd {
position 7;
description "40 Gb full-duplex rate support.";
}
- bit _100gb-fd {
+ bit _100gb-fd {
position 8;
description "100 Gb full-duplex rate support.";
}
- bit _1tb-fd {
+ bit _1tb-fd {
position 9;
description "1 Tb full-duplex rate support.";
}
- bit other {
+ bit other {
position 10;
description "Other rate, not in the list.";
}
- bit copper {
+ bit copper {
position 11;
description "Copper medium.";
}
- bit fiber {
+ bit fiber {
position 12;
description "Fiber medium.";
}
- bit autoneg {
+ bit autoneg {
position 13;
description "Auto-negotiation.";
}
- bit pause {
+ bit pause {
position 14;
description "Pause.";
}
- bit pause-asym {
+ bit pause-asym {
position 15;
description "Asymmetric pause.";
}
@@ -142,24 +142,24 @@
}
typedef port-config {
- description
+ description
"Flags to indicate behavior of the physical port. These flags are
- describe the current configuration and used port_mod message
+ describe the current configuration and used port_mod message
to configure the port's behavior.";
type bits {
- bit port-down {
+ bit port-down {
//description " Port is administratively down.";
position 0;
}
- bit no-recv {
+ bit no-recv {
//description " Drop all packets received by port.";
position 2;
}
- bit no-fwd {
+ bit no-fwd {
//description " Drop packets forwarded to port.";
position 5;
}
- bit no-packet-in {
+ bit no-packet-in {
//description "Do not send packet-in msgs for port.";
position 6;
}
@@ -167,7 +167,7 @@
}
typedef port-state {
- description
+ description
"Current state of the physical port. These are not configurable from
the controller.";
type bits {
@@ -187,10 +187,10 @@
}
identity match-type-base {
- description
+ description
"The match type indicates the match structure (set of fields that compose the
match) in use. The match type is placed in the type field at the beginning
- of all match structures.Extensions that define match types may be
+ of all match structures.Extensions that define match types may be
published on the ONF wiki. Support for extensions is optional.";
}
@@ -206,6 +206,10 @@
description "Base identity for action types";
}
+ identity experimenter-meter-band-sub-type {
+ description "The base identity for vendor's meter bands.";
+ }
+
typedef metadata {
type binary;
}
@@ -226,367 +230,373 @@
typedef ether-type {
type uint16;
}
-
+ typedef experimenter-id {
+ description "This type represents experimenter ID used in experimenter messages.
+ It also represents vendor ID - as it is the same for OF version 1.3+.
+ (VENDOR naming convention has been changed in OF v1.3 specification
+ to EXPERIMENTER)";
+ type uint32;
+ }
typedef error-type {
type enumeration {
enum HELLO_FAILED {
- value 0;
+ value 0;
description "Hello Protocol failed.";
}
enum BAD_REQUEST {
- value 1;
+ value 1;
description "Request was not understood.";
}
enum BAD_ACTION {
- value 2;
+ value 2;
description "Error in action description.";
}
enum BAD_INSTRUCTION {
- value 3;
+ value 3;
description "Error in instruction list.";
}
enum BAD_MATCH {
- value 4;
+ value 4;
description "Error in match.";
}
enum FLOW_MOD_FAILED {
- value 5;
+ value 5;
description "Problem modifying flow entry.";
}
enum GROUP_MOD_FAILED {
- value 6;
+ value 6;
description "Problem modifying group entry.";
}
enum PORT_MOD_FAILED {
- value 7;
+ value 7;
description "Port mod request failed.";
}
enum TABLE_MOD_FAILED {
- value 8;
+ value 8;
description "Table mod request failed.";
}
enum QUEUE_OP_FAILED {
- value 9;
+ value 9;
description "Queue operation failed.";
}
enum SWITCH_CONFIG_FAILED {
- value 10;
+ value 10;
description "Switch config request failed.";
}
enum ROLE_REQUEST_FAILED {
- value 11;
+ value 11;
description "Controller Role request failed.";
}
enum METER_MOD_FAILED {
- value 12;
+ value 12;
description "Error in meter.";
}
enum TABLE_FEATURES_FAILED {
- value 13;
+ value 13;
description "Setting table features failed.";
}
enum EXPERIMENTER {
- value 65535; //0xffff
+ value 65535; //0xffff
description "Experimenter error messages.";
}
}
}
-
+
typedef hello-failed-code {
type enumeration {
enum INCOMPATIBLE {
- value 0;
+ value 0;
description "Hello Protocol failed.";
}
enum EPERM {
- value 1;
+ value 1;
description "Request was not understood.";
}
}
}
-
+
typedef bad-request-code {
type enumeration {
enum BAD_VERSION {
- value 0;
+ value 0;
}
enum BAD_TYPE {
- value 1;
+ value 1;
}
enum BAD_MULTIPART {
- value 2;
+ value 2;
}
enum BAD_EXPERIMENTER {
- value 3;
+ value 3;
}
enum BAD_EXP_TYPE {
- value 4;
+ value 4;
}
enum EPERM {
- value 5;
+ value 5;
}
enum BAD_LEN {
- value 6;
+ value 6;
}
enum BUFFER_EMPTY {
- value 7;
+ value 7;
}
enum BUFFER_UNKNOWN {
- value 8;
+ value 8;
}
enum BAD_TABLE_ID {
- value 9;
+ value 9;
}
enum IS_SLAVE {
- value 10;
+ value 10;
}
enum BAD_PORT {
- value 11;
+ value 11;
}
enum BAD_PACKET {
- value 12;
+ value 12;
}
enum MULTIPART_BUFFER_OVERFLOW {
- value 13;
+ value 13;
}
}
}
-
+
typedef bad-action-code {
type enumeration {
enum BAD_TYPE {
- value 0;
+ value 0;
}
enum BAD_LEN {
- value 1;
+ value 1;
}
enum BAD_EXPERIMENTER {
- value 2;
+ value 2;
}
enum BAD_EXP_TYPE {
- value 3;
+ value 3;
}
enum BAD_OUT_PORT {
- value 4;
+ value 4;
}
enum BAD_ARGUMENT {
- value 5;
+ value 5;
}
enum EPERM {
- value 6;
+ value 6;
}
enum TOO_MANY {
- value 7;
+ value 7;
}
enum BAD_QUEUE {
- value 8;
+ value 8;
}
enum BAD_OUT_GROUP {
- value 9;
+ value 9;
}
enum MATCH_INCONSISTENT {
- value 10;
+ value 10;
}
enum UNSUPPORTED_ORDER {
- value 11;
+ value 11;
}
enum BAD_TAG {
- value 12;
+ value 12;
}
enum BAD_SET_TYPE {
- value 13;
+ value 13;
}
enum BAD_SET_LEN {
- value 14;
+ value 14;
}
enum BAD_SET_ARGUMENT {
- value 15;
+ value 15;
}
}
}
-
+
typedef bad-instruction-code {
type enumeration {
enum UNKNOWN_INST {
- value 0;
+ value 0;
}
enum UNSUP_INST {
- value 1;
+ value 1;
}
enum BAD_TABLE_ID {
- value 2;
+ value 2;
}
enum UNSUP_METADATA {
- value 3;
+ value 3;
}
enum UNSUP_METADATA_MASK {
- value 4;
+ value 4;
}
enum BAD_EXPERIMENTER {
- value 5;
+ value 5;
}
enum BAD_EXP_TYPE {
- value 6;
+ value 6;
}
enum BAD_LEN {
- value 7;
+ value 7;
}
enum EPERM {
- value 8;
+ value 8;
}
}
}
-
+
typedef bad-match-code {
type enumeration {
enum BAD_TYPE {
- value 0;
+ value 0;
}
enum BAD_LEN {
- value 1;
+ value 1;
}
enum BAD_TAG {
- value 2;
+ value 2;
}
enum BAD_DL_ADDR_MASK {
- value 3;
+ value 3;
}
enum BAD_NW_ADDR_MASK {
- value 4;
+ value 4;
}
enum BAD_WILDCARDS {
- value 5;
+ value 5;
}
enum BAD_FIELD {
- value 6;
+ value 6;
}
enum BAD_VALUE {
- value 7;
+ value 7;
}
enum BAD_MASK {
- value 8;
+ value 8;
}
enum BAD_PREREQ {
- value 9;
+ value 9;
}
enum DUP_FIELD {
- value 10;
+ value 10;
}
enum EPERM {
- value 11;
+ value 11;
}
}
}
-
+
typedef flow-mod-failed-code {
type enumeration {
enum UNKNOWN {
- value 0;
+ value 0;
}
enum TABLE_FULL {
- value 1;
+ value 1;
}
enum BAD_TABLE_ID {
- value 2;
+ value 2;
}
enum OVERLAP {
- value 3;
+ value 3;
}
enum EPERM {
- value 4;
+ value 4;
}
enum BAD_TIMEOUT {
- value 5;
+ value 5;
}
enum BAD_COMMAND {
- value 6;
+ value 6;
}
enum BAD_FLAGS {
- value 7;
+ value 7;
}
}
}
-
+
typedef group-mod-failed-code {
type enumeration {
enum GROUP_EXISTS {
- value 0;
+ value 0;
}
enum INVALID_GROUP {
- value 1;
+ value 1;
}
enum WEIGHT_UNSUPPORTED {
- value 2;
+ value 2;
}
enum OUT_OF_GROUPS {
- value 3;
+ value 3;
}
enum OUT_OF_BUCKETS {
- value 4;
+ value 4;
}
enum CHAINING_UNSUPPORTED {
- value 5;
+ value 5;
}
enum WATCH_UNSUPPORTED {
- value 6;
+ value 6;
}
enum LOOP {
- value 7;
+ value 7;
}
enum UNKNOWN_GROUP {
- value 8;
+ value 8;
}
enum CHAINED_GROUP {
- value 9;
+ value 9;
}
enum BAD_TYPE {
- value 10;
+ value 10;
}
enum BAD_COMMAND {
- value 11;
+ value 11;
}
enum BAD_BUCKET {
- value 12;
+ value 12;
}
enum BAD_WATCH {
- value 13;
+ value 13;
}
enum EPERM {
- value 14;
+ value 14;
}
}
}
-
+
typedef port-mod-failed-code {
type enumeration {
enum BAD_PORT {
- value 0;
+ value 0;
}
enum BAD_HW_ADDR {
- value 1;
+ value 1;
}
enum BAD_CONFIG {
- value 2;
+ value 2;
}
enum BAD_ADVERTISE {
- value 3;
+ value 3;
}
enum EPERM {
- value 4;
+ value 4;
}
}
}
-
+
typedef table-mod-failed-code {
type enumeration {
enum BAD_TABLE {
- value 0;
+ value 0;
}
enum BAD_CONFIG {
- value 1;
+ value 1;
}
enum EPERM {
- value 2;
+ value 2;
}
}
}
@@ -594,125 +604,125 @@
typedef queue-op-failed-code {
type enumeration {
enum BAD_PORT {
- value 0;
+ value 0;
}
enum BAD_QUEUE {
- value 1;
+ value 1;
}
enum EPERM {
- value 2;
+ value 2;
}
}
}
-
+
typedef switch-config-failed-code {
type enumeration {
enum BAD_FLAGS {
- value 0;
+ value 0;
}
enum BAD_LEN {
- value 1;
+ value 1;
}
enum EPERM {
- value 2;
+ value 2;
}
}
}
-
+
typedef role-request-failed-code {
type enumeration {
enum STALE {
- value 0;
+ value 0;
}
enum UNSUP {
- value 1;
+ value 1;
}
enum BAD_ROLE {
- value 2;
+ value 2;
}
}
}
-
+
typedef meter-mod-failed-code {
type enumeration {
enum UNKNOWN {
- value 0;
+ value 0;
}
enum METER_EXISTS {
- value 1;
+ value 1;
}
enum INVALID_METER {
- value 2;
+ value 2;
}
enum UNKNOWN_METER {
- value 3;
+ value 3;
}
enum BAD_COMMAND {
- value 4;
+ value 4;
}
enum BAD_FLAGS {
- value 5;
+ value 5;
}
enum BAD_RATE {
- value 6;
+ value 6;
}
enum BAD_BURST {
- value 7;
+ value 7;
}
enum BAD_BAND {
- value 8;
+ value 8;
}
enum BAD_BAND_VALUE {
- value 9;
+ value 9;
}
enum OUT_OF_METERS {
- value 10;
+ value 10;
}
enum OUT_OF_BANDS {
- value 11;
+ value 11;
}
}
}
-
+
typedef table-features-failed-code {
type enumeration {
enum BAD_TABLE {
- value 0;
+ value 0;
}
enum BAD_METADATA {
- value 1;
+ value 1;
}
enum BAD_TYPE {
- value 2;
+ value 2;
}
enum BAD_LEN {
- value 3;
+ value 3;
}
enum BAD_ARGUMENT {
- value 4;
+ value 4;
}
enum EPERM {
- value 5;
+ value 5;
}
}
}
-
+
typedef hello-element-type {
type enumeration {
enum VERSIONBITMAP {
- value 1;
+ value 1;
description "Bitmap of version supported.";
}
}
}
-
+
typedef capabilities {
description "Capabilities supported by the datapath.";
type bits {
bit OFPC_FLOW_STATS {
position 0;
/* Flow statistics. */
- }
+ }
bit OFPC_TABLE_STATS {
position 1;
/* Table statistics. */
@@ -744,19 +754,19 @@
description " Handling of IP fragments. ";
type enumeration {
enum FRAG_NORMAL {
- value 0;
+ value 0;
description "No special handling for fragments.";
}
enum OFPC_FRAG_DROP {
- value 1;
+ value 1;
description "Drop fragments.";
}
enum OFPC_FRAG_REASM {
- value 2;
+ value 2;
description "Reassemble (only if OFPC_IP_REASM set).";
}
enum OFPC_FRAG_MASK {
- value 3;
+ value 3;
}
}
}
@@ -902,7 +912,7 @@
}
enum OFPTT_ALL {
value 255; // 0xff
- description "Wildcard table used for table config,
+ description "Wildcard table used for table config,
flow stats and flow deletes.";
}
}
@@ -922,7 +932,7 @@
}
enum OFPG_ANY {
value -1; //0xffffffff
- description "Wildcard group used only for flow stats requests.
+ description "Wildcard group used only for flow stats requests.
Selects all flows regardless of group (including flows with no group)";
}
}
@@ -1053,7 +1063,7 @@
description "Maximum datarate.";
}
enum OFPQT_EXPERIMENTER {
- value 65535; // 0xffff
+ value 65535; // 0xffff
description "Experimenter defined property.";
}
}
@@ -1098,7 +1108,7 @@
}
}
}
-
+
typedef action-type {
/* ofp_action_type */
type bits {
@@ -1226,7 +1236,7 @@
}
}
}
-
+
typedef meter-band-type-bitmap {
/* ofp_meter_band_type */
type bits {
@@ -1277,67 +1287,67 @@
typedef table-features-prop-type {
type enumeration {
enum OFPTFPT_INSTRUCTIONS {
- value 0;
+ value 0;
description "Instructions property.";
}
enum OFPTFPT_INSTRUCTIONS_MISS {
- value 1;
+ value 1;
description "Instructions for table-miss.";
}
enum OFPTFPT_NEXT_TABLES {
- value 2;
+ value 2;
description "Next Table property.";
}
enum OFPTFPT_NEXT_TABLES_MISS {
- value 3;
+ value 3;
description "Next Table for table-miss.";
}
enum OFPTFPT_WRITE_ACTIONS {
- value 4;
+ value 4;
description "Write Actions property.";
}
enum OFPTFPT_WRITE_ACTIONS_MISS {
- value 5;
+ value 5;
description "Write Actions for table-miss.";
}
enum OFPTFPT_APPLY_ACTIONS {
- value 6;
+ value 6;
description "Apply Actions property.";
}
enum OFPTFPT_APPLY_ACTIONS_MISS {
- value 7;
+ value 7;
description "Apply Actions for table-miss.";
}
enum OFPTFPT_MATCH {
- value 8;
+ value 8;
description "Match property.";
}
enum OFPTFPT_WILDCARDS {
- value 10;
+ value 10;
description "Wildcards property.";
}
enum OFPTFPT_WRITE_SETFIELD {
- value 12;
+ value 12;
description "Write Set-Field property.";
}
enum OFPTFPT_WRITE_SETFIELD_MISS {
- value 13;
+ value 13;
description "Write Set-Field for table-miss.";
}
enum OFPTFPT_APPLY_SETFIELD {
- value 14;
+ value 14;
description "Apply Set-Field property.";
}
enum OFPTFPT_APPLY_SETFIELD_MISS {
- value 15;
+ value 15;
description "Apply Set-Field for table-miss.";
}
enum OFPTFPT_EXPERIMENTER {
- value 65534;
+ value 65534;
description "Experimenter property.";
}
enum OFPTFPT_EXPERIMENTER_MISS {
- value 65535; //0xffff
+ value 65535; //0xffff
description "Experimenter for table-miss.";
}
}
@@ -1386,7 +1396,7 @@
}
}
}
-
+
typedef ipv6-exthdr-flags {
description "Bit definitions for IPv6 Extension Header pseudo-field.";
type bits {
@@ -1428,170 +1438,170 @@
}
}
}
-
+
// OPENFLOW v1.0 STRUCTURES
- // Structures under this line are needed to support OpenFlow version 1.0
+ // Structures under this line are needed to support OpenFlow version 1.0
// wire protocol 0x01;
-
+
typedef error-type-v10 {
type enumeration {
enum HELLO_FAILED {
- value 0;
+ value 0;
description "Hello Protocol failed.";
}
enum BAD_REQUEST {
- value 1;
+ value 1;
description "Request was not understood.";
}
enum BAD_ACTION {
- value 2;
+ value 2;
description "Error in action description.";
}
enum FLOW_MOD_FAILED {
- value 3;
+ value 3;
description "Problem modifying flow entry.";
}
enum PORT_MOD_FAILED {
- value 4;
+ value 4;
description "Port mod request failed.";
}
enum QUEUE_OP_FAILED {
- value 5;
+ value 5;
description "Queue operation failed.";
}
}
}
-
+
typedef hello-failed-code-v10 {
type enumeration {
enum INCOMPATIBLE {
- value 0;
+ value 0;
description "Hello Protocol failed.";
}
enum EPERM {
- value 1;
+ value 1;
description "Request was not understood.";
}
}
}
-
+
typedef bad-request-code-v10 {
type enumeration {
enum BAD_VERSION {
- value 0;
+ value 0;
}
enum BAD_TYPE {
- value 1;
+ value 1;
}
enum BAD_STAT {
- value 2;
+ value 2;
}
enum BAD_VENDOR {
- value 3;
+ value 3;
}
enum BAD_SUBTYPE {
- value 4;
+ value 4;
}
enum EPERM {
- value 5;
+ value 5;
}
enum BAD_LEN {
- value 6;
+ value 6;
}
enum BUFFER_EMPTY {
- value 7;
+ value 7;
}
enum BUFFER_UNKNOWN {
- value 8;
+ value 8;
}
}
}
-
+
typedef bad-action-code-v10 {
type enumeration {
enum BAD_TYPE {
- value 0;
+ value 0;
}
enum BAD_LEN {
- value 1;
+ value 1;
}
enum VENDOR {
- value 2;
+ value 2;
}
enum BAD_VENDOR_TYPE {
- value 3;
+ value 3;
}
enum BAD_OUT_PORT {
- value 4;
+ value 4;
}
enum BAD_ARGUMENT {
- value 5;
+ value 5;
}
enum EPERM {
- value 6;
+ value 6;
}
enum TOO_MANY {
- value 7;
+ value 7;
}
enum BAD_QUEUE {
- value 8;
+ value 8;
}
}
}
-
+
typedef flow-mod-failed-code-v10 {
type enumeration {
enum ALL_TABLES_FULL {
- value 0;
+ value 0;
}
enum OVERLAP {
- value 1;
+ value 1;
}
enum EPERM {
- value 2;
+ value 2;
}
enum BAD_EMERG_TIMEOUT {
- value 3;
+ value 3;
}
enum BAD_COMMAND {
- value 4;
+ value 4;
}
enum UNSUPPORTED {
- value 5;
+ value 5;
}
}
}
-
+
typedef port-mod-failed-code-v10 {
type enumeration {
enum BAD_PORT {
- value 0;
+ value 0;
}
enum BAD_HW_ADDR {
- value 1;
+ value 1;
}
}
}
-
+
typedef queue-op-failed-code-v10 {
type enumeration {
enum BAD_PORT {
- value 0;
+ value 0;
}
enum BAD_QUEUE {
- value 1;
+ value 1;
}
enum EPERM {
- value 2;
+ value 2;
}
}
}
-
+
typedef port-number-values-v10 {
description "Port numbering. Physical ports are numbered starting from 1.";
type enumeration {
enum MAX {
- value 65280; // 0xff00
+ value 65280; // 0xff00
}
enum IN_PORT {
description "Send the packet out the input port. This
@@ -1604,20 +1614,20 @@
description "Perform actions in flow table.
NB: This can only be the destination
port for packet-out messages.";
- value 65529; // 0xfff9
+ value 65529; // 0xfff9
}
enum NORMAL {
description "Process with normal L2/L3 switching.";
- value 65530; // 0xfffa
+ value 65530; // 0xfffa
}
enum FLOOD {
description "All physical ports except input port and
those disabled by STP.";
- value 65531; // 0xfffb
+ value 65531; // 0xfffb
}
enum ALL {
description "All physical ports except input port.";
- value 65532; // 0xfffc
+ value 65532; // 0xfffc
}
enum CONTROLLER {
description "Send to controller.";
@@ -1633,44 +1643,44 @@
}
}
}
-
+
typedef port-config-v10 {
- description
+ description
"Flags to indicate behavior of the physical port. These flags are
- describe the current configuration and used port_mod message
+ describe the current configuration and used port_mod message
to configure the port's behavior.";
type bits {
- bit port-down {
+ bit port-down {
description " Port is administratively down.";
position 0;
}
bit no-stp {
- description" Disable 802.1D spanning tree on port.";
+ description "Disable 802.1D spanning tree on port.";
position 1;
}
- bit no-recv {
+ bit no-recv {
description " Drop all packets received by port.";
position 2;
}
- bit no-recv-stp {
+ bit no-recv-stp {
description " Drop received 802.1D STP packets.";
position 3;
}
- bit no-flood {
+ bit no-flood {
description " Do not include this port when flooding.";
position 4;
}
- bit no-fwd {
+ bit no-fwd {
description " Drop packets forwarded to port.";
position 5;
}
- bit no-packet-in {
+ bit no-packet-in {
description "Do not send packet-in msgs for port.";
position 6;
}
}
}
-
+
typedef port-state-v10 {
description "Current state of the physical port. These are not configurable from
the controller.";
@@ -1704,68 +1714,68 @@
}
}
}
-
+
typedef port-features-v10 {
description "Features of ports available in datapath.";
reference "ofp_port_features";
type bits {
- bit _10mb-hd {
+ bit _10mb-hd {
position 0;
description "10 Mb half-duplex rate support.";
}
- bit _10mb-fd {
+ bit _10mb-fd {
position 1;
description "10 Mb full-duplex rate support.";
}
- bit _100mb-hd {
+ bit _100mb-hd {
position 2;
description "100 Mb half-duplex rate support.";
}
- bit _100mb-fd {
+ bit _100mb-fd {
position 3;
description "100 Mb full-duplex rate support.";
}
- bit _1gb-hd {
+ bit _1gb-hd {
position 4;
description "1 Gb half-duplex rate support.";
}
- bit _1gb-fd {
+ bit _1gb-fd {
position 5;
description "1 Gb full-duplex rate support.";
}
- bit _10gb-fd {
+ bit _10gb-fd {
position 6;
description "10 Gb full-duplex rate support.";
}
- bit copper {
+ bit copper {
position 7;
description "Copper medium.";
}
- bit fiber {
+ bit fiber {
position 8;
description "Fiber medium.";
}
- bit autoneg {
+ bit autoneg {
position 9;
description "Auto-negotiation.";
}
- bit pause {
+ bit pause {
position 10;
description "Pause.";
}
- bit pause-asym {
+ bit pause-asym {
position 11;
description "Asymmetric pause.";
}
}
}
-
+
typedef capabilities-v10 {
type bits {
bit OFPC_FLOW_STATS {
position 0;
description "Flow statistics.";
- }
+ }
bit OFPC_TABLE_STATS {
position 1;
description "Table statistics.";
@@ -1796,7 +1806,7 @@
}
}
}
-
+
typedef flow-mod-flags-v10 {
/* ofp_flow_mod_flags */
type bits {
@@ -1814,7 +1824,7 @@
}
}
}
-
+
typedef action-type-v10 {
/* ofp_action_type */
type bits {
@@ -1872,7 +1882,7 @@
}
}
}
-
+
typedef flow-wildcards-v10 {
/* ofp_flow_wildcards */
description "Flow wildcards - NW_SRC_MASK & NW_DST_MASK are handled separately";
@@ -1919,5 +1929,5 @@
}
}
}
-
+
}
diff --git a/openflow-protocol-api/src/main/yang/system-notifications.yang b/openflow-protocol-api/src/main/yang/system-notifications.yang
index 4cbe17e7..5bd805c3 100644
--- a/openflow-protocol-api/src/main/yang/system-notifications.yang
+++ b/openflow-protocol-api/src/main/yang/system-notifications.yang
@@ -5,13 +5,13 @@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
+
module system-notifications {
namespace "urn:opendaylight:openflow:system";
prefix "ofs";
revision "2013-09-27" {
- description "Model of system messages used in OpenFlow Protocol Library";
+ description "#NOT_PUBLISHED# Model of system messages used in OpenFlow Protocol Library";
}
notification disconnect-event {
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImplTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImplTest.java
new file mode 100644
index 00000000..be52a188
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/connection/TlsConfigurationImplTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.connection;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class TlsConfigurationImplTest {
+
+ /**
+ * Test correct TlsConfigurationImpl creation
+ */
+ @Test
+ public void test() {
+ List cipherSuites = Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256");
+ TlsConfigurationImpl config = new TlsConfigurationImpl(KeystoreType.JKS,
+ "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH, cipherSuites);
+ assertEquals("Wrong keystore location", "/var/lib", config.getTlsKeystore());
+ assertEquals("Wrong truststore location", "user/dir", config.getTlsTruststore());
+ assertEquals("Wrong keystore type", KeystoreType.PKCS12, config.getTlsKeystoreType());
+ assertEquals("Wrong truststore type", KeystoreType.JKS, config.getTlsTruststoreType());
+ assertEquals("Wrong keystore path type", PathType.PATH, config.getTlsKeystorePathType());
+ assertEquals("Wrong truststore path type", PathType.CLASSPATH, config.getTlsTruststorePathType());
+ assertEquals("Wrong certificate password", "opendaylight", config.getCertificatePassword());
+ assertEquals("Wrong keystore password", "opendaylight", config.getKeystorePassword());
+ assertEquals("Wrong truststore password", "opendaylight", config.getTruststorePassword());
+ assertEquals("Wrong cipher suites", cipherSuites, config.getCipherSuites());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java
new file mode 100644
index 00000000..6e08c1e4
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageCodeKeyTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class EnhancedMessageCodeKeyTest {
+
+ /**
+ * Test EnhancedMessageCodeKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ EnhancedMessageCodeKey key1 =
+ new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class);
+ EnhancedMessageCodeKey key2 =
+ new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageCodeKey(EncodeConstants.OF13_VERSION_ID, 4, 8, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierOutput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 6, 8, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 16, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test EnhancedMessageTypeKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ EnhancedMessageCodeKey key1 =
+ new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+ }
+
+ /**
+ * Test EnhancedMessageCodeKey toString()
+ */
+ @Test
+ public void testToString() {
+ EnhancedMessageCodeKey key1 =
+ new EnhancedMessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, 8, BarrierInput.class);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
+ + ".openflow.protocol.rev130731.BarrierInput msgType: 4 msgType2: 8", key1.toString());
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java
new file mode 100644
index 00000000..eb19e7ff
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/EnhancedMessageTypeKeyTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class EnhancedMessageTypeKeyTest {
+
+ /**
+ * Test EnhancedMessageTypeKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ EnhancedMessageTypeKey,?> key1 =
+ new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ EnhancedMessageTypeKey,?> key2 =
+ new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, OutputActionCase.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null, OutputActionCase.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Instruction.class, OutputActionCase.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Action.class, SetFieldCase.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test EnhancedMessageTypeKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ EnhancedMessageTypeKey,?> key1;
+ EnhancedMessageTypeKey,?> key2;
+ key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, null);
+ Assert.assertFalse("Wrong equal by msgType2.", key1.equals(key2));
+ key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, OutputActionCase.class);
+ key2 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, Action.class, SetFieldCase.class);
+ Assert.assertFalse("Wrong equal by msgType2 class name.", key1.equals(key2));
+ }
+
+ /**
+ * Test EnhancedMessageTypeKey toString()
+ */
+ @Test
+ public void testToString() {
+ EnhancedMessageTypeKey,?> key1 = new EnhancedMessageTypeKey<>(EncodeConstants.OF10_VERSION_ID,
+ Action.class, OutputActionCase.class);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action msgType2:"
+ + " org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action"
+ + ".grouping.action.choice.OutputActionCase", key1.toString());
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKeyTest.java
new file mode 100644
index 00000000..2c5b69c6
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageCodeKeyTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class MessageCodeKeyTest {
+
+ /**
+ * Test MessageCodeKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ MessageCodeKey key1 =
+ new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierInput.class);
+ MessageCodeKey key2 =
+ new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierInput.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageCodeKey(EncodeConstants.OF13_VERSION_ID, 4, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierOutput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 6, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test MessageCodeKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ MessageCodeKey key1 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierInput.class);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to null.", key1.equals(null));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ key1 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, null);
+ MessageCodeKey key2 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierInput.class);
+ Assert.assertFalse("Wrong equal by clazz.", key1.equals(key2));
+
+ key2 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, null);
+ Assert.assertTrue("Wrong equal by clazz.", key1.equals(key2));
+ }
+
+ /**
+ * Test MessageCodeKey toString()
+ */
+ @Test
+ public void testToString() {
+ MessageCodeKey key1 = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, 4, BarrierInput.class);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.protocol.rev130731.BarrierInput msgType: 4", key1.toString());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java
new file mode 100644
index 00000000..7a45015a
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/extensibility/MessageTypeKeyTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.extensibility;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class MessageTypeKeyTest {
+
+ /**
+ * Test MessageTypeKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ MessageTypeKey> key1 =
+ new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+ MessageTypeKey> key2 =
+ new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, BarrierInput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierOutput.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test MessageTypeKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ MessageTypeKey> key1;
+ MessageTypeKey> key2;
+ key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to null.", key1.equals(null));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null);
+ key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+ Assert.assertFalse("Wrong equal by msgType.", key1.equals(key2));
+
+ key2 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, null);
+ Assert.assertTrue("Wrong equal by msgType.", key1.equals(key2));
+ }
+
+ /**
+ * Test MessageTypeKey toString()
+ */
+ @Test
+ public void testToString() {
+ MessageTypeKey> key1 = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID, BarrierInput.class);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.protocol.rev130731.BarrierInput", key1.toString());
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java
new file mode 100644
index 00000000..84760e8b
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionDeserializerKeyTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ActionDeserializerKeyTest {
+
+ /**
+ * Test ActionDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
+ ActionDeserializerKey key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 11, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ActionDeserializerKey equals - additional test
+ */
+ @Test
+ public void testEquals(){
+ ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ ActionDeserializerKey key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+ Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+ key2 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ Assert.assertTrue("Wrong equal by experimenterId", key1.equals(key2));
+ }
+
+ /**
+ * Test InstructionDeserializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ ActionDeserializerKey key1 = new ActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action msgType: 11"
+ + " experimenterID: null", key1.toString());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java
new file mode 100644
index 00000000..9fdde0ae
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/ActionSerializerKeyTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCase;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ActionSerializerKeyTest {
+
+ /**
+ * Test ActionSerializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ActionSerializerKey key1 =
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
+ ActionSerializerKey> key2 =
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlOutCase.class, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ActionSerializerKey equals - additional test
+ */
+ @Test
+ public void testEquals(){
+ ActionSerializerKey> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ ActionSerializerKey> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+ CopyTtlInCase.class, 42L);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal by actionType", key1.equals(key2));
+
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ Assert.assertTrue("Wrong equal by action type", key1.equals(key2));
+ key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
+ Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, null);
+ Assert.assertTrue("Wrong equal by experimenterId", key1.equals(key2));
+ }
+
+ /**
+ * Test ActionSerializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ ActionSerializerKey key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+ CopyTtlInCase.class, 42L);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action action type:"
+ + " org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action"
+ + ".grouping.action.choice.CopyTtlInCase experimenterID: 42", key1.toString());
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java
new file mode 100644
index 00000000..6b501a1c
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionDeserializerKeyTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class InstructionDeserializerKeyTest {
+
+ /**
+ * Test InstructionDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ InstructionDeserializerKey key1 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
+ InstructionDeserializerKey key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 11, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test InstructionDeserializerKey equals - additional test
+ */
+ @Test
+ public void testEquals(){
+ InstructionDeserializerKey key1 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ InstructionDeserializerKey key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, 24L);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+ Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+ key2 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+ Assert.assertTrue("Wrong equal by experimenterId", key1.equals(key2));
+ }
+
+ /**
+ * Test InstructionDeserializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ InstructionDeserializerKey key1 = new InstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 11, null);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectClass: org.opendaylight.yang.gen.v1.urn.opendaylight"
+ + ".openflow.common.instruction.rev130731.instructions.grouping.Instruction msgType: 11"
+ + " experimenterID: null", key1.toString());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java
new file mode 100644
index 00000000..17ecf582
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKeyTest.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCase;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class InstructionSerializerKeyTest {
+
+ /**
+ * Test InstructionSerializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ InstructionSerializerKey> key1 =
+ new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
+ InstructionSerializerKey> key2 =
+ new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, WriteActionsCase.class, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, ApplyActionsCase.class, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test InstructionSerializerKey equals - additional test
+ */
+ @Test
+ public void testEquals(){
+ InstructionSerializerKey> key1 =
+ new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
+ InstructionSerializerKey> key2 =
+ new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ key1 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, null);
+ Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
+
+ key1 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ key2 = new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ Assert.assertTrue("Wrong equal by instructionType.", key1.equals(key2));
+ }
+
+ /**
+ * Test InstructionSerializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ InstructionSerializerKey> key1 =
+ new InstructionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, ApplyActionsCase.class, 42L);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction "
+ + "instructionType type: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction"
+ + ".rev130731.instruction.grouping.instruction.choice.ApplyActionsCase vendorID: 42", key1.toString());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java
new file mode 100644
index 00000000..d2aefedb
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/KeysTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.action.container.action.choice.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+
+/**
+ * @author michal.polkorab
+ */
+public class KeysTest {
+
+ /**
+ * Testing equals() and hashcode() methods of extension deserializer's keys
+ */
+ @Test
+ public void testEqualsAndHashcodeOfDeserializerKeys() {
+ ActionDeserializerKey actionDeserializerKey = new ActionDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ EncodeConstants.EXPERIMENTER_VALUE, 1L);
+ ExperimenterActionDeserializerKey experimenterActionDeserializerKey = new ExperimenterActionDeserializerKey(
+ EncodeConstants.OF13_VERSION_ID, 1L);
+ Assert.assertEquals(actionDeserializerKey, experimenterActionDeserializerKey);
+ Assert.assertEquals(actionDeserializerKey.hashCode(), experimenterActionDeserializerKey.hashCode());
+
+ InstructionDeserializerKey instructionDeserializerKey = new InstructionDeserializerKey(
+ EncodeConstants.OF13_VERSION_ID, EncodeConstants.EXPERIMENTER_VALUE, 1L);
+ ExperimenterInstructionDeserializerKey experimenterInstructionDeserializerKey = new ExperimenterInstructionDeserializerKey(
+ EncodeConstants.OF13_VERSION_ID, 1L);
+ Assert.assertEquals(instructionDeserializerKey, experimenterInstructionDeserializerKey);
+ Assert.assertEquals(instructionDeserializerKey.hashCode(), experimenterInstructionDeserializerKey.hashCode());
+
+ MatchEntryDeserializerKey matchKey = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
+ MatchEntryDeserializerKey matchKey2 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
+ OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
+ Assert.assertEquals(matchKey, matchKey2);
+ Assert.assertEquals(matchKey.hashCode(), matchKey2.hashCode());
+ }
+
+ /**
+ * Testing equals() and hashcode() methods of extension serializer's keys
+ */
+ @Test
+ public void testEqualsAndHashcodeOfActionDeserializerKeys() {
+ ActionSerializerKey actionSerializerKey = new ActionSerializerKey<>(
+ EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, 1L);
+ ExperimenterActionSerializerKey experimenterActionSerializerKey = new ExperimenterActionSerializerKey(
+ EncodeConstants.OF13_VERSION_ID, 1L, ExpSubType.class);
+ Assert.assertFalse(actionSerializerKey.equals(experimenterActionSerializerKey));
+ Assert.assertFalse(experimenterActionSerializerKey.equals(actionSerializerKey));
+
+ InstructionSerializerKey instructionSerializerKey =
+ new InstructionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, org.opendaylight.yang.gen.v1.urn
+ .opendaylight.openflow.augments.rev150225.instruction.container.instruction.choice
+ .ExperimenterIdCase.class, 1L);
+ ExperimenterInstructionSerializerKey experimenterInstructionSerializerKey = new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 1L);
+ Assert.assertEquals(instructionSerializerKey, experimenterInstructionSerializerKey);
+ Assert.assertEquals(instructionSerializerKey.hashCode(), experimenterInstructionSerializerKey.hashCode());
+
+ MatchEntrySerializerKey matchKey = new MatchEntrySerializerKey<>(
+ EncodeConstants.OF10_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ MatchEntrySerializerKey matchKey2 = new MatchEntrySerializerKey<>(
+ EncodeConstants.OF10_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ Assert.assertEquals(matchKey, matchKey2);
+ Assert.assertEquals(matchKey.hashCode(), matchKey2.hashCode());
+ }
+
+ private static class ExpSubType extends ExperimenterActionSubType {
+ // empty class - only used in test for comparation
+ }
+
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java
new file mode 100644
index 00000000..ceefbc1b
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntryDeserializerKeyTest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class MatchEntryDeserializerKeyTest {
+
+ /**
+ * Test MatchEntryDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+ MatchEntryDeserializerKey key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0, 42);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 0);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0x8000, 42);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0x8000, 42);
+ key2.setExperimenterId(158L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+ key2.setExperimenterId(158L);
+ key1.setExperimenterId(158L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test MatchEntryDeserializerKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+ MatchEntryDeserializerKey key2 = new MatchEntryDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0x8000, 42);
+
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ Long expId1=123456L;
+ Long expId2=654321L;
+ key1.setExperimenterId(null);
+ key2.setExperimenterId(expId2);
+ Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2));
+
+ key1.setExperimenterId(expId1);
+ Assert.assertFalse("Wrong equal by experimeterId.", key1.equals(key2));
+ Assert.assertFalse("Wrong equals with different object class", key1.equals(key2));
+ }
+
+ /**
+ * Test MatchEntryDeserializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ MatchEntryDeserializerKey key1 = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID, 0x8000, 42);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 4 objectClass: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry"
+ + " msgType: 32768 oxm_field: 42 experimenterID: null", key1.toString());
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java
new file mode 100644
index 00000000..fbd5e26a
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/MatchEntrySerializerKeyTest.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPhyPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class MatchEntrySerializerKeyTest {
+
+ /**
+ * Test MatchEntrySerializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ MatchEntrySerializerKey, ?> key1 = new MatchEntrySerializerKey<>
+ (EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ MatchEntrySerializerKey, ?> key2 = new MatchEntrySerializerKey<>
+ (EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID,
+ OpenflowBasicClass.class, InPhyPort.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID,
+ Nxm0Class.class, InPort.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF10_VERSION_ID,
+ OpenflowBasicClass.class, InPhyPort.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID,
+ OpenflowBasicClass.class, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID,
+ null, InPhyPort.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ key2.setExperimenterId(42L);
+ Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test MatchEntrySerializerKey equals - additional test
+ */
+ @Test
+ public void testEquals(){
+ MatchEntrySerializerKey, ?> key1;
+ MatchEntrySerializerKey, ?> key2;
+ key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(new Object()));
+
+ Long expId1 = 987654331L;
+ Long expId2 = 123456789L;
+
+ key1.setExperimenterId(null);
+ key2.setExperimenterId(expId2);
+ Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+ key1.setExperimenterId(expId1);
+ Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
+ key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class);
+ key1.setExperimenterId(expId2);
+ Assert.assertFalse("Wrong equal by oxmClass", key1.equals(key2));
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, null, InPort.class);
+ key2.setExperimenterId(expId2);
+ Assert.assertTrue("Wrong equal by oxmClass", key1.equals(key2));
+ key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null);
+ key1.setExperimenterId(expId2);
+ Assert.assertFalse("Wrong equal by oxmField", key1.equals(key2));
+ key2 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, null);
+ key2.setExperimenterId(expId2);
+ Assert.assertTrue("Wrong equal by oxmField", key1.equals(key2));
+ }
+
+ /**
+ * Test MatchEntrySerializerKey toString()
+ */
+ @Test
+ public void testToString(){
+ MatchEntrySerializerKey, ?> key1;
+ key1 = new MatchEntrySerializerKey<>(EncodeConstants.OF13_VERSION_ID, OpenflowBasicClass.class, InPort.class);
+
+ Assert.assertEquals("Wrong toString()", "msgVersion: 4 objectType: org.opendaylight.yang.gen.v1.urn"
+ + ".opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry"
+ + " oxm_class: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225"
+ + ".OpenflowBasicClass oxm_field: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow"
+ + ".oxm.rev150225.InPort experimenterID: null", key1.toString());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKeyTest.java
new file mode 100644
index 00000000..8b6192d3
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/TypeToClassKeyTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+/**
+ *
+ * @author madamjak
+ *
+ */
+public class TypeToClassKeyTest {
+
+ /**
+ * Test equals
+ */
+ @Test
+ public void test(){
+ final short ver10 = EncodeConstants.OF10_VERSION_ID;
+ final short ver13 = EncodeConstants.OF13_VERSION_ID;
+ final int type1 = 1;
+ final int type2 = 2;
+ TypeToClassKey typeToClsKey10 = new TypeToClassKey(ver10,type1);
+ Assert.assertTrue("Wrong - equals to same object", typeToClsKey10.equals(typeToClsKey10));
+ Assert.assertFalse("Wrong - equals to null", typeToClsKey10.equals(null));
+ Assert.assertFalse("Wrong - equals to different class", typeToClsKey10.equals(new Object()));
+ TypeToClassKey typeToClsKey13 = new TypeToClassKey(ver13,type2);
+ Assert.assertFalse("Wrong - equals by different version", typeToClsKey13.equals(new Object()));
+ Assert.assertFalse("Wrong - equals by different type", typeToClsKey13.equals(typeToClsKey10));
+ }
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKeyTest.java
new file mode 100644
index 00000000..97543fea
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionDeserializerKeyTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterActionDeserializerKeyTest {
+
+ /**
+ * Test ExperimenterActionDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ExperimenterActionDeserializerKey key1 =
+ new ExperimenterActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ ExperimenterActionDeserializerKey key2 =
+ new ExperimenterActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java
new file mode 100644
index 00000000..e3e910ca
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterActionSerializerKeyTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterActionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterActionSerializerKeyTest {
+
+
+ /**
+ * Test ExperimenterActionSerializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ExperimenterActionSerializerKey key1 =
+ new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ ExperimenterActionSerializerKey key2 =
+ new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF13_VERSION_ID, 42L, TestSubType.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, null, TestSubType.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, TestSubType.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, TestSubType2.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ExperimenterActionSerializerKey equals
+ */
+ @Test
+ public void testEquals() {
+ ExperimenterActionSerializerKey key1;
+ ExperimenterActionSerializerKey key2;
+ key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, null);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType2.class);
+ Assert.assertFalse("Wrong equal by actionSubType.", key1.equals(key2));
+ key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ Assert.assertFalse("Wrong equal by actionSubType.", key1.equals(key2));
+ }
+
+
+ private static class TestSubType extends ExperimenterActionSubType {
+ // empty class - only used in test for comparation
+ }
+
+ private static class TestSubType2 extends ExperimenterActionSubType {
+ // empty class - only used in test for comparation
+ }
+
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKeyTest.java
new file mode 100644
index 00000000..d7f61084
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdDeserializerKeyTest.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterIdDeserializerKeyTest {
+
+ /**
+ * Test ExperimenterIdDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ExperimenterIdDeserializerKey key1 =
+ new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ ExperimenterIdDeserializerKey key2 =
+ new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, ErrorMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ExperimenterIdDeserializerKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ ExperimenterIdDeserializerKey key1 =
+ new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 0L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ MessageCodeKey mk = new MessageCodeKey(EncodeConstants.OF10_VERSION_ID,EncodeConstants.EXPERIMENTER_VALUE, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
+ ExperimenterIdDeserializerKey key2 =
+ new ExperimenterIdDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
+ }
+
+}
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java
new file mode 100644
index 00000000..a3bf7891
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdSerializerKeyTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterIdSerializerKeyTest {
+
+ /**
+ * Test ExperimenterIdSerializerKey equals and hashCode
+ */
+ @Test
+ public void testHashCodeAndEquals() {
+ ExperimenterIdSerializerKey> key1 =
+ new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ ExperimenterIdSerializerKey> key2 =
+ new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF13_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, ErrorMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ExperimenterIdSerializerKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ ExperimenterIdSerializerKey> key1 =
+ new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ MessageTypeKey>mk = new MessageTypeKey<>(EncodeConstants.OF10_VERSION_ID,ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
+ ExperimenterIdSerializerKey> key2 =
+ new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeDeserializerKeyTest.java
new file mode 100644
index 00000000..7405b773
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeDeserializerKeyTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
+
+/**
+ * @author michal.polkorab
+ */
+public class ExperimenterIdTypeDeserializerKeyTest {
+
+ /**
+ * Test ExperimenterIdTypeDeserializerKey equals and hashCode
+ */
+ @Test
+ public void testHashCodeAndEquals() {
+ ExperimenterIdTypeDeserializerKey key1 =
+ new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ ExperimenterIdTypeDeserializerKey key2 =
+ new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ErrorMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+
+ key2 = new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 2L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ExperimenterIdTypeDeserializerKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ ExperimenterIdTypeDeserializerKey key1 =
+ new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 41L, 1L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ ExperimenterIdSerializerKey> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
+ ExperimenterIdTypeDeserializerKey key2 =
+ new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
+
+ ExperimenterIdTypeDeserializerKey key3 =
+ new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF10_VERSION_ID, 41L, 2L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by type.", key1.equals(key3));
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeSerializerKeyTest.java
new file mode 100644
index 00000000..a613d0d8
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterIdTypeSerializerKeyTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterIdTypeSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
+
+/**
+ * @author michal.polkorab
+ */
+public class ExperimenterIdTypeSerializerKeyTest {
+
+ /**
+ * Test ExperimenterIdTypeSerializerKey equals and hashCode
+ */
+ @Test
+ public void testHashCodeAndEquals() {
+ ExperimenterIdTypeSerializerKey> key1 =
+ new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ ExperimenterIdTypeSerializerKey> key2 =
+ new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF13_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 55L, 1L, ErrorMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+
+ key2 = new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 2L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+
+ /**
+ * Test ExperimenterIdTypeSerializerKey equals - additional test
+ */
+ @Test
+ public void testEquals() {
+ ExperimenterIdTypeSerializerKey> key1 =
+ new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, 1L, ExperimenterMessage.class);
+ Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
+ ExperimenterIdSerializerKey> mk = new ExperimenterIdSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal to different class.", key1.equals(mk));
+ ExperimenterIdTypeSerializerKey> key2 =
+ new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 42L, 1L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by experimenterId.", key1.equals(key2));
+
+ ExperimenterIdTypeSerializerKey> key3 =
+ new ExperimenterIdTypeSerializerKey<>(EncodeConstants.OF10_VERSION_ID, 41L, 2L, ExperimenterMessage.class);
+ Assert.assertFalse("Wrong equal by type.", key1.equals(key3));
+ }
+
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKeyTest.java
new file mode 100644
index 00000000..74f1bf96
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionDeserializerKeyTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionDeserializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterInstructionDeserializerKeyTest {
+
+ /**
+ * Test ExperimenterInstructionDeserializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ExperimenterInstructionDeserializerKey key1 =
+ new ExperimenterInstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ ExperimenterInstructionDeserializerKey key2 =
+ new ExperimenterInstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF13_VERSION_ID, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionDeserializerKey(EncodeConstants.OF10_VERSION_ID, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionSerializerKeyTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionSerializerKeyTest.java
new file mode 100644
index 00000000..e7f8e35a
--- /dev/null
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/keys/experimenter/ExperimenterInstructionSerializerKeyTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionSerializerKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ExperimenterInstructionSerializerKeyTest {
+
+ /**
+ * Test ExperimenterInstructionSerializerKey equals and hashCode
+ */
+ @Test
+ public void test() {
+ ExperimenterInstructionSerializerKey key1 =
+ new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ ExperimenterInstructionSerializerKey key2 =
+ new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L);
+ Assert.assertTrue("Wrong equals", key1.equals(key2));
+ Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionSerializerKey(EncodeConstants.OF13_VERSION_ID, 42L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID, null);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+ key2 = new ExperimenterInstructionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L);
+ Assert.assertFalse("Wrong equals", key1.equals(key2));
+ Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
+
+ }
+}
\ No newline at end of file
diff --git a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java
index af09e0cb..3c2bc650 100644
--- a/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java
+++ b/openflow-protocol-api/src/test/java/org/opendaylight/openflowjava/protocol/api/util/BinContentTest.java
@@ -1,64 +1,63 @@
-/*
- * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.openflowjava.protocol.api.util;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-/**
- * @author michal.polkorab
- */
-public class BinContentTest {
-
- /**
- * Testing correct conversion from signed int value to unsigned long value
- */
- @Test
- public void testIntToUnsignedLong() {
- int a = 0;
- int b = 1;
- int c = -1;
- int d = Integer.MAX_VALUE;
- int e = Integer.MIN_VALUE;
- int f = 12345;
- Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(a));
- Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(b));
- Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(c));
- Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(d));
- Assert.assertEquals("Wrong conversion", ((long) Integer.MAX_VALUE) + 1, BinContent.intToUnsignedLong(e));
- Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(f));
- }
-
- /**
- * Testing correct conversion from unsigned long value to signed int value
- */
- @Test
- public void testLongToSignedInt() {
- long a = 0;
- long b = 1;
- long c = -1;
- long d = Integer.MAX_VALUE;
- long e = Integer.MIN_VALUE;
- long f = 12345;
- long g = Long.MAX_VALUE;
- long h = 1094624935644L;
- long i = ((long) Integer.MAX_VALUE) + 1;
- Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(a));
- Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(b));
- Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(c));
- Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(d));
- Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(e));
- Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(f));
- Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(g));
- Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(h));
- Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(i));
- }
-
-}
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowjava.protocol.api.util;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author michal.polkorab
+ */
+public class BinContentTest {
+
+ /**
+ * Testing correct conversion from signed int value to unsigned long value
+ */
+ @Test
+ public void testIntToUnsignedLong() {
+ int a = 0;
+ int b = 1;
+ int c = -1;
+ int d = Integer.MAX_VALUE;
+ int e = Integer.MIN_VALUE;
+ int f = 12345;
+ Assert.assertEquals("Wrong conversion", 0, BinContent.intToUnsignedLong(a));
+ Assert.assertEquals("Wrong conversion", 1, BinContent.intToUnsignedLong(b));
+ Assert.assertEquals("Wrong conversion", 4294967295L, BinContent.intToUnsignedLong(c));
+ Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.intToUnsignedLong(d));
+ Assert.assertEquals("Wrong conversion", ((long) Integer.MAX_VALUE) + 1, BinContent.intToUnsignedLong(e));
+ Assert.assertEquals("Wrong conversion", 12345, BinContent.intToUnsignedLong(f));
+ }
+
+ /**
+ * Testing correct conversion from unsigned long value to signed int value
+ */
+ @Test
+ public void testLongToSignedInt() {
+ long a = 0;
+ long b = 1;
+ long c = -1;
+ long d = Integer.MAX_VALUE;
+ long e = Integer.MIN_VALUE;
+ long f = 12345;
+ long g = Long.MAX_VALUE;
+ long h = 1094624935644L;
+ long i = ((long) Integer.MAX_VALUE) + 1;
+ Assert.assertEquals("Wrong conversion", 0, BinContent.longToSignedInt(a));
+ Assert.assertEquals("Wrong conversion", 1, BinContent.longToSignedInt(b));
+ Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(c));
+ Assert.assertEquals("Wrong conversion", Integer.MAX_VALUE, BinContent.longToSignedInt(d));
+ Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(e));
+ Assert.assertEquals("Wrong conversion", 12345, BinContent.longToSignedInt(f));
+ Assert.assertEquals("Wrong conversion", -1, BinContent.longToSignedInt(g));
+ Assert.assertEquals("Wrong conversion", -591724836, BinContent.longToSignedInt(h));
+ Assert.assertEquals("Wrong conversion", Integer.MIN_VALUE, BinContent.longToSignedInt(i));
+ }
+
+}
diff --git a/openflow-protocol-impl/pom.xml b/openflow-protocol-impl/pom.xml
index 27f66695..62c2ddd3 100644
--- a/openflow-protocol-impl/pom.xml
+++ b/openflow-protocol-impl/pom.xml
@@ -2,23 +2,20 @@
4.0.0
org.opendaylight.openflowjava
- openflow-protocol-parent
- 0.5-SNAPSHOT
+ openflowjava-parent
+ 0.10.0-SNAPSHOT
+ ../parent
openflow-protocol-impl
bundle
- Openflow Protocol Library - IMPL
+
+ ODL :: openflowjava :: ${project.artifactId}
https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main
HEAD
-
- 0.6.2-SNAPSHOT
- 0.6.2-SNAPSHOT
- 0.6.2-SNAPSHOT
-
-
@@ -29,7 +26,7 @@
org.opendaylight.openflowjava.protocol.impl.*,
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.*
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.*
@@ -48,7 +45,7 @@
org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
- ${project.build.directory}/generated-sources/config
+ ${jmxGeneratorPath}
urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang
@@ -57,12 +54,12 @@
- org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+ org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl
- ${project.build.directory}/generated-sources/sal
+ ${salGeneratorPath}
- org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl
+ org.opendaylight.mdsal.binding.yang.unified.doc.generator.maven.DocumentationGeneratorImpl
${project.build.directory}/site/models
@@ -77,31 +74,43 @@
${config.version}
- org.opendaylight.yangtools
+ org.opendaylight.mdsal
maven-sal-api-gen-plugin
- ${yangtools.generator.version}
+ ${mdsal.model.version}
jar
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ test-jar
+
+
+
+
-
+
${project.groupId}
openflow-protocol-api
- ${project.version}
${project.groupId}
openflow-protocol-spi
- ${project.version}
+
+
+ org.opendaylight.openflowjava
+ openflowjava-util
org.opendaylight.controller
sal-common-util
- ${yang.prototype.version}
org.opendaylight.controller
@@ -124,7 +133,6 @@
org.slf4j
slf4j-log4j12
- ${slf4j.version}
test
@@ -138,12 +146,17 @@
org.mockito
- mockito-all
+ mockito-core
org.opendaylight.controller
config-api
- 0.2.5-SNAPSHOT
+
+
+ io.netty
+ netty-transport-native-epoll
+
+ linux-x86_64