}
identity output {
- description " Output to switch port. ";
- base oft:action;
+ description " Output to switch port. (both OF v1.0 and v1.3)";
+ base oft:action-base;
}
identity copy_ttl_out {
description " Copy TTL \"outwards\" -- from next-to-outermost to outermost ";
- base oft:action;
+ base oft:action-base;
}
identity copy_ttl_in {
description " Copy TTL \"inwards\" -- from outermost to next-to-outermost ";
- base oft:action;
+ base oft:action-base;
}
identity set_mpls_ttl {
description " MPLS TTL ";
- base oft:action;
+ base oft:action-base;
}
identity dec_mpls_ttl {
description " Decrement MPLS TTL ";
- base oft:action;
+ base oft:action-base;
}
identity push_vlan {
description " Push a new VLAN tag ";
- base oft:action;
+ base oft:action-base;
}
identity pop_vlan {
description " Pop the outer VLAN tag ";
- base oft:action;
+ base oft:action-base;
}
identity push_mpls {
description " Push a new MPLS tag ";
- base oft:action;
+ base oft:action-base;
}
identity pop_mpls {
description " Pop the outer MPLS tag ";
- base oft:action;
+ base oft:action-base;
}
identity set_queue {
description " Set queue id when outputting to a port ";
- base oft:action;
+ base oft:action-base;
}
identity group {
description " Apply group. ";
- base oft:action;
+ base oft:action-base;
}
identity set_nw_ttl {
description " IP TTL. ";
- base oft:action;
+ base oft:action-base;
}
identity dec_nw_ttl {
description " Decrement IP TTL. ";
- base oft:action;
+ base oft:action-base;
}
identity set_field {
description " Set a header field using OXM TLV format. ";
- base oft:action;
+ base oft:action-base;
}
identity push_pbb {
description " Push a new PBB service tag (I-TAG) ";
- base oft:action;
+ base oft:action-base;
}
identity pop_pbb {
description " Pop the outer PBB service tag (I-TAG) ";
- base oft:action;
+ base oft:action-base;
}
identity experimenter {
description "";
- base oft:action;
+ base oft:action-base;
}
container actions-container {
- uses actions;
+ uses actions-grouping;
}
- grouping actions {
- list actions-list {
- key "action";
- container action {
- leaf type {
- type identityref {
- base oft:action;
- }
+ grouping actions-grouping {
+ list action {
+ key "type";
+ leaf type {
+ type identityref {
+ base oft:action-base;
}
}
}
// OF1.0 structures
identity set_vlan_vid {
- description "";
- base oft:action;
+ description "Set the 802.1q VLAN id (OF v1.0).";
+ base oft:action-base;
}
identity set_vlan_pcp {
- description "";
- base oft:action;
+ description "Set the 802.1q priority (OF v1.0).";
+ base oft:action-base;
}
identity strip_vlan {
- description "";
- base oft:action;
+ description "Strip the 802.1q header (OF v1.0).";
+ base oft:action-base;
}
identity set_dl_src {
- description "";
- base oft:action;
+ description "Ethernet source address (OF v1.0).";
+ base oft:action-base;
}
identity set_dl_dst {
- description "";
- base oft:action;
+ description "Ethernet destination address (OF v1.0).";
+ base oft:action-base;
}
identity set_nw_src {
- description "";
- base oft:action;
+ description "IP source address (OF v1.0).";
+ base oft:action-base;
}
identity set_nw_dst {
- description "";
- base oft:action;
+ description "IP destination address (OF v1.0).";
+ base oft:action-base;
}
identity set_nw_tos {
- description "";
- base oft:action;
+ description "IP ToS (DSCP field, 6 bits) (OF v1.0).";
+ base oft:action-base;
}
identity set_tp_src {
- description "";
- base oft:action;
+ description "TCP/UDP source port (OF v1.0).";
+ base oft:action-base;
}
identity set_tp_dst {
- description "";
- base oft:action;
+ description "TCP/UDP destination port (OF v1.0).";
+ base oft:action-base;
}
identity enqueue {
- description "";
- base oft:action;
+ description "Output to queue (OF v1.0).";
+ base oft:action-base;
}
}
\ No newline at end of file
import openflow-extensible-match {prefix oxm;}\r
\r
revision "2013-10-02" {\r
- description "OpenFlow 1.3 - augments model";\r
+ description "OpenFlow 1.3 - augments model. \r
+ Please visit \r
+ https://wiki.opendaylight.org/view/File:OpenFlow_Protocol_Library_-_Project_documentation.pdf\r
+ - Augmentation Tables chapter";\r
}\r
\r
// OFP_MATCH AUGMENTS\r
}\r
\r
// OFP_ACTION AUGMENTS\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "port-action";\r
leaf port {\r
type oft:port-number;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "max-length-action";\r
leaf max-length {\r
type uint16;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "mpls-ttl-action";\r
leaf mpls-ttl {\r
type uint8;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "ethertype-action";\r
leaf ethertype {\r
type oft:ether-type;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "queue-id-action";\r
leaf queue-id {\r
type uint32;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "group-id-action";\r
leaf group-id {\r
type uint32;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "nw-ttl-action";\r
leaf nw-ttl {\r
type uint8;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "oxm-fields-action";\r
- uses oxm:oxm-fields;\r
+ uses oxm:oxm-fields-grouping;\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "experimenter-action";\r
leaf experimenter {\r
type uint32;\r
}\r
}\r
// OF1.0 structures\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "vlan-vid-action";\r
leaf vlan-vid {\r
type uint16;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "vlan-pcp-action";\r
leaf vlan-pcp {\r
type uint8;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "dl-address-action";\r
leaf dl-address {\r
type yang:mac-address;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "nw-tos-action";\r
leaf nw-tos {\r
type uint8;\r
}\r
}\r
- augment "/ofaction:actions-container/ofaction:actions-list/ofaction:action" {\r
+ augment "/ofaction:actions-container/ofaction:action" {\r
ext:augment-identifier "ip-address-action";\r
leaf ip-address {\r
type inet:ipv4-address;\r
// OFP_TABLE_FEATURES_PROPERTIES AUGMENTS\r
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
ext:augment-identifier "instruction-related-table-feature-property";\r
- uses ofinstruction:instructions;\r
+ uses ofinstruction:instructions-grouping;\r
}\r
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
ext:augment-identifier "next-table-related-table-feature-property";\r
}\r
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
ext:augment-identifier "action-related-table-feature-property";\r
- uses ofaction:actions;\r
+ uses ofaction:actions-grouping;\r
}\r
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
ext:augment-identifier "oxm-related-table-feature-property";\r
- uses oxm:oxm-fields;\r
+ uses oxm:oxm-fields-grouping;\r
}\r
augment "/ofproto:table-features-properties-container/ofproto:table-feature-properties" {\r
ext:augment-identifier "experimenter-related-table-feature-property";\r
}\r
\r
// OFP_INSTRUCTION AUGMENTS\r
- augment "/ofinstruction:instruction-container/ofinstruction:instructions" {\r
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction" {\r
ext:augment-identifier "table-id-instruction";\r
leaf table-id {\r
type uint8;\r
}\r
}\r
- augment "/ofinstruction:instruction-container/ofinstruction:instructions" {\r
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction" {\r
ext:augment-identifier "metadata-instruction";\r
leaf metadata {\r
type binary;\r
type binary;\r
}\r
}\r
- augment "/ofinstruction:instruction-container/ofinstruction:instructions" {\r
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction" {\r
ext:augment-identifier "actions-instruction";\r
- uses ofaction:actions;\r
+ uses ofaction:actions-grouping;\r
}\r
- augment "/ofinstruction:instruction-container/ofinstruction:instructions" {\r
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction" {\r
ext:augment-identifier "meter-id-instruction";\r
leaf meter-id {\r
type uint32;\r
}\r
}\r
- augment "/ofinstruction:instruction-container/ofinstruction:instructions" {\r
+ augment "/ofinstruction:instruction-container/ofinstruction:instruction" {\r
ext:augment-identifier "experimenter-instruction";\r
leaf experimenter {\r
type uint32;\r
}
identity nxm-0-class {
- description "Backward compatibility with NXM";
+ description "Match class for backward compatibility with NXM";
base clazz;
}
identity nxm-1-class {
- description "Backward compatibility with NXM";
+ description "Match class for backward compatibility with NXM";
base clazz;
}
identity openflow-basic-class {
identity in_port {
base match-field;
- description "Match for Switch input port.";
+ description "OXM field for Switch input port.";
}
identity in_phy_port {
base match-field;
- description "Match for Switch physical input port.";
+ description "OXM field for Switch physical input port.";
}
identity metadata {
base match-field;
- description "Match for Metadata passed between tables.";
+ description "OXM field for Metadata passed between tables.";
}
identity eth_dst {
base match-field;
- description "Match for Ethernet destination address.";
+ description "OXM field for Ethernet destination address.";
}
identity eth_src {
base match-field;
- description "Match for Ethernet source address.";
+ description "OXM field for Ethernet source address.";
}
identity eth_type {
base match-field;
- description "Match for Ethernet frame type.";
+ description "OXM field for Ethernet frame type.";
}
identity vlan_vid {
base match-field;
- description "Match for VLAN id.";
+ description "OXM field for VLAN id.";
}
identity vlan_pcp {
base match-field;
- description "Match for VLAN priority.";
+ description "OXM field for VLAN priority.";
}
identity ip_dscp {
base match-field;
- description "Match for IP DSCP (6 bits in ToS field).";
+ description "OXM field for IP DSCP (6 bits in ToS field).";
}
identity ip_ecn {
base match-field;
- description "Match for IP ECN (2 bits in ToS field).";
+ description "OXM field for IP ECN (2 bits in ToS field).";
}
identity ip_proto {
base match-field;
- description "Match for IP protocol.";
+ description "OXM field for IP protocol.";
}
identity ipv4_src {
base match-field;
- description "Match for IPv4 source address.";
+ description "OXM field for IPv4 source address.";
}
identity ipv4_dst {
base match-field;
- description "Match for IPv4 destination address.";
+ description "OXM field for IPv4 destination address.";
}
identity tcp_src {
base match-field;
- description "Match for TCP source port.";
+ description "OXM field for TCP source port.";
}
identity tcp_dst {
base match-field;
- description "Match for TCP destination port.";
+ description "OXM field for TCP destination port.";
}
identity udp_src {
base match-field;
- description "Match for UDP source port.";
+ description "OXM field for UDP source port.";
}
identity udp_dst {
base match-field;
- description "Match for UDP destination port.";
+ description "OXM field for UDP destination port.";
}
identity sctp_src {
base match-field;
- description "Match for SCTP source port.";
+ description "OXM field for SCTP source port.";
}
identity sctp_dst {
base match-field;
- description "Match for SCTP destination port.";
+ description "OXM field for SCTP destination port.";
}
identity icmpv4_type {
base match-field;
- description "Match for ICMP type.";
+ description "OXM field for ICMP type.";
}
identity icmpv4_code {
base match-field;
- description "Match for ICMP code.";
+ description "OXM field for ICMP code.";
}
identity arp_op {
base match-field;
- description "Match for ARP opcode.";
+ description "OXM field for ARP opcode.";
}
identity arp_spa {
base match-field;
- description "Match for ARP source IPv4 address.";
+ description "OXM field for ARP source IPv4 address.";
}
identity arp_tpa {
base match-field;
- description "Match for ARP target IPv4 address.";
+ description "OXM field for ARP target IPv4 address.";
}
identity arp_sha {
base match-field;
- description "Match for ARP source hardware address.";
+ description "OXM field for ARP source hardware address.";
}
identity arp_tha {
base match-field;
- description "Match for ARP target hardware address.";
+ description "OXM field for ARP target hardware address.";
}
identity ipv6_src {
base match-field;
- description "Match for IPv6 source address.";
+ description "OXM field for IPv6 source address.";
}
identity ipv6_dst {
base match-field;
- description "Match for IPv6 destination address.";
+ description "OXM field for IPv6 destination address.";
}
identity ipv6_flabel {
base match-field;
- description "Match for IPv6 Flow Label";
+ description "OXM field for IPv6 Flow Label";
}
identity icmpv6_type {
base match-field;
- description "Match for ICMPv6 type.";
+ description "OXM field for ICMPv6 type.";
}
identity icmpv6_code {
base match-field;
- description "Match for ICMPv6 code.";
+ description "OXM field for ICMPv6 code.";
}
identity ipv6_nd_target {
base match-field;
- description "Match for Target address for ND.";
+ description "OXM field for Target address for ND.";
}
identity ipv6_nd_sll {
base match-field;
- description "Match for Source link-layer for ND.";
+ description "OXM field for Source link-layer for ND.";
}
identity ipv6_nd_tll {
base match-field;
- description "Match for Target link-layer for ND.";
+ description "OXM field for Target link-layer for ND.";
}
identity mpls_label {
base match-field;
- description "Match for MPLS label.";
+ description "OXM field for MPLS label.";
}
identity mpls_tc {
base match-field;
- description "Match for MPLS TC.";
+ description "OXM field for MPLS TC.";
}
identity mpls_bos {
base match-field;
- description "Match for MPLS BoS bit.";
+ description "OXM field for MPLS BoS bit.";
}
identity pbb_isid {
base match-field;
- description "Match for PBB I-SID.";
+ description "OXM field for PBB I-SID.";
}
identity tunnel_id {
base match-field;
- description "Match for Logical Port Metadata";
+ description "OXM field for Logical Port Metadata";
}
identity ipv6_exthdr {
base match-field;
- description "Match for IPv6 Extension Header pseudo-field";
+ description "OXM field for IPv6 Extension Header pseudo-field";
}
container oxm-container {
- uses oxm-fields;
+ uses oxm-fields-grouping;
}
- grouping oxm-fields {
+ grouping oxm-fields-grouping {
list match-entries {
+ description "OXM TLV-structures (Type Length Value)";
key "oxm-class oxm-match-field has-mask";
leaf oxm-class {
type identityref {
}
}
}
-
+
+ grouping match-grouping {
+ container match {
+ description "Match structure (OF v1.3)";
+ leaf type {
+ type identityref {
+ base oft:match-type-base;
+ }
+ }
+ 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;
}
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;
}
}
import openflow-types { prefix oft; }
revision "2013-07-31" {
- // description "OpenFlow 1.3 - instruction model";
+ description "OpenFlow 1.3 - instruction model";
}
identity goto_table {
- //description " Setup the next table in the lookup pipeline";
- base oft:instruction;
+ description " Setup the next table in the lookup pipeline";
+ base oft:instruction-base;
}
identity write_metadata {
- //description " Setup the metadata field for use later in pipeline";
- base oft:instruction;
+ description " Setup the metadata field for use later in pipeline";
+ base oft:instruction-base;
}
identity write_actions {
description " Write the action(s) onto the datapath action set";
- base oft:instruction;
+ base oft:instruction-base;
}
identity apply_actions {
description " Applies the action(s) immediately";
- base oft:instruction;
+ base oft:instruction-base;
}
identity clear_actions {
description " Clears all actions from the datapath action set";
- base oft:instruction;
+ base oft:instruction-base;
}
identity meter {
description " Apply meter (rate limiter)";
- base oft:instruction;
+ base oft:instruction-base;
}
identity experimenter {
description "Experimenter instruction";
- base oft:instruction;
+ base oft:instruction-base;
}
container instruction-container {
- uses instructions;
+ uses instructions-grouping;
}
- grouping instructions {
- list instructions {
+ grouping instructions-grouping {
+ list instruction {
key "type";
leaf type {
type identityref {
- base oft:instruction;
+ base oft:instruction-base;
}
}
}
}\r
\r
// Generic Structures\r
- grouping port {\r
- // reference "ofp_port";\r
- leaf port-no { \r
- // reference "ofp_port.port_no"; \r
+ grouping port-grouping {\r
+ reference "ofp_port";\r
+ leaf port-no {\r
type uint32;\r
}\r
- leaf hw-addr { \r
- // reference "ofp_port.hw_addr"; \r
+ leaf hw-addr {\r
type yang:mac-address;\r
}\r
- leaf name { \r
- // reference "ofp_port.name"; \r
+ leaf name {\r
type string;\r
}\r
- leaf config { \r
- // reference "ofp_port.config"; \r
+ leaf config {\r
+ description "Bitmap of OFPPC_* flags.";\r
type oft:port-config;\r
}\r
- leaf state { \r
- // reference "ofp_port.state"; \r
+ leaf state {\r
+ description "Bitmap of OFPPS_* flags.";\r
type oft:port-state;\r
}\r
- leaf current-features { \r
+ leaf current-features {\r
description "Current features.";\r
- // reference "ofp_port.curr"; \r
- type oft:port-features; \r
+ type oft:port-features;\r
}\r
- leaf advertised-features { \r
+ leaf advertised-features {\r
description "Features being advertised by the port.";\r
- // reference "ofp_port.advertised"; \r
- type oft:port-features; \r
+ type oft:port-features;\r
}\r
- leaf supported-features { \r
+ leaf supported-features {\r
description "Features supported by the port.";\r
- // reference "ofp_port.supported"; \r
- type oft:port-features; \r
+ type oft:port-features;\r
}\r
- leaf peer-features { \r
+ leaf peer-features {\r
description "Features advertised by peer.";\r
- // reference "ofp_port.peer"; \r
type oft:port-features; \r
}\r
- leaf curr-speed { \r
+ leaf curr-speed {\r
description "Current port bitrate in kbps.";\r
- // reference "ofp_port.curr_speed"; \r
- type uint32; \r
+ type uint32;\r
units "kbps";\r
}\r
- leaf max-speed { \r
+ leaf max-speed {\r
description "Max port bitrate in kbps";\r
- // reference "ofp_port.max_speed"; \r
type uint32;\r
- units "kbps"; \r
+ units "kbps";\r
}\r
- \r
+\r
// OF1.0 structures\r
- leaf config-v10 { \r
- // reference "ofp_port.config"; \r
+ leaf config-v10 {\r
type oft:port-config-v10;\r
}\r
leaf state-v10 { \r
- // reference "ofp_port.state"; \r
type oft:port-state-v10;\r
}\r
- leaf current-features-v10 { \r
+ leaf current-features-v10 {\r
description "Current features.";\r
- // reference "ofp_port.curr"; \r
- type oft:port-features-v10; \r
+ type oft:port-features-v10;\r
}\r
- leaf advertised-features-v10 { \r
+ leaf advertised-features-v10 {\r
description "Features being advertised by the port.";\r
- // reference "ofp_port.advertised"; \r
- type oft:port-features-v10; \r
+ type oft:port-features-v10;\r
}\r
- leaf supported-features-v10 { \r
+ leaf supported-features-v10 {\r
description "Features supported by the port.";\r
- // reference "ofp_port.supported"; \r
- type oft:port-features-v10; \r
+ type oft:port-features-v10;\r
}\r
leaf peer-features-v10 { \r
description "Features advertised by peer.";\r
- // reference "ofp_port.peer"; \r
type oft:port-features-v10; \r
}\r
}\r
- \r
- grouping match-grouping {\r
- container match {\r
- leaf type {\r
- type identityref {\r
- base oft:match-type-base;\r
- }\r
- }\r
- uses oxm:oxm-fields;\r
- }\r
- }\r
\r
- grouping buckets {\r
+ grouping buckets-grouping {\r
list buckets-list {\r
- uses bucket;\r
+ uses bucket-grouping;\r
}\r
}\r
- \r
- grouping bucket {\r
+\r
+ grouping bucket-grouping {\r
+ description "Bucket for use in groups.";\r
leaf weight {\r
+ description "Relative weight of bucket. Only\r
+ defined for select groups.";\r
type uint16;\r
}\r
leaf watch-port {\r
+ description "Port whose state affects whether this\r
+ bucket is live. Only required for fast\r
+ failover groups.";\r
type oft:port-number;\r
}\r
leaf watch-group {\r
+ description "Group whose state affects whether this\r
+ bucket is live. Only required for fast\r
+ failover groups.";\r
type uint32;\r
}\r
- \r
- uses ofaction:actions;\r
+\r
+ uses ofaction:actions-grouping;\r
}\r
\r
container table-features-properties-container {\r
- uses table-features-properties;\r
+ uses table-features-properties-grouping;\r
}\r
\r
- grouping table-features-properties {\r
+ grouping table-features-properties-grouping {\r
list table-feature-properties {\r
key "type";\r
leaf type {\r
// # MESSAGE Structures\r
/* Immutable messages. */\r
grouping ofHeader {\r
- //reference "ofpt_header struct in Openflow Switch 1.3 Spec"\r
+ reference "ofp_header struct in Openflow Switch 1.3 Spec";\r
leaf version {\r
type uint8;\r
- //reference "OpenFlow Header - OFP_VERSION";\r
+ description "OpenFlow version";\r
}\r
leaf xid {\r
type uint32;\r
- //reference "OpenFlow Header - transaction id";\r
+ description "Transaction ID";\r
}\r
}\r
grouping ofHelloElementHeader {\r
- //reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec"\r
+ reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec";\r
leaf type {\r
type oft:hello-element-type;\r
//reference "OpenFlow Header element type - OFPHET_*";\r
}\r
}\r
grouping hello {\r
- // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";\r
/* Symmetric message */\r
uses ofHeader;\r
\r
}\r
}\r
grouping error {\r
- // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";\r
/* Symmetric message */\r
uses ofHeader;\r
\r
}\r
}\r
grouping echo-request {\r
- // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Symmetric message */\r
uses ofHeader;\r
\r
}\r
}\r
grouping echo-reply {\r
- // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec";\r
/* Symmetric message */\r
uses ofHeader;\r
\r
}\r
}\r
grouping experimenter {\r
- // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";\r
/* Symmetric message */\r
uses ofHeader;\r
\r
}\r
/* Switch configuration messages. */\r
grouping features-request {\r
- // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
}\r
grouping features-reply {\r
- // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
\r
type oft:action-type-v10;\r
}\r
list phy-port {\r
- uses port;\r
+ uses port-grouping;\r
}\r
}\r
grouping get-config-request {\r
- // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
}\r
grouping get-config-reply {\r
- // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
\r
}\r
}\r
grouping set-config {\r
- // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
/* Asynchronous messages. */\r
grouping packet-in {\r
- // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec";\r
/* Async message */\r
\r
uses ofHeader;\r
// Cookie of the flow entry that was looked up.\r
type uint64;\r
}\r
- uses match-grouping;\r
- \r
-// struct ofp_match match; /* Packet metadata. Variable size. */\r
-// /* The variable size and padded match is always followed by:\r
-// * - Exactly 2 all-zero padding bytes, then\r
-// * - An Ethernet frame whose length is inferred from header.length.\r
-// * The padding bytes preceding the Ethernet frame ensure that the IP\r
-// * header (if any) following the Ethernet header is 32-bit aligned.\r
-// */\r
+ uses oxm:match-grouping;\r
+\r
leaf data {\r
type binary;\r
}\r
}\r
}\r
grouping flow-removed {\r
- // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec";\r
/* Async message */\r
uses ofHeader;\r
\r
leaf byte-count {\r
type uint64;\r
}\r
- uses match-grouping;\r
+ uses oxm:match-grouping;\r
\r
// OF1.0 structures\r
uses oxm:match-v10-grouping;\r
} \r
grouping port-status {\r
- // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec";\r
\r
uses ofHeader;\r
\r
- uses port;\r
+ uses port-grouping;\r
\r
leaf reason {\r
type oft:port-reason;\r
}\r
- } /* Async message */\r
+ }\r
/* Controller command messages. */\r
grouping packet-out {\r
- // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
\r
- uses ofaction:actions;\r
+ uses ofaction:actions-grouping;\r
\r
leaf data {\r
type binary;\r
}\r
} \r
grouping flow-mod {\r
- // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
leaf flags {\r
type oft:flow-mod-flags;\r
}\r
- uses match-grouping;\r
+ uses oxm:match-grouping;\r
\r
- uses ofinstruction:instructions;\r
+ uses ofinstruction:instructions-grouping;\r
\r
// OF1.0 structures\r
leaf flags-v10 {\r
type oft:flow-mod-flags-v10;\r
}\r
uses oxm:match-v10-grouping;\r
- uses ofaction:actions;\r
+ uses ofaction:actions-grouping;\r
} \r
grouping group-mod {\r
- // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
type oft:group-id;\r
}\r
\r
- uses buckets;\r
+ uses buckets-grouping;\r
}\r
\r
grouping port-mod {\r
- // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
} \r
grouping table-mod {\r
- // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
\r
/* Multipart messages. */\r
grouping multipart-request {\r
- // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
\r
leaf type {\r
type oft:multipart-type;\r
- } \r
+ }\r
leaf flags {\r
type oft:multipart-request-flags;\r
- } \r
+ }\r
choice multipart-request-body {\r
case multipart-request-desc-case {\r
container multipart-request-desc {\r
leaf cookie-mask {\r
type uint64;\r
}\r
- uses match-grouping;\r
+ uses oxm:match-grouping;\r
\r
// OF1.0 structures\r
uses oxm:match-v10-grouping;\r
leaf cookie-mask {\r
type uint64;\r
}\r
- uses match-grouping;\r
+ uses oxm:match-grouping;\r
\r
// OF1.0 structures\r
uses oxm:match-v10-grouping;\r
leaf max-entries {\r
type uint32;\r
}\r
- uses table-features-properties;\r
+ uses table-features-properties-grouping;\r
}\r
}\r
}\r
}\r
} \r
grouping multipart-reply {\r
- // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
leaf byte-count {\r
type uint64;\r
}\r
- uses match-grouping;\r
+ uses oxm:match-grouping;\r
\r
- uses ofinstruction:instructions;\r
+ uses ofinstruction:instructions-grouping;\r
\r
// OF1.0 structures\r
uses oxm:match-v10-grouping;\r
- uses ofaction:actions;\r
+ uses ofaction:actions-grouping;\r
}\r
}\r
}\r
leaf group-id {\r
type oft:group-id;\r
}\r
- uses buckets;\r
+ uses buckets-grouping;\r
}\r
}\r
}\r
leaf max-entries {\r
type uint32;\r
}\r
- uses table-features-properties;\r
+ uses table-features-properties-grouping;\r
}\r
}\r
}\r
case multipart-reply-port-desc-case {\r
container multipart-reply-port-desc {\r
list ports {\r
- uses port;\r
+ uses port-grouping;\r
}\r
}\r
}\r
} \r
/* Barrier messages. */\r
grouping barrier-request {\r
- // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
} \r
grouping barrier-reply {\r
- // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
uses ofHeader;\r
} \r
/* Queue Configuration messages. */\r
grouping queue-get-config-request {\r
- // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
} \r
grouping queue-get-config-reply {\r
- // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
/* Controller role change request messages. */\r
grouping role-request {\r
- // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
} \r
grouping role-reply {\r
- // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
} \r
/* Asynchronous message configuration. */\r
grouping get-async-request {\r
- // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
- uses ofHeader; \r
+ uses ofHeader;\r
} \r
grouping get-async-reply {\r
- // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
uses async-body-grouping;\r
} \r
grouping set-async {\r
- // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
}\r
/* Meters and rate limiters configuration messages. */\r
grouping meter-mod {\r
- // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec";\r
/* Controller/switch message */\r
\r
uses ofHeader;\r
/* Immutable messages. */\r
notification hello-message {\r
uses hello;\r
- // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";\r
\r
/* Symmetric message */\r
}\r
notification error-message {\r
uses error;\r
- // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";\r
\r
/* Symmetric message */\r
}\r
notification echo-request-message {\r
uses echo-request;\r
- // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";\r
\r
/* Symmetric message */\r
}\r
notification experimenter-message {\r
uses experimenter;\r
- // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
+ reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";\r
// TODO:: does switch send this when understood experimenter msg from lib?\r
/* Symmetric message */\r
}\r
// # Notification and RPCs\r
/* Symmetric RPC. */\r
rpc echo {\r
- // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
input {\r
uses echo-request;\r
}\r
}\r
\r
rpc echo-reply {\r
- // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"\r
input {\r
uses echo-reply;\r
}\r
}\r
\r
rpc hello {\r
- // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"\r
input {\r
uses hello;\r
}\r
}\r
\r
rpc experimenter {\r
- // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"\r
input {\r
uses experimenter;\r
}\r
\r
/* Switch configuration messages. */\r
rpc get-features {\r
- // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"\r
input {\r
uses features-request;\r
}\r
}\r
\r
rpc get-config {\r
- // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
input {\r
uses get-config-request;\r
}\r
}\r
\r
rpc set-config {\r
- // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"\r
input {\r
uses set-config;\r
} \r
/* Asynchronous messages. */\r
notification packet-in-message {\r
uses packet-in;\r
- // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"\r
\r
/* Async message */\r
}\r
notification flow-removed-message {\r
uses flow-removed;\r
- // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"\r
\r
/* Async message */\r
} \r
notification port-status-message {\r
uses port-status;\r
- // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"\r
\r
} /* Async message */\r
\r
rpc packet-out {\r
input {\r
uses packet-out;\r
- // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"\r
}\r
/* Controller/switch message */\r
} \r
rpc flow-mod {\r
input {\r
uses flow-mod;\r
- // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"\r
}\r
/* Controller/switch message */\r
} \r
rpc group-mod {\r
input {\r
uses group-mod;\r
- // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"\r
}\r
/* Controller/switch message */\r
} \r
rpc port-mod {\r
input {\r
uses port-mod;\r
- // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"\r
}\r
} /* Controller/switch message */\r
\r
rpc table-mod {\r
input {\r
uses table-mod;\r
- // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"\r
}\r
} /* Controller/switch message */\r
\r
/* Controller/switch message */\r
notification multipart-reply-message {\r
uses multipart-reply;\r
- // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"\r
// notification because of multiple following responses\r
} /* Controller/switch message */\r
\r
rpc barrier {\r
input {\r
uses barrier-request;\r
- // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"\r
}\r
output {\r
uses barrier-reply;\r
- // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"\r
}\r
}\r
/* Queue Configuration messages. */\r
rpc get-queue-config {\r
input {\r
uses queue-get-config-request;\r
- // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"\r
}\r
output {\r
uses queue-get-config-reply;\r
- // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"\r
}\r
} \r
\r
rpc role-request {\r
input {\r
uses role-request;\r
- // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"\r
}\r
output {\r
uses role-reply;\r
- // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"\r
}\r
} /* Controller/switch message */\r
\r
rpc get-async {\r
input {\r
uses get-async-request;\r
- // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"\r
}\r
output {\r
uses get-async-reply;\r
- // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"\r
}\r
} \r
/* Controller/switch message */\r
rpc set-async {\r
input { \r
uses set-async;\r
- // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"\r
}\r
\r
} \r
rpc meter-mod {\r
input {\r
uses meter-mod;\r
- // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"\r
}\r
} /* Controller/switch message */\r
}
\ No newline at end of file
prefix "oft";
revision "2013-07-31" {
- //description "OpenFlow 1.3 - common types model";
+ description "OpenFlow 1.3 - common types model";
}
typedef port-number {
+ description "Port numbering. Ports are numbered starting from 1 -
+ supports special / reserved values (in OF v1.3)";
type uint32;
}
typedef port-number-values {
+ description "Reserved OpenFlow Port (fake output \"ports\") (OF v1.3).";
type enumeration {
enum MAX {
- value -256; // 0xffffff00
+ description "Maximum number of physical and logical switch ports.";
+ value -256; // 0xffffff00
}
enum IN_PORT {
+ description "Send the packet out the input port. This
+ reserved port must be explicitly used
+ in order to send back out of the input
+ port.";
value -8; // 0xfffffff8
}
enum TABLE {
+ description "Submit the packet to the first flow table
+ NB: This destination port can only be
+ used in packet-out messages.";
value -7; // 0xfffffff9
}
enum NORMAL {
+ description "Process with normal L2/L3 switching.";
value -6; // 0xfffffffa
}
enum FLOOD {
+ description "All physical ports in VLAN, except input
+ port and those blocked or link down.";
value -5; // 0xfffffffb
}
enum ALL {
+ description "All physical ports except input port.";
value -4; // 0xfffffffc
}
enum CONTROLLER {
+ description "Send to controller.";
value -3; // 0xfffffffd
}
enum LOCAL {
+ description "Local openflow \"port\".";
value -2; // 0xfffffffe
}
enum ANY {
+ description "Wildcard port used only for flow mod
+ (delete) and flow stats requests. Selects
+ all flows regardless of output port
+ (including flows with no output port).";
value -1; // 0xffffffff
}
}
}
typedef port-features {
- ////description "Features of ports available in datapath.";
- //reference "ofp_port_features";
+ description "Features of ports available in datapath.";
type bits {
bit _10mb_hd {
position 0;
- //description "10 Mb half-duplex rate support.";
+ description "10 Mb half-duplex rate support.";
}
bit _10mb-fd {
position 1;
- //description "10 Mb full-duplex rate support.";
+ description "10 Mb full-duplex rate support.";
}
bit _100mb-hd {
position 2;
- //description "100 Mb half-duplex rate support.";
+ description "100 Mb half-duplex rate support.";
}
bit _100mb-fd {
position 3;
- //description "100 Mb full-duplex rate support.";
+ description "100 Mb full-duplex rate support.";
}
bit _1gb-hd {
position 4;
- //description "1 Gb half-duplex rate support.";
+ description "1 Gb half-duplex rate support.";
}
bit _1gb-fd {
position 5;
- //description "1 Gb full-duplex rate support.";
+ description "1 Gb full-duplex rate support.";
}
bit _10gb-fd {
position 6;
- //description "10 Gb full-duplex rate support.";
+ description "10 Gb full-duplex rate support.";
}
bit _40gb-fd {
position 7;
- //description "40 Gb full-duplex rate support.";
+ description "40 Gb full-duplex rate support.";
}
bit _100gb-fd {
position 8;
- //description "100 Gb full-duplex rate support.";
+ description "100 Gb full-duplex rate support.";
}
bit _1tb-fd {
position 9;
- //description "1 Tb full-duplex rate support.";
+ description "1 Tb full-duplex rate support.";
}
bit other {
position 10;
- //description "Other rate, not in the list.";
+ description "Other rate, not in the list.";
}
bit copper {
position 11;
- //description "Copper medium.";
+ description "Copper medium.";
}
bit fiber {
position 12;
- //description "Fiber medium.";
+ description "Fiber medium.";
}
bit autoneg {
position 13;
- //description "Auto-negotiation.";
+ description "Auto-negotiation.";
}
bit pause {
position 14;
- //description "Pause.";
+ description "Pause.";
}
bit pause-asym {
position 15;
- //description "Asymmetric pause.";
+ description "Asymmetric pause.";
}
}
}
base oft:match-type-base;
}
- identity instruction {
+ identity instruction-base {
+ description "Base identity for instruction types";
}
- identity action {
+ identity action-base {
+ description "Base identity for action types";
}
typedef metadata {
}
typedef capabilities {
+ description "Capabilities supported by the datapath.";
type bits {
bit OFPC_FLOW_STATS {
position 0;
}
typedef switch-config-flag {
- /* Handling of IP fragments. */
+ description " Handling of IP fragments. ";
type enumeration {
enum FRAG_NORMAL {
value 0;
}
typedef flow-removed-reason {
- /* flow removed */
+ description "Why was this flow removed?";
type enumeration {
enum OFPRR_IDLE_TIMEOUT {
value 0;
}
typedef port-reason {
- /* port status */
+ description "What changed about the physical port";
type enumeration {
enum OFPPR_ADD {
value 0;
typedef flow-mod-command {
/* ofp_flow_mod_command */
type enumeration {
- enum OFPFC_ADD {
- value 0;
- description "New flow.";
+ enum OFPFC_ADD {
+ value 0;
+ description "New flow.";
}
enum OFPFC_MODIFY {
value 1;
type bits {
bit OFPFF_SEND_FLOW_REM {
position 0;
- /* Send flow removed message when flow expires or is deleted. */
+ description "Send flow removed message when flow expires or is deleted.";
}
bit OFPFF_CHECK_OVERLAP {
position 1;
- /* Check for overlapping entries first. */
+ description "Check for overlapping entries first.";
}
bit OFPFF_RESET_COUNTS {
position 2;
- /* Reset flow packet and byte counts. */
+ description "Reset flow packet and byte counts.";
}
bit OFPFF_NO_PKT_COUNTS {
position 3;
- /* Don't keep track of packet count. */
+ description "Don't keep track of packet count.";
}
bit OFPFF_NO_BYT_COUNTS {
position 4;
- /* Don't keep track of byte count. */
+ description "Don't keep track of byte count.";
}
}
}
typedef group-mod-command {
/* ofp_group_mod_command */
type enumeration {
- enum OFPGC_ADD {
- value 0;
- description "New group.";
+ enum OFPGC_ADD {
+ value 0;
+ description "New group.";
}
enum OFPGC_MODIFY {
value 1;
value 2;
description "Delete all matching groups.";
}
-
}
}
typedef group-type {
/* ofp_group_type */
type enumeration {
- enum OFPGT_ALL {
- value 0;
- description "All (multicast/broadcast) group.";
+ enum OFPGT_ALL {
+ value 0;
+ description "All (multicast/broadcast) group.";
}
enum OFPGT_SELECT {
value 1;
}
}
}
-
+
typedef table-values {
/* ofp_table */
type enumeration {
- enum OFPTT_MAX {
- value 254; // 0xfe
- description "Last usable table number.";
+ enum OFPTT_MAX {
+ value 254; // 0xfe
+ description "Last usable table number.";
}
enum OFPTT_ALL {
value 255; // 0xff
}
}
- typedef group {
- /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
- type enumeration {
- enum OFPG_MAX {
- value -256; //0xffffff00
- description "Last usable group number";
- }
-
- /* Fake groups. */
- enum OFPG_ALL {
- value -4; //0xfffffffc
- description "Represents all groups for group delete commands";
- }
- enum OFPG_ANY {
- value -1; //0xffffffff
- description "Wildcard group used only for flow stats requests.
- Selects all flows regardless of group (including flows with no group)";
-
- }
- }
-
- }
-
+ typedef group {
+ /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
+ type enumeration {
+ enum OFPG_MAX {
+ value -256; //0xffffff00
+ description "Last usable group number";
+ }
+ /* Fake groups. */
+ enum OFPG_ALL {
+ value -4; //0xfffffffc
+ description "Represents all groups for group delete commands";
+ }
+ enum OFPG_ANY {
+ value -1; //0xffffffff
+ description "Wildcard group used only for flow stats requests.
+ Selects all flows regardless of group (including flows with no group)";
+ }
+ }
+ }
+
typedef multipart-request-flags {
- description
- "enum ofp_multipart_request_flags ";
+ description "enum ofp_multipart_request_flags ";
type bits {
bit OFPMPF_REQ_MORE {
- //description "More requests to follow.";
+ description "More requests to follow.";
position 0;
}
}
}
typedef multipart-type {
- /* ofp_multipart_type */
type enumeration {
enum OFPMP_DESC {
value 0;
}
}
- typedef meter {
- /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
- type enumeration {
- enum OFPM_MAX {
- value -65536; //0xffff0000
- description "Last usable meter number";
- }
-
- /* Virtual meters. */
- enum OFPM_SLOWPATH {
- value -3; //0xfffffffd
- description "Meter for slow datapath";
- }
- enum OFPM_CONTROLLER {
- value -2; //0xfffffffe
- description "Meter for controller connection";
- }
- enum OFPM_ALL {
- value -1; //0xffffffff
- description "Represents all meters for stat requests commands";
- }
- }
-
- }
+ typedef meter {
+ description "Meter numbering. Flow meters can use any number up to OFPM_MAX";
+ type enumeration {
+ enum OFPM_MAX {
+ value -65536; //0xffff0000
+ description "Last usable meter number";
+ }
+ /* Virtual meters. */
+ enum OFPM_SLOWPATH {
+ value -3; //0xfffffffd
+ description "Meter for slow datapath";
+ }
+ enum OFPM_CONTROLLER {
+ value -2; //0xfffffffe
+ description "Meter for controller connection";
+ }
+ enum OFPM_ALL {
+ value -1; //0xffffffff
+ description "Represents all meters for stat requests commands";
+ }
+ }
+ }
typedef table-config {
/* ofp_table_config */
/* ofp_group_type */
type bits {
bit OFPGT_ALL {
- /* All (multicast/broadcast) group. */
+ description "All (multicast/broadcast) group.";
position 0;
}
bit OFPGT_SELECT {
- /* Select group. */
+ description "Select group.";
position 1;
}
bit OFPGT_INDIRECT {
- /* Indirect group. */
+ description "Indirect group.";
position 2;
}
bit OFPGT_FF {
- /* Fast failover group. */
+ description "Fast failover group.";
position 3;
}
}
/* ofp_group_capabilities */
type bits {
bit OFPGFC_SELECT_WEIGHT {
- /* Support weight for select groups */
+ description "Support weight for select groups";
position 0;
}
bit OFPGFC_SELECT_LIVENESS {
- /* Support liveness for select groups */
+ description "Support liveness for select groups";
position 1;
}
bit OFPGFC_CHAINING {
- /* Support chaining groups */
+ description "Support chaining group";
position 2;
}
bit OFPGFC_CHAINING_CHECKS {
- /* Check chaining for loops and delete */
+ description "Check chaining for loops and delete";
position 3;
}
}
}
typedef ipv6-exthdr-flags {
+ description "Bit definitions for IPv6 Extension Header pseudo-field.";
type bits {
bit nonext {
description "<No next header> encountered.";
}
typedef port-number-values-v10 {
+ description "Port numbering. Physical ports are numbered starting from 1.";
type enumeration {
enum MAX {
value 65280; // 0xff00
}
enum IN_PORT {
+ description "Send the packet out the input port. This
+ virtual port must be explicitly used
+ in order to send back out of the input
+ port.";
value 65528; // 0xfff8
}
enum TABLE {
+ description "Perform actions in flow table.
+ NB: This can only be the destination
+ port for packet-out messages.";
value 65529; // 0xfff9
}
enum NORMAL {
+ description "Process with normal L2/L3 switching.";
value 65530; // 0xfffa
}
enum FLOOD {
+ description "All physical ports except input port and
+ those disabled by STP.";
value 65531; // 0xfffb
}
enum ALL {
+ description "All physical ports except input port.";
value 65532; // 0xfffc
}
enum CONTROLLER {
+ description "Send to controller.";
value 65533; // 0xfffd
}
enum LOCAL {
+ description "Local openflow \"port\".";
value 65534; // 0xfffe
}
enum NONE {
+ description "Not associated with a physical port.";
value 65535; // 0xffff
}
}
to configure the port's behavior.";
type bits {
bit port-down {
- //description " Port is administratively down.";
+ description " Port is administratively down.";
position 0;
}
bit no-stp {
- //description" Disable 802.1D spanning tree on port.";
+ description" Disable 802.1D spanning tree on port.";
position 1;
}
bit no-recv {
- //description " Drop all packets received by port.";
+ description " Drop all packets received by port.";
position 2;
}
bit no-recv-stp {
- //description " Drop received 802.1D STP packets.";
+ description " Drop received 802.1D STP packets.";
position 3;
}
bit no-flood {
- //description " Do not include this port when flooding.";
+ description " Do not include this port when flooding.";
position 4;
}
bit no-fwd {
- //description " Drop packets forwarded to port.";
+ description " Drop packets forwarded to port.";
position 5;
}
bit no-packet-in {
- //description "Do not send packet-in msgs for port.";
+ description "Do not send packet-in msgs for port.";
position 6;
}
}
}
typedef port-state-v10 {
- description
- "Current state of the physical port. These are not configurable from
- the controller.";
+ description "Current state of the physical port. These are not configurable from
+ the controller.";
type bits {
bit link_down {
- //description "No physical link present.";
+ description "No physical link present.";
position 0;
}
bit blocked {
- //description "Port is blocked";
+ description "Port is blocked";
position 1;
}
bit live {
- //description "Live for Fast Failover Group.";
+ description "Live for Fast Failover Group.";
position 2;
}
bit stp_listen {
- //description "Not learning or relaying frames.";
+ description "Not learning or relaying frames.";
}
bit stp_learn {
- //description "Learning but not relaying frames.";
+ description "Learning but not relaying frames.";
}
bit stp_forward {
- //description "Learning and relaying frames.";
+ description "Learning and relaying frames.";
}
bit stp_block {
- //description "Not part of spanning tree.";
+ description "Not part of spanning tree.";
}
bit stp_mask {
- //description "Bit mask for OFPPS_STP_* values.";
+ description "Bit mask for OFPPS_STP_* values.";
}
}
}
typedef port-features-v10 {
- ////description "Features of ports available in datapath.";
- //reference "ofp_port_features";
+ description "Features of ports available in datapath.";
+ reference "ofp_port_features";
type bits {
bit _10mb-hd {
position 0;
- //description "10 Mb half-duplex rate support.";
+ description "10 Mb half-duplex rate support.";
}
bit _10mb-fd {
position 1;
- //description "10 Mb full-duplex rate support.";
+ description "10 Mb full-duplex rate support.";
}
bit _100mb-hd {
position 2;
- //description "100 Mb half-duplex rate support.";
+ description "100 Mb half-duplex rate support.";
}
bit _100mb-fd {
position 3;
- //description "100 Mb full-duplex rate support.";
+ description "100 Mb full-duplex rate support.";
}
bit _1gb-hd {
position 4;
- //description "1 Gb half-duplex rate support.";
+ description "1 Gb half-duplex rate support.";
}
bit _1gb-fd {
position 5;
- //description "1 Gb full-duplex rate support.";
+ description "1 Gb full-duplex rate support.";
}
bit _10gb-fd {
position 6;
- //description "10 Gb full-duplex rate support.";
+ description "10 Gb full-duplex rate support.";
}
bit copper {
position 7;
- //description "Copper medium.";
+ description "Copper medium.";
}
bit fiber {
position 8;
- //description "Fiber medium.";
+ description "Fiber medium.";
}
bit autoneg {
position 9;
- //description "Auto-negotiation.";
+ description "Auto-negotiation.";
}
bit pause {
position 10;
- //description "Pause.";
+ description "Pause.";
}
bit pause-asym {
position 11;
- //description "Asymmetric pause.";
+ description "Asymmetric pause.";
}
}
}
type bits {
bit OFPC_FLOW_STATS {
position 0;
- /* Flow statistics. */
+ description "Flow statistics.";
}
bit OFPC_TABLE_STATS {
position 1;
- /* Table statistics. */
+ description "Table statistics.";
}
bit OFPC_PORT_STATS {
position 2;
- /* Port statistics. */
+ description "Port statistics.";
}
bit OFPC_STP {
position 3;
- /* 802.1d spanning tree. */
+ description "802.1d spanning tree.";
}
bit OFPC_RESERVED {
position 4;
- /* Reserved, must be zero. */
+ description "Reserved, must be zero.";
}
bit OFPC_IP_REASM {
position 5;
- /* Can reassemble IP fragments. */
+ description "Can reassemble IP fragments.";
}
bit OFPC_QUEUE_STATS {
position 6;
- /* Queue statistics. */
+ description "Queue statistics.";
}
bit OFPC_ARP_MATCH_IP {
position 8;
- /* Match IP addresses in ARP pkts. */
+ description "Match IP addresses in ARP pkts.";
}
}
}
type bits {
bit OFPFF_SEND_FLOW_REM {
position 0;
- /* Send flow removed message when flow expires or is deleted. */
+ description "Send flow removed message when flow expires or is deleted.";
}
bit OFPFF_CHECK_OVERLAP {
position 1;
- /* Check for overlapping entries first. */
+ description "Check for overlapping entries first.";
}
bit OFPFF_EMERG {
position 2;
- /* Reset flow packet and byte counts. */
+ description "Reset flow packet and byte counts.";
}
}
}
type bits {
bit OFPAT_OUTPUT {
position 0;
- /* Output to switch port. */
+ description "Output to switch port.";
}
bit OFPAT_SET_VLAN_VID {
position 1;
- /* Set the 802.1q VLAN id. */
+ description "Set the 802.1q VLAN id.";
}
bit OFPAT_SET_VLAN_PCP {
position 2;
- /* Set the 802.1q priority. */
+ description "Set the 802.1q priority.";
}
bit OFPAT_STRIP_VLAN {
position 3;
- /* Strip the 802.1q header. */
+ description "Strip the 802.1q header.";
}
bit OFPAT_SET_DL_SRC {
position 4;
- /* Ethernet source address. */
+ description "Ethernet source address.";
}
bit OFPAT_SET_DL_DST {
position 5;
- /* Ethernet destination address. */
+ description "Ethernet destination address.";
}
bit OFPAT_SET_NW_SRC {
position 6;
- /* IP source address. */
+ description "IP source address.";
}
bit OFPAT_SET_NW_DST {
position 7;
- /* IP destination address. */
+ description "IP destination address.";
}
bit OFPAT_SET_NW_TOS {
position 8;
- /* IP ToS (DSCP field, 6 bits). */
+ description "IP ToS (DSCP field, 6 bits).";
}
bit OFPAT_SET_TP_SRC {
position 9;
- /* TCP/UDP source port. */
+ description "TCP/UDP source port.";
}
bit OFPAT_SET_TP_DST {
position 10;
- /* TCP/UDP destination port. */
+ description "TCP/UDP destination port.";
}
bit OFPAT_ENQUEUE {
position 11;
- /* Output to queue. */
+ description "Output to queue.";
}
bit OFPAT_VENDOR {
position 12;
- /* Experimenter in later versions */
+ description "Experimenter in later versions.";
}
}
}
typedef flow-wildcards-v10 {
/* ofp_flow_wildcards */
+ description "Flow wildcards - NW_SRC_MASK & NW_DST_MASK are handled separately";
type bits {
bit IN_PORT {
+ description "Switch input port.";
position 0;
}
bit DL_VLAN {
+ description "VLAN id.";
position 1;
}
bit DL_SRC {
+ description "Ethernet source address.";
position 2;
}
bit DL_DST {
+ description "Ethernet destination address.";
position 3;
}
bit DL_TYPE {
+ description "Ethernet frame type.";
position 4;
}
bit NW_PROTO {
+ description "IP protocol.";
position 5;
}
bit TP_SRC {
+ description "TCP/UDP source port.";
position 6;
}
bit TP_DST {
+ description "TCP/UDP destination port.";
position 7;
}
bit DL_VLAN_PCP {
+ description "VLAN priority.";
position 20;
}
bit NW_TOS {
+ description "IP ToS (DSCP field, 6 bits).";
position 21;
}
}
prefix "ofs";
revision "2013-09-27" {
- //description "Model of system messages used in OpenFlow Protocol Library";
+ description "Model of system messages used in OpenFlow Protocol Library";
}
notification disconnect-event {
+ description "Disconnect notification";
leaf info {
type string;
}
}
notification switch-idle-event {
+ description "Switch-idle notification";
leaf info {
type string;
}
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.common.action.rev130731.actions.ActionsList;
+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.ActionType;
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.GroupCapabilities;
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.MultipartReplyMessageBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.BucketsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.BucketsListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDropCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDscpRemarkCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandExperimenterCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.MultipartReplyTableFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeatures;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.multipart.reply.table.features.TableFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeatureProperties;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeaturePropertiesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder;
/**
* Translates MultipartReply messages
subInput.readBytes(byteCount);
flowStatsBuilder.setByteCount(new BigInteger(1, byteCount));
flowStatsBuilder.setMatch(MatchDeserializer.createMatch(subInput));
- flowStatsBuilder.setInstructions(InstructionsDeserializer.createInstructions(subInput, subInput.readableBytes()));
+ flowStatsBuilder.setInstruction(InstructionsDeserializer.createInstructions(subInput, subInput.readableBytes()));
flowStatsList.add(flowStatsBuilder.build());
}
flowBuilder.setFlowStats(flowStatsList);
if (type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONS)
|| type.equals(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS)) {
InstructionRelatedTableFeaturePropertyBuilder insBuilder = new InstructionRelatedTableFeaturePropertyBuilder();
- insBuilder.setInstructions(InstructionsDeserializer.createInstructionIds(input, propertyLength - COMMON_PROPERTY_LENGTH));
+ insBuilder.setInstruction(InstructionsDeserializer.createInstructionIds(input, propertyLength - COMMON_PROPERTY_LENGTH));
builder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insBuilder.build());
} else if (type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLES)
|| type.equals(TableFeaturesPropType.OFPTFPTNEXTTABLESMISS)) {
|| type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONS)
|| type.equals(TableFeaturesPropType.OFPTFPTAPPLYACTIONSMISS)) {
ActionRelatedTableFeaturePropertyBuilder actionBuilder = new ActionRelatedTableFeaturePropertyBuilder();
- actionBuilder.setActionsList(ActionsDeserializer.createActionIds(input, propertyLength - COMMON_PROPERTY_LENGTH));
+ actionBuilder.setAction(ActionsDeserializer.createActionIds(input, propertyLength - COMMON_PROPERTY_LENGTH));
builder.addAugmentation(ActionRelatedTableFeatureProperty.class, actionBuilder.build());
} else if (type.equals(TableFeaturesPropType.OFPTFPTMATCH)
|| type.equals(TableFeaturesPropType.OFPTFPTWILDCARDS)
bucketsBuilder.setWatchPort(new PortNumber(input.readUnsignedInt()));
bucketsBuilder.setWatchGroup(input.readUnsignedInt());
input.skipBytes(PADDING_IN_BUCKETS_HEADER);
- List<ActionsList> actionsList = ActionsDeserializer
- .createActionsList(input, bucketsLength - BUCKETS_HEADER_LENGTH);
- bucketsBuilder.setActionsList(actionsList);
+ List<Action> actionsList = ActionsDeserializer
+ .createActions(input, bucketsLength - BUCKETS_HEADER_LENGTH);
+ bucketsBuilder.setAction(actionsList);
bucketsList.add(bucketsBuilder.build());
actualLength += bucketsLength;
}
byte[] byteCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
input.readBytes(byteCount);
flowStatsBuilder.setByteCount(new BigInteger(1, byteCount));
- flowStatsBuilder.setActionsList(OF10ActionsDeserializer
+ flowStatsBuilder.setAction(OF10ActionsDeserializer
.createActionsList(input, length - LENGTH_OF_FLOW_STATS));
flowStatsList.add(flowStatsBuilder.build());
}
out.writeShort(createFlowModFlagsBitmask(message.getFlags()));
ByteBufUtils.padBuffer(PADDING_IN_FLOW_MOD_MESSAGE, out);
MatchSerializer.encodeMatch(message.getMatch(), out);
- InstructionsSerializer.encodeInstructions(message.getInstructions(), out);
+ InstructionsSerializer.encodeInstructions(message.getInstruction(), out);
}
@Override
public int computeLength(FlowModInput message) {
return MESSAGE_LENGTH + MatchSerializer.computeMatchLength(message.getMatch())
- + InstructionsSerializer.computeInstructionsLength(message.getInstructions());
+ + InstructionsSerializer.computeInstructionsLength(message.getInstruction());
}
@Override
import org.opendaylight.openflowjava.protocol.impl.util.ActionsSerializer;
import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.BucketsList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
/**
* Translates GroupMod messages
outBuffer.writeInt(currentBucket.getWatchPort().getValue().intValue());
outBuffer.writeInt(currentBucket.getWatchGroup().intValue());
ByteBufUtils.padBuffer(PADDING_IN_BUCKET, outBuffer);
- ActionsSerializer.encodeActions(currentBucket.getActionsList(), outBuffer);
+ ActionsSerializer.encodeActions(currentBucket.getAction(), outBuffer);
}
}
}
private static int computeLengthOfBucket(BucketsList bucket) {
int lengthOfBuckets = 0;
if (bucket != null) {
- lengthOfBuckets = LENGTH_OF_BUCKET_STRUCTURE + ActionsSerializer.computeLengthOfActions(bucket.getActionsList());
+ lengthOfBuckets = LENGTH_OF_BUCKET_STRUCTURE
+ + ActionsSerializer.computeLengthOfActions(bucket.getAction());
}
return lengthOfBuckets;
}
int lengthOfBuckets = 0;
if (buckets != null) {
for (BucketsList currentBucket : buckets) {
- lengthOfBuckets += LENGTH_OF_BUCKET_STRUCTURE + ActionsSerializer.computeLengthOfActions(currentBucket.getActionsList());
+ lengthOfBuckets += LENGTH_OF_BUCKET_STRUCTURE
+ + ActionsSerializer.computeLengthOfActions(currentBucket.getAction());
}
}
return lengthOfBuckets;
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.common.action.rev130731.actions.ActionsList;
+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.Experimenter;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;
+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.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.oxm.fields.MatchEntries;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;
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.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.MultipartRequestTableFeatures;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.multipart.request.table.features.TableFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeatureProperties;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;
/**
* Translates MultipartRequest messages
if (featProp.getAugmentation(InstructionRelatedTableFeatureProperty.class) != null) {
InstructionRelatedTableFeatureProperty property =
featProp.getAugmentation(InstructionRelatedTableFeatureProperty.class);
- length += property.getInstructions().size() * STRUCTURE_HEADER_LENGTH;
+ length += property.getInstruction().size() * STRUCTURE_HEADER_LENGTH;
length += paddingNeeded(length);
} else if (featProp.getAugmentation(NextTableRelatedTableFeatureProperty.class) != null) {
NextTableRelatedTableFeatureProperty property =
} else if (featProp.getAugmentation(ActionRelatedTableFeatureProperty.class) != null) {
ActionRelatedTableFeatureProperty property =
featProp.getAugmentation(ActionRelatedTableFeatureProperty.class);
- length += property.getActionsList().size() * STRUCTURE_HEADER_LENGTH;
+ length += property.getAction().size() * STRUCTURE_HEADER_LENGTH;
length += paddingNeeded(length);
} else if (featProp.getAugmentation(OxmRelatedTableFeatureProperty.class) != null) {
OxmRelatedTableFeatureProperty property =
private static void writeInstructionRelatedTableProperty(ByteBuf output,
TableFeatureProperties property, byte code) {
output.writeShort(code);
- List<Instructions> instructions = property.
- getAugmentation(InstructionRelatedTableFeatureProperty.class).getInstructions();
+ List<Instruction> instructions = property.
+ getAugmentation(InstructionRelatedTableFeatureProperty.class).getInstruction();
int length = TABLE_FEAT_HEADER_LENGTH;
int padding = 0;
if (instructions != null) {
- for (Instructions instruction : instructions) {
+ for (Instruction instruction : instructions) {
if (instruction.getType().isAssignableFrom(Experimenter.class)) {
length += EncodeConstants.EXPERIMENTER_IDS_LENGTH;
} else {
private static void writeActionsRelatedTableProperty(ByteBuf output,
TableFeatureProperties property, byte code) {
output.writeShort(code);
- List<ActionsList> actions = property.
- getAugmentation(ActionRelatedTableFeatureProperty.class).getActionsList();
+ List<Action> actions = property.
+ getAugmentation(ActionRelatedTableFeatureProperty.class).getAction();
int length = TABLE_FEAT_HEADER_LENGTH;
int padding = 0;
if (actions != null) {
- for (ActionsList action : actions) {
- if (action.getAction().getType().isAssignableFrom(Experimenter.class)) {
+ for (Action action : actions) {
+ if (action.getType().isAssignableFrom(Experimenter.class)) {
length += EncodeConstants.EXPERIMENTER_IDS_LENGTH;
} else {
length += STRUCTURE_HEADER_LENGTH;
out.writeInt(message.getBufferId().intValue());
out.writeShort(message.getOutPort().getValue().intValue());
out.writeShort(createFlowModFlagsBitmask(message.getFlagsV10()));
- OF10ActionsSerializer.encodeActionsV10(out, message.getActionsList());
+ OF10ActionsSerializer.encodeActionsV10(out, message.getAction());
}
@Override
public int computeLength(FlowModInput message) {
- return MESSAGE_LENGTH + OF10ActionsSerializer.computeActionsLength(message.getActionsList());
+ return MESSAGE_LENGTH + OF10ActionsSerializer.computeActionsLength(message.getAction());
}
@Override
ByteBufUtils.writeOFHeader(instance, message, out);
out.writeInt(message.getBufferId().intValue());
out.writeShort(message.getInPort().getValue().intValue());
- out.writeShort(OF10ActionsSerializer.computeActionsLength(message.getActionsList()));
- OF10ActionsSerializer.encodeActionsV10(out, message.getActionsList());
+ out.writeShort(OF10ActionsSerializer.computeActionsLength(message.getAction()));
+ OF10ActionsSerializer.encodeActionsV10(out, message.getAction());
byte[] data = message.getData();
if (data != null) {
out.writeBytes(data);
@Override
public int computeLength(PacketOutInput message) {
- int length = MESSAGE_LENGTH + OF10ActionsSerializer.computeActionsLength(message.getActionsList());
+ int length = MESSAGE_LENGTH + OF10ActionsSerializer.computeActionsLength(message.getAction());
byte[] data = message.getData();
if (data != null) {
length += data.length;
ByteBufUtils.writeOFHeader(instance, message, out);
out.writeInt(message.getBufferId().intValue());
out.writeInt(message.getInPort().getValue().intValue());
- out.writeShort(ActionsSerializer.computeLengthOfActions(message.getActionsList()));
+ out.writeShort(ActionsSerializer.computeLengthOfActions(message.getAction()));
ByteBufUtils.padBuffer(PADDING_IN_PACKET_OUT_MESSAGE, out);
- ActionsSerializer.encodeActions(message.getActionsList(), out);
+ ActionsSerializer.encodeActions(message.getAction(), out);
byte[] data = message.getData();
if (data != null) {
out.writeBytes(data);
@Override
public int computeLength(PacketOutInput message) {
int length = MESSAGE_LENGTH;
- length += ActionsSerializer.computeLengthOfActions(message.getActionsList());
+ length += ActionsSerializer.computeLengthOfActions(message.getAction());
byte[] data = message.getData();
if (data != null) {
length += data.length;
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.SetNwTtl;
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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;
+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.common.types.rev130731.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
* @param actionsLength length of buckets
* @return ActionsList
*/
- public static List<ActionsList> createActionsList(ByteBuf input, int actionsLength) {
- ActionsListBuilder actionsListBuilder = new ActionsListBuilder();
- List<ActionsList> actionsList = new ArrayList<>();
+ public static List<Action> createActions(ByteBuf input, int actionsLength) {
+ List<Action> actions = new ArrayList<>();
int length = 0;
while (length < actionsLength) {
int type = input.readUnsignedShort();
int currentActionLength = input.readUnsignedShort();
+ ActionBuilder actionBuilder = new ActionBuilder();
switch(type) {
case 0:
- actionsList.add(createOutputAction(input, actionsListBuilder));
+ actions.add(createOutputAction(input, actionBuilder));
break;
case 11:
- actionsList.add(createCopyTtlOutAction(input, actionsListBuilder));
+ actions.add(createCopyTtlOutAction(input, actionBuilder));
break;
case 12:
- actionsList.add(createCopyTtlInAction(input, actionsListBuilder));
+ actions.add(createCopyTtlInAction(input, actionBuilder));
break;
case 15:
- actionsList.add(createSetMplsTtlAction(input, actionsListBuilder));
+ actions.add(createSetMplsTtlAction(input, actionBuilder));
break;
case 16:
- actionsList.add(createDecMplsTtlOutAction(input, actionsListBuilder));
+ actions.add(createDecMplsTtlOutAction(input, actionBuilder));
break;
case 17:
- actionsList.add(createPushVlanAction(input, actionsListBuilder));
+ actions.add(createPushVlanAction(input, actionBuilder));
break;
case 18:
- actionsList.add(createPopVlanAction(input, actionsListBuilder));
+ actions.add(createPopVlanAction(input, actionBuilder));
break;
case 19:
- actionsList.add(createPushMplsAction(input, actionsListBuilder));
+ actions.add(createPushMplsAction(input, actionBuilder));
break;
case 20:
- actionsList.add(createPopMplsAction(input, actionsListBuilder));
+ actions.add(createPopMplsAction(input, actionBuilder));
break;
case 21:
- actionsList.add(createSetQueueAction(input, actionsListBuilder));
+ actions.add(createSetQueueAction(input, actionBuilder));
break;
case 22:
- actionsList.add(createGroupAction(input, actionsListBuilder));
+ actions.add(createGroupAction(input, actionBuilder));
break;
case 23:
- actionsList.add(createSetNwTtlAction(input, actionsListBuilder));
+ actions.add(createSetNwTtlAction(input, actionBuilder));
break;
case 24:
- actionsList.add(createDecNwTtlAction(input, actionsListBuilder));
+ actions.add(createDecNwTtlAction(input, actionBuilder));
break;
case 25:
- actionsList.add(createSetFieldAction(input, actionsListBuilder, currentActionLength));
+ actions.add(createSetFieldAction(input, actionBuilder, currentActionLength));
break;
case 26:
- actionsList.add(createPushPbbAction(input, actionsListBuilder));
+ actions.add(createPushPbbAction(input, actionBuilder));
break;
case 27:
- actionsList.add(createPopPbbAction(input, actionsListBuilder));
+ actions.add(createPopPbbAction(input, actionBuilder));
break;
case 0xFFFF:
- actionsList.add(createExperimenterAction(input, actionsListBuilder));
+ actions.add(createExperimenterAction(input, actionBuilder));
break;
default:
break;
}
length += currentActionLength;
}
- return actionsList;
+ return actions;
}
/**
* @param actionsLength length of actions
* @return ActionsList
*/
- public static List<ActionsList> createActionIds(ByteBuf input, int actionsLength) {
- List<ActionsList> actionsList = new ArrayList<>();
+ public static List<Action> createActionIds(ByteBuf input, int actionsLength) {
+ List<Action> actionsList = new ArrayList<>();
int length = 0;
ActionBuilder builder;
- ActionsListBuilder listBuilder;
while (length < actionsLength) {
+ builder = new ActionBuilder();
int type = input.readUnsignedShort();
int currentActionLength = input.readUnsignedShort();
- builder = new ActionBuilder();
- listBuilder = new ActionsListBuilder();
switch(type) {
case 0:
builder.setType(Output.class);
default:
break;
}
- listBuilder.setAction(builder.build());
- actionsList.add(listBuilder.build());
+ actionsList.add(builder.build());
length += currentActionLength;
}
return actionsList;
}
- private static ActionsList createEmptyHeader(Class<? extends org.opendaylight.yang.gen.v1.
- urn.opendaylight.openflow.common.types.rev130731.Action> action,
- ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createEmptyHeader(Class<? extends ActionBase> action,
+ ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(action);
in.skipBytes(PADDING_IN_ACTIONS_HEADER);
- actionsListBuilder.setAction(actionBuilder.build());
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createCopyTtlInAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(CopyTtlIn.class, in, actionsListBuilder);
+ private static Action createCopyTtlInAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(CopyTtlIn.class, in, actionBuilder);
}
- private static ActionsList createCopyTtlOutAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(CopyTtlOut.class, in, actionsListBuilder);
+ private static Action createCopyTtlOutAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(CopyTtlOut.class, in, actionBuilder);
}
- private static ActionsList createDecMplsTtlOutAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(DecMplsTtl.class, in, actionsListBuilder);
+ private static Action createDecMplsTtlOutAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(DecMplsTtl.class, in, actionBuilder);
}
- private static ActionsList createPopVlanAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(PopVlan.class, in, actionsListBuilder);
+ private static Action createPopVlanAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(PopVlan.class, in, actionBuilder);
}
- private static ActionsList createDecNwTtlAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(DecNwTtl.class, in, actionsListBuilder);
+ private static Action createDecNwTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(DecNwTtl.class, in, actionBuilder);
}
- private static ActionsList createPopPbbAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createEmptyHeader(PopPbb.class, in, actionsListBuilder);
+ private static Action createPopPbbAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createEmptyHeader(PopPbb.class, in, actionBuilder);
}
- private static ActionsList createOutputAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createOutputAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(Output.class);
PortActionBuilder port = new PortActionBuilder();
port.setPort(new PortNumber(in.readUnsignedInt()));
MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
maxLen.setMaxLength(in.readUnsignedShort());
actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
- actionsListBuilder.setAction(actionBuilder.build());
in.skipBytes(PADDING_IN_OUTPUT_ACTIONS_HEADER);
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createSetMplsTtlAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createSetMplsTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(SetMplsTtl.class);
MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();
mplsTtl.setMplsTtl(in.readUnsignedByte());
actionBuilder.addAugmentation(MplsTtlAction.class, mplsTtl.build());
- actionsListBuilder.setAction(actionBuilder.build());
in.skipBytes(PADDING_IN_SET_MPLS_TTL_ACTIONS_HEADER);
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createPushAction(Class<? extends org.opendaylight.yang.gen.
- v1.urn.opendaylight.openflow.common.types.rev130731.Action> action,
- ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createPushAction(Class<? extends ActionBase> action,
+ ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(action);
EthertypeActionBuilder etherType = new EthertypeActionBuilder();
etherType.setEthertype(new EtherType(in.readUnsignedShort()));
actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());
- actionsListBuilder.setAction(actionBuilder.build());
in.skipBytes(PADDING_IN_PUSH_VLAN_ACTIONS_HEADER);
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createPushVlanAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createPushAction(PushVlan.class, in, actionsListBuilder);
+ private static Action createPushVlanAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createPushAction(PushVlan.class, in, actionBuilder);
}
- private static ActionsList createPushMplsAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createPushAction(PushMpls.class, in, actionsListBuilder);
+ private static Action createPushMplsAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createPushAction(PushMpls.class, in, actionBuilder);
}
- private static ActionsList createPopMplsAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createPushAction(PopMpls.class, in, actionsListBuilder);
+ private static Action createPopMplsAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createPushAction(PopMpls.class, in, actionBuilder);
}
- private static ActionsList createPushPbbAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- return createPushAction(PushPbb.class, in, actionsListBuilder);
+ private static Action createPushPbbAction(ByteBuf in, ActionBuilder actionBuilder) {
+ return createPushAction(PushPbb.class, in, actionBuilder);
}
- private static ActionsList createSetQueueAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createSetQueueAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(SetQueue.class);
QueueIdActionBuilder queueId = new QueueIdActionBuilder();
queueId.setQueueId(in.readUnsignedInt());
actionBuilder.addAugmentation(QueueIdAction.class, queueId.build());
- actionsListBuilder.setAction(actionBuilder.build());
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createGroupAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createGroupAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(Group.class);
GroupIdActionBuilder group = new GroupIdActionBuilder();
group.setGroupId(in.readUnsignedInt());
actionBuilder.addAugmentation(GroupIdAction.class, group.build());
- actionsListBuilder.setAction(actionBuilder.build());
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createExperimenterAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createExperimenterAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(Experimenter.class);
ExperimenterActionBuilder experimenter = new ExperimenterActionBuilder();
experimenter.setExperimenter(in.readUnsignedInt());
actionBuilder.addAugmentation(ExperimenterAction.class, experimenter.build());
- actionsListBuilder.setAction(actionBuilder.build());
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createSetNwTtlAction(ByteBuf in, ActionsListBuilder actionsListBuilder) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createSetNwTtlAction(ByteBuf in, ActionBuilder actionBuilder) {
actionBuilder.setType(SetNwTtl.class);
NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();
nwTtl.setNwTtl(in.readUnsignedByte());
actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());
- actionsListBuilder.setAction(actionBuilder.build());
in.skipBytes(PADDING_IN_NW_TTL_ACTIONS_HEADER);
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
- private static ActionsList createSetFieldAction(ByteBuf in, ActionsListBuilder actionsListBuilder, int actionLength) {
- ActionBuilder actionBuilder = new ActionBuilder();
+ private static Action createSetFieldAction(ByteBuf in, ActionBuilder actionBuilder, int actionLength) {
actionBuilder.setType(SetField.class);
OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();
matchEntries.setMatchEntries(MatchDeserializer.createMatchEntry(in, actionLength - ACTION_HEADER_LENGTH));
actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());
- actionsListBuilder.setAction(actionBuilder.build());
- return actionsListBuilder.build();
+ return actionBuilder.build();
}
}
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.SetNwTtl;
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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;
+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;
/**
* Serializes ofp_actions (OpenFlow v1.3)
* @param actionsList list of actions to be encoded
* @param outBuffer output ByteBuf
*/
- public static void encodeActions(List<ActionsList> actionsList, ByteBuf outBuffer) {
+ public static void encodeActions(List<Action> actionsList, ByteBuf outBuffer) {
if (actionsList == null) {
return;
}
- for (ActionsList list : actionsList) {
- Action action = list.getAction();
+ for (Action action : actionsList) {
if (action.getType().isAssignableFrom(Output.class)) {
encodeOutputAction(action, outBuffer);
} else if (action.getType().isAssignableFrom(CopyTtlOut.class)) {
* @param actionsList list of actions to be encoded
* @param outBuffer output ByteBuf
*/
- public static void encodeActionIds(List<ActionsList> actionsList, ByteBuf outBuffer) {
+ public static void encodeActionIds(List<Action> actionsList, ByteBuf outBuffer) {
if (actionsList == null) {
return;
}
- for (ActionsList list : actionsList) {
- Action action = list.getAction();
+ for (Action action : actionsList) {
if (action.getType().isAssignableFrom(Output.class)) {
writeTypeAndLength(outBuffer, OUTPUT_CODE, ACTION_IDS_LENGTH);
} else if (action.getType().isAssignableFrom(CopyTtlOut.class)) {
* @param actionsList list of actions
* @return actions length
*/
- public static int computeLengthOfActions(List<ActionsList> actionsList) {
+ public static int computeLengthOfActions(List<Action> actionsList) {
int lengthOfActions = 0;
if (actionsList != null) {
- for (ActionsList list : actionsList) {
- Action action = list.getAction();
+ for (Action action : actionsList) {
if (action.getType().isAssignableFrom(Output.class)) {
lengthOfActions += OUTPUT_LENGTH;
} else if (action.getType().isAssignableFrom(SetField.class)){
package org.opendaylight.openflowjava.protocol.impl.util;
+import io.netty.buffer.ByteBuf;
+
import java.util.ArrayList;
import java.util.List;
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.WriteActions;
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.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.InstructionsBuilder;
-
-import io.netty.buffer.ByteBuf;
+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;
/**
* Deserializes ofp_instruction (OpenFlow v1.3) structures
* @param length
* @return list of ofp_instruction
*/
- public static List<Instructions> createInstructions(ByteBuf input, int length) {
- List<Instructions> instructions = new ArrayList<>();
+ public static List<Instruction> createInstructions(ByteBuf input, int length) {
+ List<Instruction> instructions = new ArrayList<>();
if (input.readableBytes() != 0) {
int lengthOfInstructions = length;
while (lengthOfInstructions > 0) {
- InstructionsBuilder builder = new InstructionsBuilder();
+ InstructionBuilder builder = new InstructionBuilder();
int type = input.readUnsignedShort();
int instructionLength = input.readUnsignedShort();
lengthOfInstructions -= instructionLength;
* @param length
* @return list of ofp_instruction without values
*/
- public static List<Instructions> createInstructionIds(ByteBuf input, int length) {
- List<Instructions> instructions = new ArrayList<>();
+ public static List<Instruction> createInstructionIds(ByteBuf input, int length) {
+ List<Instruction> instructions = new ArrayList<>();
if (input.readableBytes() != 0) {
int lengthOfInstructions = length;
while (lengthOfInstructions > 0) {
- InstructionsBuilder builder = new InstructionsBuilder();
+ InstructionBuilder builder = new InstructionBuilder();
int type = input.readUnsignedShort();
int instructionLength = input.readUnsignedShort();
lengthOfInstructions -= instructionLength;
return instructions;
}
- private static void createGotoTableInstruction(InstructionsBuilder builder,
+ private static void createGotoTableInstruction(InstructionBuilder builder,
ByteBuf input) {
builder.setType(GotoTable.class);
TableIdInstructionBuilder tableBuilder = new TableIdInstructionBuilder();
input.skipBytes(GOTO_TABLE_PADDING);
}
- private static void createMetadataInstruction(InstructionsBuilder builder,
+ private static void createMetadataInstruction(InstructionBuilder builder,
ByteBuf input) {
input.skipBytes(WRITE_METADATA_PADDING);
builder.setType(WriteMetadata.class);
}
private static void createActionRelatedInstruction(ByteBuf input,
- InstructionsBuilder builder, int actionsLength) {
+ InstructionBuilder builder, int actionsLength) {
input.skipBytes(ACTIONS_RELATED_INSTRUCTION_PADDING);
ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder();
- actionsBuilder.setActionsList(ActionsDeserializer.createActionsList(input, actionsLength));
+ actionsBuilder.setAction(ActionsDeserializer.createActions(input, actionsLength));
builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());
}
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.TableIdInstruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;
+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.ApplyActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Experimenter;
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.WriteActions;
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.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Instruction;
+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.InstructionBase;
/**
* Serializes ofp_instruction (OpenFlow v 1.3) structure
* @param instructions List of instructions
* @param out output buffer
*/
- public static void encodeInstructions(List<Instructions> instructions, ByteBuf out) {
+ public static void encodeInstructions(List<Instruction> instructions, ByteBuf out) {
if (instructions != null) {
- for (Instructions instruction : instructions) {
- Class<? extends Instruction> type = instruction.getType();
+ for (Instruction instruction : instructions) {
+ Class<? extends InstructionBase> type = instruction.getType();
if (type.isAssignableFrom(GotoTable.class)) {
writeTypeAndLength(out, GOTO_TABLE_TYPE, GOTO_TABLE_LENGTH);
out.writeByte(instruction.getAugmentation(TableIdInstruction.class).getTableId());
* @param instructions List of instruction identifiers (without values)
* @param out output buffer
*/
- public static void encodeInstructionIds(List<Instructions> instructions, ByteBuf out) {
+ public static void encodeInstructionIds(List<Instruction> instructions, ByteBuf out) {
if (instructions != null) {
- for (Instructions instruction : instructions) {
- Class<? extends Instruction> type = instruction.getType();
+ for (Instruction instruction : instructions) {
+ Class<? extends InstructionBase> type = instruction.getType();
if (type.isAssignableFrom(GotoTable.class)) {
writeTypeAndLength(out, GOTO_TABLE_TYPE, INSTRUCTION_IDS_LENGTH);
} else if (type.isAssignableFrom(WriteMetadata.class)) {
}
private static void writeActionsInstruction(ByteBuf out,
- Instructions instruction, int type) {
+ Instruction instruction, int type) {
out.writeShort(type);
if (instruction.getAugmentation(ActionsInstruction.class) != null) {
- List<ActionsList> actions = instruction.getAugmentation(ActionsInstruction.class).getActionsList();
+ List<Action> actions = instruction.getAugmentation(ActionsInstruction.class).getAction();
out.writeShort(ACTIONS_INSTRUCTION_LENGTH + ActionsSerializer.computeLengthOfActions(actions));
ByteBufUtils.padBuffer(PADDING_IN_ACTIONS_INSTRUCTION, out);
ActionsSerializer.encodeActions(actions, out);
* @param instructions List of instructions
* @return length of instructions (in bytes)
*/
- public static int computeInstructionsLength(List<Instructions> instructions) {
+ public static int computeInstructionsLength(List<Instruction> instructions) {
int length = 0;
if (instructions != null) {
- for (Instructions instruction : instructions) {
- Class<? extends Instruction> type = instruction.getType();
+ for (Instruction instruction : instructions) {
+ Class<? extends InstructionBase> type = instruction.getType();
if (type.isAssignableFrom(GotoTable.class)) {
length += GOTO_TABLE_LENGTH;
} else if (type.isAssignableFrom(WriteMetadata.class)) {
length += ACTIONS_INSTRUCTION_LENGTH;
if (instruction.getAugmentation(ActionsInstruction.class) != null) {
length += ActionsSerializer.computeLengthOfActions(
- instruction.getAugmentation(ActionsInstruction.class).getActionsList());
+ instruction.getAugmentation(ActionsInstruction.class).getAction());
}
} else if (type.isAssignableFrom(ApplyActions.class)) {
length += ACTIONS_INSTRUCTION_LENGTH;
if (instruction.getAugmentation(ActionsInstruction.class) != null) {
length += ActionsSerializer.computeLengthOfActions(
- instruction.getAugmentation(ActionsInstruction.class).getActionsList());
+ instruction.getAugmentation(ActionsInstruction.class).getAction());
}
} else if (type.isAssignableFrom(ClearActions.class)) {
length += ACTIONS_INSTRUCTION_LENGTH;
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.oxm.fields.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.MatchBuilder;
+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 com.google.common.base.Joiner;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;\r
\r
/**\r
* Encodes match ids (oxm_ids) needed in Multipart-TableFeatures messages\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
\r
/**\r
* Encodes match ids (oxm_ids) needed in Multipart-TableFeatures messages\r
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.oxm.fields.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;
+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.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.SetVlanVid;
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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;
+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 org.opendaylight.yangtools.yang.binding.Augmentation;
* @param input input ByteBuf
* @return ActionsList list of actions
*/
- public static List<ActionsList> createActionsList(ByteBuf input) {
- List<ActionsList> actions = new ArrayList<>();
+ public static List<Action> createActionsList(ByteBuf input) {
+ List<Action> actions = new ArrayList<>();
while (input.readableBytes() > 0) {
int type = input.readUnsignedShort();
input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
* @param actionsLength length of actions
* @return ActionsList list of actions
*/
- public static List<ActionsList> createActionsList(ByteBuf input, int actionsLength) {
- List<ActionsList> actions = new ArrayList<>();
+ public static List<Action> createActionsList(ByteBuf input, int actionsLength) {
+ List<Action> actions = new ArrayList<>();
int currentLength = 0;
while (currentLength < actionsLength) {
int type = input.readUnsignedShort();
return actions;
}
- private static ActionsList decodeAction(ByteBuf input, int type) {
- ActionsListBuilder actionsBuilder = new ActionsListBuilder();
- ActionsList actionsList = null;
+ private static Action decodeAction(ByteBuf input, int type) {
+ ActionBuilder actionsBuilder = new ActionBuilder();
+ Action actionsList = null;
switch(type) {
case 0:
actionsList = createOutputAction(input, actionsBuilder);
* @param builder
* @return ActionList
*/
- public static ActionsList createOutputAction(ByteBuf in, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Output.class);
- createPortAugmentation(in, actionBuilder);
+ public static Action createOutputAction(ByteBuf in, ActionBuilder builder) {
+ builder.setType(Output.class);
+ createPortAugmentation(in, builder);
MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
maxLen.setMaxLength(in.readUnsignedShort());
- actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
- builder.setAction(actionBuilder.build());
+ builder.addAugmentation(MaxLengthAction.class, maxLen.build());
return builder.build();
}
- private static ActionsList createSetVlanVidAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetVlanVid.class);
+ private static Action createSetVlanVidAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetVlanVid.class);
VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();
vlanBuilder.setVlanVid(input.readUnsignedShort());
input.skipBytes(PADDING_IN_SET_VLAN_VID_ACTION);
- actionBuilder.addAugmentation(VlanVidAction.class, vlanBuilder.build());
- builder.setAction(actionBuilder.build());
+ builder.addAugmentation(VlanVidAction.class, vlanBuilder.build());
return builder.build();
}
- private static ActionsList createVlanPcpAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetVlanPcp.class);
+ private static Action createVlanPcpAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetVlanPcp.class);
VlanPcpActionBuilder vlanBuilder = new VlanPcpActionBuilder();
vlanBuilder.setVlanPcp(input.readUnsignedByte());
input.skipBytes(PADDING_IN_SET_VLAN_PCP_ACTION);
- actionBuilder.addAugmentation(VlanPcpAction.class, vlanBuilder.build());
- builder.setAction(actionBuilder.build());
+ builder.addAugmentation(VlanPcpAction.class, vlanBuilder.build());
return builder.build();
}
- private static ActionsList createStripVlanAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(StripVlan.class);
+ private static Action createStripVlanAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(StripVlan.class);
input.skipBytes(PADDING_IN_STRIP_VLAN_ACTION);
- builder.setAction(actionBuilder.build());
return builder.build();
}
- private static ActionsList createSetDlSrcAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetDlSrc.class);
- actionBuilder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
- builder.setAction(actionBuilder.build());
+ private static Action createSetDlSrcAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetDlSrc.class);
+ builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
return builder.build();
}
- private static ActionsList createSetDlDstAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetDlDst.class);
- actionBuilder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
- builder.setAction(actionBuilder.build());
+ private static Action createSetDlDstAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetDlDst.class);
+ builder.addAugmentation(DlAddressAction.class, createDlAugmentationAndPad(input));
return builder.build();
}
return dlBuilder.build();
}
- private static ActionsList createSetNwSrcAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwSrc.class);
- actionBuilder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
- builder.setAction(actionBuilder.build());
+ private static Action createSetNwSrcAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetNwSrc.class);
+ builder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
return builder.build();
}
- private static ActionsList createSetNwDstAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwDst.class);
- actionBuilder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
- builder.setAction(actionBuilder.build());
+ private static Action createSetNwDstAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetNwDst.class);
+ builder.addAugmentation(IpAddressAction.class, createNwAddressAugmentationAndPad(input));
return builder.build();
}
return ipBuilder.build();
}
- private static ActionsList createSetNwTosAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetNwTos.class);
+ private static Action createSetNwTosAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetNwTos.class);
NwTosActionBuilder tosBuilder = new NwTosActionBuilder();
tosBuilder.setNwTos(input.readUnsignedByte());
- actionBuilder.addAugmentation(NwTosAction.class, tosBuilder.build());
+ builder.addAugmentation(NwTosAction.class, tosBuilder.build());
input.skipBytes(PADDING_IN_NW_TOS_ACTION);
- builder.setAction(actionBuilder.build());
return builder.build();
}
- private static ActionsList createSetTpSrcAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetTpSrc.class);
- createPortAugmentation(input, actionBuilder);
+ private static Action createSetTpSrcAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetTpSrc.class);
+ createPortAugmentation(input, builder);
input.skipBytes(PADDING_IN_TP_ACTION);
- builder.setAction(actionBuilder.build());
return builder.build();
}
- private static ActionsList createSetTpDstAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(SetTpDst.class);
- createPortAugmentation(input, actionBuilder);
+ private static Action createSetTpDstAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(SetTpDst.class);
+ createPortAugmentation(input, builder);
input.skipBytes(PADDING_IN_TP_ACTION);
- builder.setAction(actionBuilder.build());
return builder.build();
}
actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
}
- private static ActionsList createEnqueueAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Enqueue.class);
- createPortAugmentation(input, actionBuilder);
+ private static Action createEnqueueAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(Enqueue.class);
+ createPortAugmentation(input, builder);
input.skipBytes(PADDING_IN_ENQUEUE_ACTION);
QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();
queueBuilder.setQueueId(input.readUnsignedInt());
- actionBuilder.addAugmentation(QueueIdAction.class, queueBuilder.build());
- builder.setAction(actionBuilder.build());
+ builder.addAugmentation(QueueIdAction.class, queueBuilder.build());
return builder.build();
}
- private static ActionsList createExperimenterAction(ByteBuf input, ActionsListBuilder builder) {
- ActionBuilder actionBuilder = new ActionBuilder();
- actionBuilder.setType(Experimenter.class);
+ private static Action createExperimenterAction(ByteBuf input, ActionBuilder builder) {
+ builder.setType(Experimenter.class);
ExperimenterActionBuilder expBuilder = new ExperimenterActionBuilder();
expBuilder.setExperimenter(input.readUnsignedInt());
- actionBuilder.addAugmentation(ExperimenterAction.class, expBuilder.build());
- builder.setAction(actionBuilder.build());
+ builder.addAugmentation(ExperimenterAction.class, expBuilder.build());
return builder.build();
}
-
-
+
}
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.SetVlanVid;
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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
/**
* Serializes ofp_action (OpenFlow v1.0) structures
/**
* Encodes ofp_action (OpenFlow v1.0) structures
* @param out output ByteBuf that actions will be written into
- * @param actionsList actions to be encoded
+ * @param actions actions to be encoded
*/
- public static void encodeActionsV10(ByteBuf out, List<ActionsList> actionsList) {
- if (actionsList == null) {
+ public static void encodeActionsV10(ByteBuf out, List<Action> actions) {
+ if (actions == null) {
return;
}
- for (ActionsList list : actionsList) {
- Action action = list.getAction();
+ for (Action action : actions) {
if (action.getType().equals(Output.class)) {
encodeOutputAction(action, out);
} else if (action.getType().equals(SetVlanVid.class)) {
/**
* Computes length of actions
- * @param actionsList
+ * @param actions
* @return length of actions (OpenFlow v1.0)
*/
- public static int computeActionsLength(List<ActionsList> actionsList) {
+ public static int computeActionsLength(List<Action> actions) {
int length = 0;
- if (actionsList != null) {
- for (ActionsList list : actionsList) {
- Action action = list.getAction();
+ if (actions != null) {
+ for (Action action : actions) {
if (action.getType().equals(Output.class)) {
length += 8;
} else if (action.getType().equals(SetVlanVid.class)) {
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
Assert.assertEquals("Wrong outputType", Output.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getType());
Assert.assertEquals("Wrong outputPort", 4351,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getAugmentation(PortAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getAugmentation(PortAction.class).
getPort().getValue().intValue());
Assert.assertEquals("Wrong outputMaxLen", 65535,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getAugmentation(MaxLengthAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getAugmentation(MaxLengthAction.class).
getMaxLength().intValue());
Assert.assertEquals("Wrong copyTtlOutType", CopyTtlOut.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getType());
Assert.assertEquals("Wrong copyTtlInType", CopyTtlIn.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(2).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
+ .getType());
}
/**
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
Assert.assertEquals("Wrong setMplsTtlType", SetMplsTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getType());
Assert.assertEquals("Wrong setMplsTtlMPLS_TTL", 9,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getAugmentation(MplsTtlAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getAugmentation(MplsTtlAction.class).
getMplsTtl().intValue());
Assert.assertEquals("Wrong decMplsTtlType", DecMplsTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getType());
Assert.assertEquals("Wrong pushVlanType", PushVlan.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(2).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
+ .getType());
Assert.assertEquals("Wrong pushVlanEthertype", 32,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(2).
- getAction().getAugmentation(EthertypeAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
+ .getAugmentation(EthertypeAction.class).
getEthertype().getValue().intValue());
Assert.assertEquals("Wrong pushMplsType", PushMpls.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(3).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
+ .getType());
Assert.assertEquals("Wrong pushMplsEthertype", 255,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(3).
- getAction().getAugmentation(EthertypeAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3).
+ getAugmentation(EthertypeAction.class).
getEthertype().getValue().intValue());
Assert.assertEquals("Wrong pushPbbType", PushPbb.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(4).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
+ .getType());
Assert.assertEquals("Wrong pushPbbEthertype", 4095,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(4).
- getAction().getAugmentation(EthertypeAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
+ .getAugmentation(EthertypeAction.class).
getEthertype().getValue().intValue());
}
Assert.assertEquals("Wrong bucketWatchGroup", 4,
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
Assert.assertEquals("Wrong popVlanType", PopVlan.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getType());
Assert.assertEquals("Wrong popPbbType", PopPbb.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getType());
Assert.assertEquals("Wrong popMplsType", PopMpls.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(2).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
+ .getType());
Assert.assertEquals("Wrong popMplsEthertype", 207,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(2).
- getAction().getAugmentation(EthertypeAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(2)
+ .getAugmentation(EthertypeAction.class).
getEthertype().getValue().intValue());
Assert.assertEquals("Wrong setQueueType", SetQueue.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(3).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
+ .getType());
Assert.assertEquals("Wrong setQueueQueueId", 13565952,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(3).
- getAction().getAugmentation(QueueIdAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(3)
+ .getAugmentation(QueueIdAction.class).
getQueueId().intValue());
Assert.assertEquals("Wrong groupType", Group.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(4).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
+ .getType());
Assert.assertEquals("Wrong groupGroupId", 13565952,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(4).
- getAction().getAugmentation(GroupIdAction.class).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(4)
+ .getAugmentation(GroupIdAction.class).
getGroupId().intValue());
Assert.assertEquals("Wrong decNwTtlType", DecNwTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(5).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(5)
+ .getType());
}
/**
message.getGroupDesc().get(0).getBucketsList().get(0).getWatchGroup().intValue());
Assert.assertEquals("Wrong nwTTlType", SetNwTtl.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getType());
Assert.assertEquals("Wrong nwTTlnwTTL", 14,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(0).
- getAction().getAugmentation(NwTtlAction.class).getNwTtl().intValue());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(0)
+ .getAugmentation(NwTtlAction.class).getNwTtl().intValue());
Assert.assertEquals("Wrong setFieldType", SetField.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getType());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getType());
Assert.assertEquals("Wrong setFieldOXMClass", OpenflowBasicClass.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmClass());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmClass());
Assert.assertEquals("Wrong setFieldOXMField", InPort.class,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmMatchField());
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).getOxmMatchField());
Assert.assertEquals("Wrong setFieldOXMValue", 255,
- message.getGroupDesc().get(0).getBucketsList().get(0).getActionsList().get(1).
- getAction().getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).
+ message.getGroupDesc().get(0).getBucketsList().get(0).getAction().get(1)
+ .getAugmentation(OxmFieldsAction.class).getMatchEntries().get(0).
getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyAggregateCase;\r
Assert.assertEquals("Wrong byteCount",\r
new BigInteger(1, new byte[]{(byte) 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}), \r
message.getFlowStats().get(0).getByteCount());\r
- Action action1 = message.getFlowStats().get(0).getActionsList().get(0).getAction();\r
+ Action action1 = message.getFlowStats().get(0).getAction().get(0);\r
Assert.assertEquals("Wrong action type", Output.class, action1.getType());\r
Assert.assertEquals("Wrong action port", 1, action1.getAugmentation(PortAction.class)\r
.getPort().getValue().intValue());\r
Assert.assertEquals("Wrong action port", 2, action1.getAugmentation(MaxLengthAction.class)\r
.getMaxLength().intValue());\r
- Action action2 = message.getFlowStats().get(0).getActionsList().get(1).getAction();\r
+ Action action2 = message.getFlowStats().get(0).getAction().get(1);\r
Assert.assertEquals("Wrong action type", SetVlanVid.class, action2.getType());\r
Assert.assertEquals("Wrong action port", 3, action2.getAugmentation(VlanVidAction.class)\r
.getVlanVid().intValue());\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;
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.WriteMetadata;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.InstructionsBuilder;
+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.FlowModCommand;
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.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.rev130731.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;
+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.protocol.rev130731.FlowModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.MatchBuilder;
/**
* @author timotej.kubas
entries.add(entriesBuilder.build());
matchBuilder.setMatchEntries(entries);
builder.setMatch(matchBuilder.build());
- List<Instructions> instructions = new ArrayList<>();
- InstructionsBuilder insBuilder = new InstructionsBuilder();
+ List<Instruction> instructions = new ArrayList<>();
+ InstructionBuilder insBuilder = new InstructionBuilder();
insBuilder.setType(GotoTable.class);
TableIdInstructionBuilder idBuilder = new TableIdInstructionBuilder();
idBuilder.setTableId((short) 43);
metaBuilder.setMetadataMask(cookieMask);
insBuilder.addAugmentation(MetadataInstruction.class, metaBuilder.build());
instructions.add(insBuilder.build());
- insBuilder = new InstructionsBuilder();
+ insBuilder = new InstructionBuilder();
insBuilder.setType(ApplyActions.class);
insBuilder.addAugmentation(MetadataInstruction.class, metaBuilder.build());
instructions.add(insBuilder.build());
- builder.setInstructions(instructions);
+ builder.setInstruction(instructions);
FlowModInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.BucketsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.BucketsListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsListBuilder;
/**
* @author timotej.kubas
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;
+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.FlowModCommand;
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;
builder.setBufferId(2L);
builder.setOutPort(new PortNumber(4422L));
builder.setFlagsV10(new FlowModFlagsV10(true, false, true));
- List<ActionsList> actions = new ArrayList<>();
- ActionsListBuilder actionsListBuilder = new ActionsListBuilder();
+ List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setType(SetNwDst.class);
IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();
ipBuilder.setIpAddress(new Ipv4Address("2.2.2.2"));
actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());
- actionsListBuilder.setAction(actionBuilder.build());
- actions.add(actionsListBuilder.build());
+ actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setType(SetTpSrc.class);
PortActionBuilder portBuilder = new PortActionBuilder();
portBuilder.setPort(new PortNumber(42L));
actionBuilder.addAugmentation(PortAction.class, portBuilder.build());
- actionsListBuilder.setAction(actionBuilder.build());
- actions.add(actionsListBuilder.build());
- builder.setActionsList(actions);
+ actions.add(actionBuilder.build());
+ builder.setAction(actions);
FlowModInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;
+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 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInputBuilder;
BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
builder.setBufferId(256L);
builder.setInPort(new PortNumber(257L));
- List<ActionsList> actions = new ArrayList<>();
- ActionsListBuilder actionsListBuilder = new ActionsListBuilder();
+ List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setType(Output.class);
PortActionBuilder portBuilder = new PortActionBuilder();
MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();
maxLen.setMaxLength(50);
actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());
- actionsListBuilder.setAction(actionBuilder.build());
- actions.add(actionsListBuilder.build());
- actionsListBuilder = new ActionsListBuilder();
+ actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setType(StripVlan.class);
- actionsListBuilder.setAction(actionBuilder.build());
- builder.setActionsList(actions);
- actions.add(actionsListBuilder.build());
- builder.setActionsList(actions);
+ builder.setAction(actions);
+ actions.add(actionBuilder.build());
+ builder.setAction(actions);
builder.setData(ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14"));
PacketOutInput message = builder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.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.ActionsList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;
+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 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
builder.setBufferId(256L);
builder.setInPort(new PortNumber(256L));
- List<ActionsList> actions = new ArrayList<>();
- ActionsListBuilder actionsListBuilder = new ActionsListBuilder();
+ List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setType(PushVlan.class);
EthertypeActionBuilder ethertypeBuilder = new EthertypeActionBuilder();
ethertypeBuilder.setEthertype(new EtherType(25));
actionBuilder.addAugmentation(EthertypeAction.class, ethertypeBuilder.build());
- actionsListBuilder.setAction(actionBuilder.build());
- actions.add(actionsListBuilder.build());
+ actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setType(PopVlan.class);
- actionsListBuilder.setAction(actionBuilder.build());
- actions.add(actionsListBuilder.build());
- builder.setActionsList(actions);
+ actions.add(actionBuilder.build());
+ builder.setAction(actions);
builder.setData(ByteBufUtils.hexStringToBytes("00 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14"));
PacketOutInput message = builder.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteActions;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.InstructionsBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartRequestFlags;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm0Class;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.Nxm1Class;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableFeaturesCaseBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.MultipartRequestTableFeaturesBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.multipart.request.table.features.TableFeatures;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table.features._case.multipart.request.table.features.TableFeaturesBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeatureProperties;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.TableFeaturePropertiesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder;\r
\r
/**\r
* @author michal.polkorab\r
propBuilder.setType(TableFeaturesPropType.OFPTFPTINSTRUCTIONS);\r
InstructionRelatedTableFeaturePropertyBuilder insPropBuilder =\r
new InstructionRelatedTableFeaturePropertyBuilder();\r
- List<Instructions> insIds = new ArrayList<>();\r
- InstructionsBuilder insBuilder = new InstructionsBuilder();\r
+ List<Instruction> insIds = new ArrayList<>();\r
+ InstructionBuilder insBuilder = new InstructionBuilder();\r
insBuilder.setType(WriteActions.class);\r
insIds.add(insBuilder.build());\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(GotoTable.class);\r
insIds.add(insBuilder.build());\r
- insPropBuilder.setInstructions(insIds);\r
+ insPropBuilder.setInstruction(insIds);\r
propBuilder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insPropBuilder.build());\r
properties.add(propBuilder.build());\r
propBuilder = new TableFeaturePropertiesBuilder();\r
propBuilder.setType(TableFeaturesPropType.OFPTFPTINSTRUCTIONSMISS);\r
insPropBuilder = new InstructionRelatedTableFeaturePropertyBuilder();\r
insIds = new ArrayList<>();\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(WriteMetadata.class);\r
insIds.add(insBuilder.build());\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(ApplyActions.class);\r
insIds.add(insBuilder.build());\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(Meter.class);\r
insIds.add(insBuilder.build());\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(ClearActions.class);\r
insIds.add(insBuilder.build());\r
- insBuilder = new InstructionsBuilder();\r
+ insBuilder = new InstructionBuilder();\r
insBuilder.setType(GotoTable.class);\r
insIds.add(insBuilder.build());\r
- insPropBuilder.setInstructions(insIds);\r
+ insPropBuilder.setInstruction(insIds);\r
propBuilder.addAugmentation(InstructionRelatedTableFeatureProperty.class, insPropBuilder.build());\r
properties.add(propBuilder.build());\r
tableFeaturesBuilder.setTableFeatureProperties(properties);\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortNumberMatchEntry;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
\r
message.skipBytes(4); // skip XID\r
LOGGER.info("bytes: " + message.readableBytes());\r
- List<ActionsList> actions = ActionsDeserializer.createActionsList(message, message.readableBytes());\r
+ List<Action> actions = ActionsDeserializer.createActions(message, message.readableBytes());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.Output", actions.get(0).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.Output", actions.get(0).getType().getName());\r
Assert.assertEquals("Wrong action port", 1,\r
- actions.get(0).getAction().getAugmentation(PortAction.class).getPort().getValue().intValue());\r
+ actions.get(0).getAugmentation(PortAction.class).getPort().getValue().intValue());\r
Assert.assertEquals("Wrong action max-length", 2,\r
- actions.get(0).getAction().getAugmentation(MaxLengthAction.class).getMaxLength().intValue());\r
+ actions.get(0).getAugmentation(MaxLengthAction.class).getMaxLength().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.CopyTtlOut", actions.get(1).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.CopyTtlOut", actions.get(1).getType().getName());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.CopyTtlIn", actions.get(2).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.CopyTtlIn", actions.get(2).getType().getName());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.SetMplsTtl", actions.get(3).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.SetMplsTtl", actions.get(3).getType().getName());\r
Assert.assertEquals("Wrong action value", 3,\r
- actions.get(3).getAction().getAugmentation(MplsTtlAction.class).getMplsTtl().shortValue());\r
+ actions.get(3).getAugmentation(MplsTtlAction.class).getMplsTtl().shortValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.DecMplsTtl", actions.get(4).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.DecMplsTtl", actions.get(4).getType().getName());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PushVlan", actions.get(5).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PushVlan", actions.get(5).getType().getName());\r
Assert.assertEquals("Wrong action value", 4,\r
- actions.get(5).getAction().getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
+ actions.get(5).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PopVlan", actions.get(6).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PopVlan", actions.get(6).getType().getName());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PushMpls", actions.get(7).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PushMpls", actions.get(7).getType().getName());\r
Assert.assertEquals("Wrong action value", 5,\r
- actions.get(7).getAction().getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
+ actions.get(7).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PopMpls", actions.get(8).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PopMpls", actions.get(8).getType().getName());\r
Assert.assertEquals("Wrong action value", 6,\r
- actions.get(8).getAction().getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
+ actions.get(8).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.SetQueue", actions.get(9).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.SetQueue", actions.get(9).getType().getName());\r
Assert.assertEquals("Wrong action value", 7,\r
- actions.get(9).getAction().getAugmentation(QueueIdAction.class).getQueueId().intValue());\r
+ actions.get(9).getAugmentation(QueueIdAction.class).getQueueId().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.Group", actions.get(10).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.Group", actions.get(10).getType().getName());\r
Assert.assertEquals("Wrong action value", 8,\r
- actions.get(10).getAction().getAugmentation(GroupIdAction.class).getGroupId().intValue());\r
+ actions.get(10).getAugmentation(GroupIdAction.class).getGroupId().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.SetNwTtl", actions.get(11).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.SetNwTtl", actions.get(11).getType().getName());\r
Assert.assertEquals("Wrong action value", 9,\r
- actions.get(11).getAction().getAugmentation(NwTtlAction.class).getNwTtl().intValue());\r
+ actions.get(11).getAugmentation(NwTtlAction.class).getNwTtl().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.DecNwTtl", actions.get(12).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.DecNwTtl", actions.get(12).getType().getName());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.SetField", actions.get(13).getAction().getType().getName());\r
- List<MatchEntries> entries = actions.get(13).getAction().getAugmentation(OxmFieldsAction.class).getMatchEntries();\r
+ + "openflow.common.action.rev130731.SetField", actions.get(13).getType().getName());\r
+ List<MatchEntries> entries = actions.get(13).getAugmentation(OxmFieldsAction.class).getMatchEntries();\r
Assert.assertEquals("Wrong number of fields", 1, entries.size());\r
Assert.assertEquals("Wrong match entry class", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow."\r
+ "oxm.rev130731.OpenflowBasicClass", entries.get(0).getOxmClass().getName());\r
Assert.assertEquals("Wrong match entry value", 11, \r
entries.get(0).getAugmentation(PortNumberMatchEntry.class).getPortNumber().getValue().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PushPbb", actions.get(14).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PushPbb", actions.get(14).getType().getName());\r
Assert.assertEquals("Wrong action value", 10,\r
- actions.get(14).getAction().getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
+ actions.get(14).getAugmentation(EthertypeAction.class).getEthertype().getValue().intValue());\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight."\r
- + "openflow.common.action.rev130731.PopPbb", actions.get(15).getAction().getType().getName());\r
+ + "openflow.common.action.rev130731.PopPbb", actions.get(15).getType().getName());\r
Assert.assertTrue("Unread data in message", message.readableBytes() == 0);\r
}\r
\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.InPort;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.OpenflowBasicClass;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;\r
\r
/**\r
* @author michal.polkorab\r
*/\r
@Test\r
public void test() {\r
- List<ActionsList> actions = new ArrayList<>();\r
- ActionsListBuilder listBuilder = new ActionsListBuilder();\r
+ List<Action> actions = new ArrayList<>();\r
ActionBuilder actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Output.class);\r
PortActionBuilder port = new PortActionBuilder();\r
MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();\r
maxLen.setMaxLength(52);\r
actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(CopyTtlOut.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(CopyTtlIn.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetMplsTtl.class);\r
MplsTtlActionBuilder mplsTtl = new MplsTtlActionBuilder();\r
mplsTtl.setMplsTtl((short) 4);\r
actionBuilder.addAugmentation(MplsTtlAction.class, mplsTtl.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(DecMplsTtl.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PushVlan.class);\r
EthertypeActionBuilder etherType = new EthertypeActionBuilder();\r
etherType.setEthertype(new EtherType(16));\r
actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PopVlan.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PushMpls.class);\r
etherType = new EthertypeActionBuilder();\r
etherType.setEthertype(new EtherType(17));\r
actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PopMpls.class);\r
etherType = new EthertypeActionBuilder();\r
etherType.setEthertype(new EtherType(18));\r
actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetQueue.class);\r
QueueIdActionBuilder queueId = new QueueIdActionBuilder();\r
queueId.setQueueId(1234L);\r
actionBuilder.addAugmentation(QueueIdAction.class, queueId.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Group.class);\r
GroupIdActionBuilder group = new GroupIdActionBuilder();\r
group.setGroupId(555L);\r
actionBuilder.addAugmentation(GroupIdAction.class, group.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetNwTtl.class);\r
NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();\r
nwTtl.setNwTtl((short) 8);\r
actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(DecNwTtl.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetField.class);\r
OxmFieldsActionBuilder matchEntries = new OxmFieldsActionBuilder();\r
entries.add(matchBuilder.build());\r
matchEntries.setMatchEntries(entries);\r
actionBuilder.addAugmentation(OxmFieldsAction.class, matchEntries.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PushPbb.class);\r
etherType = new EthertypeActionBuilder();\r
etherType.setEthertype(new EtherType(19));\r
actionBuilder.addAugmentation(EthertypeAction.class, etherType.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(PopPbb.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Experimenter.class);\r
ExperimenterActionBuilder experimenter = new ExperimenterActionBuilder();\r
experimenter.setExperimenter(4L);\r
actionBuilder.addAugmentation(ExperimenterAction.class, experimenter.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
+ actions.add(actionBuilder.build());\r
\r
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();\r
ActionsSerializer.encodeActions(actions, out);\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.PortAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
\r
/**\r
* @author michal.polkorab\r
+ "00 16 00 08 00 00 00 50 00 04 00 18 00 00 00 00 00 15 00 08 00 00 00 25 00 0F 00 08 05 00 00 00");\r
\r
message.skipBytes(4); // skip XID\r
- List<Instructions> instructions = InstructionsDeserializer.createInstructions(message, message.readableBytes());\r
- Instructions i1 = instructions.get(0);\r
+ List<Instruction> instructions = InstructionsDeserializer.createInstructions(message, message.readableBytes());\r
+ Instruction i1 = instructions.get(0);\r
Assert.assertEquals("Wrong type - i1", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.GotoTable", i1.getType().getName());\r
Assert.assertEquals("Wrong table-id - i1", 10, i1.getAugmentation(TableIdInstruction.class).getTableId().intValue());\r
- Instructions i2 = instructions.get(1);\r
+ Instruction i2 = instructions.get(1);\r
Assert.assertEquals("Wrong type - i2", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.WriteMetadata", i2.getType().getName());\r
Assert.assertArrayEquals("Wrong metadata - i2", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 20"),\r
i2.getAugmentation(MetadataInstruction.class).getMetadata());\r
Assert.assertArrayEquals("Wrong metadata-mask - i2", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 30"),\r
i2.getAugmentation(MetadataInstruction.class).getMetadataMask());\r
- Instructions i3 = instructions.get(2);\r
+ Instruction i3 = instructions.get(2);\r
Assert.assertEquals("Wrong type - i3", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.ClearActions", i3.getType().getName());\r
- Assert.assertEquals("Wrong instructions - i3", 0, i3.getAugmentation(ActionsInstruction.class).getActionsList().size());\r
- Instructions i4 = instructions.get(3);\r
+ Assert.assertEquals("Wrong instructions - i3", 0, i3.getAugmentation(ActionsInstruction.class).getAction().size());\r
+ Instruction i4 = instructions.get(3);\r
Assert.assertEquals("Wrong type - i4", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.Meter", i4.getType().getName());\r
Assert.assertEquals("Wrong meterId - i4", 66051, i4.getAugmentation(MeterIdInstruction.class).getMeterId().intValue());\r
- Instructions i5 = instructions.get(4);\r
+ Instruction i5 = instructions.get(4);\r
Assert.assertEquals("Wrong type - i5", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.WriteActions", i5.getType().getName());\r
- Assert.assertEquals("Wrong instructions - i5", 2, i5.getAugmentation(ActionsInstruction.class).getActionsList().size());\r
- Action action1 = i5.getAugmentation(ActionsInstruction.class).getActionsList().get(0).getAction();\r
+ Assert.assertEquals("Wrong instructions - i5", 2, i5.getAugmentation(ActionsInstruction.class).getAction().size());\r
+ Action action1 = i5.getAugmentation(ActionsInstruction.class).getAction().get(0);\r
Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Output",\r
action1.getType().getName());\r
Assert.assertEquals("Wrong action", 37, action1.getAugmentation(PortAction.class).getPort().getValue().intValue());\r
Assert.assertEquals("Wrong action", 53, action1.getAugmentation(MaxLengthAction.class).getMaxLength().intValue());\r
- Action action2 = i5.getAugmentation(ActionsInstruction.class).getActionsList().get(1).getAction();\r
+ Action action2 = i5.getAugmentation(ActionsInstruction.class).getAction().get(1);\r
Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.Group",\r
action2.getType().getName());\r
Assert.assertEquals("Wrong action", 80, action2.getAugmentation(GroupIdAction.class).getGroupId().intValue());\r
- Instructions i6 = instructions.get(5);\r
+ Instruction i6 = instructions.get(5);\r
Assert.assertEquals("Wrong type - i6", "org.opendaylight.yang.gen.v1.urn."\r
+ "opendaylight.openflow.common.instruction.rev130731.ApplyActions", i6.getType().getName());\r
- Assert.assertEquals("Wrong instructions - i6", 2, i6.getAugmentation(ActionsInstruction.class).getActionsList().size());\r
- action1 = i6.getAugmentation(ActionsInstruction.class).getActionsList().get(0).getAction();\r
+ Assert.assertEquals("Wrong instructions - i6", 2, i6.getAugmentation(ActionsInstruction.class).getAction().size());\r
+ action1 = i6.getAugmentation(ActionsInstruction.class).getAction().get(0);\r
Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetQueue",\r
action1.getType().getName());\r
Assert.assertEquals("Wrong action", 37, action1.getAugmentation(QueueIdAction.class).getQueueId().intValue());\r
- action2 = i6.getAugmentation(ActionsInstruction.class).getActionsList().get(1).getAction();\r
+ action2 = i6.getAugmentation(ActionsInstruction.class).getAction().get(1);\r
Assert.assertEquals("Wrong action", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetMplsTtl",\r
action2.getType().getName());\r
Assert.assertEquals("Wrong action", 5, action2.getAugmentation(MplsTtlAction.class).getMplsTtl().intValue());\r
import java.util.ArrayList;\r
import java.util.List;\r
\r
-\r
-\r
-\r
import org.junit.Assert;\r
import org.junit.Test;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.ActionsInstruction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PopPbb;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetNwTtl;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ApplyActions;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.ClearActions;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.GotoTable;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.Meter;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteActions;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.WriteMetadata;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.InstructionsBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
\r
*/\r
@Test\r
public void test() {\r
- List<Instructions> instructions = new ArrayList<>();\r
+ List<Instruction> instructions = new ArrayList<>();\r
// Goto_table instruction\r
- InstructionsBuilder builder = new InstructionsBuilder();\r
+ InstructionBuilder builder = new InstructionBuilder();\r
builder.setType(GotoTable.class);\r
TableIdInstructionBuilder tableIdBuilder = new TableIdInstructionBuilder();\r
tableIdBuilder.setTableId((short) 5);\r
builder.addAugmentation(TableIdInstruction.class, tableIdBuilder.build());\r
instructions.add(builder.build());\r
- builder = new InstructionsBuilder();\r
+ builder = new InstructionBuilder();\r
// Write_metadata instruction\r
builder.setType(WriteMetadata.class);\r
MetadataInstructionBuilder metaBuilder = new MetadataInstructionBuilder();\r
builder.addAugmentation(MetadataInstruction.class, metaBuilder.build());\r
instructions.add(builder.build());\r
// Clear_actions instruction\r
- builder = new InstructionsBuilder();\r
+ builder = new InstructionBuilder();\r
builder.setType(ClearActions.class);\r
instructions.add(builder.build());\r
// Meter instruction\r
- builder = new InstructionsBuilder();\r
+ builder = new InstructionBuilder();\r
builder.setType(Meter.class);\r
MeterIdInstructionBuilder meterBuilder = new MeterIdInstructionBuilder();\r
meterBuilder.setMeterId(42L);\r
builder.addAugmentation(MeterIdInstruction.class, meterBuilder.build());\r
instructions.add(builder.build());\r
// Write_actions instruction\r
- builder = new InstructionsBuilder();\r
+ builder = new InstructionBuilder();\r
builder.setType(WriteActions.class);\r
ActionsInstructionBuilder actionsBuilder = new ActionsInstructionBuilder();\r
- List<ActionsList> actions = new ArrayList<>();\r
- ActionsListBuilder listBuilder = new ActionsListBuilder();\r
- ActionBuilder actBuilder = new ActionBuilder();\r
- actBuilder.setType(Output.class);\r
+ List<Action> actions = new ArrayList<>();\r
+ ActionBuilder actionBuilder = new ActionBuilder();\r
+ actionBuilder.setType(Output.class);\r
PortActionBuilder portBuilder = new PortActionBuilder();\r
portBuilder.setPort(new PortNumber(45L));\r
- actBuilder.addAugmentation(PortAction.class, portBuilder.build());\r
+ actionBuilder.addAugmentation(PortAction.class, portBuilder.build());\r
MaxLengthActionBuilder maxBuilder = new MaxLengthActionBuilder();\r
maxBuilder.setMaxLength(55);\r
- actBuilder.addAugmentation(MaxLengthAction.class, maxBuilder.build());\r
- listBuilder.setAction(actBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
- actBuilder = new ActionBuilder();\r
- actBuilder.setType(SetNwTtl.class);\r
+ actionBuilder.addAugmentation(MaxLengthAction.class, maxBuilder.build());\r
+ actions.add(actionBuilder.build());\r
+ actionBuilder = new ActionBuilder();\r
+ actionBuilder.setType(SetNwTtl.class);\r
NwTtlActionBuilder nwTtl = new NwTtlActionBuilder();\r
nwTtl.setNwTtl((short) 64);\r
- actBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());\r
- listBuilder.setAction(actBuilder.build());\r
- actions.add(listBuilder.build());\r
- actionsBuilder.setActionsList(actions);\r
+ actionBuilder.addAugmentation(NwTtlAction.class, nwTtl.build());\r
+ actions.add(actionBuilder.build());\r
+ actionsBuilder.setAction(actions);\r
builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());\r
instructions.add(builder.build());\r
// Apply_actions instruction\r
- builder = new InstructionsBuilder();\r
+ builder = new InstructionBuilder();\r
builder.setType(ApplyActions.class);\r
actionsBuilder = new ActionsInstructionBuilder();\r
actions = new ArrayList<>();\r
- listBuilder = new ActionsListBuilder();\r
- actBuilder = new ActionBuilder();\r
- actBuilder.setType(PushVlan.class);\r
+ actionBuilder = new ActionBuilder();\r
+ actionBuilder.setType(PushVlan.class);\r
EthertypeActionBuilder ethertypeBuilder = new EthertypeActionBuilder();\r
ethertypeBuilder.setEthertype(new EtherType(14));\r
- actBuilder.addAugmentation(EthertypeAction.class, ethertypeBuilder.build());\r
- listBuilder.setAction(actBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
- actBuilder = new ActionBuilder();\r
- actBuilder.setType(PopPbb.class);\r
- listBuilder.setAction(actBuilder.build());\r
- actions.add(listBuilder.build());\r
- actionsBuilder.setActionsList(actions);\r
+ actionBuilder.addAugmentation(EthertypeAction.class, ethertypeBuilder.build());\r
+ actions.add(actionBuilder.build());\r
+ actionBuilder = new ActionBuilder();\r
+ actionBuilder.setType(PopPbb.class);\r
+ actions.add(actionBuilder.build());\r
+ actionsBuilder.setAction(actions);\r
builder.addAugmentation(ActionsInstruction.class, actionsBuilder.build());\r
instructions.add(builder.build());\r
\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
\r
/**\r
* @author michal.polkorab\r
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.OxmMatchType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.MatchBuilder;
+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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.UdpSrc;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanPcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.VlanVid;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntries;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.MatchEntriesBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.Match;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.match.grouping.MatchBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.Match;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.match.grouping.MatchBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntries;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev130731.oxm.fields.grouping.MatchEntriesBuilder;\r
\r
/**\r
* @author michal.polkorab\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.QueueIdAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanPcpAction;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.VlanVidAction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
\r
/**\r
* @author michal.polkorab\r
+ "FF FF 00 08 00 00 12 34");\r
\r
message.skipBytes(4); // skip XID\r
- List<ActionsList> actions = OF10ActionsDeserializer.createActionsList(message);\r
+ List<Action> actions = OF10ActionsDeserializer.createActionsList(message);\r
Assert.assertEquals("Wrong number of actions", 13, actions.size());\r
- Action action1 = actions.get(0).getAction();\r
+ Action action1 = actions.get(0);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.Output", action1.getType().getName());\r
Assert.assertEquals("Wrong port", 16,\r
action1.getAugmentation(PortAction.class).getPort().getValue().intValue());\r
Assert.assertEquals("Wrong max-length", 8192,\r
action1.getAugmentation(MaxLengthAction.class).getMaxLength().intValue());\r
- Action action2 = actions.get(1).getAction();\r
+ Action action2 = actions.get(1);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetVlanVid", action2.getType().getName());\r
Assert.assertEquals("Wrong vlan-vid", 4112,\r
action2.getAugmentation(VlanVidAction.class).getVlanVid().intValue());\r
- Action action3 = actions.get(2).getAction();\r
+ Action action3 = actions.get(2);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetVlanPcp", action3.getType().getName());\r
Assert.assertEquals("Wrong vlan-pcp", 37,\r
action3.getAugmentation(VlanPcpAction.class).getVlanPcp().intValue());\r
- Action action4 = actions.get(3).getAction();\r
+ Action action4 = actions.get(3);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.StripVlan", action4.getType().getName());\r
- Action action5 = actions.get(4).getAction();\r
+ Action action5 = actions.get(4);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetDlSrc", action5.getType().getName());\r
Assert.assertArrayEquals("Wrong dl-src", ByteBufUtils.macAddressToBytes("01:02:03:04:05:06"), \r
ByteBufUtils.macAddressToBytes(action5.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));\r
- Action action6 = actions.get(5).getAction();\r
+ Action action6 = actions.get(5);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetDlDst", action6.getType().getName());\r
Assert.assertArrayEquals("Wrong dl-dst", ByteBufUtils.macAddressToBytes("02:03:04:05:06:07"), \r
ByteBufUtils.macAddressToBytes(action6.getAugmentation(DlAddressAction.class).getDlAddress().getValue()));\r
- Action action7 = actions.get(6).getAction();\r
+ Action action7 = actions.get(6);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetNwSrc", action7.getType().getName());\r
Assert.assertEquals("Wrong nw-src", new Ipv4Address("10.0.0.1"),\r
action7.getAugmentation(IpAddressAction.class).getIpAddress());\r
- Action action8 = actions.get(7).getAction();\r
+ Action action8 = actions.get(7);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetNwDst", action8.getType().getName());\r
Assert.assertEquals("Wrong nw-dst", new Ipv4Address("11.0.0.2"),\r
action8.getAugmentation(IpAddressAction.class).getIpAddress());\r
- Action action9 = actions.get(8).getAction();\r
+ Action action9 = actions.get(8);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetNwTos", action9.getType().getName());\r
Assert.assertEquals("Wrong nw-tos", 1, action9.getAugmentation(NwTosAction.class).getNwTos().intValue());\r
- Action action10 = actions.get(9).getAction();\r
+ Action action10 = actions.get(9);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetTpSrc", action10.getType().getName());\r
Assert.assertEquals("Wrong port", 2, action10.getAugmentation(PortAction.class)\r
.getPort().getValue().intValue());\r
- Action action11 = actions.get(10).getAction();\r
+ Action action11 = actions.get(10);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.SetTpDst", action11.getType().getName());\r
Assert.assertEquals("Wrong port", 3, action11.getAugmentation(PortAction.class)\r
.getPort().getValue().intValue());\r
- Action action12 = actions.get(11).getAction();\r
+ Action action12 = actions.get(11);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.Enqueue", action12.getType().getName());\r
Assert.assertEquals("Wrong port", 4, action12.getAugmentation(PortAction.class)\r
.getPort().getValue().intValue());\r
Assert.assertEquals("Wrong queue-id", 48,\r
action12.getAugmentation(QueueIdAction.class).getQueueId().intValue());\r
- Action action13 = actions.get(12).getAction();\r
+ Action action13 = actions.get(12);\r
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight"\r
+ ".openflow.common.action.rev130731.Experimenter", action13.getType().getName());\r
Assert.assertEquals("Wrong port", 4660, action13.getAugmentation(ExperimenterAction.class)\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanPcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.SetVlanVid;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.StripVlan;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsListBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.actions.list.ActionBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.ActionBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
\r
/**\r
*/\r
@Test\r
public void test() {\r
- List<ActionsList> actions = new ArrayList<>();\r
- ActionsListBuilder listBuilder = new ActionsListBuilder();\r
+ List<Action> actions = new ArrayList<>();\r
ActionBuilder actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Output.class);\r
PortActionBuilder portBuilder = new PortActionBuilder();\r
MaxLengthActionBuilder maxLen = new MaxLengthActionBuilder();\r
maxLen.setMaxLength(32);\r
actionBuilder.addAugmentation(MaxLengthAction.class, maxLen.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetVlanVid.class);\r
VlanVidActionBuilder vlanBuilder = new VlanVidActionBuilder();\r
vlanBuilder.setVlanVid(15);\r
actionBuilder.addAugmentation(VlanVidAction.class, vlanBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetVlanPcp.class);\r
VlanPcpActionBuilder pcpBuilder = new VlanPcpActionBuilder();\r
pcpBuilder.setVlanPcp((short) 16);\r
actionBuilder.addAugmentation(VlanPcpAction.class, pcpBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(StripVlan.class);\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetDlSrc.class);\r
DlAddressActionBuilder dlBuilder = new DlAddressActionBuilder();\r
dlBuilder.setDlAddress(new MacAddress("00:00:00:02:03:04"));\r
actionBuilder.addAugmentation(DlAddressAction.class, dlBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetDlDst.class);\r
dlBuilder = new DlAddressActionBuilder();\r
dlBuilder.setDlAddress(new MacAddress("00:00:00:01:02:03"));\r
actionBuilder.addAugmentation(DlAddressAction.class, dlBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetNwSrc.class);\r
IpAddressActionBuilder ipBuilder = new IpAddressActionBuilder();\r
ipBuilder.setIpAddress(new Ipv4Address("10.0.0.1"));\r
actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetNwDst.class);\r
ipBuilder = new IpAddressActionBuilder();\r
ipBuilder.setIpAddress(new Ipv4Address("10.0.0.3"));\r
actionBuilder.addAugmentation(IpAddressAction.class, ipBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetNwTos.class);\r
NwTosActionBuilder tosBuilder = new NwTosActionBuilder();\r
tosBuilder.setNwTos((short) 204);\r
actionBuilder.addAugmentation(NwTosAction.class, tosBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetTpSrc.class);\r
portBuilder = new PortActionBuilder();\r
portBuilder.setPort(new PortNumber(6653L));\r
actionBuilder.addAugmentation(PortAction.class, portBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(SetTpDst.class);\r
portBuilder = new PortActionBuilder();\r
portBuilder.setPort(new PortNumber(6633L));\r
actionBuilder.addAugmentation(PortAction.class, portBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Enqueue.class);\r
portBuilder = new PortActionBuilder();\r
QueueIdActionBuilder queueBuilder = new QueueIdActionBuilder();\r
queueBuilder.setQueueId(400L);\r
actionBuilder.addAugmentation(QueueIdAction.class, queueBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
- listBuilder = new ActionsListBuilder();\r
+ actions.add(actionBuilder.build());\r
actionBuilder = new ActionBuilder();\r
actionBuilder.setType(Experimenter.class);\r
ExperimenterActionBuilder expBuilder = new ExperimenterActionBuilder();\r
expBuilder.setExperimenter(500L);\r
actionBuilder.addAugmentation(ExperimenterAction.class, expBuilder.build());\r
- listBuilder.setAction(actionBuilder.build());\r
- actions.add(listBuilder.build());\r
+ actions.add(actionBuilder.build());\r
\r
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();\r
OF10ActionsSerializer.encodeActionsV10(out, actions);\r