import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterInstructionSerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.ExperimenterSerializerKey;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+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.ExperimenterInput;
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.multipart.request.multipart.request.body.MultipartRequestExperimenterCase;
package org.opendaylight.openflowjava.protocol.api.keys;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
* @author michal.polkorab
*/
public MatchEntryDeserializerKey(short version,
int oxmClass, int oxmField) {
- super(version, oxmClass, MatchEntries.class);
+ super(version, oxmClass, MatchEntry.class);
this.oxmField = oxmField;
}
package org.opendaylight.openflowjava.protocol.api.keys;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+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 <F> oxm_field (see specification)
*/
public final class MatchEntrySerializerKey<C extends OxmClassBase, F extends MatchField>
- extends MessageTypeKey<MatchEntries> implements ExperimenterSerializerKey {
+ extends MessageTypeKey<MatchEntry> implements ExperimenterSerializerKey {
private Class<C> oxmClass;
private Class<F> oxmField;
*/
public MatchEntrySerializerKey(short msgVersion, Class<C> oxmClass,
Class<F> oxmField) {
- super(msgVersion, MatchEntries.class);
+ super(msgVersion, MatchEntry.class);
this.oxmClass = oxmClass;
this.oxmField = oxmField;
}
import openflow-instruction {prefix ofinstruction;}
import openflow-extensible-match {prefix oxm;}
- revision "2013-10-02" {
+ revision "2015-02-25" {
description "OpenFlow 1.3 - augments model.
Please visit
https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf
}
// 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;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
+ augment "/oxm:oxm-container/oxm:match-entry-value" {
ext:augment-identifier "experimenter-id-match-entry";
- leaf experimenter {
- type oft:experimenter-id;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "tcp-flag-match-entry";
- leaf tcp-flag {
- type uint16;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "tunnel-ipv4-dst-match-entry";
- leaf tunnel-ipv4-dst {
- type inet:ipv4-address;
- }
- }
- augment "/oxm:oxm-container/oxm:match-entries" {
- ext:augment-identifier "tunnel-ipv4-src-match-entry";
- leaf tunnel-ipv4-src {
- type inet:ipv4-address;
+ case experimenter-id-case {
+ container experimenter {
+ leaf experimenter {
+ type oft:experimenter-id;
+ }
+ }
}
}
}
augment "/ofaction:actions-container/ofaction:action" {
ext:augment-identifier "oxm-fields-action";
- uses oxm:oxm-fields-grouping;
+ uses oxm:match-entries-grouping;
}
augment "/ofaction:actions-container/ofaction:action" {
ext:augment-identifier "experimenter-id-action";
}
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
ext:augment-identifier "oxm-related-table-feature-property";
- uses oxm:oxm-fields-grouping;
+ uses oxm:match-entries-grouping;
}
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {
ext:augment-identifier "experimenter-id-table-feature-property";
import ietf-inet-types {prefix inet;}
import openflow-types {prefix oft;}
- revision "2013-07-31" {
+ revision "2015-02-25" {
description "OpenFlow 1.3 - match model";
}
}
// oxm classes
- identity oxm-class-base {
- 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 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;
- }
+ 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 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";
+ 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 tcp_flag {
- base match-field;
- description "NXM field for NXM_NX_TCP_FLAGS";
+ }
+
+ grouping match-entries-grouping {
+ list match-entry {
+ config false;
+ uses match-entry-fields-grouping;
+ uses match-entry-value-grouping;
}
- identity tunnel_ipv4_dst {
- base match-field;
- description "NXM field for NXM_NX_TUN_IPV4_DST";
+ }
+
+ grouping match-entry-fields-grouping {
+ leaf oxm-class {
+ type identityref {
+ base oxm-class-base;
+ }
}
- identity tunnel_ipv4_src {
- base match-field;
- description "NXM field for NXM_NX_TUN_IPV4_SRC";
+ leaf oxm-match-field {
+ type identityref {
+ base match-field;
+ }
}
- container oxm-container {
- uses oxm-fields-grouping;
+ leaf has-mask {
+ type boolean;
}
+ }
- grouping oxm-fields-grouping {
- list match-entries {
- description "OXM TLV-structures (Type Length Value)";
- config false;
- leaf oxm-class {
- type identityref {
- base oxm-class-base;
+ 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;
+ }
+ case metadata-case {
+ container metadata {
+ leaf metadata {
+ type binary;
+ }
+ leaf mask {
+ type binary;
+ }
}
}
- }
-
- grouping match-grouping {
- container match {
- description "Match structure (OF v1.3)";
- leaf type {
- type identityref {
- base oft:match-type-base;
+ case eth-src-case {
+ container eth-src {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ 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-dst-case {
+ container eth-dst {
+ 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-type-case {
+ container eth-type {
+ leaf eth-type {
+ type oft:ether-type;
+ }
}
- 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 vlan-vid-case {
+ container vlan-vid {
+ leaf vlan-vid {
+ type uint16;
+ }
+ leaf cfi-bit {
+ type boolean;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+ }
+ 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;
+ }
}
- leaf in-port {
- description "Input switch port.";
- type uint16;
+ }
+ case arp-tha-case {
+ container arp-tha {
+ leaf mac-address {
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-src {
- description "Ethernet source 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-dst {
- description "Ethernet destination address.";
- type yang:mac-address;
+ }
+ case ipv6-dst-case {
+ container ipv6-dst {
+ leaf ipv6-address {
+ type inet:ipv6-address;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-vlan {
- description "Input VLAN id.";
- type uint16;
+ }
+ case ipv6-flabel-case {
+ container ipv6-flabel {
+ leaf ipv6-flabel {
+ type inet:ipv6-flow-label;
+ }
+ leaf mask {
+ type binary;
+ }
}
- leaf dl-vlan-pcp {
- description "Input VLAN priority.";
- type uint8;
+ }
+ 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
import org.junit.Assert;
import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.keys.ActionDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.InstructionDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.InstructionSerializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
-import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
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.common.action.rev130731.Experimenter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
+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 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.rev130731.oxm.fields.grouping.MatchEntries msgType: 32768 oxm_field: 42"
- + " experimenterID: null", key1.toString());
+ 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());
}
}
\ No newline at end of file
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.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm0Class;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
+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
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.rev130731.oxm.fields.grouping.MatchEntries oxm_class: org.opendaylight.yang.gen.v1.urn"
- + ".opendaylight.openflow.oxm.rev130731.OpenflowBasicClass oxm_field: org.opendaylight.yang.gen.v1.urn"
- + ".opendaylight.openflow.oxm.rev130731.InPort experimenterID: null", key1.toString());
+ 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
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+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.ErrorMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;
import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import io.netty.buffer.ByteBuf;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTos;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
* @author michal.polkorab
+ 2 * EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
key.setExperimenterId(expId);
}
- OFDeserializer<MatchEntries> matchDeserializer = registry.getDeserializer(key);
- List<MatchEntries> entry = new ArrayList<>();
+ OFDeserializer<MatchEntry> matchDeserializer = registry.getDeserializer(key);
+ List<MatchEntry> entry = new ArrayList<>();
entry.add(matchDeserializer.deserialize(input));
- matchEntries.setMatchEntries(entry);
+ matchEntries.setMatchEntry(entry);
builder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
int paddingRemainder = (input.readerIndex() - startIndex) % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlActionBuilder;
+import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowRemovedReason;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.util.ExperimenterDeserializerKeyFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
CodeKeyMaker keyMaker = CodeKeyMakerFactory
.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
- List<MatchEntries> entries = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
+ List<MatchEntry> entries = ListDeserializer.deserializeHeaders(EncodeConstants.OF13_VERSION_ID,
propertyLength - COMMON_PROPERTY_LENGTH, input, keyMaker, registry);
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
builder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
} else if (type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTER)
|| type.equals(TableFeaturesPropType.OFPTFPTEXPERIMENTERMISS)) {
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.common.types.rev130731.FlowRemovedReason;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueuePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueueProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueuePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.util.ExperimenterDeserializerKeyFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueuePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueueProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueuePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistryInjector;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.CodeKeyMakerFactory;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmIpv4AddressDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(final ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpv4AddressAugmentation(builder, input);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_INT_IN_BYTES);
- }
- return builder.build();
- }
-
- private static void addIpv4AddressAugmentation(final MatchEntriesBuilder builder, final ByteBuf input) {
- Ipv4AddressMatchEntryBuilder ipv4AddressBuilder = new Ipv4AddressMatchEntryBuilder();
- ipv4AddressBuilder.setIpv4Address(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
- builder.addAugmentation(Ipv4AddressMatchEntry.class, ipv4AddressBuilder.build());
- }
-}
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmIpv6AddressDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(final ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpv6AddressAugmentation(builder, input);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input,
- EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES);
- }
- return builder.build();
- }
-
- private static void addIpv6AddressAugmentation(final MatchEntriesBuilder builder, final ByteBuf input) {
- Ipv6AddressMatchEntryBuilder ipv6AddressBuilder = new Ipv6AddressMatchEntryBuilder();
- ipv6AddressBuilder.setIpv6Address(new Ipv6Address(ByteBufUtils.readIpv6Address(input)));
- builder.addAugmentation(Ipv6AddressMatchEntry.class, ipv6AddressBuilder.build());
- }
-}
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmMacAddressDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addMacAddressAugmentation(builder, input);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.MAC_ADDRESS_LENGTH);
- }
- return builder.build();
- }
-
- private static void addMacAddressAugmentation(MatchEntriesBuilder builder, ByteBuf input) {
- MacAddressMatchEntryBuilder macAddress = new MacAddressMatchEntryBuilder();
- byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
- input.readBytes(address);
- macAddress.setMacAddress(new MacAddress(ByteBufUtils.macAddressToString(address)));
- builder.addAugmentation(MacAddressMatchEntry.class, macAddress.build());
- }
-}
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
/**
* @author michal.polkorab
*
*/
-public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeserializer<MatchEntries> {
+public abstract class AbstractOxmMatchEntryDeserializer implements HeaderDeserializer<MatchEntry> {
@Override
- public MatchEntries deserializeHeader(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ public MatchEntry deserializeHeader(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
return builder.build();
}
* @param input input bytebuf
* @return MatchEntriesBuilder which can be filled with MatchEntry augmentation
*/
- protected MatchEntriesBuilder processHeader(Class<? extends OxmClassBase> oxmClass,
+ protected MatchEntryBuilder processHeader(Class<? extends OxmClassBase> oxmClass,
Class<? extends MatchField> oxmField, ByteBuf input) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(oxmClass);
// skip oxm_class (provided)
input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmMetadataDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addMetadataAugmentation(builder, input);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_LONG_IN_BYTES);
- }
- return builder.build();
- }
-
- private static void addMetadataAugmentation(MatchEntriesBuilder builder, ByteBuf input) {
- MetadataMatchEntryBuilder metadata = new MetadataMatchEntryBuilder();
- byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
- input.readBytes(metadataBytes);
- metadata.setMetadata(metadataBytes);
- builder.addAugmentation(MetadataMatchEntry.class, metadata.build());
- }
-}
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmPortDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addPortAugmentation(builder, input);
- return builder.build();
- }
-
- private static void addPortAugmentation(MatchEntriesBuilder builder, ByteBuf input) {
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(input.readUnsignedShort()));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
- }
-}
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public abstract class AbstractOxmPortNumberDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
-
- @Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- PortNumberMatchEntryBuilder port = new PortNumberMatchEntryBuilder();
- port.setPortNumber(new PortNumber(input.readUnsignedInt()));
- builder.addAugmentation(PortNumberMatchEntry.class, port.build());
- return builder.build();
- }
-}
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.op._case.ArpOpBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmArpOpDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addArpOpAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addArpOpValue(input, builder);
return builder.build();
}
- private static void addArpOpAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- OpCodeMatchEntryBuilder opcodeBuilder = new OpCodeMatchEntryBuilder();
- opcodeBuilder.setOpCode(input.readUnsignedShort());
- builder.addAugmentation(OpCodeMatchEntry.class, opcodeBuilder.build());
+ private static void addArpOpValue(ByteBuf input, MatchEntryBuilder builder) {
+ ArpOpCaseBuilder caseBuilder = new ArpOpCaseBuilder();
+ ArpOpBuilder opBuilder = new ArpOpBuilder();
+ opBuilder.setOpCode(input.readUnsignedShort());
+ caseBuilder.setArpOp(opBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpShaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.sha._case.ArpShaBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmArpShaDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmArpShaDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addArpShaValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addArpShaValue(ByteBuf input, MatchEntryBuilder builder) {
+ ArpShaCaseBuilder caseBuilder = new ArpShaCaseBuilder();
+ ArpShaBuilder shaBuilder = new ArpShaBuilder();
+ shaBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ if (builder.isHasMask()) {
+ shaBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.MAC_ADDRESS_LENGTH));
+ }
+ caseBuilder.setArpSha(shaBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpSpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.spa._case.ArpSpaBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmArpSpaDeserializer extends AbstractOxmIpv4AddressDeserializer {
+public class OxmArpSpaDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addArpSpaValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addArpSpaValue(ByteBuf input, MatchEntryBuilder builder) {
+ ArpSpaCaseBuilder caseBuilder = new ArpSpaCaseBuilder();
+ ArpSpaBuilder arpBuilder = new ArpSpaBuilder();
+ arpBuilder.setIpv4Address(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ if (builder.isHasMask()) {
+ arpBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.GROUPS_IN_IPV4_ADDRESS));
+ }
+ caseBuilder.setArpSpa(arpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpThaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tha._case.ArpThaBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmArpThaDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmArpThaDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addArpThaValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addArpThaValue(ByteBuf input, MatchEntryBuilder builder) {
+ ArpThaCaseBuilder caseBuilder = new ArpThaCaseBuilder();
+ ArpThaBuilder thaBuilder = new ArpThaBuilder();
+ thaBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ if (builder.isHasMask()) {
+ thaBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.MAC_ADDRESS_LENGTH));
+ }
+ caseBuilder.setArpTha(thaBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpTpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tpa._case.ArpTpaBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmArpTpaDeserializer extends AbstractOxmIpv4AddressDeserializer {
+public class OxmArpTpaDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addArpTpaValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addArpTpaValue(ByteBuf input, MatchEntryBuilder builder) {
+ ArpTpaCaseBuilder caseBuilder = new ArpTpaCaseBuilder();
+ ArpTpaBuilder arpBuilder = new ArpTpaBuilder();
+ arpBuilder.setIpv4Address(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ if (builder.isHasMask()) {
+ arpBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.GROUPS_IN_IPV4_ADDRESS));
+ }
+ caseBuilder.setArpTpa(arpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
--- /dev/null
+/*
+ * 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.match;
+
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public final class OxmDeserializerHelper {
+
+ private OxmDeserializerHelper() {
+ throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
+ }
+
+ /**
+ * Converts binary data into binary mask (for match entries)
+ * @param input input ByteBuf
+ * @param matchEntryLength mask length
+ * @return binary mask
+ */
+ public static byte[] convertMask(ByteBuf input, int matchEntryLength) {
+ byte[] mask = new byte[matchEntryLength];
+ input.readBytes(mask);
+ return mask;
+ }
+
+ /**
+ * Converts binary data into mac address
+ * @param input input ByteBuf
+ * @return mac address
+ */
+ public static MacAddress convertMacAddress(ByteBuf input) {
+ byte[] address = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
+ input.readBytes(address);
+ return new MacAddress(ByteBufUtils.macAddressToString(address));
+ }
+}
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.dst._case.EthDstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmEthDstDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmEthDstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addEthDstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addEthDstValue(ByteBuf input, MatchEntryBuilder builder) {
+ EthDstCaseBuilder caseBuilder = new EthDstCaseBuilder();
+ EthDstBuilder ethBuilder = new EthDstBuilder();
+ ethBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ if (builder.isHasMask()) {
+ ethBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.MAC_ADDRESS_LENGTH));
+ }
+ caseBuilder.setEthDst(ethBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmEthSrcDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmEthSrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addEthSrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addEthSrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ EthSrcCaseBuilder caseBuilder = new EthSrcCaseBuilder();
+ EthSrcBuilder ethBuilder = new EthSrcBuilder();
+ ethBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ if (builder.isHasMask()) {
+ ethBuilder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.MAC_ADDRESS_LENGTH));
+ }
+ caseBuilder.setEthSrc(ethBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.type._case.EthTypeBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmEthTypeDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addEthTypeAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addEthTypeValue(input, builder);
return builder.build();
}
- private static void addEthTypeAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- EthTypeMatchEntryBuilder ethertypeBuilder = new EthTypeMatchEntryBuilder();
- ethertypeBuilder.setEthType(new EtherType(input.readUnsignedShort()));
- builder.addAugmentation(EthTypeMatchEntry.class, ethertypeBuilder.build());
+ private static void addEthTypeValue(ByteBuf input, MatchEntryBuilder builder) {
+ EthTypeCaseBuilder caseBuilder = new EthTypeCaseBuilder();
+ EthTypeBuilder ethBuilder = new EthTypeBuilder();
+ ethBuilder.setEthType(new EtherType(input.readUnsignedShort()));
+ caseBuilder.setEthType(ethBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIcmpv4CodeDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIcmpv4CodeAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIcmpv4CodeValue(input, builder);
return builder.build();
}
- private static void addIcmpv4CodeAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- Icmpv4CodeMatchEntryBuilder icmpv4CodeBuilder = new Icmpv4CodeMatchEntryBuilder();
- icmpv4CodeBuilder.setIcmpv4Code(input.readUnsignedByte());
- builder.addAugmentation(Icmpv4CodeMatchEntry.class, icmpv4CodeBuilder.build());
+ private static void addIcmpv4CodeValue(ByteBuf input, MatchEntryBuilder builder) {
+ Icmpv4CodeCaseBuilder caseBuilder = new Icmpv4CodeCaseBuilder();
+ Icmpv4CodeBuilder icmpBuilder = new Icmpv4CodeBuilder();
+ icmpBuilder.setIcmpv4Code(input.readUnsignedByte());
+ caseBuilder.setIcmpv4Code(icmpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIcmpv4TypeDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIcmpv4TypeAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIcmpv4TypeValue(input, builder);
return builder.build();
}
- private static void addIcmpv4TypeAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- Icmpv4TypeMatchEntryBuilder icmpv4TypeBuilder = new Icmpv4TypeMatchEntryBuilder();
- icmpv4TypeBuilder.setIcmpv4Type(input.readUnsignedByte());
- builder.addAugmentation(Icmpv4TypeMatchEntry.class, icmpv4TypeBuilder.build());
+ private static void addIcmpv4TypeValue(ByteBuf input, MatchEntryBuilder builder) {
+ Icmpv4TypeCaseBuilder caseBuilder = new Icmpv4TypeCaseBuilder();
+ Icmpv4TypeBuilder icmpBuilder = new Icmpv4TypeBuilder();
+ icmpBuilder.setIcmpv4Type(input.readUnsignedByte());
+ caseBuilder.setIcmpv4Type(icmpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIcmpv6CodeDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIcmpv6CodeAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIcmpv6CodeValue(input, builder);
return builder.build();
}
- private static void addIcmpv6CodeAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- Icmpv6CodeMatchEntryBuilder icmpv6CodeBuilder = new Icmpv6CodeMatchEntryBuilder();
- icmpv6CodeBuilder.setIcmpv6Code(input.readUnsignedByte());
- builder.addAugmentation(Icmpv6CodeMatchEntry.class, icmpv6CodeBuilder.build());
+ private static void addIcmpv6CodeValue(ByteBuf input, MatchEntryBuilder builder) {
+ Icmpv6CodeCaseBuilder caseBuilder = new Icmpv6CodeCaseBuilder();
+ Icmpv6CodeBuilder icmpBuilder = new Icmpv6CodeBuilder();
+ icmpBuilder.setIcmpv6Code(input.readUnsignedByte());
+ caseBuilder.setIcmpv6Code(icmpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.type._case.Icmpv6TypeBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIcmpv6TypeDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- Icmpv6TypeMatchEntryBuilder icmpv6TypeBuilder = new Icmpv6TypeMatchEntryBuilder();
- icmpv6TypeBuilder.setIcmpv6Type(input.readUnsignedByte());
- builder.addAugmentation(Icmpv6TypeMatchEntry.class, icmpv6TypeBuilder.build());
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIcmpv6TypeValue(input, builder);
return builder.build();
}
+ private static void addIcmpv6TypeValue(ByteBuf input, MatchEntryBuilder builder) {
+ Icmpv6TypeCaseBuilder caseBuilder = new Icmpv6TypeCaseBuilder();
+ Icmpv6TypeBuilder icmpBuilder = new Icmpv6TypeBuilder();
+ icmpBuilder.setIcmpv6Type(input.readUnsignedByte());
+ caseBuilder.setIcmpv6Type(icmpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
+
@Override
protected Class<? extends MatchField> getOxmField() {
return Icmpv6Type.class;
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPhyPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.phy.port._case.InPhyPortBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmInPhyPortDeserializer extends AbstractOxmPortNumberDeserializer {
+public class OxmInPhyPortDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addInPhyPortValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addInPhyPortValue(ByteBuf input, MatchEntryBuilder builder) {
+ InPhyPortCaseBuilder caseBuilder = new InPhyPortCaseBuilder();
+ InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
+ inPhyPortBuilder.setPortNumber(new PortNumber(input.readUnsignedInt()));
+ caseBuilder.setInPhyPort(inPhyPortBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmInPortDeserializer extends AbstractOxmPortNumberDeserializer {
+public class OxmInPortDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addInPortValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addInPortValue(ByteBuf input, MatchEntryBuilder builder) {
+ InPortCaseBuilder caseBuilder = new InPortCaseBuilder();
+ InPortBuilder inPortBuilder = new InPortBuilder();
+ inPortBuilder.setPortNumber(new PortNumber(input.readUnsignedInt()));
+ caseBuilder.setInPort(inPortBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpDscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIpDscpDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpDscpAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpDscpValue(input, builder);
return builder.build();
}
- private static void addIpDscpAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- DscpMatchEntryBuilder dscpBuilder = new DscpMatchEntryBuilder();
+ private static void addIpDscpValue(ByteBuf input, MatchEntryBuilder builder) {
+ IpDscpCaseBuilder caseBuilder = new IpDscpCaseBuilder();
+ IpDscpBuilder dscpBuilder = new IpDscpBuilder();
dscpBuilder.setDscp(new Dscp(input.readUnsignedByte()));
- builder.addAugmentation(DscpMatchEntry.class, dscpBuilder.build());
+ caseBuilder.setIpDscp(dscpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.ecn._case.IpEcnBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIpEcnDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpEcnAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpEcnValue(input, builder);
return builder.build();
}
- private static void addIpEcnAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- EcnMatchEntryBuilder ecnBuilder = new EcnMatchEntryBuilder();
+ private static void addIpEcnValue(ByteBuf input, MatchEntryBuilder builder) {
+ IpEcnCaseBuilder caseBuilder = new IpEcnCaseBuilder();
+ IpEcnBuilder ecnBuilder = new IpEcnBuilder();
ecnBuilder.setEcn(input.readUnsignedByte());
- builder.addAugmentation(EcnMatchEntry.class, ecnBuilder.build());
+ caseBuilder.setIpEcn(ecnBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.proto._case.IpProtoBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIpProtoDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpProtoAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpProtoValue(input, builder);
return builder.build();
}
- private static void addIpProtoAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- ProtocolNumberMatchEntryBuilder protoNumberBuilder = new ProtocolNumberMatchEntryBuilder();
- protoNumberBuilder.setProtocolNumber(input.readUnsignedByte());
- builder.addAugmentation(ProtocolNumberMatchEntry.class, protoNumberBuilder.build());
+ private static void addIpProtoValue(ByteBuf input, MatchEntryBuilder builder) {
+ IpProtoCaseBuilder caseBuilder = new IpProtoCaseBuilder();
+ IpProtoBuilder protoBuilder = new IpProtoBuilder();
+ protoBuilder.setProtocolNumber(input.readUnsignedByte());
+ caseBuilder.setIpProto(protoBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.dst._case.Ipv4DstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv4DstDeserializer extends AbstractOxmIpv4AddressDeserializer {
+public class OxmIpv4DstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv4DstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv4DstValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv4DstCaseBuilder caseBuilder = new Ipv4DstCaseBuilder();
+ Ipv4DstBuilder ipv4Builder = new Ipv4DstBuilder();
+ ipv4Builder.setIpv4Address(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ if (builder.isHasMask()) {
+ ipv4Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.GROUPS_IN_IPV4_ADDRESS));
+ }
+ caseBuilder.setIpv4Dst(ipv4Builder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.src._case.Ipv4SrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv4SrcDeserializer extends AbstractOxmIpv4AddressDeserializer {
+public class OxmIpv4SrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv4SrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv4SrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv4SrcCaseBuilder caseBuilder = new Ipv4SrcCaseBuilder();
+ Ipv4SrcBuilder ipv4Builder = new Ipv4SrcBuilder();
+ ipv4Builder.setIpv4Address(new Ipv4Address(ByteBufUtils.readIpv4Address(input)));
+ if (builder.isHasMask()) {
+ ipv4Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.GROUPS_IN_IPV4_ADDRESS));
+ }
+ caseBuilder.setIpv4Src(ipv4Builder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.dst._case.Ipv6DstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv6DstDeserializer extends AbstractOxmIpv6AddressDeserializer {
+public class OxmIpv6DstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6DstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6DstValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6DstCaseBuilder caseBuilder = new Ipv6DstCaseBuilder();
+ Ipv6DstBuilder ipv6Builder = new Ipv6DstBuilder();
+ ipv6Builder.setIpv6Address(new Ipv6Address(ByteBufUtils.readIpv6Address(input)));
+ if (builder.isHasMask()) {
+ ipv6Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES));
+ }
+ caseBuilder.setIpv6Dst(ipv6Builder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.exthdr._case.Ipv6ExthdrBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIpv6ExtHdrDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpv6ExtHdrAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6ExtHdrValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6ExtHdrValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6ExthdrCaseBuilder caseBuilder = new Ipv6ExthdrCaseBuilder();
+ Ipv6ExthdrBuilder extHdrBuilder = new Ipv6ExthdrBuilder();
+ extHdrBuilder.setPseudoField(convertPseudofields(input));
if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
+ extHdrBuilder.setMask(OxmDeserializerHelper
+ .convertMask(input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES));
}
- return builder.build();
+ caseBuilder.setIpv6Exthdr(extHdrBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
- private static void addIpv6ExtHdrAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- PseudoFieldMatchEntryBuilder pseudoBuilder = new PseudoFieldMatchEntryBuilder();
+ private static Ipv6ExthdrFlags convertPseudofields(ByteBuf input) {
int bitmap = input.readUnsignedShort();
final Boolean nonext = ((bitmap) & (1<<0)) != 0;
final Boolean esp = ((bitmap) & (1<<1)) != 0;
final Boolean hop = ((bitmap) & (1<<6)) != 0;
final Boolean unrep = ((bitmap) & (1<<7)) != 0;
final Boolean unseq = ((bitmap) & (1<<8)) != 0;
- pseudoBuilder.setPseudoField(new Ipv6ExthdrFlags(auth, dest, esp, frag, hop, nonext, router, unrep, unseq));
- builder.addAugmentation(PseudoFieldMatchEntry.class, pseudoBuilder.build());
+ return new Ipv6ExthdrFlags(auth, dest, esp, frag, hop, nonext, router, unrep, unseq);
}
@Override
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6FlowLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.flabel._case.Ipv6FlabelBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmIpv6FlabelDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addIpv6FlabelAugmentation(input, builder);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_INT_IN_BYTES);
- }
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6FlabelValue(input, builder);
return builder.build();
}
- private static void addIpv6FlabelAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- Ipv6FlabelMatchEntryBuilder ipv6FlabelBuilder = new Ipv6FlabelMatchEntryBuilder();
- ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(input.readUnsignedInt()));
- builder.addAugmentation(Ipv6FlabelMatchEntry.class, ipv6FlabelBuilder.build());
+ private static void addIpv6FlabelValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6FlabelCaseBuilder caseBuilder = new Ipv6FlabelCaseBuilder();
+ Ipv6FlabelBuilder labelBuilder = new Ipv6FlabelBuilder();
+ labelBuilder.setIpv6Flabel(new Ipv6FlowLabel(input.readUnsignedInt()));
+ if (builder.isHasMask()) {
+ labelBuilder.setMask(OxmDeserializerHelper.convertMask(input,
+ EncodeConstants.SIZE_OF_INT_IN_BYTES));
+ }
+ caseBuilder.setIpv6Flabel(labelBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdSll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdSllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.sll._case.Ipv6NdSllBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv6NdSllDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmIpv6NdSllDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6NdSllValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6NdSllValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6NdSllCaseBuilder caseBuilder = new Ipv6NdSllCaseBuilder();
+ Ipv6NdSllBuilder ndBuilder = new Ipv6NdSllBuilder();
+ ndBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ caseBuilder.setIpv6NdSll(ndBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTarget;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTargetCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.target._case.Ipv6NdTargetBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv6NdTargetDeserializer extends AbstractOxmIpv6AddressDeserializer {
+public class OxmIpv6NdTargetDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6NdTargetValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6NdTargetValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6NdTargetCaseBuilder caseBuilder = new Ipv6NdTargetCaseBuilder();
+ Ipv6NdTargetBuilder ipv6Builder = new Ipv6NdTargetBuilder();
+ ipv6Builder.setIpv6Address(new Ipv6Address(ByteBufUtils.readIpv6Address(input)));
+ caseBuilder.setIpv6NdTarget(ipv6Builder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTllBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv6NdTllDeserializer extends AbstractOxmMacAddressDeserializer {
+public class OxmIpv6NdTllDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6NdTllValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6NdTllValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6NdTllCaseBuilder caseBuilder = new Ipv6NdTllCaseBuilder();
+ Ipv6NdTllBuilder ndBuilder = new Ipv6NdTllBuilder();
+ ndBuilder.setMacAddress(OxmDeserializerHelper.convertMacAddress(input));
+ caseBuilder.setIpv6NdTll(ndBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.src._case.Ipv6SrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmIpv6SrcDeserializer extends AbstractOxmIpv6AddressDeserializer {
+public class OxmIpv6SrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addIpv6SrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addIpv6SrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ Ipv6SrcCaseBuilder caseBuilder = new Ipv6SrcCaseBuilder();
+ Ipv6SrcBuilder ipv6Builder = new Ipv6SrcBuilder();
+ ipv6Builder.setIpv6Address(new Ipv6Address(ByteBufUtils.readIpv6Address(input)));
+ if (builder.isHasMask()) {
+ ipv6Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES));
+ }
+ caseBuilder.setIpv6Src(ipv6Builder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
+++ /dev/null
-/*
- * 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.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
-
-/**
- * @author michal.polkorab
- *
- */
-public final class OxmMaskDeserializer {
-
- private OxmMaskDeserializer() {
- throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
- }
-
- /**
- * Appends mask to match entry (match entry builder)
- * @param builder builder which the mask will append to
- * @param input input ByteBuf
- * @param matchEntryLength mask length
- */
- public static void addMaskAugmentation(MatchEntriesBuilder builder, ByteBuf input,
- int matchEntryLength) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- byte[] mask = new byte[matchEntryLength];
- input.readBytes(mask);
- maskBuilder.setMask(mask);
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
- }
-}
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.metadata._case.MetadataBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmMetadataDeserializer extends AbstractOxmMetadataDeserializer {
+public class OxmMetadataDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addMetadataValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addMetadataValue(ByteBuf input, MatchEntryBuilder builder) {
+ MetadataCaseBuilder caseBuilder = new MetadataCaseBuilder();
+ MetadataBuilder metadataBuilder = new MetadataBuilder();
+ byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+ input.readBytes(metadataBytes);
+ metadataBuilder.setMetadata(metadataBytes);
+ if (builder.isHasMask()) {
+ metadataBuilder.setMask(OxmDeserializerHelper
+ .convertMask(input, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+ }
+ caseBuilder.setMetadata(metadataBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.bos._case.MplsBosBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmMplsBosDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addMplsBosDeserializer(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addMplsBosValue(input, builder);
return builder.build();
}
-
- private static void addMplsBosDeserializer(ByteBuf input,
- MatchEntriesBuilder builder) {
- BosMatchEntryBuilder bosBuilder = new BosMatchEntryBuilder();
+ private static void addMplsBosValue(ByteBuf input, MatchEntryBuilder builder) {
+ MplsBosCaseBuilder caseBuilder = new MplsBosCaseBuilder();
+ MplsBosBuilder bosBuilder = new MplsBosBuilder();
if (input.readUnsignedByte() != 0) {
bosBuilder.setBos(true);
} else {
bosBuilder.setBos(false);
}
- builder.addAugmentation(BosMatchEntry.class, bosBuilder.build());
+ caseBuilder.setMplsBos(bosBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.label._case.MplsLabelBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmMplsLabelDeserializer extends AbstractOxmMatchEntryDeserializer
-implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addMplsLabelAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addMplsLabelValue(input, builder);
return builder.build();
}
- private static void addMplsLabelAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- MplsLabelMatchEntryBuilder mplsLabelBuilder = new MplsLabelMatchEntryBuilder();
- mplsLabelBuilder.setMplsLabel(input.readUnsignedInt());
- builder.addAugmentation(MplsLabelMatchEntry.class, mplsLabelBuilder.build());
+ private static void addMplsLabelValue(ByteBuf input, MatchEntryBuilder builder) {
+ MplsLabelCaseBuilder caseBuilder = new MplsLabelCaseBuilder();
+ MplsLabelBuilder labelBuilder = new MplsLabelBuilder();
+ labelBuilder.setMplsLabel(input.readUnsignedInt());
+ caseBuilder.setMplsLabel(labelBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsTc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+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;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.tc._case.MplsTcBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmMplsTcDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addMplsTcAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addMplsTcValue(input, builder);
return builder.build();
}
- private static void addMplsTcAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- TcMatchEntryBuilder tcBuilder = new TcMatchEntryBuilder();
+ private static void addMplsTcValue(ByteBuf input, MatchEntryBuilder builder) {
+ MplsTcCaseBuilder caseBuilder = new MplsTcCaseBuilder();
+ MplsTcBuilder tcBuilder = new MplsTcBuilder();
tcBuilder.setTc(input.readUnsignedByte());
- builder.addAugmentation(TcMatchEntry.class, tcBuilder.build());
+ caseBuilder.setMplsTc(tcBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsidBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmPbbIsidDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addPbbIsidAugmentation(input, builder);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_3_BYTES);
- }
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addPbbIsidValue(input, builder);
return builder.build();
}
- private static void addPbbIsidAugmentation(ByteBuf input,
- MatchEntriesBuilder builder) {
- IsidMatchEntryBuilder isidBuilder = new IsidMatchEntryBuilder();
+ private static void addPbbIsidValue(ByteBuf input, MatchEntryBuilder builder) {
+ PbbIsidCaseBuilder caseBuilder = new PbbIsidCaseBuilder();
+ PbbIsidBuilder isidBuilder = new PbbIsidBuilder();
Integer isid = input.readUnsignedMedium();
isidBuilder.setIsid(isid.longValue());
- builder.addAugmentation(IsidMatchEntry.class, isidBuilder.build());
+ if (builder.isHasMask()) {
+ isidBuilder.setMask(OxmDeserializerHelper
+ .convertMask(input, EncodeConstants.SIZE_OF_3_BYTES));
+ }
+ caseBuilder.setPbbIsid(isidBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.dst._case.SctpDstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmSctpDstDeserializer extends AbstractOxmPortDeserializer {
+public class OxmSctpDstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addSctpDstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addSctpDstValue(ByteBuf input, MatchEntryBuilder builder) {
+ SctpDstCaseBuilder caseBuilder = new SctpDstCaseBuilder();
+ SctpDstBuilder sctpBuilder = new SctpDstBuilder();
+ sctpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setSctpDst(sctpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.src._case.SctpSrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmSctpSrcDeserializer extends AbstractOxmPortDeserializer {
+public class OxmSctpSrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addSctpSrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addSctpSrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ SctpSrcCaseBuilder caseBuilder = new SctpSrcCaseBuilder();
+ SctpSrcBuilder sctpBuilder = new SctpSrcBuilder();
+ sctpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setSctpSrc(sctpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpDst;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.dst._case.TcpDstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmTcpDstDeserializer extends AbstractOxmPortDeserializer {
+public class OxmTcpDstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addTcpDstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addTcpDstValue(ByteBuf input, MatchEntryBuilder builder) {
+ TcpDstCaseBuilder caseBuilder = new TcpDstCaseBuilder();
+ TcpDstBuilder tcpBuilder = new TcpDstBuilder();
+ tcpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setTcpDst(tcpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
protected Class<? extends OxmClassBase> getOxmClass() {
return OpenflowBasicClass.class;
}
+
}
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpSrc;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.src._case.TcpSrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmTcpSrcDeserializer extends AbstractOxmPortDeserializer {
+public class OxmTcpSrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addTcpSrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addTcpSrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ TcpSrcCaseBuilder caseBuilder = new TcpSrcCaseBuilder();
+ TcpSrcBuilder tcpBuilder = new TcpSrcBuilder();
+ tcpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setTcpSrc(tcpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelId;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tunnel.id._case.TunnelIdBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmTunnelIdDeserializer extends AbstractOxmMetadataDeserializer {
+public class OxmTunnelIdDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addTunnelIdValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addTunnelIdValue(ByteBuf input, MatchEntryBuilder builder) {
+ TunnelIdCaseBuilder caseBuilder = new TunnelIdCaseBuilder();
+ TunnelIdBuilder tunnelIdBuilder = new TunnelIdBuilder();
+ byte[] metadataBytes = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+ input.readBytes(metadataBytes);
+ tunnelIdBuilder.setTunnelId(metadataBytes);
+ if (builder.isHasMask()) {
+ tunnelIdBuilder.setMask(OxmDeserializerHelper
+ .convertMask(input, EncodeConstants.SIZE_OF_LONG_IN_BYTES));
+ }
+ caseBuilder.setTunnelId(tunnelIdBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpDst;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.dst._case.UdpDstBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmUdpDstDeserializer extends AbstractOxmPortDeserializer {
+public class OxmUdpDstDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addUdpDstValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addUdpDstValue(ByteBuf input, MatchEntryBuilder builder) {
+ UdpDstCaseBuilder caseBuilder = new UdpDstCaseBuilder();
+ UdpDstBuilder udpBuilder = new UdpDstBuilder();
+ udpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setUdpDst(udpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
*/
package org.opendaylight.openflowjava.protocol.impl.deserialization.match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;
+import io.netty.buffer.ByteBuf;
+
+import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.src._case.UdpSrcBuilder;
/**
* @author michal.polkorab
*
*/
-public class OxmUdpSrcDeserializer extends AbstractOxmPortDeserializer {
+public class OxmUdpSrcDeserializer extends AbstractOxmMatchEntryDeserializer
+ implements OFDeserializer<MatchEntry> {
+
+ @Override
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addUdpSrcValue(input, builder);
+ return builder.build();
+ }
+
+ private static void addUdpSrcValue(ByteBuf input, MatchEntryBuilder builder) {
+ UdpSrcCaseBuilder caseBuilder = new UdpSrcCaseBuilder();
+ UdpSrcBuilder udpBuilder = new UdpSrcBuilder();
+ udpBuilder.setPort(new PortNumber(input.readUnsignedShort()));
+ caseBuilder.setUdpSrc(udpBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ }
@Override
protected Class<? extends MatchField> getOxmField() {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.pcp._case.VlanPcpBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmVlanPcpDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addVlanPcpAugmentation(input, builder);
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addVlanPcpValue(input, builder);
return builder.build();
}
- private static void addVlanPcpAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- VlanPcpMatchEntryBuilder vlanPcpBuilder = new VlanPcpMatchEntryBuilder();
- vlanPcpBuilder.setVlanPcp(input.readUnsignedByte());
- builder.addAugmentation(VlanPcpMatchEntry.class, vlanPcpBuilder.build());
+ private static void addVlanPcpValue(ByteBuf input, MatchEntryBuilder builder) {
+ VlanPcpCaseBuilder caseBuilder = new VlanPcpCaseBuilder();
+ VlanPcpBuilder vlanBuilder = new VlanPcpBuilder();
+ vlanBuilder.setVlanPcp(input.readUnsignedByte());
+ caseBuilder.setVlanPcp(vlanBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVidBuilder;
/**
* @author michal.polkorab
*
*/
public class OxmVlanVidDeserializer extends AbstractOxmMatchEntryDeserializer
- implements OFDeserializer<MatchEntries> {
+ implements OFDeserializer<MatchEntry> {
@Override
- public MatchEntries deserialize(ByteBuf input) {
- MatchEntriesBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
- addVlanVidAugmentation(input, builder);
- if (builder.isHasMask()) {
- OxmMaskDeserializer.addMaskAugmentation(builder, input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
- }
+ public MatchEntry deserialize(ByteBuf input) {
+ MatchEntryBuilder builder = processHeader(getOxmClass(), getOxmField(), input);
+ addVlanVidValue(input, builder);
return builder.build();
}
- private static void addVlanVidAugmentation(ByteBuf input, MatchEntriesBuilder builder) {
- VlanVidMatchEntryBuilder vlanVidBuilder = new VlanVidMatchEntryBuilder();
+ private static void addVlanVidValue(ByteBuf input, MatchEntryBuilder builder) {
+ VlanVidCaseBuilder caseBuilder = new VlanVidCaseBuilder();
+ VlanVidBuilder vlanBuilder = new VlanVidBuilder();
int vidEntryValue = input.readUnsignedShort();
- vlanVidBuilder.setCfiBit((vidEntryValue & (1 << 12)) != 0); // cfi is 13-th bit
- vlanVidBuilder.setVlanVid(vidEntryValue & ((1 << 12) - 1)); // value without 13-th bit
- builder.addAugmentation(VlanVidMatchEntry.class, vlanVidBuilder.build());
+ vlanBuilder.setCfiBit((vidEntryValue & (1 << 12)) != 0); // cfi is 13-th bit
+ vlanBuilder.setVlanVid(vidEntryValue & ((1 << 12) - 1)); // value without 13-th bit
+ if (builder.isHasMask()) {
+ vlanBuilder.setMask(OxmDeserializerHelper
+ .convertMask(input, EncodeConstants.SIZE_OF_SHORT_IN_BYTES));
+ }
+ caseBuilder.setVlanVid(vlanBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
}
@Override
import org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmVlanPcpSerializer;
import org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmVlanVidSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.MatchEntrySerializerRegistryHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpDscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdSll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTarget;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsTc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpFlag;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelIpv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelIpv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
+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.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
/**
* Initializes serializer registry with match entry serializers
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.OF10MatchSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
* @author michal.polkorab
int lengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
OxmFieldsAction oxmField = action.getAugmentation(OxmFieldsAction.class);
- MatchEntries entry = oxmField.getMatchEntries().get(0);
+ MatchEntry entry = oxmField.getMatchEntry().get(0);
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID, entry.getOxmClass(), entry.getOxmMatchField());
if (entry.getOxmClass().equals(ExperimenterClass.class)) {
- key.setExperimenterId(entry.getAugmentation(ExperimenterIdMatchEntry.class)
- .getExperimenter().getValue());
+ ExperimenterIdCase experimenterIdCase = (ExperimenterIdCase) entry.getMatchEntryValue();
+ key.setExperimenterId(experimenterIdCase.getExperimenter().getExperimenter().getValue());
} else {
key.setExperimenterId(null);
}
- OFSerializer<MatchEntries> serializer = registry.getSerializer(key);
+ OFSerializer<MatchEntry> serializer = registry.getSerializer(key);
serializer.serialize(entry, outBuffer);
int paddingRemainder = (outBuffer.writerIndex() - startIndex) % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
-import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
/**
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.util.ExperimenterSerializerKeyFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMeterBand;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMeterBand;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterBandCommons;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.util.ExperimenterSerializerKeyFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase;
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<MatchEntries> entries = property.
- getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntries();
+ List<MatchEntry> entries = property.
+ getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
if (entries != null) {
- TypeKeyMaker<MatchEntries> keyMaker = TypeKeyMakerFactory
+ TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory
.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
ListSerializer.serializeHeaderList(entries, keyMaker, registry, output);
}
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
-import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
/**
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.util.ExperimenterSerializerKeyFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequest;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.MultipartRequestBody;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCase;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
-import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ListSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
+import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMaker;
+import org.opendaylight.openflowjava.protocol.impl.util.TypeKeyMakerFactory;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.impl.util.InstructionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
/**
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
/**
* Parent for Ipv4 address based match entry serializers
*/
public abstract class AbstractOxmIpv4AddressSerializer extends AbstractOxmMatchEntrySerializer {
- @Override
- public void serialize(final MatchEntries entry, final ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- writeIpv4Address(entry, outBuffer);
- writeMask(entry, outBuffer, getValueLength());
- }
-
- private static void writeIpv4Address(final MatchEntries entry, final ByteBuf out) {
- Iterable<String> addressGroups = ByteBufUtils.DOT_SPLITTER
- .split(entry.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address().getValue());
+ protected static void writeIpv4Address(String address, final ByteBuf out) {
+ Iterable<String> addressGroups = ByteBufUtils.DOT_SPLITTER.split(address);
for (String group : addressGroups) {
out.writeByte(Short.parseShort(group));
}
import java.util.Arrays;
import java.util.List;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import com.google.common.collect.Lists;
*/
public abstract class AbstractOxmIpv6AddressSerializer extends AbstractOxmMatchEntrySerializer {
- @Override
- public void serialize(final MatchEntries entry, final ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- String textAddress = entry.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address().getValue();
+ protected void writeIpv6Address(String textAddress, final ByteBuf outBuffer) {
List<String> address;
if (textAddress.equals("::")) {
String[] tmp = new String[EncodeConstants.GROUPS_IN_IPV6_ADDRESS];
for (String group : address) {
outBuffer.writeShort(Integer.parseInt(group, 16));
}
- writeMask(entry, outBuffer, getValueLength());
}
private static List<String> parseIpv6Address(final List<String> addressGroups) {
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
/**
* Parent for MAC address based match entry serializers
*/
public abstract class AbstractOxmMacAddressSerializer extends AbstractOxmMatchEntrySerializer {
- @Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- String macAddress = entry.getAugmentation(MacAddressMatchEntry.class).getMacAddress().getValue();
- outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(macAddress)); // 48 b + mask [OF 1.3.2 spec]
- writeMask(entry, outBuffer, getValueLength());
+ protected void writeMacAddress(MacAddress address, ByteBuf outBuffer) {
+ outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(address.getValue())); // 48 b + mask [OF 1.3.2 spec]
}
}
import org.opendaylight.openflowjava.protocol.api.extensibility.HeaderSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
* Parent for all match entry serializers
* @author michal.polkorab
*/
public abstract class AbstractOxmMatchEntrySerializer
- implements OFSerializer<MatchEntries>, HeaderSerializer<MatchEntries>{
+ implements OFSerializer<MatchEntry>, HeaderSerializer<MatchEntry>{
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
serializeHeader(entry, outBuffer);
}
@Override
- public void serializeHeader(MatchEntries entry, ByteBuf outBuffer) {
+ public void serializeHeader(MatchEntry entry, ByteBuf outBuffer) {
outBuffer.writeShort(getOxmClassCode());
writeOxmFieldAndLength(outBuffer, getOxmFieldCode(), entry.isHasMask(),
getValueLength());
}
- protected static void writeMask(MatchEntries entry, ByteBuf out, int length) {
- if (entry.isHasMask()) {
- byte[] mask = entry.getAugmentation(MaskMatchEntry.class).getMask();
- if (mask != null && mask.length != length) {
- throw new IllegalArgumentException("incorrect length of mask: "+
- mask.length + ", expected: " + length);
- }
- out.writeBytes(mask);
+ protected static void writeMask(byte[] mask, ByteBuf out, int length) {
+ if (mask != null && mask.length != length) {
+ throw new IllegalArgumentException("incorrect length of mask: "+
+ mask.length + ", expected: " + length);
}
+ out.writeBytes(mask);
}
protected static void writeOxmFieldAndLength(ByteBuf out, int fieldValue, boolean hasMask, int lengthArg) {
+++ /dev/null
-/*
- * 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.serialization.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-
-/**
- * Parent for metadata based match entry serializers
- * @author michal.polkorab
- */
-public abstract class AbstractOxmMetadataSerializer extends AbstractOxmMatchEntrySerializer {
-
- @Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- outBuffer.writeBytes(entry.getAugmentation(MetadataMatchEntry.class).getMetadata());
- writeMask(entry, outBuffer, getValueLength());
- }
-}
+++ /dev/null
-/*
- * 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.serialization.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-
-/**
- * Parent for port(32-bit) based match entry serializers
- * @author michal.polkorab
- */
-public abstract class AbstractOxmPortNumberSerializer extends AbstractOxmMatchEntrySerializer {
-
- @Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- outBuffer.writeInt(entry.getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
- }
-}
+++ /dev/null
-/*
- * 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.serialization.match;
-
-import io.netty.buffer.ByteBuf;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-
-/**
- * Parent for port(16-bit) based match entry serializers
- * @author michal.polkorab
- */
-public abstract class AbstractOxmPortSerializer extends AbstractOxmMatchEntrySerializer {
-
- @Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
- super.serialize(entry, outBuffer);
- outBuffer.writeShort(entry.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- }
-}
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.rev131002.OpCodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCase;
/**
* @author michal.polkorab
public class OxmArpOpSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeShort(entry.getAugmentation(OpCodeMatchEntry.class).getOpCode());
+ ArpOpCase entryValue = (ArpOpCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getArpOp().getOpCode());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpShaCase;
/**
* @author michal.polkorab
*/
public class OxmArpShaSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ ArpShaCase entryValue = (ArpShaCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getArpSha().getMacAddress(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getArpSha().getMask(), outBuffer, EncodeConstants.MAC_ADDRESS_LENGTH);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpSpaCase;
/**
* @author michal.polkorab
*/
public class OxmArpSpaSerializer extends AbstractOxmIpv4AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ ArpSpaCase entryValue = (ArpSpaCase) entry.getMatchEntryValue();
+ writeIpv4Address(entryValue.getArpSpa().getIpv4Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getArpSpa().getMask(), outBuffer,
+ EncodeConstants.GROUPS_IN_IPV4_ADDRESS);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpThaCase;
/**
* @author michal.polkorab
*/
public class OxmArpThaSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ ArpThaCase entryValue = (ArpThaCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getArpTha().getMacAddress(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getArpTha().getMask(), outBuffer, EncodeConstants.MAC_ADDRESS_LENGTH);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpTpaCase;
/**
* @author michal.polkorab
*/
public class OxmArpTpaSerializer extends AbstractOxmIpv4AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ ArpTpaCase entryValue = (ArpTpaCase) entry.getMatchEntryValue();
+ writeIpv4Address(entryValue.getArpTpa().getIpv4Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getArpTpa().getMask(), outBuffer,
+ EncodeConstants.GROUPS_IN_IPV4_ADDRESS);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCase;
/**
* @author michal.polkorab
*/
public class OxmEthDstSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ EthDstCase entryValue = (EthDstCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getEthDst().getMacAddress(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getEthDst().getMask(), outBuffer, EncodeConstants.MAC_ADDRESS_LENGTH);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCase;
/**
* @author michal.polkorab
*/
public class OxmEthSrcSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ EthSrcCase entryValue = (EthSrcCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getEthSrc().getMacAddress(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getEthSrc().getMask(), outBuffer, EncodeConstants.MAC_ADDRESS_LENGTH);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
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.rev131002.EthTypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCase;
/**
* @author michal.polkorab
public class OxmEthTypeSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeShort(entry.getAugmentation(EthTypeMatchEntry.class).getEthType().getValue().shortValue());
+ EthTypeCase entryValue = (EthTypeCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getEthType().getEthType().getValue().shortValue());
}
@Override
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.rev131002.Icmpv4CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCase;
/**
* @author michal.polkorab
public class OxmIcmpv4CodeSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(Icmpv4CodeMatchEntry.class).getIcmpv4Code());
+ Icmpv4CodeCase entryValue = (Icmpv4CodeCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIcmpv4Code().getIcmpv4Code());
}
@Override
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.rev131002.Icmpv4TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCase;
/**
* @author michal.polkorab
public class OxmIcmpv4TypeSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(Icmpv4TypeMatchEntry.class).getIcmpv4Type());
+ Icmpv4TypeCase entryValue = (Icmpv4TypeCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIcmpv4Type().getIcmpv4Type());
}
@Override
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.rev131002.Icmpv6CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCase;
/**
* @author michal.polkorab
public class OxmIcmpv6CodeSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(Icmpv6CodeMatchEntry.class).getIcmpv6Code());
+ Icmpv6CodeCase entryValue = (Icmpv6CodeCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIcmpv6Code().getIcmpv6Code());
}
@Override
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.rev131002.Icmpv6TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCase;
/**
* @author michal.polkorab
public class OxmIcmpv6TypeSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(Icmpv6TypeMatchEntry.class).getIcmpv6Type());
+ Icmpv6TypeCase entryValue = (Icmpv6TypeCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIcmpv6Type().getIcmpv6Type());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCase;
/**
* @author michal.polkorab
*
*/
-public class OxmInPhyPortSerializer extends AbstractOxmPortNumberSerializer {
+public class OxmInPhyPortSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ InPhyPortCase entryValue = (InPhyPortCase) entry.getMatchEntryValue();
+ outBuffer.writeInt(entryValue.getInPhyPort().getPortNumber().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCase;
/**
* @author michal.polkorab
*
*/
-public class OxmInPortSerializer extends AbstractOxmPortNumberSerializer {
+public class OxmInPortSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ InPortCase entryValue = (InPortCase) entry.getMatchEntryValue();
+ outBuffer.writeInt(entryValue.getInPort().getPortNumber().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
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.rev131002.DscpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCase;
/**
* @author michal.polkorab
public class OxmIpDscpSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(DscpMatchEntry.class).getDscp().getValue());
+ IpDscpCase entryValue = (IpDscpCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIpDscp().getDscp().getValue());
}
@Override
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.rev131002.EcnMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCase;
/**
* @author michal.polkorab
public class OxmIpEcnSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(EcnMatchEntry.class).getEcn());
+ IpEcnCase entryValue = (IpEcnCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIpEcn().getEcn());
}
@Override
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.rev131002.ProtocolNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCase;
/**
* @author michal.polkorab
public class OxmIpProtoSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(ProtocolNumberMatchEntry.class).getProtocolNumber());
+ IpProtoCase entryValue = (IpProtoCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getIpProto().getProtocolNumber());
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCase;
/**
* @author michal.polkorab
*/
public class OxmIpv4DstSerializer extends AbstractOxmIpv4AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv4DstCase entryValue = (Ipv4DstCase) entry.getMatchEntryValue();
+ writeIpv4Address(entryValue.getIpv4Dst().getIpv4Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getIpv4Dst().getMask(), outBuffer,
+ EncodeConstants.GROUPS_IN_IPV4_ADDRESS);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCase;
/**
* @author michal.polkorab
*/
public class OxmIpv4SrcSerializer extends AbstractOxmIpv4AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv4SrcCase entryValue = (Ipv4SrcCase) entry.getMatchEntryValue();
+ writeIpv4Address(entryValue.getIpv4Src().getIpv4Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getIpv4Src().getMask(), outBuffer,
+ EncodeConstants.GROUPS_IN_IPV4_ADDRESS);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCase;
/**
* @author michal.polkorab
*/
public class OxmIpv6DstSerializer extends AbstractOxmIpv6AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv6DstCase entryValue = (Ipv6DstCase) entry.getMatchEntryValue();
+ writeIpv6Address(entryValue.getIpv6Dst().getIpv6Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getIpv6Dst().getMask(), outBuffer,
+ EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
import io.netty.buffer.ByteBuf;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
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.rev131002.PseudoFieldMatchEntry;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCase;
/**
* @author michal.polkorab
public class OxmIpv6ExtHdrSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(final MatchEntries entry, final ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- Ipv6ExthdrFlags pseudoField = entry.getAugmentation(PseudoFieldMatchEntry.class).getPseudoField();
+ Ipv6ExthdrCase entryValue = (Ipv6ExthdrCase) entry.getMatchEntryValue();
+ Ipv6ExthdrFlags pseudoField = entryValue.getIpv6Exthdr().getPseudoField();
int bitmap = ByteBufUtils.fillBitMask(0,
pseudoField.isNonext(),
pseudoField.isEsp(),
pseudoField.isUnrep(),
pseudoField.isUnseq());
outBuffer.writeShort(bitmap);
- writeMask(entry, outBuffer, getValueLength());
+ if (entry.isHasMask()) {
+ outBuffer.writeBytes(entryValue.getIpv6Exthdr().getMask());
+ }
}
@Override
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.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCase;
/**
* @author michal.polkorab
public class OxmIpv6FlabelSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeInt(entry.getAugmentation(Ipv6FlabelMatchEntry.class).getIpv6Flabel().getValue().intValue());
- writeMask(entry, outBuffer, getValueLength());
+ Ipv6FlabelCase entryValue = (Ipv6FlabelCase) entry.getMatchEntryValue();
+ outBuffer.writeInt(entryValue.getIpv6Flabel().getIpv6Flabel().getValue().intValue());
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getIpv6Flabel().getMask(), outBuffer, EncodeConstants.SIZE_OF_INT_IN_BYTES);
+ }
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdSllCase;
/**
* @author michal.polkorab
*/
public class OxmIpv6NdSllSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv6NdSllCase entryValue = (Ipv6NdSllCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getIpv6NdSll().getMacAddress(), outBuffer);
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTargetCase;
/**
* @author michal.polkorab
*/
public class OxmIpv6NdTargetSerializer extends AbstractOxmIpv6AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv6NdTargetCase entryValue = (Ipv6NdTargetCase) entry.getMatchEntryValue();
+ writeIpv6Address(entryValue.getIpv6NdTarget().getIpv6Address().getValue(), outBuffer);
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTllCase;
/**
* @author michal.polkorab
*/
public class OxmIpv6NdTllSerializer extends AbstractOxmMacAddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv6NdTllCase entryValue = (Ipv6NdTllCase) entry.getMatchEntryValue();
+ writeMacAddress(entryValue.getIpv6NdTll().getMacAddress(), outBuffer);
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCase;
/**
* @author michal.polkorab
*/
public class OxmIpv6SrcSerializer extends AbstractOxmIpv6AddressSerializer {
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ Ipv6SrcCase entryValue = (Ipv6SrcCase) entry.getMatchEntryValue();
+ writeIpv6Address(entryValue.getIpv6Src().getIpv6Address().getValue(), outBuffer);
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getIpv6Src().getMask(), outBuffer,
+ EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES);
+ }
+ }
+
@Override
protected int getOxmClassCode() {
return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase;
/**
* @author michal.polkorab
*
*/
-public class OxmMetadataSerializer extends AbstractOxmMetadataSerializer {
+public class OxmMetadataSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ MetadataCase entryValue = (MetadataCase) entry.getMatchEntryValue();
+ outBuffer.writeBytes(entryValue.getMetadata().getMetadata());
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getMetadata().getMask(), outBuffer,
+ EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+ }
+ }
@Override
protected int getOxmClassCode() {
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.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCase;
/**
* @author michal.polkorab
public class OxmMplsBosSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeBoolean(entry.getAugmentation(BosMatchEntry.class).isBos().booleanValue());
+ MplsBosCase entryValue = (MplsBosCase) entry.getMatchEntryValue();
+ outBuffer.writeBoolean(entryValue.getMplsBos().isBos().booleanValue());
}
@Override
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.rev131002.MplsLabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCase;
/**
* @author michal.polkorab
public class OxmMplsLabelSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeInt(entry.getAugmentation(MplsLabelMatchEntry.class).getMplsLabel().intValue());
+ MplsLabelCase entryValue = (MplsLabelCase) entry.getMatchEntryValue();
+ outBuffer.writeInt(entryValue.getMplsLabel().getMplsLabel().intValue());
}
@Override
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.rev131002.TcMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCase;
/**
* @author michal.polkorab
public class OxmMplsTcSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(TcMatchEntry.class).getTc());
+ MplsTcCase entryValue = (MplsTcCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getMplsTc().getTc());
}
@Override
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.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCase;
/**
* @author michal.polkorab
public class OxmPbbIsidSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeMedium(entry.getAugmentation(IsidMatchEntry.class).getIsid().intValue());
- writeMask(entry, outBuffer, getValueLength());
+ PbbIsidCase entryValue = (PbbIsidCase) entry.getMatchEntryValue();
+ outBuffer.writeMedium(entryValue.getPbbIsid().getIsid().intValue());
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getPbbIsid().getMask(), outBuffer, getValueLength());
+ }
}
@Override
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCase;
/**
* @author michal.polkorab
*
*/
-public class OxmSctpDstSerializer extends AbstractOxmPortSerializer {
+public class OxmSctpDstSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ SctpDstCase entryValue = (SctpDstCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getSctpDst().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCase;
/**
* @author michal.polkorab
*
*/
-public class OxmSctpSrcSerializer extends AbstractOxmPortSerializer {
+public class OxmSctpSrcSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ SctpSrcCase entryValue = (SctpSrcCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getSctpSrc().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCase;
/**
* @author michal.polkorab
*
*/
-public class OxmTcpDstSerializer extends AbstractOxmPortSerializer{
+public class OxmTcpDstSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ TcpDstCase entryValue = (TcpDstCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getTcpDst().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCase;
/**
* @author michal.polkorab
*
*/
-public class OxmTcpSrcSerializer extends AbstractOxmPortSerializer {
+public class OxmTcpSrcSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ TcpSrcCase entryValue = (TcpSrcCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getTcpSrc().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCase;
/**
* @author michal.polkorab
*
*/
-public class OxmTunnelIdSerializer extends AbstractOxmMetadataSerializer {
+public class OxmTunnelIdSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ TunnelIdCase entryValue = (TunnelIdCase) entry.getMatchEntryValue();
+ outBuffer.writeBytes(entryValue.getTunnelId().getTunnelId());
+ if (entry.isHasMask()) {
+ writeMask(entryValue.getTunnelId().getMask(), outBuffer,
+ EncodeConstants.SIZE_OF_LONG_IN_BYTES);
+ }
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCase;
/**
* @author michal.polkorab
*
*/
-public class OxmUdpDstSerializer extends AbstractOxmPortSerializer {
+public class OxmUdpDstSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ UdpDstCase entryValue = (UdpDstCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getUdpDst().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
*/
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
+import io.netty.buffer.ByteBuf;
+
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.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCase;
/**
* @author michal.polkorab
*
*/
-public class OxmUdpSrcSerializer extends AbstractOxmPortSerializer {
+public class OxmUdpSrcSerializer extends AbstractOxmMatchEntrySerializer {
+
+ @Override
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
+ super.serialize(entry, outBuffer);
+ UdpSrcCase entryValue = (UdpSrcCase) entry.getMatchEntryValue();
+ outBuffer.writeShort(entryValue.getUdpSrc().getPort().getValue().intValue());
+ }
@Override
protected int getOxmClassCode() {
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.rev131002.VlanPcpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCase;
/**
* @author michal.polkorab
public class OxmVlanPcpSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- outBuffer.writeByte(entry.getAugmentation(VlanPcpMatchEntry.class).getVlanPcp().byteValue());
+ VlanPcpCase entryValue = (VlanPcpCase) entry.getMatchEntryValue();
+ outBuffer.writeByte(entryValue.getVlanPcp().getVlanPcp());
}
@Override
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.rev131002.VlanVidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVid;
/**
* @author michal.polkorab
public class OxmVlanVidSerializer extends AbstractOxmMatchEntrySerializer {
@Override
- public void serialize(MatchEntries entry, ByteBuf outBuffer) {
+ public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
- VlanVidMatchEntry vlanVid = entry.getAugmentation(VlanVidMatchEntry.class);
+ VlanVid vlanVid = ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid();
int vlanVidValue = vlanVid.getVlanVid();
if (vlanVid.isCfiBit()) {
short cfi = 1 << 12; // 13-th bit
vlanVidValue = vlanVidValue | cfi;
}
-
outBuffer.writeShort(vlanVidValue);
- writeMask(entry, outBuffer, getValueLength());
+ if (entry.isHasMask()) {
+ writeMask(vlanVid.getMask(), outBuffer, getValueLength());
+ }
}
@Override
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
/**
* Deserializes ofp_match (OpenFlow v1.3) and its oxm_fields structures
}
CodeKeyMaker keyMaker = CodeKeyMakerFactory
.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
- List<MatchEntries> entries = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
+ List<MatchEntry> entries = ListDeserializer.deserializeList(EncodeConstants.OF13_VERSION_ID,
length - 2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES, input, keyMaker, registry);
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
int paddingRemainder = length % EncodeConstants.PADDING;
if (paddingRemainder != 0) {
input.skipBytes(EncodeConstants.PADDING - paddingRemainder);
import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmClassBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmClassBase;
/**
* @author michal.polkorab
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
/**
* Deserializes ofp_match (OpenFlow v1.0) structure
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
/**
* Serializes ofp_match (OpenFlow v1.0) structure
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
serializeType(match, outBuffer);
int matchLengthIndex = outBuffer.writerIndex();
outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
- serializeMatchEntries(match.getMatchEntries(), outBuffer);
+ serializeMatchEntries(match.getMatchEntry(), outBuffer);
// Length of ofp_match (excluding padding)
int matchLength = outBuffer.writerIndex() - matchStartIndex;
outBuffer.setShort(matchLengthIndex, matchLength);
* @param matchEntries list of match entries (oxm_fields)
* @param out output ByteBuf
*/
- public void serializeMatchEntries(List<MatchEntries> matchEntries, ByteBuf out) {
+ public void serializeMatchEntries(List<MatchEntry> matchEntries, ByteBuf out) {
if (matchEntries == null) {
LOGGER.debug("Match entries are null");
return;
}
- for (MatchEntries entry : matchEntries) {
+ for (MatchEntry entry : matchEntries) {
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
EncodeConstants.OF13_VERSION_ID, entry.getOxmClass(), entry.getOxmMatchField());
if (entry.getOxmClass().equals(ExperimenterClass.class)) {
- key.setExperimenterId(entry.getAugmentation(ExperimenterIdMatchEntry.class)
- .getExperimenter().getValue());
+ ExperimenterIdCase entryValue = (ExperimenterIdCase) entry.getMatchEntryValue();
+ key.setExperimenterId(entryValue.getExperimenter().getExperimenter().getValue());
} else {
key.setExperimenterId(null);
}
- OFSerializer<MatchEntries> entrySerializer = registry.getSerializer(key);
+ OFSerializer<MatchEntry> entrySerializer = registry.getSerializer(key);
entrySerializer.serialize(entry, out);
}
}
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.augments.rev131002.ExperimenterIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
/**
* Creates KeyMakers
* in lookup key
* @return lookup key
*/
- public static TypeKeyMaker<MatchEntries> createMatchEntriesKeyMaker(short version) {
- return new AbstractTypeKeyMaker<MatchEntries>(version) {
+ public static TypeKeyMaker<MatchEntry> createMatchEntriesKeyMaker(short version) {
+ return new AbstractTypeKeyMaker<MatchEntry>(version) {
@Override
- public MatchEntrySerializerKey<?, ?> make(MatchEntries entry) {
+ public MatchEntrySerializerKey<?, ?> make(MatchEntry entry) {
MatchEntrySerializerKey<?, ?> key;
key = new MatchEntrySerializerKey<>(getVersion(), entry.getOxmClass(),
entry.getOxmMatchField());
if (entry.getOxmClass().equals(ExperimenterClass.class)) {
- key.setExperimenterId(entry.getAugmentation(ExperimenterIdMatchEntry.class)
- .getExperimenter().getValue());
+ ExperimenterIdCase entryValue = (ExperimenterIdCase) entry.getMatchEntryValue();
+ key.setExperimenterId(entryValue.getExperimenter().getExperimenter().getValue());
return key;
}
key.setExperimenterId(null);
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 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.TransportProtocol;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessage;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.MatchDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
/**
*
* @author madamjak
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDropCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDscpRemarkCase;
Assert.assertEquals("Wrong setFieldOXMClass", OpenflowBasicClass.class,
message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmClass());
+ .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0).getOxmClass());
Assert.assertEquals("Wrong setFieldOXMField", InPort.class,
message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmMatchField());
+ .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0).getOxmMatchField());
- Assert.assertEquals("Wrong setFieldOXMValue", 255,
- message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
- .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).
- getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
+ MatchEntry entry = message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getAugmentation(OxmFieldsAction.class).getMatchEntry().get(0);
+ Assert.assertEquals("Wrong setFieldOXMValue", 255, ((InPortCase) entry.getMatchEntryValue())
+ .getInPort().getPortNumber().getValue().intValue());
}
}
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueueProperty;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.queue.get.config.reply.Queues;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueuePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueueProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueuePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;
import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueueProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.RateQueuePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueueProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.RateQueuePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.QueueProperties;
import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyFlowCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.MultipartReplyFlow;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesCase;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmIpv6ExtHdrDeserializer deserializer = new OxmIpv6ExtHdrDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Exthdr.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
Assert.assertEquals("Wrong entry value",
new Ipv6ExthdrFlags(true, true, true, true, true, true, true, true, true),
- entry.getAugmentation(PseudoFieldMatchEntry.class).getPseudoField());
- Assert.assertEquals("Wrong entry mask", null, entry.getAugmentation(MaskMatchEntry.class));
+ ((Ipv6ExthdrCase) entry.getMatchEntryValue()).getIpv6Exthdr().getPseudoField());
+ Assert.assertEquals("Wrong entry mask", null, ((Ipv6ExthdrCase) entry.getMatchEntryValue())
+ .getIpv6Exthdr().getMask());
Assert.assertTrue("Unread data", buffer.readableBytes() == 0);
}
}
\ No newline at end of file
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmIpv6FlabelDeserializer deserializer = new OxmIpv6FlabelDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Flabel.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
Assert.assertEquals("Wrong entry value", 2,
- entry.getAugmentation(Ipv6FlabelMatchEntry.class).getIpv6Flabel().getValue().intValue());
+ ((Ipv6FlabelCase) entry.getMatchEntryValue()).getIpv6Flabel()
+ .getIpv6Flabel().getValue().intValue());
+ }
+
+ /**
+ * Tests {@link OxmIpv6FlabelDeserializer#deserialize(ByteBuf)}
+ */
+ @Test
+ public void testWithMask() {
+ ByteBuf buffer = BufferHelper.buildBuffer("80 00 39 08 00 00 00 02 00 00 00 05");
+
+ buffer.skipBytes(4); // skip XID
+ OxmIpv6FlabelDeserializer deserializer = new OxmIpv6FlabelDeserializer();
+ MatchEntry entry = deserializer.deserialize(buffer);
+
+ Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
+ Assert.assertEquals("Wrong entry field", Ipv6Flabel.class, entry.getOxmMatchField());
+ Assert.assertEquals("Wrong entry hasMask", true, entry.isHasMask());
+ Assert.assertEquals("Wrong entry value", 2,
+ ((Ipv6FlabelCase) entry.getMatchEntryValue()).getIpv6Flabel()
+ .getIpv6Flabel().getValue().intValue());
+ Assert.assertArrayEquals("Wrong entry mask", new byte[]{0, 0, 0, 5},
+ ((Ipv6FlabelCase) entry.getMatchEntryValue()).getIpv6Flabel().getMask());
}
}
\ No newline at end of file
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmMetadataDeserializer deserializer = new OxmMetadataDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", Metadata.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"),
- entry.getAugmentation(MetadataMatchEntry.class).getMetadata());
+ ((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMetadata());
}
}
\ No newline at end of file
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmMplsBosDeserializer deserializer = new OxmMplsBosDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", MplsBos.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
- Assert.assertEquals("Wrong entry value", false, entry.getAugmentation(BosMatchEntry.class).isBos());
+ Assert.assertEquals("Wrong entry value", false,
+ ((MplsBosCase) entry.getMatchEntryValue()).getMplsBos().isBos());
}
}
\ No newline at end of file
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmPbbIsidDeserializer deserializer = new OxmPbbIsidDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", PbbIsid.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
- Assert.assertEquals("Wrong entry value", 2, entry.getAugmentation(IsidMatchEntry.class).getIsid().intValue());
+ Assert.assertEquals("Wrong entry value", 2, ((PbbIsidCase) entry.getMatchEntryValue())
+ .getPbbIsid().getIsid().intValue());
}
}
\ No newline at end of file
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
/**
* @author michal.polkorab
buffer.skipBytes(4); // skip XID
OxmVlanVidDeserializer deserializer = new OxmVlanVidDeserializer();
- MatchEntries entry = deserializer.deserialize(buffer);
+ MatchEntry entry = deserializer.deserialize(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", VlanVid.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
Assert.assertEquals("Wrong entry value", 10,
- entry.getAugmentation(VlanVidMatchEntry.class).getVlanVid().intValue());
+ ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getVlanVid().intValue());
Assert.assertEquals("Wrong entry value", false,
- entry.getAugmentation(VlanVidMatchEntry.class).isCfiBit());
+ ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().isCfiBit());
}
}
\ No newline at end of file
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
/**
*
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetField;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
/**
* @author madamjak
public class OF13SetFieldActionSerializerTest {
private SerializerRegistry registry;
- @Mock OFSerializer<MatchEntries> serializerMock;
+ @Mock OFSerializer<MatchEntry> serializerMock;
/**
* Initialize registry and mock
ser.injectSerializerRegistry(registry);
ActionBuilder actionBuilder = new ActionBuilder();
long experimenterId = 12L;
- ExperimenterIdMatchEntryBuilder expIdMatchBuilder = new ExperimenterIdMatchEntryBuilder();
- expIdMatchBuilder.setExperimenter(new ExperimenterId(experimenterId));
- MatchEntriesBuilder meb = new MatchEntriesBuilder();
+ ExperimenterIdCaseBuilder expCaseBuilder = new ExperimenterIdCaseBuilder();
+ ExperimenterBuilder expBuilder = new ExperimenterBuilder();
+ expBuilder.setExperimenter(new ExperimenterId(experimenterId));
+ expCaseBuilder.setExperimenter(expBuilder.build());
+ MatchEntryBuilder meb = new MatchEntryBuilder();
meb.setOxmClass(ExperimenterClass.class);
meb.setOxmMatchField(OxmMatchFieldClass.class);
- meb.addAugmentation(ExperimenterIdMatchEntry.class, expIdMatchBuilder.build());
- List<MatchEntries> matchEntries = new ArrayList<>();
- MatchEntries me = meb.build();
- matchEntries.add(me);
+ meb.setMatchEntryValue(expCaseBuilder.build());
+ List<MatchEntry> MatchEntry = new ArrayList<>();
+ MatchEntry me = meb.build();
+ MatchEntry.add(me);
OxmFieldsActionBuilder oxmActBuilder = new OxmFieldsActionBuilder();
- oxmActBuilder.setMatchEntries(matchEntries);
+ oxmActBuilder.setMatchEntry(MatchEntry);
actionBuilder.addAugmentation(OxmFieldsAction.class, oxmActBuilder.build());
actionBuilder.setType(SetField.class);
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
registry.registerSerializer(key, serializerMock);
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
ser.serialize(actionBuilder.build(), out);
- Mockito.verify(serializerMock, Mockito.times(1)).serialize((MatchEntries)Mockito.anyObject(), (ByteBuf)Mockito.anyObject());
+ Mockito.verify(serializerMock, Mockito.times(1)).serialize((MatchEntry)Mockito.anyObject(), (ByteBuf)Mockito.anyObject());
int lenght = out.readableBytes();
Assert.assertEquals("Wrong - bad field code", ActionConstants.SET_FIELD_CODE, out.readUnsignedShort());
Assert.assertEquals("Wrong - bad lenght", lenght, out.readUnsignedShort());
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPhyPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.phy.port._case.InPhyPortBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.ecn._case.IpEcnBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
builder.setFlags(new FlowModFlags(true, false, true, false, true));
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(InPhyPort.class);
entriesBuilder.setHasMask(false);
- PortNumberMatchEntryBuilder portNumberBuilder = new PortNumberMatchEntryBuilder();
- portNumberBuilder.setPortNumber(new PortNumber(42L));
- entriesBuilder.addAugmentation(PortNumberMatchEntry.class, portNumberBuilder.build());
+ InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
+ InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
+ inPhyPortBuilder.setPortNumber(new PortNumber(42L));
+ inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
+ entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
entries.add(entriesBuilder.build());
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(IpEcn.class);
entriesBuilder.setHasMask(false);
- EcnMatchEntryBuilder ecnBuilder = new EcnMatchEntryBuilder();
- ecnBuilder.setEcn((short) 4);
- entriesBuilder.addAugmentation(EcnMatchEntry.class, ecnBuilder.build());
+ IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
+ IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
+ ipEcnBuilder.setEcn((short) 4);
+ ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
entries.add(entriesBuilder.build());
- matchBuilder.setMatchEntries(entries);
+ matchBuilder.setMatchEntry(entries);
builder.setMatch(matchBuilder.build());
List<Instruction> instructions = new ArrayList<>();
InstructionBuilder insBuilder = new InstructionBuilder();
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwDst;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetTpSrc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescCaseBuilder;
import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopVlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequestBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequestBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactoryTest;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.InstructionRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NextTableRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeatureProperty;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmRelatedTableFeaturePropertyBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.InstructionRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NextTableRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeaturePropertyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIdsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+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.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableFeaturesCaseBuilder;
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTMATCH);
OxmRelatedTableFeaturePropertyBuilder oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(InPhyPort.class);
entriesBuilder.setHasMask(false);
entries.add(entriesBuilder.build());
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(InPort.class);
entriesBuilder.setHasMask(false);
entries.add(entriesBuilder.build());
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTWILDCARDS);
oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
entries = new ArrayList<>();
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELD);
oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
entries = new ArrayList<>();
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTWRITESETFIELDMISS);
oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
entries = new ArrayList<>();
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELD);
oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
entries = new ArrayList<>();
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(IpProto.class);
entriesBuilder.setHasMask(false);
entries.add(entriesBuilder.build());
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(IpEcn.class);
entriesBuilder.setHasMask(false);
entries.add(entriesBuilder.build());
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
propBuilder = new TableFeaturePropertiesBuilder();
propBuilder.setType(TableFeaturesPropType.OFPTFPTAPPLYSETFIELDMISS);
oxmBuilder = new OxmRelatedTableFeaturePropertyBuilder();
entries = new ArrayList<>();
- oxmBuilder.setMatchEntries(entries);
+ oxmBuilder.setMatchEntry(entries);
propBuilder.addAugmentation(OxmRelatedTableFeatureProperty.class, oxmBuilder.build());
properties.add(propBuilder.build());
tableFeaturesBuilder.setTableFeatureProperties(properties);
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestAggregateCaseBuilder;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory;
import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMultipartRequestBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdMultipartRequestBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
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.rev131002.OpCodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.op._case.ArpOpBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareArpOpMatchEntry(1402);
+ MatchEntryBuilder builder = prepareArpOpMatchEntry(1402);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareArpOpHeader(false);
+ MatchEntryBuilder builder = prepareArpOpHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareArpOpMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareArpOpHeader(false);
- OpCodeMatchEntryBuilder opBuilder = new OpCodeMatchEntryBuilder();
- opBuilder.setOpCode(value);
- builder.addAugmentation(OpCodeMatchEntry.class, opBuilder.build());
+ private static MatchEntryBuilder prepareArpOpMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareArpOpHeader(false);
+ ArpOpCaseBuilder casebuilder = new ArpOpCaseBuilder();
+ ArpOpBuilder valueBuilder = new ArpOpBuilder();
+ valueBuilder.setOpCode(value);
+ casebuilder.setArpOp(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareArpOpHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareArpOpHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(ArpOp.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpShaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.sha._case.ArpShaBuilder;
/**
* @author michal.polkorab
*/
public class OxmArpShaSerializerTest {
- OxmArpThaSerializer serializer = new OxmArpThaSerializer();
+ OxmArpShaSerializer serializer = new OxmArpShaSerializer();
/**
* Test correct serialization
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void getOxmFieldCode() {
- assertEquals("Wrong oxm-class", OxmMatchConstants.ARP_THA, serializer.getOxmFieldCode());
+ assertEquals("Wrong oxm-class", OxmMatchConstants.ARP_SHA, serializer.getOxmFieldCode());
}
/**
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ ArpShaCaseBuilder casebuilder = new ArpShaCaseBuilder();
+ ArpShaBuilder valueBuilder = new ArpShaBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
}
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setArpSha(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
- builder.setOxmMatchField(ArpTha.class);
+ builder.setOxmMatchField(ArpSha.class);
builder.setHasMask(hasMask);
return builder;
}
private static void checkHeader(ByteBuf buffer, boolean hasMask) {
assertEquals("Wrong oxm-class", OxmMatchConstants.OPENFLOW_BASIC_CLASS, buffer.readUnsignedShort());
short fieldAndMask = buffer.readUnsignedByte();
- assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_THA, fieldAndMask >>> 1);
+ assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_SHA, fieldAndMask >>> 1);
assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
if (hasMask) {
assertEquals("Wrong length", 2 * EncodeConstants.MAC_ADDRESS_LENGTH, buffer.readUnsignedByte());
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpSpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.spa._case.ArpSpaBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "10.0.0.1");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "120.121.122.0");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ ArpSpaCaseBuilder casebuilder = new ArpSpaCaseBuilder();
+ ArpSpaBuilder valueBuilder = new ArpSpaBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0});
}
- Ipv4AddressMatchEntryBuilder addressBuilder = new Ipv4AddressMatchEntryBuilder();
- addressBuilder.setIpv4Address(new Ipv4Address(value));
- builder.addAugmentation(Ipv4AddressMatchEntry.class, addressBuilder.build());
+ valueBuilder.setIpv4Address(new Ipv4Address(value));
+ casebuilder.setArpSpa(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(ArpSpa.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpThaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tha._case.ArpThaBuilder;
/**
* @author michal.polkorab
*/
public class OxmArpThaSerializerTest {
- OxmArpShaSerializer serializer = new OxmArpShaSerializer();
+ OxmArpThaSerializer serializer = new OxmArpThaSerializer();
/**
* Test correct serialization
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void getOxmFieldCode() {
- assertEquals("Wrong oxm-class", OxmMatchConstants.ARP_SHA, serializer.getOxmFieldCode());
+ assertEquals("Wrong oxm-class", OxmMatchConstants.ARP_THA, serializer.getOxmFieldCode());
}
/**
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ ArpThaCaseBuilder casebuilder = new ArpThaCaseBuilder();
+ ArpThaBuilder valueBuilder = new ArpThaBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
}
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setArpTha(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
- builder.setOxmMatchField(ArpSha.class);
+ builder.setOxmMatchField(ArpTha.class);
builder.setHasMask(hasMask);
return builder;
}
private static void checkHeader(ByteBuf buffer, boolean hasMask) {
assertEquals("Wrong oxm-class", OxmMatchConstants.OPENFLOW_BASIC_CLASS, buffer.readUnsignedShort());
short fieldAndMask = buffer.readUnsignedByte();
- assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_SHA, fieldAndMask >>> 1);
+ assertEquals("Wrong oxm-field", OxmMatchConstants.ARP_THA, fieldAndMask >>> 1);
assertEquals("Wrong hasMask", hasMask, (fieldAndMask & 1) != 0);
if (hasMask) {
assertEquals("Wrong length", 2 * EncodeConstants.MAC_ADDRESS_LENGTH, buffer.readUnsignedByte());
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpTpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tpa._case.ArpTpaBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "10.0.0.1");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "120.121.122.0");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ ArpTpaCaseBuilder casebuilder = new ArpTpaCaseBuilder();
+ ArpTpaBuilder valueBuilder = new ArpTpaBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0});
}
- Ipv4AddressMatchEntryBuilder addressBuilder = new Ipv4AddressMatchEntryBuilder();
- addressBuilder.setIpv4Address(new Ipv4Address(value));
- builder.addAugmentation(Ipv4AddressMatchEntry.class, addressBuilder.build());
+ valueBuilder.setIpv4Address(new Ipv4Address(value));
+ casebuilder.setArpTpa(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(ArpTpa.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.dst._case.EthDstBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ EthDstCaseBuilder casebuilder = new EthDstCaseBuilder();
+ EthDstBuilder valueBuilder = new EthDstBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
}
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setEthDst(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(EthDst.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "00:01:02:03:04:0A");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ EthSrcCaseBuilder casebuilder = new EthSrcCaseBuilder();
+ EthSrcBuilder valueBuilder = new EthSrcBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
}
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setEthSrc(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(EthSrc.class);
builder.setHasMask(hasMask);
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.rev131002.EthTypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.type._case.EthTypeBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareEthTypeMatchEntry(65535);
+ MatchEntryBuilder builder = prepareEthTypeMatchEntry(65535);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareEthTypeHeader(false);
+ MatchEntryBuilder builder = prepareEthTypeHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareEthTypeMatchEntry(int type) {
- MatchEntriesBuilder builder = prepareEthTypeHeader(false);
- EthTypeMatchEntryBuilder typeBuilder = new EthTypeMatchEntryBuilder();
- typeBuilder.setEthType(new EtherType(type));
- builder.addAugmentation(EthTypeMatchEntry.class, typeBuilder.build());
+ private static MatchEntryBuilder prepareEthTypeMatchEntry(int type) {
+ MatchEntryBuilder builder = prepareEthTypeHeader(false);
+ EthTypeCaseBuilder casebuilder = new EthTypeCaseBuilder();
+ EthTypeBuilder valueBuilder = new EthTypeBuilder();
+ valueBuilder.setEthType(new EtherType(type));
+ casebuilder.setEthType(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareEthTypeHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareEthTypeHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(EthType.class);
builder.setHasMask(hasMask);
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.rev131002.Icmpv4CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareIcmpv4CodeMatchEntry((short) 200);
+ MatchEntryBuilder builder = prepareIcmpv4CodeMatchEntry((short) 200);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareIcmpv4CodeHeader(false);
+ MatchEntryBuilder builder = prepareIcmpv4CodeHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareIcmpv4CodeMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareIcmpv4CodeHeader(false);
- Icmpv4CodeMatchEntryBuilder icmpv4Builder = new Icmpv4CodeMatchEntryBuilder();
- icmpv4Builder.setIcmpv4Code(value);
- builder.addAugmentation(Icmpv4CodeMatchEntry.class, icmpv4Builder.build());
+ private static MatchEntryBuilder prepareIcmpv4CodeMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareIcmpv4CodeHeader(false);
+ Icmpv4CodeCaseBuilder casebuilder = new Icmpv4CodeCaseBuilder();
+ Icmpv4CodeBuilder valueBuilder = new Icmpv4CodeBuilder();
+ valueBuilder.setIcmpv4Code(value);
+ casebuilder.setIcmpv4Code(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIcmpv4CodeHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIcmpv4CodeHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Icmpv4Code.class);
builder.setHasMask(hasMask);
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.rev131002.Icmpv4TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareIcmpv4TypeMatchEntry((short) 128);
+ MatchEntryBuilder builder = prepareIcmpv4TypeMatchEntry((short) 128);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareIcmpv4TypeHeader(false);
+ MatchEntryBuilder builder = prepareIcmpv4TypeHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareIcmpv4TypeMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareIcmpv4TypeHeader(false);
- Icmpv4TypeMatchEntryBuilder icmpv4Builder = new Icmpv4TypeMatchEntryBuilder();
- icmpv4Builder.setIcmpv4Type(value);
- builder.addAugmentation(Icmpv4TypeMatchEntry.class, icmpv4Builder.build());
+ private static MatchEntryBuilder prepareIcmpv4TypeMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareIcmpv4TypeHeader(false);
+ Icmpv4TypeCaseBuilder casebuilder = new Icmpv4TypeCaseBuilder();
+ Icmpv4TypeBuilder valueBuilder = new Icmpv4TypeBuilder();
+ valueBuilder.setIcmpv4Type(value);
+ casebuilder.setIcmpv4Type(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIcmpv4TypeHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIcmpv4TypeHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Icmpv4Type.class);
builder.setHasMask(hasMask);
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.rev131002.Icmpv6CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareIcmpv6CodeMatchEntry((short) 101);
+ MatchEntryBuilder builder = prepareIcmpv6CodeMatchEntry((short) 101);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareIcmpv6CodeHeader(false);
+ MatchEntryBuilder builder = prepareIcmpv6CodeHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareIcmpv6CodeMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareIcmpv6CodeHeader(false);
- Icmpv6CodeMatchEntryBuilder icmpv6Builder = new Icmpv6CodeMatchEntryBuilder();
- icmpv6Builder.setIcmpv6Code(value);
- builder.addAugmentation(Icmpv6CodeMatchEntry.class, icmpv6Builder.build());
+ private static MatchEntryBuilder prepareIcmpv6CodeMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareIcmpv6CodeHeader(false);
+ Icmpv6CodeCaseBuilder casebuilder = new Icmpv6CodeCaseBuilder();
+ Icmpv6CodeBuilder valueBuilder = new Icmpv6CodeBuilder();
+ valueBuilder.setIcmpv6Code(value);
+ casebuilder.setIcmpv6Code(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIcmpv6CodeHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIcmpv6CodeHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Icmpv6Code.class);
builder.setHasMask(hasMask);
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.rev131002.Icmpv6TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.type._case.Icmpv6TypeBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareIcmpv6TypeMatchEntry((short) 123);
+ MatchEntryBuilder builder = prepareIcmpv6TypeMatchEntry((short) 123);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareIcmpv6TypeHeader(false);
+ MatchEntryBuilder builder = prepareIcmpv6TypeHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareIcmpv6TypeMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareIcmpv6TypeHeader(false);
- Icmpv6TypeMatchEntryBuilder icmpv6Builder = new Icmpv6TypeMatchEntryBuilder();
- icmpv6Builder.setIcmpv6Type(value);
- builder.addAugmentation(Icmpv6TypeMatchEntry.class, icmpv6Builder.build());
+ private static MatchEntryBuilder prepareIcmpv6TypeMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareIcmpv6TypeHeader(false);
+ Icmpv6TypeCaseBuilder casebuilder = new Icmpv6TypeCaseBuilder();
+ Icmpv6TypeBuilder valueBuilder = new Icmpv6TypeBuilder();
+ valueBuilder.setIcmpv6Type(value);
+ casebuilder.setIcmpv6Type(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIcmpv6TypeHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIcmpv6TypeHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Icmpv6Type.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpDscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareIpDscpMatchEntry((short) 58);
+ MatchEntryBuilder builder = prepareIpDscpMatchEntry((short) 58);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareIpDscpHeader(false);
+ MatchEntryBuilder builder = prepareIpDscpHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareIpDscpMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareIpDscpHeader(false);
- DscpMatchEntryBuilder dscpBuilder = new DscpMatchEntryBuilder();
+ private static MatchEntryBuilder prepareIpDscpMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareIpDscpHeader(false);
+ IpDscpCaseBuilder casebuilder = new IpDscpCaseBuilder();
+ IpDscpBuilder dscpBuilder = new IpDscpBuilder();
dscpBuilder.setDscp(new Dscp(value));
- builder.addAugmentation(DscpMatchEntry.class, dscpBuilder.build());
+ casebuilder.setIpDscp(dscpBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIpDscpHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIpDscpHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(IpDscp.class);
builder.setHasMask(hasMask);
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.rev131002.ProtocolNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.proto._case.IpProtoBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry((short) 123);
+ MatchEntryBuilder builder = prepareMatchEntry((short) 123);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- ProtocolNumberMatchEntryBuilder protoBuilder = new ProtocolNumberMatchEntryBuilder();
+ private static MatchEntryBuilder prepareMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ IpProtoCaseBuilder casebuilder = new IpProtoCaseBuilder();
+ IpProtoBuilder protoBuilder = new IpProtoBuilder();
protoBuilder.setProtocolNumber(value);
- builder.addAugmentation(ProtocolNumberMatchEntry.class, protoBuilder.build());
+ casebuilder.setIpProto(protoBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(IpProto.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.dst._case.Ipv4DstBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "10.0.0.1");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "120.121.122.0");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ Ipv4DstCaseBuilder casebuilder = new Ipv4DstCaseBuilder();
+ Ipv4DstBuilder valueBuilder = new Ipv4DstBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0});
}
- Ipv4AddressMatchEntryBuilder addressBuilder = new Ipv4AddressMatchEntryBuilder();
- addressBuilder.setIpv4Address(new Ipv4Address(value));
- builder.addAugmentation(Ipv4AddressMatchEntry.class, addressBuilder.build());
+ valueBuilder.setIpv4Address(new Ipv4Address(value));
+ casebuilder.setIpv4Dst(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Ipv4Dst.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.src._case.Ipv4SrcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "10.0.0.1");
+ MatchEntryBuilder builder = prepareMatchEntry(false, "10.0.0.1");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, "120.121.122.0");
+ MatchEntryBuilder builder = prepareMatchEntry(true, "120.121.122.0");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, String value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ Ipv4SrcCaseBuilder casebuilder = new Ipv4SrcCaseBuilder();
+ Ipv4SrcBuilder valueBuilder = new Ipv4SrcBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15, 0, 0});
}
- Ipv4AddressMatchEntryBuilder addressBuilder = new Ipv4AddressMatchEntryBuilder();
- addressBuilder.setIpv4Address(new Ipv4Address(value));
- builder.addAugmentation(Ipv4AddressMatchEntry.class, addressBuilder.build());
+ valueBuilder.setIpv4Address(new Ipv4Address(value));
+ casebuilder.setIpv4Src(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Ipv4Src.class);
builder.setHasMask(hasMask);
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.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.exthdr._case.Ipv6ExthdrBuilder;
/**
* @author michal.polkorab
* Test correct serialization
*/
@Test
- public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareIpv6ExtHdrMatchEntry(false,
+ public void testSerializeWithoutMask() {
+ MatchEntryBuilder builder = prepareIpv6ExtHdrMatchEntry(false,
new Ipv6ExthdrFlags(true, false, true, false, true, false, true, false, true));
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
* Test correct serialization
*/
@Test
- public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareIpv6ExtHdrMatchEntry(true,
+ public void testSerializeWithMask() {
+ MatchEntryBuilder builder = prepareIpv6ExtHdrMatchEntry(true,
new Ipv6ExthdrFlags(false, true, false, true, false, true, false, true, false));
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(false);
+ MatchEntryBuilder builder = prepareIpv6ExtHdrHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(true);
+ MatchEntryBuilder builder = prepareIpv6ExtHdrHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareIpv6ExtHdrMatchEntry(boolean hasMask, Ipv6ExthdrFlags flags) {
- MatchEntriesBuilder builder = prepareIpv6ExtHdrHeader(hasMask);
+ private static MatchEntryBuilder prepareIpv6ExtHdrMatchEntry(boolean hasMask, Ipv6ExthdrFlags flags) {
+ MatchEntryBuilder builder = prepareIpv6ExtHdrHeader(hasMask);
+ Ipv6ExthdrCaseBuilder casebuilder = new Ipv6ExthdrCaseBuilder();
+ Ipv6ExthdrBuilder valueBuilder = new Ipv6ExthdrBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0, 15});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{0, 15});
}
- PseudoFieldMatchEntryBuilder pseudoBuilder = new PseudoFieldMatchEntryBuilder();
- pseudoBuilder.setPseudoField(flags);
- builder.addAugmentation(PseudoFieldMatchEntry.class, pseudoBuilder.build());
+ valueBuilder.setPseudoField(flags);
+ casebuilder.setIpv6Exthdr(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareIpv6ExtHdrHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareIpv6ExtHdrHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Ipv6Exthdr.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdSll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdSllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.sll._case.Ipv6NdSllBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry("00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
- if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
- }
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(String value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ Ipv6NdSllCaseBuilder casebuilder = new Ipv6NdSllCaseBuilder();
+ Ipv6NdSllBuilder valueBuilder = new Ipv6NdSllBuilder();
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setIpv6NdSll(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Ipv6NdSll.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTllBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, "00:01:02:03:04:05");
+ MatchEntryBuilder builder = prepareMatchEntry("00:01:02:03:04:05");
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.MAC_ADDRESS_LENGTH, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, String value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
- if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15, 0, 0, 10, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
- }
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress(value));
- builder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(String value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ Ipv6NdTllCaseBuilder casebuilder = new Ipv6NdTllCaseBuilder();
+ Ipv6NdTllBuilder valueBuilder = new Ipv6NdTllBuilder();
+ valueBuilder.setMacAddress(new MacAddress(value));
+ casebuilder.setIpv6NdTll(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Ipv6NdTll.class);
builder.setHasMask(hasMask);
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.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.metadata._case.MetadataBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7});
+ MatchEntryBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7});
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15});
+ MatchEntryBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15});
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ MetadataCaseBuilder casebuilder = new MetadataCaseBuilder();
+ MetadataBuilder valueBuilder = new MetadataBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{30, 30, 25, 25, 15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{30, 30, 25, 25, 15, 15, 0, 0});
}
- MetadataMatchEntryBuilder metadataBuilder = new MetadataMatchEntryBuilder();
- metadataBuilder.setMetadata(value);
- builder.addAugmentation(MetadataMatchEntry.class, metadataBuilder.build());
+ valueBuilder.setMetadata(value);
+ casebuilder.setMetadata(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(Metadata.class);
builder.setHasMask(hasMask);
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.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.bos._case.MplsBosBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMplsBosMatchEntry(true);
+ MatchEntryBuilder builder = prepareMplsBosMatchEntry(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareMplsBosHeader(false);
+ MatchEntryBuilder builder = prepareMplsBosHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder prepareMplsBosMatchEntry(boolean bos) {
- MatchEntriesBuilder builder = prepareMplsBosHeader(false);
- BosMatchEntryBuilder bosBuilder = new BosMatchEntryBuilder();
- bosBuilder.setBos(bos);
- builder.addAugmentation(BosMatchEntry.class, bosBuilder.build());
+ private static MatchEntryBuilder prepareMplsBosMatchEntry(boolean bos) {
+ MatchEntryBuilder builder = prepareMplsBosHeader(false);
+ MplsBosCaseBuilder casebuilder = new MplsBosCaseBuilder();
+ MplsBosBuilder valueBuilder = new MplsBosBuilder();
+ valueBuilder.setBos(bos);
+ casebuilder.setMplsBos(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareMplsBosHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareMplsBosHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(MplsBos.class);
builder.setHasMask(hasMask);
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.rev131002.MplsLabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.label._case.MplsLabelBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMplsLabelMatchEntry(168535);
+ MatchEntryBuilder builder = prepareMplsLabelMatchEntry(168535);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareMplsLabelHeader(false);
+ MatchEntryBuilder builder = prepareMplsLabelHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_INT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMplsLabelMatchEntry(long label) {
- MatchEntriesBuilder builder = prepareMplsLabelHeader(false);
- MplsLabelMatchEntryBuilder labelBuilder = new MplsLabelMatchEntryBuilder();
- labelBuilder.setMplsLabel(label);
- builder.addAugmentation(MplsLabelMatchEntry.class, labelBuilder.build());
+ private static MatchEntryBuilder prepareMplsLabelMatchEntry(long label) {
+ MatchEntryBuilder builder = prepareMplsLabelHeader(false);
+ MplsLabelCaseBuilder casebuilder = new MplsLabelCaseBuilder();
+ MplsLabelBuilder valueBuilder = new MplsLabelBuilder();
+ valueBuilder.setMplsLabel(label);
+ casebuilder.setMplsLabel(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareMplsLabelHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareMplsLabelHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(MplsLabel.class);
builder.setHasMask(hasMask);
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.rev131002.TcMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsTc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.tc._case.MplsTcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMplsTcMatchEntry((short) 16);
+ MatchEntryBuilder builder = prepareMplsTcMatchEntry((short) 16);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareMplsTcHeader(false);
+ MatchEntryBuilder builder = prepareMplsTcHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMplsTcMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareMplsTcHeader(false);
- TcMatchEntryBuilder tcBuilder = new TcMatchEntryBuilder();
- tcBuilder.setTc(value);
- builder.addAugmentation(TcMatchEntry.class, tcBuilder.build());
+ private static MatchEntryBuilder prepareMplsTcMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareMplsTcHeader(false);
+ MplsTcCaseBuilder casebuilder = new MplsTcCaseBuilder();
+ MplsTcBuilder valueBuilder = new MplsTcBuilder();
+ valueBuilder.setTc(value);
+ casebuilder.setMplsTc(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareMplsTcHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareMplsTcHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(MplsTc.class);
builder.setHasMask(hasMask);
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.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsidBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = preparePbbIsidMatchEntry(false, 12345);
+ MatchEntryBuilder builder = preparePbbIsidMatchEntry(false, 12345);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = preparePbbIsidMatchEntry(true, 6789);
+ MatchEntryBuilder builder = preparePbbIsidMatchEntry(true, 6789);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = preparePbbIsidHeader(false);
+ MatchEntryBuilder builder = preparePbbIsidHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = preparePbbIsidHeader(true);
+ MatchEntryBuilder builder = preparePbbIsidHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_3_BYTES, serializer.getValueLength());
}
-
- private static MatchEntriesBuilder preparePbbIsidMatchEntry(boolean hasMask, long value) {
- MatchEntriesBuilder builder = preparePbbIsidHeader(hasMask);
+ private static MatchEntryBuilder preparePbbIsidMatchEntry(boolean hasMask, long value) {
+ MatchEntryBuilder builder = preparePbbIsidHeader(hasMask);
+ PbbIsidCaseBuilder casebuilder = new PbbIsidCaseBuilder();
+ PbbIsidBuilder valueBuilder = new PbbIsidBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0, 15, 10});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{0, 15, 10});
}
- IsidMatchEntryBuilder isidBuilder = new IsidMatchEntryBuilder();
- isidBuilder.setIsid(value);
- builder.addAugmentation(IsidMatchEntry.class, isidBuilder.build());
+ valueBuilder.setIsid(value);
+ casebuilder.setPbbIsid(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder preparePbbIsidHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder preparePbbIsidHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(PbbIsid.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.dst._case.SctpDstBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(4096);
+ MatchEntryBuilder builder = prepareMatchEntry(4096);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ SctpDstCaseBuilder casebuilder = new SctpDstCaseBuilder();
+ SctpDstBuilder valueBuilder = new SctpDstBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setSctpDst(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(SctpDst.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.src._case.SctpSrcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(4096);
+ MatchEntryBuilder builder = prepareMatchEntry(4096);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ SctpSrcCaseBuilder casebuilder = new SctpSrcCaseBuilder();
+ SctpSrcBuilder valueBuilder = new SctpSrcBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setSctpSrc(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(SctpSrc.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.dst._case.TcpDstBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(4096);
+ MatchEntryBuilder builder = prepareMatchEntry(4096);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ TcpDstCaseBuilder casebuilder = new TcpDstCaseBuilder();
+ TcpDstBuilder valueBuilder = new TcpDstBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setTcpDst(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(TcpDst.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.src._case.TcpSrcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(512);
+ MatchEntryBuilder builder = prepareMatchEntry(512);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ TcpSrcCaseBuilder casebuilder = new TcpSrcCaseBuilder();
+ TcpSrcBuilder valueBuilder = new TcpSrcBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setTcpSrc(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(TcpSrc.class);
builder.setHasMask(hasMask);
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.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tunnel.id._case.TunnelIdBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithoutMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7});
+ MatchEntryBuilder builder = prepareMatchEntry(false, new byte[]{0, 1, 2, 3, 4, 5, 6, 7});
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithMask() {
- MatchEntriesBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15});
+ MatchEntryBuilder builder = prepareMatchEntry(true, new byte[]{8, 9, 10, 11, 12, 13, 14, 15});
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareHeader(true);
+ MatchEntryBuilder builder = prepareHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_LONG_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
- MatchEntriesBuilder builder = prepareHeader(hasMask);
+ private static MatchEntryBuilder prepareMatchEntry(boolean hasMask, byte[] value) {
+ MatchEntryBuilder builder = prepareHeader(hasMask);
+ TunnelIdCaseBuilder casebuilder = new TunnelIdCaseBuilder();
+ TunnelIdBuilder valueBuilder = new TunnelIdBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{30, 30, 25, 25, 15, 15, 0, 0});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{30, 30, 25, 25, 15, 15, 0, 0});
}
- MetadataMatchEntryBuilder metadataBuilder = new MetadataMatchEntryBuilder();
- metadataBuilder.setMetadata(value);
- builder.addAugmentation(MetadataMatchEntry.class, metadataBuilder.build());
+ valueBuilder.setTunnelId(value);
+ casebuilder.setTunnelId(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(TunnelId.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.dst._case.UdpDstBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(2048);
+ MatchEntryBuilder builder = prepareMatchEntry(2048);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ UdpDstCaseBuilder casebuilder = new UdpDstCaseBuilder();
+ UdpDstBuilder valueBuilder = new UdpDstBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setUdpDst(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(UdpDst.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.src._case.UdpSrcBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareMatchEntry(1024);
+ MatchEntryBuilder builder = prepareMatchEntry(1024);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareHeader(false);
+ MatchEntryBuilder builder = prepareHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareMatchEntry(int value) {
- MatchEntriesBuilder builder = prepareHeader(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new PortNumber(value));
- builder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ private static MatchEntryBuilder prepareMatchEntry(int value) {
+ MatchEntryBuilder builder = prepareHeader(false);
+ UdpSrcCaseBuilder casebuilder = new UdpSrcCaseBuilder();
+ UdpSrcBuilder valueBuilder = new UdpSrcBuilder();
+ valueBuilder.setPort(new PortNumber(value));
+ casebuilder.setUdpSrc(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(UdpSrc.class);
builder.setHasMask(hasMask);
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.rev131002.VlanPcpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.pcp._case.VlanPcpBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerialize() {
- MatchEntriesBuilder builder = prepareVlanPcpMatchEntry((short) 42);
+ MatchEntryBuilder builder = prepareVlanPcpMatchEntry((short) 42);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeader() {
- MatchEntriesBuilder builder = prepareVlanPcpHeader(false);
+ MatchEntryBuilder builder = prepareVlanPcpHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_BYTE_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareVlanPcpMatchEntry(short value) {
- MatchEntriesBuilder builder = prepareVlanPcpHeader(false);
- VlanPcpMatchEntryBuilder pcpBuilder = new VlanPcpMatchEntryBuilder();
- pcpBuilder.setVlanPcp(value);
- builder.addAugmentation(VlanPcpMatchEntry.class, pcpBuilder.build());
+ private static MatchEntryBuilder prepareVlanPcpMatchEntry(short value) {
+ MatchEntryBuilder builder = prepareVlanPcpHeader(false);
+ VlanPcpCaseBuilder casebuilder = new VlanPcpCaseBuilder();
+ VlanPcpBuilder valueBuilder = new VlanPcpBuilder();
+ valueBuilder.setVlanPcp(value);
+ casebuilder.setVlanPcp(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareVlanPcpHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareVlanPcpHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(VlanPcp.class);
builder.setHasMask(hasMask);
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.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVidBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testSerializeWithCfiBitSet() {
- MatchEntriesBuilder builder = prepareVlanVidMatchEntry(false, true);
+ MatchEntryBuilder builder = prepareVlanVidMatchEntry(false, true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeWithoutCfiBitSet() {
- MatchEntriesBuilder builder = prepareVlanVidMatchEntry(true, false);
+ MatchEntryBuilder builder = prepareVlanVidMatchEntry(true, false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serialize(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithoutMask() {
- MatchEntriesBuilder builder = prepareVlanVidHeader(false);
+ MatchEntryBuilder builder = prepareVlanVidHeader(false);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
*/
@Test
public void testSerializeHeaderWithMask() {
- MatchEntriesBuilder builder = prepareVlanVidHeader(true);
+ MatchEntryBuilder builder = prepareVlanVidHeader(true);
ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
serializer.serializeHeader(builder.build(), buffer);
assertEquals("Wrong value length", EncodeConstants.SIZE_OF_SHORT_IN_BYTES, serializer.getValueLength());
}
- private static MatchEntriesBuilder prepareVlanVidMatchEntry(boolean hasMask, boolean cfiBit) {
- MatchEntriesBuilder builder = prepareVlanVidHeader(hasMask);
+ private static MatchEntryBuilder prepareVlanVidMatchEntry(boolean hasMask, boolean cfiBit) {
+ MatchEntryBuilder builder = prepareVlanVidHeader(hasMask);
+ VlanVidCaseBuilder casebuilder = new VlanVidCaseBuilder();
+ VlanVidBuilder valueBuilder = new VlanVidBuilder();
if (hasMask) {
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{15, 15});
- builder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ valueBuilder.setMask(new byte[]{15, 15});
}
- VlanVidMatchEntryBuilder vlanBuilder = new VlanVidMatchEntryBuilder();
- vlanBuilder.setVlanVid(500);
- vlanBuilder.setCfiBit(cfiBit);
- builder.addAugmentation(VlanVidMatchEntry.class, vlanBuilder.build());
+ valueBuilder.setVlanVid(500);
+ valueBuilder.setCfiBit(cfiBit);
+ casebuilder.setVlanVid(valueBuilder.build());
+ builder.setMatchEntryValue(casebuilder.build());
return builder;
}
- private static MatchEntriesBuilder prepareVlanVidHeader(boolean hasMask) {
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ private static MatchEntryBuilder prepareVlanVidHeader(boolean hasMask) {
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(VlanVid.class);
builder.setHasMask(hasMask);
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.protocol.impl.deserialization.action.AbstractActionDeserializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+ "openflow.common.action.rev130731.DecNwTtl", actions.get(12).getType().getName());
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
+ "openflow.common.action.rev130731.SetField", actions.get(13).getType().getName());
- List<MatchEntries> entries = actions.get(13).getAugmentation(OxmFieldsAction.class).getMatchEntries();
+ List<MatchEntry> entries = actions.get(13).getAugmentation(OxmFieldsAction.class).getMatchEntry();
Assert.assertEquals("Wrong number of fields", 1, entries.size());
Assert.assertEquals("Wrong match entry class", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow."
- + "oxm.rev130731.OpenflowBasicClass", entries.get(0).getOxmClass().getName());
+ + "oxm.rev150225.OpenflowBasicClass", entries.get(0).getOxmClass().getName());
Assert.assertEquals("Wrong match entry field", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow."
- + "oxm.rev130731.InPhyPort", entries.get(0).getOxmMatchField().getName());
+ + "oxm.rev150225.InPhyPort", entries.get(0).getOxmMatchField().getName());
Assert.assertEquals("Wrong match entry mask", false, entries.get(0).isHasMask());
Assert.assertEquals("Wrong match entry value", 11,
- entries.get(0).getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
+ ((InPhyPortCase) entries.get(0).getMatchEntryValue()).getInPhyPort().getPortNumber()
+ .getValue().intValue());
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."
+ "openflow.common.action.rev130731.PushPbb", actions.get(14).getType().getName());
Assert.assertEquals("Wrong action value", 10,
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpDscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdSll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTarget;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsTc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
+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.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpShaCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpSpaCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpThaCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpTpaCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdSllCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTargetCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTllCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
/**
* @author michal.polkorab
MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
0x8000, 12);
key.setExperimenterId(null);
- OFDeserializer<MatchEntries> entryDeserializer = registry.getDeserializer(key);
- MatchEntries entry = entryDeserializer.deserialize(buffer);
+ OFDeserializer<MatchEntry> entryDeserializer = registry.getDeserializer(key);
+ MatchEntry entry = entryDeserializer.deserialize(buffer);
Assert.assertEquals("Wrong Ipv4 address format", new Ipv4Address("0.1.2.3"),
- entry.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address());
+ ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst().getIpv4Address());
}
/**
MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
0x8000, 26);
key.setExperimenterId(null);
- OFDeserializer<MatchEntries> entryDeserializer = registry.getDeserializer(key);
- MatchEntries entry = entryDeserializer.deserialize(buffer);
+ OFDeserializer<MatchEntry> entryDeserializer = registry.getDeserializer(key);
+ MatchEntry entry = entryDeserializer.deserialize(buffer);
Assert.assertEquals("Wrong Ipv6 address format", new Ipv6Address("0000:0001:0002:0003:0004:0005:0006:0F07"),
- entry.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address());
+ ((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address());
}
/**
*/
@Test
public void testMatch() {
- ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("00 01 01 AC "
+ ByteBuf buffer = ByteBufUtils.hexStringToByteBuf("00 01 01 A8 "
+ "80 00 00 04 00 00 00 01 "
+ "80 00 02 04 00 00 00 02 "
+ "80 00 05 10 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 04 "
+ "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 "
+ "80 00 37 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 "
+ "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 "
- + "80 00 39 08 00 00 00 02 00 00 00 03 "
+ + "80 00 38 04 00 00 00 02 "
+ "80 00 3A 01 15 "
+ "80 00 3C 01 17 "
+ "80 00 3E 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 " //ipv6ndtarget
+ "80 00 48 01 01 "
+ "80 00 4B 06 00 00 02 00 00 01 "
+ "80 00 4D 10 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 FF "
- + "80 00 4F 04 00 00 03 04 "
- + "00 00 00 00");
+ + "80 00 4F 04 00 00 03 04");
+ System.out.println(buffer.readableBytes());
Match match = matchDeserializer.deserialize(buffer);
Assert.assertEquals("Wrong match type", OxmMatchType.class, match.getType());
- Assert.assertEquals("Wrong match entries size", 40, match.getMatchEntries().size());
- List<MatchEntries> entries = match.getMatchEntries();
- MatchEntries entry0 = entries.get(0);
+ Assert.assertEquals("Wrong match entries size", 40, match.getMatchEntry().size());
+ List<MatchEntry> entries = match.getMatchEntry();
+ MatchEntry entry0 = entries.get(0);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry0.getOxmClass());
Assert.assertEquals("Wrong entry field", InPort.class, entry0.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry0.isHasMask());
Assert.assertEquals("Wrong entry value", 1,
- entry0.getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
- MatchEntries entry1 = entries.get(1);
+ ((InPortCase) entry0.getMatchEntryValue()).getInPort().getPortNumber().getValue().intValue());
+ MatchEntry entry1 = entries.get(1);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry1.getOxmClass());
Assert.assertEquals("Wrong entry field", InPhyPort.class, entry1.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry1.isHasMask());
Assert.assertEquals("Wrong entry value", 2,
- entry1.getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
- MatchEntries entry2 = entries.get(2);
+ ((InPhyPortCase) entry1.getMatchEntryValue()).getInPhyPort().getPortNumber().getValue().intValue());
+ MatchEntry entry2 = entries.get(2);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry2.getOxmClass());
Assert.assertEquals("Wrong entry field", Metadata.class, entry2.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry2.isHasMask());
Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"),
- entry2.getAugmentation(MetadataMatchEntry.class).getMetadata());
+ ((MetadataCase) entry2.getMatchEntryValue()).getMetadata().getMetadata());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 04"),
- entry2.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry3 = entries.get(3);
+ ((MetadataCase) entry2.getMatchEntryValue()).getMetadata().getMask());
+ MatchEntry entry3 = entries.get(3);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry3.getOxmClass());
Assert.assertEquals("Wrong entry field", EthDst.class, entry3.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry3.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:05"),
- entry3.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
+ ((EthDstCase) entry3.getMatchEntryValue()).getEthDst().getMacAddress());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 06"),
- entry3.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry4 = entries.get(4);
+ ((EthDstCase) entry3.getMatchEntryValue()).getEthDst().getMask());
+ MatchEntry entry4 = entries.get(4);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry4.getOxmClass());
Assert.assertEquals("Wrong entry field", EthSrc.class, entry4.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry4.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:07"),
- entry4.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
+ ((EthSrcCase) entry4.getMatchEntryValue()).getEthSrc().getMacAddress());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 08"),
- entry4.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry5 = entries.get(5);
+ ((EthSrcCase) entry4.getMatchEntryValue()).getEthSrc().getMask());
+ MatchEntry entry5 = entries.get(5);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry5.getOxmClass());
Assert.assertEquals("Wrong entry field", EthType.class, entry5.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry5.isHasMask());
Assert.assertEquals("Wrong entry value", 9,
- entry5.getAugmentation(EthTypeMatchEntry.class).getEthType().getValue().intValue());
- MatchEntries entry6 = entries.get(6);
+ ((EthTypeCase) entry5.getMatchEntryValue()).getEthType().getEthType().getValue().intValue());
+ MatchEntry entry6 = entries.get(6);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry6.getOxmClass());
Assert.assertEquals("Wrong entry field", VlanVid.class, entry6.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry6.isHasMask());
Assert.assertEquals("Wrong entry value", 10,
- entry6.getAugmentation(VlanVidMatchEntry.class).getVlanVid().intValue());
+ ((VlanVidCase) entry6.getMatchEntryValue()).getVlanVid().getVlanVid().intValue());
Assert.assertEquals("Wrong entry value", false,
- entry6.getAugmentation(VlanVidMatchEntry.class).isCfiBit());
+ ((VlanVidCase) entry6.getMatchEntryValue()).getVlanVid().isCfiBit());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 0B"),
- entry6.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry7 = entries.get(7);
+ ((VlanVidCase) entry6.getMatchEntryValue()).getVlanVid().getMask());
+ MatchEntry entry7 = entries.get(7);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry7.getOxmClass());
Assert.assertEquals("Wrong entry field", VlanPcp.class, entry7.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry7.isHasMask());
Assert.assertEquals("Wrong entry value", 12,
- entry7.getAugmentation(VlanPcpMatchEntry.class).getVlanPcp().intValue());
- MatchEntries entry8 = entries.get(8);
+ ((VlanPcpCase) entry7.getMatchEntryValue()).getVlanPcp().getVlanPcp().intValue());
+ MatchEntry entry8 = entries.get(8);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry8.getOxmClass());
Assert.assertEquals("Wrong entry field", IpDscp.class, entry8.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry8.isHasMask());
Assert.assertEquals("Wrong entry value", 13,
- entry8.getAugmentation(DscpMatchEntry.class).getDscp().getValue().intValue());
- MatchEntries entry9 = entries.get(9);
+ ((IpDscpCase) entry8.getMatchEntryValue()).getIpDscp().getDscp().getValue().intValue());
+ MatchEntry entry9 = entries.get(9);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry9.getOxmClass());
Assert.assertEquals("Wrong entry field", IpEcn.class, entry9.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry9.isHasMask());
Assert.assertEquals("Wrong entry value", 14,
- entry9.getAugmentation(EcnMatchEntry.class).getEcn().intValue());
- MatchEntries entry10 = entries.get(10);
+ ((IpEcnCase) entry9.getMatchEntryValue()).getIpEcn().getEcn().intValue());
+ MatchEntry entry10 = entries.get(10);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry10.getOxmClass());
Assert.assertEquals("Wrong entry field", IpProto.class, entry10.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry10.isHasMask());
Assert.assertEquals("Wrong entry value", 15,
- entry10.getAugmentation(ProtocolNumberMatchEntry.class).getProtocolNumber().intValue());
- MatchEntries entry11 = entries.get(11);
+ ((IpProtoCase) entry10.getMatchEntryValue()).getIpProto().getProtocolNumber().intValue());
+ MatchEntry entry11 = entries.get(11);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry11.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv4Src.class, entry11.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry11.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.1"),
- entry11.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address());
+ ((Ipv4SrcCase) entry11.getMatchEntryValue()).getIpv4Src().getIpv4Address());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"),
- entry11.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry12 = entries.get(12);
+ ((Ipv4SrcCase) entry11.getMatchEntryValue()).getIpv4Src().getMask());
+ MatchEntry entry12 = entries.get(12);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry12.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv4Dst.class, entry12.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry12.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.2"),
- entry12.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address());
+ ((Ipv4DstCase) entry12.getMatchEntryValue()).getIpv4Dst().getIpv4Address());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"),
- entry12.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry13 = entries.get(13);
+ ((Ipv4DstCase) entry12.getMatchEntryValue()).getIpv4Dst().getMask());
+ MatchEntry entry13 = entries.get(13);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry13.getOxmClass());
Assert.assertEquals("Wrong entry field", TcpSrc.class, entry13.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry13.isHasMask());
Assert.assertEquals("Wrong entry value", 3,
- entry13.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry14 = entries.get(14);
+ ((TcpSrcCase) entry13.getMatchEntryValue()).getTcpSrc().getPort().getValue().intValue());
+ MatchEntry entry14 = entries.get(14);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry14.getOxmClass());
Assert.assertEquals("Wrong entry field", TcpDst.class, entry14.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry14.isHasMask());
Assert.assertEquals("Wrong entry value", 4,
- entry14.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry15 = entries.get(15);
+ ((TcpDstCase) entry14.getMatchEntryValue()).getTcpDst().getPort().getValue().intValue());
+ MatchEntry entry15 = entries.get(15);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry15.getOxmClass());
Assert.assertEquals("Wrong entry field", UdpSrc.class, entry15.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry15.isHasMask());
Assert.assertEquals("Wrong entry value", 5,
- entry15.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry16 = entries.get(16);
+ ((UdpSrcCase) entry15.getMatchEntryValue()).getUdpSrc().getPort().getValue().intValue());
+ MatchEntry entry16 = entries.get(16);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry16.getOxmClass());
Assert.assertEquals("Wrong entry field", UdpDst.class, entry16.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry16.isHasMask());
Assert.assertEquals("Wrong entry value", 6,
- entry16.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry17 = entries.get(17);
+ ((UdpDstCase) entry16.getMatchEntryValue()).getUdpDst().getPort().getValue().intValue());
+ MatchEntry entry17 = entries.get(17);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry17.getOxmClass());
Assert.assertEquals("Wrong entry field", SctpSrc.class, entry17.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry17.isHasMask());
Assert.assertEquals("Wrong entry value", 7,
- entry17.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry18 = entries.get(18);
+ ((SctpSrcCase) entry17.getMatchEntryValue()).getSctpSrc().getPort().getValue().intValue());
+ MatchEntry entry18 = entries.get(18);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry18.getOxmClass());
Assert.assertEquals("Wrong entry field", SctpDst.class, entry18.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry18.isHasMask());
Assert.assertEquals("Wrong entry value", 8,
- entry18.getAugmentation(PortMatchEntry.class).getPort().getValue().intValue());
- MatchEntries entry19 = entries.get(19);
+ ((SctpDstCase) entry18.getMatchEntryValue()).getSctpDst().getPort().getValue().intValue());
+ MatchEntry entry19 = entries.get(19);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry19.getOxmClass());
Assert.assertEquals("Wrong entry field", Icmpv4Type.class, entry19.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry19.isHasMask());
Assert.assertEquals("Wrong entry value", 5,
- entry19.getAugmentation(Icmpv4TypeMatchEntry.class).getIcmpv4Type().intValue());
- MatchEntries entry20 = entries.get(20);
+ ((Icmpv4TypeCase) entry19.getMatchEntryValue()).getIcmpv4Type().getIcmpv4Type().intValue());
+ MatchEntry entry20 = entries.get(20);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry20.getOxmClass());
Assert.assertEquals("Wrong entry field", Icmpv4Code.class, entry20.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry20.isHasMask());
Assert.assertEquals("Wrong entry value", 7,
- entry20.getAugmentation(Icmpv4CodeMatchEntry.class).getIcmpv4Code().intValue());
- MatchEntries entry21 = entries.get(21);
+ ((Icmpv4CodeCase) entry20.getMatchEntryValue()).getIcmpv4Code().getIcmpv4Code().intValue());
+ MatchEntry entry21 = entries.get(21);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry21.getOxmClass());
Assert.assertEquals("Wrong entry field", ArpOp.class, entry21.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry21.isHasMask());
Assert.assertEquals("Wrong entry value", 16,
- entry21.getAugmentation(OpCodeMatchEntry.class).getOpCode().intValue());
- MatchEntries entry22 = entries.get(22);
+ ((ArpOpCase) entry21.getMatchEntryValue()).getArpOp().getOpCode().intValue());
+ MatchEntry entry22 = entries.get(22);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry22.getOxmClass());
Assert.assertEquals("Wrong entry field", ArpSpa.class, entry22.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry22.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.9"),
- entry22.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address());
+ ((ArpSpaCase) entry22.getMatchEntryValue()).getArpSpa().getIpv4Address());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 FF 00"),
- entry22.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry23 = entries.get(23);
+ ((ArpSpaCase) entry22.getMatchEntryValue()).getArpSpa().getMask());
+ MatchEntry entry23 = entries.get(23);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry23.getOxmClass());
Assert.assertEquals("Wrong entry field", ArpTpa.class, entry23.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry23.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv4Address("10.0.0.10"),
- entry23.getAugmentation(Ipv4AddressMatchEntry.class).getIpv4Address());
+ ((ArpTpaCase) entry23.getMatchEntryValue()).getArpTpa().getIpv4Address());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 FF"),
- entry23.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry24 = entries.get(24);
+ ((ArpTpaCase) entry23.getMatchEntryValue()).getArpTpa().getMask());
+ MatchEntry entry24 = entries.get(24);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry24.getOxmClass());
Assert.assertEquals("Wrong entry field", ArpSha.class, entry24.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry24.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:01"),
- entry24.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
+ ((ArpShaCase) entry24.getMatchEntryValue()).getArpSha().getMacAddress());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 03"),
- entry24.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry25 = entries.get(25);
+ ((ArpShaCase) entry24.getMatchEntryValue()).getArpSha().getMask());
+ MatchEntry entry25 = entries.get(25);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry25.getOxmClass());
Assert.assertEquals("Wrong entry field", ArpTha.class, entry25.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry25.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:00:00:00:00:02"),
- entry25.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
+ ((ArpThaCase) entry25.getMatchEntryValue()).getArpTha().getMacAddress());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 04"),
- entry25.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry26 = entries.get(26);
+ ((ArpThaCase) entry25.getMatchEntryValue()).getArpTha().getMask());
+ MatchEntry entry26 = entries.get(26);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry26.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Src.class, entry26.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry26.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0015"),
- entry26.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address());
+ ((Ipv6SrcCase) entry26.getMatchEntryValue()).getIpv6Src().getIpv6Address());
Assert.assertArrayEquals("Wrong entry mask",
ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16"),
- entry26.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry27 = entries.get(27);
+ ((Ipv6SrcCase) entry26.getMatchEntryValue()).getIpv6Src().getMask());
+ MatchEntry entry27 = entries.get(27);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry27.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Dst.class, entry27.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry27.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0017"),
- entry27.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address());
+ ((Ipv6DstCase) entry27.getMatchEntryValue()).getIpv6Dst().getIpv6Address());
Assert.assertArrayEquals("Wrong entry mask",
ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18"),
- entry27.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry28 = entries.get(28);
+ ((Ipv6DstCase) entry27.getMatchEntryValue()).getIpv6Dst().getMask());
+ MatchEntry entry28 = entries.get(28);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry28.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Flabel.class, entry28.getOxmMatchField());
- Assert.assertEquals("Wrong entry hasMask", true, entry28.isHasMask());
+ Assert.assertEquals("Wrong entry hasMask", false, entry28.isHasMask());
Assert.assertEquals("Wrong entry value", 2,
- entry28.getAugmentation(Ipv6FlabelMatchEntry.class).getIpv6Flabel().getValue().intValue());
- Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 03"),
- entry28.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry29 = entries.get(29);
+ ((Ipv6FlabelCase) entry28.getMatchEntryValue()).getIpv6Flabel().getIpv6Flabel()
+ .getValue().intValue());
+ MatchEntry entry29 = entries.get(29);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry29.getOxmClass());
Assert.assertEquals("Wrong entry field", Icmpv6Type.class, entry29.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry29.isHasMask());
Assert.assertEquals("Wrong entry value", 21,
- entry29.getAugmentation(Icmpv6TypeMatchEntry.class).getIcmpv6Type().intValue());
- MatchEntries entry30 = entries.get(30);
+ ((Icmpv6TypeCase) entry29.getMatchEntryValue()).getIcmpv6Type().getIcmpv6Type().intValue());
+ MatchEntry entry30 = entries.get(30);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry30.getOxmClass());
Assert.assertEquals("Wrong entry field", Icmpv6Code.class, entry30.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry30.isHasMask());
Assert.assertEquals("Wrong entry value", 23,
- entry30.getAugmentation(Icmpv6CodeMatchEntry.class).getIcmpv6Code().intValue());
- MatchEntries entry31 = entries.get(31);
+ ((Icmpv6CodeCase) entry30.getMatchEntryValue()).getIcmpv6Code().getIcmpv6Code().intValue());
+ MatchEntry entry31 = entries.get(31);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry31.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6NdTarget.class, entry31.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry31.isHasMask());
Assert.assertEquals("Wrong entry value", new Ipv6Address("0000:0000:0000:0000:0000:0000:0000:0020"),
- entry31.getAugmentation(Ipv6AddressMatchEntry.class).getIpv6Address());
- MatchEntries entry32 = entries.get(32);
+ ((Ipv6NdTargetCase) entry31.getMatchEntryValue()).getIpv6NdTarget().getIpv6Address());
+ MatchEntry entry32 = entries.get(32);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry32.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6NdSll.class, entry32.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry32.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:05:00:00:00:01"),
- entry32.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
- MatchEntries entry33 = entries.get(33);
+ ((Ipv6NdSllCase) entry32.getMatchEntryValue()).getIpv6NdSll().getMacAddress());
+ MatchEntry entry33 = entries.get(33);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry33.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6NdTll.class, entry33.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry33.isHasMask());
Assert.assertEquals("Wrong entry value", new MacAddress("00:05:00:00:00:02"),
- entry33.getAugmentation(MacAddressMatchEntry.class).getMacAddress());
- MatchEntries entry34 = entries.get(34);
+ ((Ipv6NdTllCase) entry33.getMatchEntryValue()).getIpv6NdTll().getMacAddress());
+ MatchEntry entry34 = entries.get(34);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry34.getOxmClass());
Assert.assertEquals("Wrong entry field", MplsLabel.class, entry34.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry34.isHasMask());
Assert.assertEquals("Wrong entry value", 515,
- entry34.getAugmentation(MplsLabelMatchEntry.class).getMplsLabel().intValue());
- MatchEntries entry35 = entries.get(35);
+ ((MplsLabelCase) entry34.getMatchEntryValue()).getMplsLabel().getMplsLabel().intValue());
+ MatchEntry entry35 = entries.get(35);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry35.getOxmClass());
Assert.assertEquals("Wrong entry field", MplsTc.class, entry35.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry35.isHasMask());
Assert.assertEquals("Wrong entry value", 3,
- entry35.getAugmentation(TcMatchEntry.class).getTc().intValue());
- MatchEntries entry36 = entries.get(36);
+ ((MplsTcCase) entry35.getMatchEntryValue()).getMplsTc().getTc().intValue());
+ MatchEntry entry36 = entries.get(36);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry36.getOxmClass());
Assert.assertEquals("Wrong entry field", MplsBos.class, entry36.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry36.isHasMask());
Assert.assertEquals("Wrong entry value", true,
- entry36.getAugmentation(BosMatchEntry.class).isBos());
- MatchEntries entry37 = entries.get(37);
+ ((MplsBosCase) entry36.getMatchEntryValue()).getMplsBos().isBos());
+ MatchEntry entry37 = entries.get(37);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry37.getOxmClass());
Assert.assertEquals("Wrong entry field", PbbIsid.class, entry37.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry37.isHasMask());
Assert.assertEquals("Wrong entry value", 2,
- entry37.getAugmentation(IsidMatchEntry.class).getIsid().intValue());
+ ((PbbIsidCase) entry37.getMatchEntryValue()).getPbbIsid().getIsid().intValue());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 01"),
- entry37.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry38 = entries.get(38);
+ ((PbbIsidCase) entry37.getMatchEntryValue()).getPbbIsid().getMask());
+ MatchEntry entry38 = entries.get(38);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry38.getOxmClass());
Assert.assertEquals("Wrong entry field", TunnelId.class, entry38.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry38.isHasMask());
Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 07"),
- entry38.getAugmentation(MetadataMatchEntry.class).getMetadata());
+ ((TunnelIdCase) entry38.getMatchEntryValue()).getTunnelId().getTunnelId());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 FF"),
- entry38.getAugmentation(MaskMatchEntry.class).getMask());
- MatchEntries entry39 = entries.get(39);
+ ((TunnelIdCase) entry38.getMatchEntryValue()).getTunnelId().getMask());
+ MatchEntry entry39 = entries.get(39);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry39.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv6Exthdr.class, entry39.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", true, entry39.isHasMask());
Assert.assertEquals("Wrong entry value",
new Ipv6ExthdrFlags(false, false, false, false, false, false, false, false, false),
- entry39.getAugmentation(PseudoFieldMatchEntry.class).getPseudoField());
+ ((Ipv6ExthdrCase) entry39.getMatchEntryValue()).getIpv6Exthdr().getPseudoField());
Assert.assertArrayEquals("Wrong entry mask", ByteBufUtils.hexStringToBytes("03 04"),
- entry39.getAugmentation(MaskMatchEntry.class).getMask());
+ ((Ipv6ExthdrCase) entry39.getMatchEntryValue()).getIpv6Exthdr().getMask());
Assert.assertTrue("Unread data", buffer.readableBytes() == 0);
}
MatchEntryDeserializerKey key = new MatchEntryDeserializerKey(EncodeConstants.OF13_VERSION_ID,
0x8000, 12);
key.setExperimenterId(null);
- HeaderDeserializer<MatchEntries> entryDeserializer = registry.getDeserializer(key);
- MatchEntries entry = entryDeserializer.deserializeHeader(buffer);
+ HeaderDeserializer<MatchEntry> entryDeserializer = registry.getDeserializer(key);
+ MatchEntry entry = entryDeserializer.deserializeHeader(buffer);
Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
Assert.assertEquals("Wrong entry field", Ipv4Dst.class, entry.getOxmMatchField());
Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
- Assert.assertEquals("Wrong Ipv4 address", null, entry.getAugmentation(Ipv4AddressMatchEntry.class));
+ Assert.assertNull("Wrong Ipv4 address", entry.getMatchEntryValue());
}
/**
Match match = matchDeserializer.deserialize(buffer);
Assert.assertEquals("Wrong match type", StandardMatchType.class, match.getType());
- Assert.assertEquals("Wrong match entries size", 1, match.getMatchEntries().size());
+ Assert.assertEquals("Wrong match entries size", 1, match.getMatchEntry().size());
}
}
\ No newline at end of file
import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl;
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
import org.opendaylight.openflowjava.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DlAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IpAddressActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTosActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.DlAddressActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.IpAddressActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTosActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanPcpActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.VlanVidActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Enqueue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetDlDst;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
/**
* @author michal.polkorab
import io.netty.buffer.ByteBuf;
import io.netty.buffer.UnpooledByteBufAllocator;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.v10.grouping.MatchV10Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10Builder;
/**
* @author michal.polkorab
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.GroupIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OxmFieldsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.GroupIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MplsTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmFieldsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.QueueIdActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlIn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.CopyTtlOut;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.DecMplsTtl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
/**
* @author michal.polkorab
actionBuilder = new ActionBuilder();
actionBuilder.setType(SetField.class);
OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder matchBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
matchBuilder.setOxmMatchField(InPort.class);
matchBuilder.setHasMask(false);
- PortNumberMatchEntryBuilder portBuilder = new PortNumberMatchEntryBuilder();
- portBuilder.setPortNumber(new PortNumber(1L));
- matchBuilder.addAugmentation(PortNumberMatchEntry.class, portBuilder.build());
+ InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
+ InPortBuilder inPortBuilder = new InPortBuilder();
+ inPortBuilder.setPortNumber(new PortNumber(1L));
+ inPortCaseBuilder.setInPort(inPortBuilder.build());
+ matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
entries.add(matchBuilder.build());
- matchEntries.setMatchEntries(entries);
+ matchEntries.setMatchEntry(entries);
actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder = new ActionBuilder();
actionBuilder.setType(SetField.class);
OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder matchBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
matchBuilder.setOxmMatchField(InPort.class);
matchBuilder.setHasMask(false);
- PortNumberMatchEntryBuilder portBuilder = new PortNumberMatchEntryBuilder();
- portBuilder.setPortNumber(new PortNumber(1L));
- matchBuilder.addAugmentation(PortNumberMatchEntry.class, portBuilder.build());
+ InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
+ InPortBuilder inPortBuilder = new InPortBuilder();
+ inPortBuilder.setPortNumber(new PortNumber(1L));
+ inPortCaseBuilder.setInPort(inPortBuilder.build());
+ matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
entries.add(matchBuilder.build());
- matchEntries.setMatchEntries(entries);
+ matchEntries.setMatchEntry(entries);
actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
actions.add(actionBuilder.build());
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl;
import org.opendaylight.openflowjava.util.ByteBufUtils;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthertypeActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaxLengthActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.NwTtlActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ActionsInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.EthertypeActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MaxLengthActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MetadataInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.MeterIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.NwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.PortActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.TableIdInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6FlowLabel;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.BosMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.DscpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EcnMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.EthTypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv4TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6CodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Icmpv6TypeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.IsidMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MacAddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MetadataMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MplsLabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.OpCodeMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ProtocolNumberMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PseudoFieldMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TcMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidMatchEntryBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Ipv6ExthdrFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpOp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpSpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTha;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ArpTpa;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.EthType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv4Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Code;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Icmpv6Type;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPhyPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpDscp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpEcn;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.IpProto;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Exthdr;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdSll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTarget;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTll;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Metadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsBos;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MplsTc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.PbbIsid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.SctpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TcpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.TunnelId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpDst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpOp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpSpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTha;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ArpTpa;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv4Type;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Code;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Icmpv6Type;
+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.IpDscp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpEcn;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpProto;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Exthdr;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdSll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTll;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Metadata;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsBos;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MplsTc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.PbbIsid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.SctpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TunnelId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpDst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.UdpSrc;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpOpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpShaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpSpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpThaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ArpTpaCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthTypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6TypeCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPhyPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpEcnCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpProtoCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6ExthdrCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdSllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTargetCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTllCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsBosCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsTcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.op._case.ArpOpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.sha._case.ArpShaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.spa._case.ArpSpaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tha._case.ArpThaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.arp.tpa._case.ArpTpaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.dst._case.EthDstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.type._case.EthTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.type._case.Icmpv6TypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.phy.port._case.InPhyPortBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.dscp._case.IpDscpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.ecn._case.IpEcnBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ip.proto._case.IpProtoBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.dst._case.Ipv4DstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.src._case.Ipv4SrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.dst._case.Ipv6DstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.exthdr._case.Ipv6ExthdrBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.flabel._case.Ipv6FlabelBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.sll._case.Ipv6NdSllBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.target._case.Ipv6NdTargetBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTllBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.src._case.Ipv6SrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.metadata._case.MetadataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.bos._case.MplsBosBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.label._case.MplsLabelBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.mpls.tc._case.MplsTcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.pbb.isid._case.PbbIsidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.dst._case.SctpDstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.sctp.src._case.SctpSrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.dst._case.TcpDstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tcp.src._case.TcpSrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tunnel.id._case.TunnelIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.dst._case.UdpDstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.udp.src._case.UdpSrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.pcp._case.VlanPcpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
/**
* @author michal.polkorab
public void test() {
MatchBuilder builder = new MatchBuilder();
builder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder entryBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(InPort.class);
entryBuilder.setHasMask(false);
- PortNumberMatchEntryBuilder portNumberBuilder = new PortNumberMatchEntryBuilder();
- portNumberBuilder.setPortNumber(new PortNumber(42L));
- entryBuilder.addAugmentation(PortNumberMatchEntry.class, portNumberBuilder.build());
+ InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
+ InPortBuilder inPortBuilder = new InPortBuilder();
+ inPortBuilder.setPortNumber(new PortNumber(42L));
+ inPortCaseBuilder.setInPort(inPortBuilder.build());
+ entryBuilder.setMatchEntryValue(inPortCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(InPhyPort.class);
entryBuilder.setHasMask(false);
- portNumberBuilder = new PortNumberMatchEntryBuilder();
- portNumberBuilder.setPortNumber(new PortNumber(43L));
- entryBuilder.addAugmentation(PortNumberMatchEntry.class, portNumberBuilder.build());
+ InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
+ InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
+ inPhyPortBuilder.setPortNumber(new PortNumber(43L));
+ inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
+ entryBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Metadata.class);
entryBuilder.setHasMask(true);
- MetadataMatchEntryBuilder metadataBuilder = new MetadataMatchEntryBuilder();
+ MetadataCaseBuilder metaCaseBuilder = new MetadataCaseBuilder();
+ MetadataBuilder metadataBuilder = new MetadataBuilder();
metadataBuilder.setMetadata(new byte[]{0,0,0,0,0,0,0,1});
- entryBuilder.addAugmentation(MetadataMatchEntry.class, metadataBuilder.build());
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,0,0,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ metadataBuilder.setMask(new byte[]{0,0,0,0,0,0,0,2});
+ metaCaseBuilder.setMetadata(metadataBuilder.build());
+ entryBuilder.setMatchEntryValue(metaCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(EthDst.class);
entryBuilder.setHasMask(true);
- MacAddressMatchEntryBuilder macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("01:00:03:00:00:06"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,5});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ EthDstCaseBuilder ethDstCaseBuilder = new EthDstCaseBuilder();
+ EthDstBuilder ethDstBuilder = new EthDstBuilder();
+ ethDstBuilder.setMacAddress(new MacAddress("01:00:03:00:00:06"));
+ ethDstBuilder.setMask(new byte[]{0,0,0,0,0,5});
+ ethDstCaseBuilder.setEthDst(ethDstBuilder.build());
+ entryBuilder.setMatchEntryValue(ethDstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(EthSrc.class);
entryBuilder.setHasMask(true);
- macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("04:00:02:00:00:08"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ EthSrcCaseBuilder ethSrcCaseBuilder = new EthSrcCaseBuilder();
+ EthSrcBuilder ethSrcBuilder = new EthSrcBuilder();
+ ethSrcBuilder.setMacAddress(new MacAddress("04:00:02:00:00:08"));
+ ethSrcBuilder.setMask(new byte[]{0,0,0,0,0,2});
+ ethSrcCaseBuilder.setEthSrc(ethSrcBuilder.build());
+ entryBuilder.setMatchEntryValue(ethSrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(EthType.class);
entryBuilder.setHasMask(false);
- EthTypeMatchEntryBuilder ethBuilder = new EthTypeMatchEntryBuilder();
- ethBuilder.setEthType(new EtherType(46));
- entryBuilder.addAugmentation(EthTypeMatchEntry.class, ethBuilder.build());
+ EthTypeCaseBuilder ethTypeCaseBuilder = new EthTypeCaseBuilder();
+ EthTypeBuilder ethTypeBuilder = new EthTypeBuilder();
+ ethTypeBuilder.setEthType(new EtherType(46));
+ ethTypeCaseBuilder.setEthType(ethTypeBuilder.build());
+ entryBuilder.setMatchEntryValue(ethTypeCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(VlanVid.class);
entryBuilder.setHasMask(true);
- VlanVidMatchEntryBuilder vidBuilder = new VlanVidMatchEntryBuilder();
- vidBuilder.setCfiBit(true);
- vidBuilder.setVlanVid(45);
- entryBuilder.addAugmentation(VlanVidMatchEntry.class, vidBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,9});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ VlanVidCaseBuilder vlanVidCaseBuilder = new VlanVidCaseBuilder();
+ VlanVidBuilder vlanVidBuilder = new VlanVidBuilder();
+ vlanVidBuilder.setVlanVid(45);
+ vlanVidBuilder.setCfiBit(true);
+ vlanVidBuilder.setMask(new byte[]{0,9});
+ vlanVidCaseBuilder.setVlanVid(vlanVidBuilder.build());
+ entryBuilder.setMatchEntryValue(vlanVidCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(VlanPcp.class);
entryBuilder.setHasMask(false);
- VlanPcpMatchEntryBuilder pcpBuilder = new VlanPcpMatchEntryBuilder();
- pcpBuilder.setVlanPcp((short) 14);
- entryBuilder.addAugmentation(VlanPcpMatchEntry.class, pcpBuilder.build());
+ VlanPcpCaseBuilder vlanPcpCaseBuilder = new VlanPcpCaseBuilder();
+ VlanPcpBuilder vlanPcpBuilder = new VlanPcpBuilder();
+ vlanPcpBuilder.setVlanPcp((short) 14);
+ vlanPcpCaseBuilder.setVlanPcp(vlanPcpBuilder.build());
+ entryBuilder.setMatchEntryValue(vlanPcpCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(IpDscp.class);
entryBuilder.setHasMask(false);
- DscpMatchEntryBuilder dscpBuilder = new DscpMatchEntryBuilder();
- dscpBuilder.setDscp(new Dscp((short) 48));
- entryBuilder.addAugmentation(DscpMatchEntry.class, dscpBuilder.build());
+ IpDscpCaseBuilder ipDscpCaseBuilder = new IpDscpCaseBuilder();
+ IpDscpBuilder ipDscpBuilder = new IpDscpBuilder();
+ ipDscpBuilder.setDscp(new Dscp((short) 48));
+ ipDscpCaseBuilder.setIpDscp(ipDscpBuilder.build());
+ entryBuilder.setMatchEntryValue(ipDscpCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(IpEcn.class);
entryBuilder.setHasMask(false);
- EcnMatchEntryBuilder ecnBuilder = new EcnMatchEntryBuilder();
- ecnBuilder.setEcn((short) 49);
- entryBuilder.addAugmentation(EcnMatchEntry.class, ecnBuilder.build());
+ IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
+ IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
+ ipEcnBuilder.setEcn((short) 49);
+ ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
+ entryBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(IpProto.class);
entryBuilder.setHasMask(false);
- ProtocolNumberMatchEntryBuilder protoBuilder = new ProtocolNumberMatchEntryBuilder();
- protoBuilder.setProtocolNumber((short) 50);
- entryBuilder.addAugmentation(ProtocolNumberMatchEntry.class, protoBuilder.build());
+ IpProtoCaseBuilder ipProtoCaseBuilder = new IpProtoCaseBuilder();
+ IpProtoBuilder ipProtoBuilder = new IpProtoBuilder();
+ ipProtoBuilder.setProtocolNumber((short) 50);
+ ipProtoCaseBuilder.setIpProto(ipProtoBuilder.build());
+ entryBuilder.setMatchEntryValue(ipProtoCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv4Src.class);
entryBuilder.setHasMask(true);
- Ipv4AddressMatchEntryBuilder ipv4Builder = new Ipv4AddressMatchEntryBuilder();
- ipv4Builder.setIpv4Address(new Ipv4Address("10.0.0.1"));
- entryBuilder.addAugmentation(Ipv4AddressMatchEntry.class, ipv4Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,14});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv4SrcCaseBuilder ipv4SrcCaseBuilder = new Ipv4SrcCaseBuilder();
+ Ipv4SrcBuilder ipv4SrcBuilder = new Ipv4SrcBuilder();
+ ipv4SrcBuilder.setIpv4Address(new Ipv4Address("10.0.0.1"));
+ ipv4SrcBuilder.setMask(new byte[]{0,0,0,14});
+ ipv4SrcCaseBuilder.setIpv4Src(ipv4SrcBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv4SrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv4Dst.class);
entryBuilder.setHasMask(true);
- ipv4Builder = new Ipv4AddressMatchEntryBuilder();
- ipv4Builder.setIpv4Address(new Ipv4Address("10.0.0.2"));
- entryBuilder.addAugmentation(Ipv4AddressMatchEntry.class, ipv4Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,15});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv4DstCaseBuilder ipv4DstCaseBuilder = new Ipv4DstCaseBuilder();
+ Ipv4DstBuilder ipv4DstBuilder = new Ipv4DstBuilder();
+ ipv4DstBuilder.setIpv4Address(new Ipv4Address("10.0.0.2"));
+ ipv4DstBuilder.setMask(new byte[]{0,0,0,15});
+ ipv4DstCaseBuilder.setIpv4Dst(ipv4DstBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv4DstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(TcpSrc.class);
entryBuilder.setHasMask(false);
- PortMatchEntryBuilder portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ TcpSrcCaseBuilder tcpSrcCaseBuilder = new TcpSrcCaseBuilder();
+ TcpSrcBuilder tcpSrcBuilder = new TcpSrcBuilder();
+ tcpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6653));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ tcpSrcCaseBuilder.setTcpSrc(tcpSrcBuilder.build());
+ entryBuilder.setMatchEntryValue(tcpSrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(TcpDst.class);
entryBuilder.setHasMask(false);
- portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ TcpDstCaseBuilder tcpDstCaseBuilder = new TcpDstCaseBuilder();
+ TcpDstBuilder tcpDstBuilder = new TcpDstBuilder();
+ tcpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6654));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ tcpDstCaseBuilder.setTcpDst(tcpDstBuilder.build());
+ entryBuilder.setMatchEntryValue(tcpDstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(UdpSrc.class);
entryBuilder.setHasMask(false);
- portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ UdpSrcCaseBuilder udpSrcCaseBuilder = new UdpSrcCaseBuilder();
+ UdpSrcBuilder udpSrcBuilder = new UdpSrcBuilder();
+ udpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6655));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ udpSrcCaseBuilder.setUdpSrc(udpSrcBuilder.build());
+ entryBuilder.setMatchEntryValue(udpSrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(UdpDst.class);
entryBuilder.setHasMask(false);
- portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ UdpDstCaseBuilder udpDstCaseBuilder = new UdpDstCaseBuilder();
+ UdpDstBuilder udpDstBuilder = new UdpDstBuilder();
+ udpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6656));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ udpDstCaseBuilder.setUdpDst(udpDstBuilder.build());
+ entryBuilder.setMatchEntryValue(udpDstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(SctpSrc.class);
entryBuilder.setHasMask(false);
- portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ SctpSrcCaseBuilder sctpSrcCaseBuilder = new SctpSrcCaseBuilder();
+ SctpSrcBuilder sctpSrcBuilder = new SctpSrcBuilder();
+ sctpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6657));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ sctpSrcCaseBuilder.setSctpSrc(sctpSrcBuilder.build());
+ entryBuilder.setMatchEntryValue(sctpSrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(SctpDst.class);
entryBuilder.setHasMask(false);
- portBuilder = new PortMatchEntryBuilder();
- portBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
+ SctpDstCaseBuilder sctpDstCaseBuilder = new SctpDstCaseBuilder();
+ SctpDstBuilder sctpDstBuilder = new SctpDstBuilder();
+ sctpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.inet.types.rev100924.PortNumber(6658));
- entryBuilder.addAugmentation(PortMatchEntry.class, portBuilder.build());
+ sctpDstCaseBuilder.setSctpDst(sctpDstBuilder.build());
+ entryBuilder.setMatchEntryValue(sctpDstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Icmpv4Type.class);
entryBuilder.setHasMask(false);
- Icmpv4TypeMatchEntryBuilder icmpv4typeBuilder = new Icmpv4TypeMatchEntryBuilder();
- icmpv4typeBuilder.setIcmpv4Type((short) 51);
- entryBuilder.addAugmentation(Icmpv4TypeMatchEntry.class, icmpv4typeBuilder.build());
+ Icmpv4TypeCaseBuilder icmpv4TypeCaseBuilder = new Icmpv4TypeCaseBuilder();
+ Icmpv4TypeBuilder icmpv4TypeBuilder = new Icmpv4TypeBuilder();
+ icmpv4TypeBuilder.setIcmpv4Type((short) 51);
+ icmpv4TypeCaseBuilder.setIcmpv4Type(icmpv4TypeBuilder.build());
+ entryBuilder.setMatchEntryValue(icmpv4TypeCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Icmpv4Code.class);
entryBuilder.setHasMask(false);
- Icmpv4CodeMatchEntryBuilder icmpv4CodeBuilder = new Icmpv4CodeMatchEntryBuilder();
+ Icmpv4CodeCaseBuilder icmpv4CodeCaseBuilder = new Icmpv4CodeCaseBuilder();
+ Icmpv4CodeBuilder icmpv4CodeBuilder = new Icmpv4CodeBuilder();
icmpv4CodeBuilder.setIcmpv4Code((short) 52);
- entryBuilder.addAugmentation(Icmpv4CodeMatchEntry.class, icmpv4CodeBuilder.build());
+ icmpv4CodeCaseBuilder.setIcmpv4Code(icmpv4CodeBuilder.build());
+ entryBuilder.setMatchEntryValue(icmpv4CodeCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(ArpOp.class);
entryBuilder.setHasMask(false);
- OpCodeMatchEntryBuilder opBuilder = new OpCodeMatchEntryBuilder();
- opBuilder.setOpCode(53);
- entryBuilder.addAugmentation(OpCodeMatchEntry.class, opBuilder.build());
+ ArpOpCaseBuilder arpOpCaseBuilder = new ArpOpCaseBuilder();
+ ArpOpBuilder arpOpBuilder = new ArpOpBuilder();
+ arpOpBuilder.setOpCode(53);
+ arpOpCaseBuilder.setArpOp(arpOpBuilder.build());
+ entryBuilder.setMatchEntryValue(arpOpCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(ArpSpa.class);
entryBuilder.setHasMask(true);
- ipv4Builder = new Ipv4AddressMatchEntryBuilder();
- ipv4Builder.setIpv4Address(new Ipv4Address("10.0.0.4"));
- entryBuilder.addAugmentation(Ipv4AddressMatchEntry.class, ipv4Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,16});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ ArpSpaCaseBuilder arpSpaCaseBuilder = new ArpSpaCaseBuilder();
+ ArpSpaBuilder arpSpaBuilder = new ArpSpaBuilder();
+ arpSpaBuilder.setIpv4Address(new Ipv4Address("10.0.0.4"));
+ arpSpaBuilder.setMask(new byte[]{0,0,0,16});
+ arpSpaCaseBuilder.setArpSpa(arpSpaBuilder.build());
+ entryBuilder.setMatchEntryValue(arpSpaCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(ArpTpa.class);
entryBuilder.setHasMask(true);
- ipv4Builder = new Ipv4AddressMatchEntryBuilder();
- ipv4Builder.setIpv4Address(new Ipv4Address("10.0.0.5"));
- entryBuilder.addAugmentation(Ipv4AddressMatchEntry.class, ipv4Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,17});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ ArpTpaCaseBuilder arpTpaCaseBuilder = new ArpTpaCaseBuilder();
+ ArpTpaBuilder arpTpaBuilder = new ArpTpaBuilder();
+ arpTpaBuilder.setIpv4Address(new Ipv4Address("10.0.0.5"));
+ arpTpaBuilder.setMask(new byte[]{0,0,0,17});
+ arpTpaCaseBuilder.setArpTpa(arpTpaBuilder.build());
+ entryBuilder.setMatchEntryValue(arpTpaCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(ArpSha.class);
entryBuilder.setHasMask(true);
- macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("00:01:02:03:04:05"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,4,0,0,6});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ ArpShaCaseBuilder arpShaCaseBuilder = new ArpShaCaseBuilder();
+ ArpShaBuilder arpShaBuilder = new ArpShaBuilder();
+ arpShaBuilder.setMacAddress(new MacAddress("00:01:02:03:04:05"));
+ arpShaBuilder.setMask(new byte[]{0,0,4,0,0,6});
+ arpShaCaseBuilder.setArpSha(arpShaBuilder.build());
+ entryBuilder.setMatchEntryValue(arpShaCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(ArpTha.class);
entryBuilder.setHasMask(true);
- macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("00:00:00:00:00:03"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,6,0,0,4});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ ArpThaCaseBuilder arpThaCaseBuilder = new ArpThaCaseBuilder();
+ ArpThaBuilder arpThaBuilder = new ArpThaBuilder();
+ arpThaBuilder.setMacAddress(new MacAddress("00:00:00:00:00:03"));
+ arpThaBuilder.setMask(new byte[]{0,0,6,0,0,4});
+ arpThaCaseBuilder.setArpTha(arpThaBuilder.build());
+ entryBuilder.setMatchEntryValue(arpThaCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6Src.class);
entryBuilder.setHasMask(true);
- Ipv6AddressMatchEntryBuilder ipv6Builder = new Ipv6AddressMatchEntryBuilder();
- ipv6Builder.setIpv6Address(new Ipv6Address("0:0:0:0:0:0:0:1"));
- entryBuilder.addAugmentation(Ipv6AddressMatchEntry.class, ipv6Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv6SrcCaseBuilder ipv6SrcCaseBuilder = new Ipv6SrcCaseBuilder();
+ Ipv6SrcBuilder ipv6SrcBuilder = new Ipv6SrcBuilder();
+ ipv6SrcBuilder.setIpv6Address(new Ipv6Address("0:0:0:0:0:0:0:1"));
+ ipv6SrcBuilder.setMask(new byte[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1});
+ ipv6SrcCaseBuilder.setIpv6Src(ipv6SrcBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6SrcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6Dst.class);
entryBuilder.setHasMask(true);
- ipv6Builder = new Ipv6AddressMatchEntryBuilder();
- ipv6Builder.setIpv6Address(new Ipv6Address("0:0:1:0:1:0:0:1"));
- entryBuilder.addAugmentation(Ipv6AddressMatchEntry.class, ipv6Builder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv6DstCaseBuilder ipv6DstCaseBuilder = new Ipv6DstCaseBuilder();
+ Ipv6DstBuilder ipv6DstBuilder = new Ipv6DstBuilder();
+ ipv6DstBuilder.setIpv6Address(new Ipv6Address("0:0:1:0:1:0:0:1"));
+ ipv6DstBuilder.setMask(new byte[]{0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1});
+ ipv6DstCaseBuilder.setIpv6Dst(ipv6DstBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6DstCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6Flabel.class);
- entryBuilder.setHasMask(true);
- Ipv6FlabelMatchEntryBuilder flabelBuilder = new Ipv6FlabelMatchEntryBuilder();
- flabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(58L));
- entryBuilder.addAugmentation(Ipv6FlabelMatchEntry.class, flabelBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,1,0,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ entryBuilder.setHasMask(false);
+ Ipv6FlabelCaseBuilder ipv6FlabelCaseBuilder = new Ipv6FlabelCaseBuilder();
+ Ipv6FlabelBuilder ipv6FlabelBuilder = new Ipv6FlabelBuilder();
+ ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(58L));
+ ipv6FlabelCaseBuilder.setIpv6Flabel(ipv6FlabelBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6FlabelCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Icmpv6Type.class);
entryBuilder.setHasMask(false);
- Icmpv6TypeMatchEntryBuilder icmpv6TypeBuilder = new Icmpv6TypeMatchEntryBuilder();
+ Icmpv6TypeCaseBuilder icmpv6TypeCaseBuilder = new Icmpv6TypeCaseBuilder();
+ Icmpv6TypeBuilder icmpv6TypeBuilder = new Icmpv6TypeBuilder();
icmpv6TypeBuilder.setIcmpv6Type((short) 59);
- entryBuilder.addAugmentation(Icmpv6TypeMatchEntry.class, icmpv6TypeBuilder.build());
+ icmpv6TypeCaseBuilder.setIcmpv6Type(icmpv6TypeBuilder.build());
+ entryBuilder.setMatchEntryValue(icmpv6TypeCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Icmpv6Code.class);
entryBuilder.setHasMask(false);
- Icmpv6CodeMatchEntryBuilder icmpv6CodeBuilder = new Icmpv6CodeMatchEntryBuilder();
- icmpv6CodeBuilder.setIcmpv6Code((short) 60);
- entryBuilder.addAugmentation(Icmpv6CodeMatchEntry.class, icmpv6CodeBuilder.build());
+ Icmpv6CodeCaseBuilder Icmpv6CodeCaseBuilder = new Icmpv6CodeCaseBuilder();
+ Icmpv6CodeBuilder Icmpv6CodeBuilder = new Icmpv6CodeBuilder();
+ Icmpv6CodeBuilder.setIcmpv6Code((short) 60);
+ Icmpv6CodeCaseBuilder.setIcmpv6Code(Icmpv6CodeBuilder.build());
+ entryBuilder.setMatchEntryValue(Icmpv6CodeCaseBuilder.build());
entries.add(entryBuilder.build());
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6NdTarget.class);
entryBuilder.setHasMask(false);
- ipv6Builder = new Ipv6AddressMatchEntryBuilder();
- ipv6Builder.setIpv6Address(new Ipv6Address("F:0:0::0:0:0:1"));
- entryBuilder.addAugmentation(Ipv6AddressMatchEntry.class, ipv6Builder.build());
+ Ipv6NdTargetCaseBuilder ipv6NdTargetCaseBuilder = new Ipv6NdTargetCaseBuilder();
+ Ipv6NdTargetBuilder ipv6NdTargetBuilder = new Ipv6NdTargetBuilder();
+ ipv6NdTargetBuilder.setIpv6Address(new Ipv6Address("F:0:0::0:0:0:1"));
+ ipv6NdTargetCaseBuilder.setIpv6NdTarget(ipv6NdTargetBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6NdTargetCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6NdSll.class);
entryBuilder.setHasMask(false);
- macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("01:00:03:00:00:06"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ Ipv6NdSllCaseBuilder ipv6NdSllCaseBuilder = new Ipv6NdSllCaseBuilder();
+ Ipv6NdSllBuilder ipv6NdSllBuilder = new Ipv6NdSllBuilder();
+ ipv6NdSllBuilder.setMacAddress(new MacAddress("01:00:03:00:00:06"));
+ ipv6NdSllCaseBuilder.setIpv6NdSll(ipv6NdSllBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6NdSllCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6NdTll.class);
entryBuilder.setHasMask(false);
- macBuilder = new MacAddressMatchEntryBuilder();
- macBuilder.setMacAddress(new MacAddress("04:00:02:00:00:08"));
- entryBuilder.addAugmentation(MacAddressMatchEntry.class, macBuilder.build());
+ Ipv6NdTllCaseBuilder ipv6NdTllCaseBuilder = new Ipv6NdTllCaseBuilder();
+ Ipv6NdTllBuilder ipv6NdTllBuilder = new Ipv6NdTllBuilder();
+ ipv6NdTllBuilder.setMacAddress(new MacAddress("04:00:02:00:00:08"));
+ ipv6NdTllCaseBuilder.setIpv6NdTll(ipv6NdTllBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6NdTllCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(MplsLabel.class);
entryBuilder.setHasMask(false);
- MplsLabelMatchEntryBuilder labelBuilder = new MplsLabelMatchEntryBuilder();
- labelBuilder.setMplsLabel(61L);
- entryBuilder.addAugmentation(MplsLabelMatchEntry.class, labelBuilder.build());
+ MplsLabelCaseBuilder mplsLabelCaseBuilder = new MplsLabelCaseBuilder();
+ MplsLabelBuilder mplsLabelBuilder = new MplsLabelBuilder();
+ mplsLabelBuilder.setMplsLabel(61L);
+ mplsLabelCaseBuilder.setMplsLabel(mplsLabelBuilder.build());
+ entryBuilder.setMatchEntryValue(mplsLabelCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(MplsTc.class);
entryBuilder.setHasMask(false);
- TcMatchEntryBuilder tcBuilder = new TcMatchEntryBuilder();
- tcBuilder.setTc((short) 62);
- entryBuilder.addAugmentation(TcMatchEntry.class, tcBuilder.build());
+ MplsTcCaseBuilder MplsTcCaseBuilder = new MplsTcCaseBuilder();
+ MplsTcBuilder MplsTcBuilder = new MplsTcBuilder();
+ MplsTcBuilder.setTc((short) 62);
+ MplsTcCaseBuilder.setMplsTc(MplsTcBuilder.build());
+ entryBuilder.setMatchEntryValue(MplsTcCaseBuilder.build());
entries.add(entryBuilder.build());
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(MplsBos.class);
entryBuilder.setHasMask(false);
- BosMatchEntryBuilder bosBuilder = new BosMatchEntryBuilder();
- bosBuilder.setBos(true);
- entryBuilder.addAugmentation(BosMatchEntry.class, bosBuilder.build());
+ MplsBosCaseBuilder MplsBosCaseBuilder = new MplsBosCaseBuilder();
+ MplsBosBuilder MplsBosBuilder = new MplsBosBuilder();
+ MplsBosBuilder.setBos(true);
+ MplsBosCaseBuilder.setMplsBos(MplsBosBuilder.build());
+ entryBuilder.setMatchEntryValue(MplsBosCaseBuilder.build());
entries.add(entryBuilder.build());
-
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(PbbIsid.class);
entryBuilder.setHasMask(true);
- IsidMatchEntryBuilder isidBuilder = new IsidMatchEntryBuilder();
- isidBuilder.setIsid(64L);
- entryBuilder.addAugmentation(IsidMatchEntry.class, isidBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,1,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ PbbIsidCaseBuilder pbbIsidCaseBuilder = new PbbIsidCaseBuilder();
+ PbbIsidBuilder pbbIsidBuilder = new PbbIsidBuilder();
+ pbbIsidBuilder.setIsid(64L);
+ pbbIsidBuilder.setMask(new byte[]{0,1,2});
+ pbbIsidCaseBuilder.setPbbIsid(pbbIsidBuilder.build());
+ entryBuilder.setMatchEntryValue(pbbIsidCaseBuilder.build());
entries.add(entryBuilder.build());
-
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(TunnelId.class);
entryBuilder.setHasMask(true);
- metadataBuilder = new MetadataMatchEntryBuilder();
- metadataBuilder.setMetadata(new byte[]{0,0,0,0,0,0,0,1});
- entryBuilder.addAugmentation(MetadataMatchEntry.class, metadataBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,0,0,0,0,0,0,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ TunnelIdCaseBuilder tunnelIdCaseBuilder = new TunnelIdCaseBuilder();
+ TunnelIdBuilder tunnelIdBuilder = new TunnelIdBuilder();
+ tunnelIdBuilder.setTunnelId(new byte[]{0,0,0,0,0,0,0,1});
+ tunnelIdBuilder.setMask(new byte[]{0,0,0,0,0,0,0,2});
+ tunnelIdCaseBuilder.setTunnelId(tunnelIdBuilder.build());
+ entryBuilder.setMatchEntryValue(tunnelIdCaseBuilder.build());
entries.add(entryBuilder.build());
-
- entryBuilder = new MatchEntriesBuilder();
+ entryBuilder = new MatchEntryBuilder();
entryBuilder.setOxmClass(OpenflowBasicClass.class);
entryBuilder.setOxmMatchField(Ipv6Exthdr.class);
entryBuilder.setHasMask(true);
- PseudoFieldMatchEntryBuilder pseudoBuilder = new PseudoFieldMatchEntryBuilder();
- pseudoBuilder.setPseudoField(new Ipv6ExthdrFlags(true, false, true, false, true, false, true, false, true));
- entryBuilder.addAugmentation(PseudoFieldMatchEntry.class, pseudoBuilder.build());
- maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(new byte[]{0,2});
- entryBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv6ExthdrCaseBuilder ipv6ExthdrCaseBuilder = new Ipv6ExthdrCaseBuilder();
+ Ipv6ExthdrBuilder ipv6ExthdrBuilder = new Ipv6ExthdrBuilder();
+ ipv6ExthdrBuilder.setPseudoField(new Ipv6ExthdrFlags(true, false, true,
+ false, true, false, true, false, true));
+ ipv6ExthdrBuilder.setMask(new byte[]{0,2});
+ ipv6ExthdrCaseBuilder.setIpv6Exthdr(ipv6ExthdrBuilder.build());
+ entryBuilder.setMatchEntryValue(ipv6ExthdrCaseBuilder.build());
entries.add(entryBuilder.build());
-
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
Match match = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
matchSerializer.serialize(match, out);
Assert.assertEquals("Wrong match type", 1, out.readUnsignedShort());
- Assert.assertEquals("Wrong match length", 428, out.readUnsignedShort());
+ Assert.assertEquals("Wrong match length", 424, out.readUnsignedShort());
Assert.assertEquals("Wrong match entry class", 0x8000, out.readUnsignedShort());
Assert.assertEquals("Wrong match entry field & hasMask", 0, out.readUnsignedByte());
Assert.assertEquals("Wrong match entry length", 4, out.readUnsignedByte());
out.readBytes(array);
Assert.assertArrayEquals("Wrong match entry mask", new byte[]{0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1}, array);
Assert.assertEquals("Wrong match entry class", 0x8000, out.readUnsignedShort());
- Assert.assertEquals("Wrong match entry field & hasMask", 57, out.readUnsignedByte());
- Assert.assertEquals("Wrong match entry length", 8, out.readUnsignedByte());
+ Assert.assertEquals("Wrong match entry field & hasMask", 56, out.readUnsignedByte());
+ Assert.assertEquals("Wrong match entry length", 4, out.readUnsignedByte()); //8, out.readUnsignedByte());
Assert.assertEquals("Wrong match entry value", 58, out.readUnsignedInt());
- array = new byte[4];
- out.readBytes(array);
- Assert.assertArrayEquals("Wrong match entry mask", new byte[]{0,1,0,2}, array);
Assert.assertEquals("Wrong match entry class", 0x8000, out.readUnsignedShort());
Assert.assertEquals("Wrong match entry field & hasMask", 58, out.readUnsignedByte());
Assert.assertEquals("Wrong match entry length", 1, out.readUnsignedByte());
array = new byte[2];
out.readBytes(array);
Assert.assertArrayEquals("Wrong match entry value", new byte[]{0,2}, array);
- Assert.assertTrue("Wrong padding", out.readableBytes() == 4);
+ Assert.assertTrue("Wrong padding", out.readableBytes() == 0);
}
}
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6FlowLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv4AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6AddressMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.Ipv6FlabelMatchEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MaskMatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.StandardMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv4Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Dst;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Flabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6NdTarget;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Ipv6Src;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Flabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6NdTarget;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OxmMatchType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6FlabelCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6NdTargetCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv4.src._case.Ipv4SrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.dst._case.Ipv6DstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.flabel._case.Ipv6FlabelBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.target._case.Ipv6NdTargetBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.src._case.Ipv6SrcBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public void testIpv4Src() {
MatchBuilder builder = new MatchBuilder();
builder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv4Src.class);
entriesBuilder.setHasMask(false);
- Ipv4AddressMatchEntryBuilder addressBuilder = new Ipv4AddressMatchEntryBuilder();
- addressBuilder.setIpv4Address(new Ipv4Address("1.2.3.4"));
- entriesBuilder.addAugmentation(Ipv4AddressMatchEntry.class, addressBuilder.build());
+ Ipv4SrcCaseBuilder ipv4SrcCaseBuilder = new Ipv4SrcCaseBuilder();
+ Ipv4SrcBuilder ipv4SrcBuilder = new Ipv4SrcBuilder();
+ ipv4SrcBuilder.setIpv4Address(new Ipv4Address("1.2.3.4"));
+ ipv4SrcCaseBuilder.setIpv4Src(ipv4SrcBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv4SrcCaseBuilder.build());
entries.add(entriesBuilder.build());
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
Match match = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
public void testIpv6Various() {
MatchBuilder builder = new MatchBuilder();
builder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
+ List<MatchEntry> entries = new ArrayList<>();
// ipv6 match entry with correct Ipv6 address
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Src.class);
entriesBuilder.setHasMask(false);
- Ipv6AddressMatchEntryBuilder addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("1:2:3:4:5:6:7:8"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ Ipv6SrcCaseBuilder ipv6SrcCaseBuilder = new Ipv6SrcCaseBuilder();
+ Ipv6SrcBuilder ipv6SrcBuilder = new Ipv6SrcBuilder();
+ ipv6SrcBuilder.setIpv6Address(new Ipv6Address("1:2:3:4:5:6:7:8"));
+ ipv6SrcCaseBuilder.setIpv6Src(ipv6SrcBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6SrcCaseBuilder.build());
entries.add(entriesBuilder.build());
// ipv6 match entry with abbreviated Ipv6 address
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6NdTarget.class);
entriesBuilder.setHasMask(false);
- addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("1:2::6:7:8"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ Ipv6NdTargetCaseBuilder ipv6NdTargetCaseBuilder = new Ipv6NdTargetCaseBuilder();
+ Ipv6NdTargetBuilder ipv6NdTargetBuilder = new Ipv6NdTargetBuilder();
+ ipv6NdTargetBuilder.setIpv6Address(new Ipv6Address("1:2::6:7:8"));
+ ipv6NdTargetCaseBuilder.setIpv6NdTarget(ipv6NdTargetBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6NdTargetCaseBuilder.build());
entries.add(entriesBuilder.build());
// ipv6 match entry with abbreviated Ipv6 address
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Dst.class);
entriesBuilder.setHasMask(false);
- addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("1::8"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ Ipv6DstCaseBuilder ipv6DstCaseBuilder = new Ipv6DstCaseBuilder();
+ Ipv6DstBuilder ipv6DstBuilder = new Ipv6DstBuilder();
+ ipv6DstBuilder.setIpv6Address(new Ipv6Address("1::8"));
+ ipv6DstCaseBuilder.setIpv6Dst(ipv6DstBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6DstCaseBuilder.build());
entries.add(entriesBuilder.build());
// ipv6 match entry with abbreviated Ipv6 address
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Dst.class);
entriesBuilder.setHasMask(false);
- addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("::1"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ ipv6DstCaseBuilder = new Ipv6DstCaseBuilder();
+ ipv6DstBuilder = new Ipv6DstBuilder();
+ ipv6DstBuilder.setIpv6Address(new Ipv6Address("::1"));
+ ipv6DstCaseBuilder.setIpv6Dst(ipv6DstBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6DstCaseBuilder.build());
entries.add(entriesBuilder.build());
// ipv6 match entry with abbreviated Ipv6 address
- entriesBuilder = new MatchEntriesBuilder();
+ entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Dst.class);
entriesBuilder.setHasMask(false);
- addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("::"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ ipv6DstCaseBuilder = new Ipv6DstCaseBuilder();
+ ipv6DstBuilder = new Ipv6DstBuilder();
+ ipv6DstBuilder.setIpv6Address(new Ipv6Address("::"));
+ ipv6DstCaseBuilder.setIpv6Dst(ipv6DstBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6DstCaseBuilder.build());
entries.add(entriesBuilder.build());
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
Match match = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
matchSerializer.serialize(match, out);
public void testIpv6Incorrect() {
MatchBuilder builder = new MatchBuilder();
builder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
+ List<MatchEntry> entries = new ArrayList<>();
// ipv6 match entry with incorrect Ipv6 address
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Src.class);
entriesBuilder.setHasMask(false);
- Ipv6AddressMatchEntryBuilder addressBuilder = new Ipv6AddressMatchEntryBuilder();
- addressBuilder.setIpv6Address(new Ipv6Address("1:2::::8"));
- entriesBuilder.addAugmentation(Ipv6AddressMatchEntry.class, addressBuilder.build());
+ Ipv6SrcCaseBuilder ipv6SrcCaseBuilder = new Ipv6SrcCaseBuilder();
+ Ipv6SrcBuilder ipv6SrcBuilder = new Ipv6SrcBuilder();
+ ipv6SrcBuilder.setIpv6Address(new Ipv6Address("1:2::::8"));
+ ipv6SrcCaseBuilder.setIpv6Src(ipv6SrcBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6SrcCaseBuilder.build());
entries.add(entriesBuilder.build());
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
Match match = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
matchSerializer.serialize(match, out);
Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
- Assert.assertEquals("Wrong field and mask", 28<<1, out.readUnsignedByte());
+ Assert.assertEquals("Wrong field and mask", 56, out.readUnsignedByte());
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
byte[] label = new byte[4];
out.readBytes(label);
}
/**
- * Test for correct serialization of Ipv4Address match entry with mask
+ * Test for correct serialization of Ipv4Address match entry
*/
@Test
public void testIpv6FlabelWithMask() {
- Match match = buildIpv6FLabelMatch(0x0f9e8dL, true, new byte[]{0, 0x0c, 0x7b, 0x6a});
+ Match match = buildIpv6FLabelMatch(0x0f9e8dL, true, new byte[]{0, 1, 2, 3});
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
matchSerializer.serialize(match, out);
Assert.assertEquals("Wrong type", 1, out.readUnsignedShort());
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
Assert.assertEquals("Wrong class", 0x8000, out.readUnsignedShort());
- Assert.assertEquals("Wrong field and mask", 28<<1 | 1, out.readUnsignedByte());
+ Assert.assertEquals("Wrong field and mask", 57, out.readUnsignedByte());
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
- byte[] labelAndMask = new byte[8];
- out.readBytes(labelAndMask);
-
- LOG.debug("label: "+ByteBufUtils.bytesToHexString(labelAndMask));
- Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d, 0, 0x0c, 0x7b, 0x6a}, labelAndMask);
+ byte[] label = new byte[4];
+ out.readBytes(label);
+ Assert.assertArrayEquals("Wrong ipv6FLabel", new byte[]{0, 0x0f, (byte) 0x9e, (byte) 0x8d}, label);
+ byte[] mask = new byte[4];
+ out.readBytes(mask);
+ Assert.assertArrayEquals("Wrong ipv6FLabel mask", new byte[]{0, 1, 2, 3}, mask);
}
/**
@Test
public void testIpv6FlabelWithMaskBad() {
Match match = buildIpv6FLabelMatch(0x0f9e8dL, true, new byte[]{0x0c, 0x7b, 0x6a});
-
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
try {
private static Match buildIpv6FLabelMatch(long labelValue, boolean hasMask, byte[] mask) {
MatchBuilder builder = new MatchBuilder();
builder.setType(OxmMatchType.class);
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder entriesBuilder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(Ipv6Flabel.class);
entriesBuilder.setHasMask(hasMask);
- Ipv6FlabelMatchEntryBuilder ip6FLabelBuilder = new Ipv6FlabelMatchEntryBuilder();
- ip6FLabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(labelValue));
- entriesBuilder.addAugmentation(Ipv6FlabelMatchEntry.class, ip6FLabelBuilder.build());
- MaskMatchEntryBuilder maskBuilder = new MaskMatchEntryBuilder();
- maskBuilder.setMask(mask);
- entriesBuilder.addAugmentation(MaskMatchEntry.class, maskBuilder.build());
+ Ipv6FlabelCaseBuilder ipv6FlabelCaseBuilder = new Ipv6FlabelCaseBuilder();
+ Ipv6FlabelBuilder ipv6FlabelBuilder = new Ipv6FlabelBuilder();
+ ipv6FlabelBuilder.setIpv6Flabel(new Ipv6FlowLabel(labelValue));
+ ipv6FlabelBuilder.setMask(mask);
+ ipv6FlabelCaseBuilder.setIpv6Flabel(ipv6FlabelBuilder.build());
+ entriesBuilder.setMatchEntryValue(ipv6FlabelCaseBuilder.build());
entries.add(entriesBuilder.build());
- builder.setMatchEntries(entries);
+ builder.setMatchEntry(entries);
Match match = builder.build();
return match;
}
*/
@Test(expected=IllegalStateException.class)
public void testSerializeExperimenterMatchEntry() {
- List<MatchEntries> entries = new ArrayList<>();
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ List<MatchEntry> entries = new ArrayList<>();
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(ExperimenterClass.class);
builder.setOxmMatchField(OxmMatchFieldClass.class);
builder.setHasMask(true);
- ExperimenterIdMatchEntryBuilder expIdBuilder = new ExperimenterIdMatchEntryBuilder();
- expIdBuilder.setExperimenter(new ExperimenterId(42L));
- builder.addAugmentation(ExperimenterIdMatchEntry.class, expIdBuilder.build());
+ ExperimenterIdCaseBuilder caseBuilder = new ExperimenterIdCaseBuilder();
+ ExperimenterBuilder expBuilder = new ExperimenterBuilder();
+ expBuilder.setExperimenter(new ExperimenterId(42L));
+ caseBuilder.setExperimenter(expBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
entries.add(builder.build());
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
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.augments.rev131002.ExperimenterIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdInstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ExperimenterIdMatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.ExperimenterIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.experimenter.id._case.ExperimenterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Experimenter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.ExperimenterActionSubType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.ExperimenterClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.MatchField;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
/**
* @author michal.polkorab
*/
@Test
public void testMatchEntriesKeyMaker() {
- TypeKeyMaker<MatchEntries> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
+ TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
Assert.assertNotNull("Null keyMaker", keyMaker);
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(InPort.class);
builder.setHasMask(true);
- MatchEntries entry = builder.build();
+ MatchEntry entry = builder.build();
MessageTypeKey<?> key = keyMaker.make(entry);
Assert.assertNotNull("Null key", key);
*/
@Test
public void testExperimenterMatchEntriesKeyMaker() {
- TypeKeyMaker<MatchEntries> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
+ TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
Assert.assertNotNull("Null keyMaker", keyMaker);
- MatchEntriesBuilder builder = new MatchEntriesBuilder();
+ MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(ExperimenterClass.class);
builder.setOxmMatchField(OxmMatchFieldClass.class);
builder.setHasMask(true);
- ExperimenterIdMatchEntryBuilder expIdBuilder = new ExperimenterIdMatchEntryBuilder();
- expIdBuilder.setExperimenter(new ExperimenterId(42L));
- builder.addAugmentation(ExperimenterIdMatchEntry.class, expIdBuilder.build());
- MatchEntries entry = builder.build();
+ ExperimenterIdCaseBuilder caseBuilder = new ExperimenterIdCaseBuilder();
+ ExperimenterBuilder expBuilder = new ExperimenterBuilder();
+ expBuilder.setExperimenter(new ExperimenterId(42L));
+ caseBuilder.setExperimenter(expBuilder.build());
+ builder.setMatchEntryValue(caseBuilder.build());
+ MatchEntry entry = builder.build();
MessageTypeKey<?> key = keyMaker.make(entry);
Assert.assertNotNull("Null key", key);
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl;
-import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessage;
LOGGER.debug("Reason: " + notification.getReason());
LOGGER.debug("TableId: " + notification.getTableId());
LOGGER.debug("Cookie: " + notification.getCookie());
- LOGGER.debug("Class: " + notification.getMatch().getMatchEntries().get(0).getOxmClass());
- LOGGER.debug("Field: " + notification.getMatch().getMatchEntries().get(0).getOxmMatchField());
+ LOGGER.debug("Class: " + notification.getMatch().getMatchEntry().get(0).getOxmClass());
+ LOGGER.debug("Field: " + notification.getMatch().getMatchEntry().get(0).getOxmMatchField());
LOGGER.debug("Datasize: " + notification.getData().length);
}