From: Jozef Gloncak Date: Wed, 21 Jan 2015 15:57:35 +0000 (+0100) Subject: BUG-2613: Migrating Openflow Specific models from controller project to openflowplugi... X-Git-Tag: release/lithium~704 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=openflowplugin.git;a=commitdiff_plain;h=20c6d51283ad86f229b9f77977acfeb86902f902 BUG-2613: Migrating Openflow Specific models from controller project to openflowplugin project Following changes are done: *.* Moved all the bundle to openflowplugin/model directory *.* Fixed all the relavent pom files to successfully build the projects *.* Did not change bundle version of any of the project, just to avoid breaking any dependent project changed model to model-parent under the same group as underlying models As of now all the bundles moved to openflowplugin contains all the commit that is pushed till following commit $ git log -1 commit 6340a32c44b6a423d52fd98ce3c66bc480ab9246 Merge: 94d7e66 4c90ff7 Author: Tony Tkacik Date: Fri Jan 16 12:50:26 2015 +0000 Change-Id: If689af7878164bf460115d53691bb8dbae490c04 Signed-off-by: Jozef Gloncak --- diff --git a/.gitignore b/.gitignore index 85f15c7866..c4a5b231c3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ target .settings MANIFEST.MF xtend-gen +yang-gen-sal +yang-gen-config .externalToolBuilders maven-eclipse.xml - +.metadata/ diff --git a/model/model-flow-base/pom.xml b/model/model-flow-base/pom.xml new file mode 100644 index 0000000000..2e46aaf1aa --- /dev/null +++ b/model/model-flow-base/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + + + org.opendaylight.openflowplugin.model + model-parent + 1.2.0-SNAPSHOT + + model-flow-base + bundle + + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main + HEAD + + + diff --git a/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java b/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java new file mode 100644 index 0000000000..ff78a7478d --- /dev/null +++ b/model/model-flow-base/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/flow/types/port/rev130925/PortNumberBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.CommonPort.PortNumber; + + +public class PortNumberBuilder { + + public static PortNumber getDefaultInstance(java.lang.String defaultValue) { + try { + long uint32 = Long.parseLong(defaultValue); + return new PortNumber(uint32); + } catch(NumberFormatException e){ + return new PortNumber(defaultValue); + } + } + +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-action-types.yang b/model/model-flow-base/src/main/yang/opendaylight-action-types.yang new file mode 100644 index 0000000000..041fc576a1 --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-action-types.yang @@ -0,0 +1,351 @@ +module opendaylight-action-types { + namespace "urn:opendaylight:action:types"; + prefix action; + + import ietf-inet-types {prefix inet; revision-date "2010-09-24";} + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";} + import opendaylight-match-types {prefix match; revision-date "2013-10-26";} + + revision "2013-11-12" { + description "Initial revision of action service"; + } + + typedef vlan-cfi { + type int32; + } + + grouping address { + choice address { + case ipv4 { + leaf ipv4-address { + type inet:ipv4-prefix; + } + } + case ipv6 { + leaf ipv6-address { + type inet:ipv6-prefix; + } + } + } + } + + container action-types { + uses action-list; + } + + grouping ordered { + leaf order { + type int32; + } + } + + grouping action-list { + list action { + key "order"; + uses ordered; + uses action; + } + } + + grouping action { + choice action { + case output-action-case { + container output-action { + leaf output-node-connector { + type inet:uri; + } + + leaf max-length { + type uint16; + } + } + } + + case controller-action-case { + container controller-action { + leaf max-length { + type uint16; + } + } + } + + + + case set-field-case { + container set-field { + uses match:match; + } + } + + + case set-queue-action-case { + container set-queue-action { + leaf queue { + type string; + } + leaf queue-id { + type uint32; + } + } + } + + case pop-mpls-action-case { + container pop-mpls-action { + leaf ethernet-type { + type uint16; // TODO: define ethertype type + } + } + } + + + case set-mpls-ttl-action-case { + container set-mpls-ttl-action { + leaf mpls-ttl { + type uint8; + } + } + } + + + case set-nw-ttl-action-case { + container set-nw-ttl-action { + leaf nw-ttl { + type uint8; + } + } + } + + + case push-pbb-action-case { + container push-pbb-action { + leaf ethernet-type { + type uint16; // TODO: define ethertype type + } + } + } + + + case pop-pbb-action-case { + container pop-pbb-action { + + } + } + + + case push-mpls-action-case { + container push-mpls-action { + leaf ethernet-type { + type uint16; // TODO: define ethertype type + } + } + } + + + case dec-mpls-ttl-case { + container dec-mpls-ttl { + } + } + + + case dec-nw-ttl-case { + container dec-nw-ttl { + } + } + + + case drop-action-case { + container drop-action { + } + } + + + case flood-action-case { + container flood-action { + } + } + + + case flood-all-action-case { + container flood-all-action { + } + } + + + case hw-path-action-case { + container hw-path-action { + } + } + + + case loopback-action-case { + container loopback-action { + } + } + + + case pop-vlan-action-case { + container pop-vlan-action { + } + } + + + + case push-vlan-action-case { + container push-vlan-action { + leaf ethernet-type { + type uint16; // TODO: define ethertype type + } + leaf tag { // TPID - 16 bits + type int32; + } + leaf pcp { // PCP - 3 bits + type int32; + } + leaf cfi { // CFI - 1 bit (drop eligible) + type vlan-cfi; + } + leaf vlan-id { // VID - 12 bits + type l2t:vlan-id; + } +// leaf tci { //TCI = [PCP + CFI + VID] +// } +// leaf header { //header = [TPID + TCI] +// } + } + } + + case copy-ttl-out-case { + container copy-ttl-out { + } + } + + + case copy-ttl-in-case { + container copy-ttl-in { + } + } + + + case set-dl-dst-action-case { + container set-dl-dst-action { + leaf address { + type yang:mac-address; + } + } + } + + + case set-dl-src-action-case { + container set-dl-src-action { + leaf address { + type yang:mac-address; + } + } + + } + case group-action-case { + container group-action { + leaf group { + type string; + } + + leaf group-id { + type uint32; + } + } + } + + case set-dl-type-action-case { + container set-dl-type-action { + leaf dl-type { + type l2t:ether-type; + } + } + } + + + case set-next-hop-action-case { + container set-next-hop-action { + uses address; + } + } + + + case set-nw-dst-action-case { + container set-nw-dst-action { + uses address; + } + } + + + case set-nw-src-action-case { + container set-nw-src-action { + uses address; + } + } + + + case set-nw-tos-action-case { + container set-nw-tos-action { + leaf tos { + type int32; + } + } + } + + + case set-tp-dst-action-case { + container set-tp-dst-action { + leaf port { + type inet:port-number; + } + } + + } + case set-tp-src-action-case { + container set-tp-src-action { + leaf port { + type inet:port-number; + } + } + + } + case set-vlan-cfi-action-case { + container set-vlan-cfi-action { + leaf vlan-cfi { + type vlan-cfi; + } + } + } + + + case set-vlan-id-action-case { + container set-vlan-id-action { + leaf vlan-id { + type l2t:vlan-id; + } + } + } + + + case set-vlan-pcp-action-case { + container set-vlan-pcp-action { + leaf vlan-pcp { + type l2t:vlan-pcp; + } + } + } + + case strip-vlan-action-case { + container strip-vlan-action { + } + } + + case sw-path-action-case { + container sw-path-action { + } + } + } + } +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang b/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang new file mode 100644 index 0000000000..5c97e1444f --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-flow-types.yang @@ -0,0 +1,271 @@ +module opendaylight-flow-types { + namespace "urn:opendaylight:flow:types"; + prefix flow; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + import opendaylight-match-types {prefix match; revision-date "2013-10-26";} + import opendaylight-action-types {prefix action;} + import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";} + + revision "2013-10-26" { + description "Initial revision of flow service"; + } + + typedef flow-ref { + type instance-identifier; + } + + typedef flow-cookie { + description "openflow specific type - flow cookie / flow cookie mask"; + type uint64; + } + + typedef output-port-values { + type enumeration { + enum MAX { + value 1; + } + enum IN_PORT { + value 2; + } + enum TABLE { + value 3; + } + enum NORMAL { + value 4; + } + enum FLOOD { + value 5; + } + enum ALL { + value 6; + } + enum CONTROLLER { + value 7; + } + enum LOCAL { + value 8; + } + enum ANY { + value 9; + } + enum NONE { + value 10; + } + + } + } + grouping instruction-list { + list instruction { + key "order"; + uses action:ordered; + uses instruction; + } + } + + grouping instruction { + choice instruction { + case go-to-table-case { + container go-to-table { + leaf table_id { + type uint8; + } + } + } + + case write-metadata-case { + container write-metadata { + leaf metadata { + type uint64; + } + + leaf metadata-mask { + type uint64; + } + } + } + + case write-actions-case { + container write-actions { + uses action:action-list; + } + } + + case apply-actions-case { + container apply-actions { + uses action:action-list; + } + } + + case clear-actions-case { + container clear-actions { + uses action:action-list; + } + } + + case meter-case { + container meter { + leaf meter-id { + type meter:meter-id; + } + } + } + } + } + + typedef flow-mod-flags { + type bits { + bit CHECK_OVERLAP; + bit RESET_COUNTS; + bit NO_PKT_COUNTS; + bit NO_BYT_COUNTS; + bit SEND_FLOW_REM; + } + } + + typedef removed_reason_flags { + type bits { + bit IDLE_TIMEOUT; + bit HARD_TIMEOUT; + bit DELETE; + bit GROUP_DELETE; + } + } + + grouping generic_flow_attributes { + leaf priority { + type uint16; + } + + leaf idle-timeout { + type uint16; + } + + leaf hard-timeout { + type uint16; + } + + leaf cookie { + type flow-cookie; + } + + leaf table_id { + type uint8; + } + } + + grouping flow { + container match { + uses match:match; + } + + container instructions { + uses instruction-list; + } + + uses generic_flow_attributes; + + leaf container-name { + type string; + } + + leaf cookie_mask { + type flow-cookie; + } + + leaf buffer_id { + type uint32; + } + + leaf out_port { + type uint64; + } + + leaf out_group { + type uint32; + } + + leaf flags { + type flow-mod-flags; + } + + leaf flow-name { + type string; + } + + leaf installHw { + type boolean; + } + + leaf barrier { + type boolean; + } + + leaf strict { + type boolean; + default "false"; + } + + } + + grouping flow-statistics { + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + + container duration { + leaf second { + type yang:counter64; + } + leaf nanosecond { + type yang:counter64; + } + } + } + + grouping flow-table-statistics { + leaf active { + type yang:counter64; + } + + leaf lookup { + type yang:counter64; + } + + leaf matched { + type yang:counter64; + } + } + + grouping flow-mod-removed { + uses generic_flow_attributes; + + leaf removed_reason { + type removed_reason_flags; + } + + leaf duration_nsec { + type uint32; + } + + leaf duration_sec { + type uint32; + } + + leaf packet_count { + type uint64; + } + + leaf byte_count { + type uint64; + } + + container match { + uses match:match; + } + } +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-group-types.yang b/model/model-flow-base/src/main/yang/opendaylight-group-types.yang new file mode 100644 index 0000000000..ca64ae3d3c --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-group-types.yang @@ -0,0 +1,246 @@ +module opendaylight-group-types { + namespace "urn:opendaylight:group:types"; + prefix group; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + import opendaylight-action-types {prefix action;} + + revision "2013-10-18" { + description "Initial revision of group service"; + } + + typedef group-id { + type uint32; + } + + typedef bucket-id { + type uint32; + } + + typedef group-types { + type enumeration { + enum group-all; + enum group-select; + enum group-indirect; + enum group-ff; + } + } + + typedef group-capabilities { + type enumeration { + enum select-weight; + enum select-liveness; + enum chaining; + enum chaining-checks; + } + } + + identity group-type { + description "Base identity for all the available group types"; + } + + identity group-all { + base group-type; + description "All (multicast/broadcast) group"; + } + + identity group-select { + base group-type; + description "Select group"; + } + + identity group-indirect { + base group-type; + description "Indirect group"; + } + + identity group-ff { + base group-type; + description "Fast failover group"; + } + + identity group-capability { + description "Base identity for all the supported group capabilities"; + } + + identity select-weight{ + base group-capability; + description "Support weight for select groups"; + } + + identity select-liveness{ + base group-capability; + description "Support liveness for select groups"; + } + + identity chaining{ + base group-capability; + description "Support chaining groups"; + } + + identity chaining-checks{ + base group-capability; + description "Check chaining for loops and delete"; + } + + typedef group-ref { + type instance-identifier; + } + + grouping group { + + leaf group-type { + type group-types; + } + + leaf group-id { + type group-id; + } + + leaf group-name { + type string; + } + + leaf container-name { + type string; + } + + leaf barrier { + type boolean; + } + + container buckets { + list bucket { + key "bucket-id"; + leaf bucket-id { + type bucket-id; + } + + leaf weight { + type uint16; + } + + leaf watch_port { + type uint32; + } + + leaf watch_group { + type uint32; + } + + uses action:action-list; + } + } + } + + grouping group-statistics { + + leaf group-id { + type group-id; + } + + leaf ref-count { + type yang:counter32; + } + + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + + container duration { + leaf second { + type yang:counter32; + } + leaf nanosecond { + type yang:counter32; + } + } + + container buckets { + list bucket-counter { + key "bucket-id"; + leaf bucket-id { + type bucket-id; + } + + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + } + } + } + + grouping group-features { + + leaf-list group-types-supported { + type identityref { + base group-type; + } + } + + leaf-list group-capabilities-supported { + type identityref { + base group-capability; + } + } + + leaf-list max-groups { + type uint32; + description "Maximum number of groups for each type"; + max-elements 4; + } + + leaf-list actions { + type uint32; + description "Bitmap number OFPAT_* that are supported"; + max-elements 4; + } + } + + grouping group-statistics-request { + list group-stats { + key "group-id"; + leaf group-id { + type group-id; + } + } + } + + + grouping group-statistics-reply { + + list group-stats { + key "group-id"; + uses group-statistics; + } + } + + grouping group-desc-stats-reply { + + list group-desc-stats { + key "group-id"; + uses group; + } + } + + grouping group-features-reply { + uses group-features; + } + + grouping groups { + list group { + key "group-id"; + + uses group; + } + } + +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-match-types.yang b/model/model-flow-base/src/main/yang/opendaylight-match-types.yang new file mode 100644 index 0000000000..deff6f1798 --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-match-types.yang @@ -0,0 +1,368 @@ +module opendaylight-match-types { + namespace "urn:opendaylight:model:match:types"; + prefix "match"; + + import ietf-inet-types {prefix inet; revision-date "2010-09-24";} + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + import opendaylight-l2-types {prefix l2t;revision-date "2013-08-27";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + + revision "2013-10-26" { + description "Initial revision of match types"; + } + + grouping "mac-address-filter" { + leaf address { + mandatory true; + type yang:mac-address; + } + leaf mask { + type yang:mac-address; + } + } + + grouping "of-metadata" { + leaf metadata { + type uint64; + } + + leaf metadata-mask { + type uint64; + } + } + + /** Match Groupings **/ + grouping "ethernet-match-fields" { + container ethernet-source { + description "Ethernet source address."; + presence "Match field is active and set"; + uses mac-address-filter; + } + container ethernet-destination { + description "Ethernet destination address."; + presence "Match field is active and set"; + uses mac-address-filter; + } + container ethernet-type { + description "Ethernet frame type."; + presence "Match field is active and set"; + + leaf type { + mandatory true; + type l2t:ether-type; // Needs to define that as general model + } + } + } + + grouping "vlan-match-fields" { + container vlan-id { + description "VLAN id."; + presence "Match field is active and set"; + + leaf vlan-id-present { + type boolean; + } + + leaf vlan-id { + type l2t:vlan-id; + } + } + leaf vlan-pcp { + description "VLAN priority."; + type l2t:vlan-pcp; + } + } + + grouping "ip-match-fields" { + leaf ip-protocol { + description "IP protocol."; + type uint8; + } + + leaf ip-dscp { + description "IP DSCP (6 bits in ToS field)."; + type inet:dscp; + } + + leaf ip-ecn { + description "IP ECN (2 bits in ToS field)."; + type uint8; + } + + leaf ip-proto { + description "IP Proto (IPv4 or IPv6 Protocol Number)."; + type inet:ip-version; + } + } + + grouping "ipv4-match-fields" { + leaf ipv4-source { + description "IPv4 source address."; + type inet:ipv4-prefix; + } + + leaf ipv4-destination { + description "IPv4 destination address."; + type inet:ipv4-prefix; + } + + } + + grouping "ipv6-match-fields" { + leaf ipv6-source { + description "IPv6 source address."; + type inet:ipv6-prefix; + } + + leaf ipv6-destination { + description "IPv6 destination address."; + type inet:ipv6-prefix; + } + + leaf ipv6-nd-target { + description "IPv6 target address for neighbour discovery message"; + type inet:ipv6-address; + } + + container "ipv6-label" { + leaf ipv6-flabel { + type inet:ipv6-flow-label; + } + + leaf flabel-mask { + type inet:ipv6-flow-label; + } + } + + leaf ipv6-nd-sll { + description "Link layer source address for neighbour discovery message"; + type yang:mac-address; + } + + leaf ipv6-nd-tll { + description "Link layer target address for neighbour discovery message"; + type yang:mac-address; + } + + container "ipv6-ext-header" { + leaf ipv6-exthdr { + description "IPv6 Extension Header field"; + type uint16; + } + + leaf ipv6-exthdr-mask { + type uint16 { + range "0..512"; + } + } + } + } + + grouping "udp-match-fields" { + leaf udp-source-port { + description "UDP source port."; + type inet:port-number; + } + leaf udp-destination-port { + description "UDP destination port."; + type inet:port-number; + } + } + + grouping "protocol-match-fields" { + leaf mpls-label { + description "Label in the first MPLS shim header"; + type uint32; + } + + leaf mpls-tc { + description "TC in the first MPLS shim header"; + type uint8; + } + + leaf mpls-bos { + description "BoS bit in the first MPLS shim header"; + type uint8; + } + + container "pbb" { + leaf pbb-isid { + description "I-SID in the first PBB service instance tag"; + type uint32; + } + + leaf pbb-mask { + type uint32 { + range "0..16777216"; + } + } + } + } + + grouping "tcp-match-fields" { + leaf tcp-source-port { + description "TCP source port."; + type inet:port-number; + } + leaf tcp-destination-port { + description "TCP destination port."; + type inet:port-number; + } + } + + grouping "sctp-match-fields" { + leaf sctp-source-port { + description "SCTP source port."; + type inet:port-number; + } + leaf sctp-destination-port { + description "SCTP destination port."; + type inet:port-number; + } + } + + grouping "icmpv4-match-fields" { + leaf icmpv4-type { + description "ICMP type."; + type uint8; // Define ICMP Type + } + description "ICMP code."; + leaf icmpv4-code { + type uint8; // Define ICMP Code + } + } + + grouping "icmpv6-match-fields" { + leaf icmpv6-type { + description "ICMP type."; + type uint8; // Define ICMP Type + } + description "ICMP code."; + leaf icmpv6-code { + type uint8; // Define ICMP Code + } + } + + grouping "arp-match-fields" { + leaf arp-op { + type uint16; + } + + leaf arp-source-transport-address { + description "ARP source IPv4 address."; + type inet:ipv4-prefix; + } + + leaf arp-target-transport-address { + description "ARP target IPv4 address."; + type inet:ipv4-prefix; + } + container arp-source-hardware-address { + description "ARP source hardware address."; + presence "Match field is active and set"; + uses mac-address-filter; + } + container arp-target-hardware-address { + description "ARP target hardware address."; + presence "Match field is active and set"; + uses mac-address-filter; + } + } + + grouping "tcp-flag-match-fields" { + leaf tcp-flag { + type uint16; + } + } + + grouping "tunnel-ipv4-match-fields" { + leaf tunnel-ipv4-source { + description "IPv4 source tunnel endpoint address."; + type inet:ipv4-prefix; + } + leaf tunnel-ipv4-destination { + description "IPv4 destination tunnel endpoint address."; + type inet:ipv4-prefix; + } + } + + grouping match { + leaf in-port { + type inv:node-connector-id; + } + + leaf in-phy-port { + type inv:node-connector-id; + } + + container "metadata" { + uses of-metadata; + } + + container "tunnel" { + leaf tunnel-id { + description "Metadata associated in the logical port"; + type uint64; + } + + leaf tunnel-mask { + type uint64; + } + } + + container "ethernet-match" { + uses "ethernet-match-fields"; + } + + container "vlan-match" { + uses "vlan-match-fields"; + } + + container "ip-match" { + uses "ip-match-fields"; + } + + choice layer-3-match { + case "ipv4-match" { + uses "ipv4-match-fields"; + } + case "ipv6-match" { + uses "ipv6-match-fields"; + } + case "arp-match" { + uses "arp-match-fields"; + } + case "tunnel-ipv4-match" { + uses "tunnel-ipv4-match-fields"; + } + } + + choice layer-4-match { + case "udp-match" { + uses "udp-match-fields"; + } + case "tcp-match" { + uses "tcp-match-fields"; + } + case "sctp-match" { + uses "sctp-match-fields"; + } + } + + container "icmpv4-match" { + uses "icmpv4-match-fields"; + } + + container "icmpv6-match" { + uses "icmpv6-match-fields"; + } + + container "protocol-match-fields" { + uses "protocol-match-fields"; + } + + container tcp-flag-match { + uses "tcp-flag-match-fields"; + } + } +} \ No newline at end of file diff --git a/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang b/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang new file mode 100644 index 0000000000..95f2b7cc39 --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang @@ -0,0 +1,281 @@ +module opendaylight-meter-types { + namespace "urn:opendaylight:meter:types"; + prefix meter; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + + + revision "2013-09-18" { + description "Initial revision of meter service"; + } + + typedef meter-id { + type uint32; + } + typedef band-id { + type uint32; + } + + typedef meter-flags { + type bits { + bit meter-kbps; + bit meter-pktps; + bit meter-burst; + bit meter-stats; + } + } + + identity meter-capability { + description "Base identity for all the supported meter capabilities/flags"; + } + identity meter-kbps { + base meter-capability; + description "Rate value in kb/s (kilo-bit per second)"; + } + identity meter-pktps { + base meter-capability; + description "Rate value in packet/sec."; + } + identity meter-burst { + base meter-capability; + description "Do burst size."; + } + identity meter-stats { + base meter-capability; + description "Collect statistics."; + } + + typedef meter-band-type { + type bits { + bit ofpmbt-drop; + bit ofpmbt-dscp-remark; + bit ofpmbt-experimenter; + } + } + + identity meter-band { + description "Base identity for all the band type available"; + } + identity meter-band-drop { + base meter-band; + description "Drop packet"; + } + identity meter-band-dscp-remark { + base meter-band; + description "Remark DSCP in the IP header"; + } + identity meter-band-experimenter { + base meter-band; + description "Experimenter meter band"; + } + + grouping band-type { + choice band-type { + case drop { + leaf drop-rate { + description "Rate for dropping packets"; + type uint32; + } + + leaf drop-burst-size { + description "Size of bursts"; + type uint32; + } + } + + case dscp-remark { + leaf dscp-remark-rate { + description "Rate for remarking packets"; + type uint32; + } + + leaf dscp-remark-burst-size { + description "Size of bursts"; + type uint32; + } + + leaf prec_level { + description "Number of drop precedence level to add"; + type uint8; + } + } + + case experimenter { + leaf experimenter-rate { + description "Rate for remarking packets"; + type uint32; + } + + leaf experimenter-burst-size { + description "Size of bursts"; + type uint32; + } + + leaf experimenter { + description "Experimenter id"; + type uint32; + } + } + } + } + + typedef meter-ref { + type instance-identifier; + } + + grouping meter { + + leaf flags { + description "Meter configuration flags"; + type meter-flags; + } + + leaf meter-id { + description "Meter instance"; + type meter-id; + } + + leaf barrier { + description "If true, barrier message is sent"; + type boolean; + } + + leaf meter-name { + description "Name of meter instance"; + type string; + } + + leaf container-name { + description "Name of container"; + type string; + } + + container meter-band-headers { + list meter-band-header { + key "band-id"; + leaf band-id { + description "Meter band id"; + type band-id; + } + + container meter-band-types { + leaf flags { + description "Meter band flags"; + type meter-band-type; + } + } + + leaf band-rate { + description "Rate for this band"; + type uint32; + } + + leaf band-burst-size { + description "Size of bursts"; + type uint32; + } + uses band-type; + } + } + } + + grouping meter-statistics { + + leaf meter-id { + type meter-id; + } + + leaf flow-count { + type yang:counter32; + } + + leaf packet-in-count { + type yang:counter64; + } + + leaf byte-in-count { + type yang:counter64; + } + + container duration { + leaf second { + type yang:counter32; + } + leaf nanosecond { + type yang:counter32; + } + } + + container meter-band-stats { + list band-stat { + key "band-id"; + leaf band-id { + type band-id; + } + + leaf packet-band-count { + type yang:counter64; + } + + leaf byte-band-count { + type yang:counter64; + } + } + } + } + + grouping meter-features { + + leaf max_meter { + type yang:counter32; + } + + leaf-list meter-band-supported { + type identityref { + base meter-band; + } + } + + leaf-list meter-capabilities-supported { + type identityref { + base meter-capability; + } + } + + leaf max_bands { + type uint8; + } + + leaf max_color { + type uint8; + } + } + + grouping meter-stats-config-request { + list meter-stats { + key "meter-id"; + leaf meter-id { + type meter-id; + } + } + } + + grouping meter-statistics-reply { + list meter-stats { + key "meter-id"; + uses meter-statistics; + } + } + + grouping meter-config-stats-reply { + list meter-config-stats { + key "meter-id"; + uses meter; + } + } + + grouping meter-features-reply { + uses meter-features; + } + +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-port-types.yang b/model/model-flow-base/src/main/yang/opendaylight-port-types.yang new file mode 100644 index 0000000000..9e88098752 --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-port-types.yang @@ -0,0 +1,176 @@ +module opendaylight-port-types { + namespace "urn:opendaylight:flow:types:port"; + prefix port-types; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";} + + revision "2013-09-25" { + description "Initial revision of Port Inventory model"; + } + + typedef port-reason { + type enumeration { + enum add; + enum delete; + enum update; + } + } + + typedef port-config { + type bits { + bit PORT-DOWN; + bit NO-RECV; + bit NO-FWD; + bit NO-PACKET-IN; + } + } + + grouping port-state { + leaf link-down { + type boolean; + } + leaf blocked { + type boolean; + } + leaf live { + type boolean; + } + } + + typedef port-features { + type bits { + bit ten-mb-hd; + bit ten-mb-fd; + bit hundred-mb-hd; + bit hundred-mb-fd; + bit one-gb-hd; + bit one-gb-fd; + bit ten-gb-fd; + bit forty-gb-fd; + bit hundred-gb-fd; + bit one-tb-fd; + bit other; + bit copper; + bit fiber; + bit autoeng; + bit pause; + bit pause-asym; + } + } + + grouping common-port { + + leaf port-number { + type union { + type uint32; + type string; + } + } + + leaf hardware-address { + type yang:mac-address; + description "MAC Address of the port"; + + } + + leaf configuration { + type port-config; + description "Bit map of OFPPC-* flags"; + } + + leaf advertised-features { + type port-features; + description "Features being advertised by the port"; + } + } + + grouping flow-port-status { + leaf reason { + type port-reason; + } + + uses flow-capable-port; + } + + grouping queues { + list queue { + key "queue-id"; + uses queue-types:queue-packet; + } + } + + grouping flow-capable-port { + + uses common-port; + + leaf name { + type string; + description "Human readable name of the port"; + } + + container state { + uses port-state; + description "Description of state of port"; + } + + leaf current-feature { + type port-features; + description "Bit map of OFPPF-* flags"; + } + + leaf supported { + type port-features; + description "Features supported by the port"; + } + + leaf peer-features { + type port-features; + description "Features advertised by peer"; + } + + leaf current-speed { + type uint32; + units "kbps"; + description "Current port bit rate in kbps"; + } + + leaf maximum-speed { + type uint32; + units "kbps"; + description "Max port bit rate in kbps"; + } + + uses queues; + } + + grouping port-mod { + container port { + list port { + key "port-mod-order"; + leaf port-mod-order { + type uint32; + } + + uses common-port; + + leaf mask { + type port-config; + description "Bitmap of OFPPC-* flags to be changed"; + } + + leaf container-name { + type string; + } + + leaf port-name { + type string; + } + + leaf barrier { + type boolean; + } + } + } + } +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang b/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang new file mode 100644 index 0000000000..cdcf0ecf14 --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-queue-types.yang @@ -0,0 +1,78 @@ +module opendaylight-queue-types { + namespace "urn:opendaylight:flow:types:queue"; + prefix queue-types; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + + revision "2013-09-25" { + description "Initial revision of Queue Inventory model"; + } + + typedef queue-id { + type yang:counter32; + description "id for the specific queue."; + } + + typedef queue-properties { + type enumeration { + enum min_rate; + enum max_rate; + } + } + + + grouping common-queue { + + leaf property { + type uint16; + description "One of OFPQT_."; + } + + } + + + grouping queue-prop-min-rate { + + uses common-queue; + + leaf rate { + type uint16; + description "OFPQT_MIN, len: 16"; + } + + } + + grouping queue-prop-max-rate { + + uses common-queue; + + leaf rate { + type uint16; + description "OFPQT_MAX, len: 16"; + } + + } + grouping queue-packet { + + + leaf queue-id { + type queue-id; + description "id for the specific queue."; + } + + leaf port { + type uint32; + description "Port this queue is attached to."; + } + uses common-queue; + } + + grouping queue-config-request + { + leaf port { + type uint32; + description "Port to be queried."; + } + + } +} diff --git a/model/model-flow-base/src/main/yang/opendaylight-table-types.yang b/model/model-flow-base/src/main/yang/opendaylight-table-types.yang new file mode 100644 index 0000000000..91224ef93e --- /dev/null +++ b/model/model-flow-base/src/main/yang/opendaylight-table-types.yang @@ -0,0 +1,352 @@ +module opendaylight-table-types { + namespace "urn:opendaylight:table:types"; + prefix table; + + import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";} + import opendaylight-action-types {prefix action;} + + revision "2013-10-26" { + description "Initial revision of table service"; + } + + typedef table-id { + type uint8; + } + + typedef table-ref { + type instance-identifier; + } + + typedef table-config { + type bits { + bit DEPRECATED-MASK; + } + } + + // field types + identity match-field { + description "Base identity for match Fields"; + } + + identity in_port { + base match-field; + description "Match for Switch input port."; + } + identity in_phy_port { + base match-field; + description "Match for Switch physical input port."; + } + identity metadata { + base match-field; + description "Match for Metadata passed between tables."; + } + identity eth_dst { + base match-field; + description "Match for Ethernet destination address."; + } + identity eth_src { + base match-field; + description "Match for Ethernet source address."; + } + identity eth_type { + base match-field; + description "Match for Ethernet frame type."; + } + identity vlan_vid { + base match-field; + description "Match for VLAN id."; + } + identity vlan_pcp { + base match-field; + description "Match for VLAN priority."; + } + identity ip_dscp { + base match-field; + description "Match for IP DSCP (6 bits in ToS field)."; + } + identity ip_ecn { + base match-field; + description "Match for IP ECN (2 bits in ToS field)."; + } + identity ip_proto { + base match-field; + description "Match for IP protocol."; + } + identity ipv4_src { + base match-field; + description "Match for IPv4 source address."; + } + identity ipv4_dst { + base match-field; + description "Match for IPv4 destination address."; + } + identity tcp_src { + base match-field; + description "Match for TCP source port."; + } + identity tcp_dst { + base match-field; + description "Match for TCP destination port."; + } + identity udp_src { + base match-field; + description "Match for UDP source port."; + } + identity udp_dst { + base match-field; + description "Match for UDP destination port."; + } + identity sctp_src { + base match-field; + description "Match for SCTP source port."; + } + identity sctp_dst { + base match-field; + description "Match for SCTP destination port."; + } + identity icmpv4_type { + base match-field; + description "Match for ICMP type."; + } + identity icmpv4_code { + base match-field; + description "Match for ICMP code."; + } + identity arp_op { + base match-field; + description "Match for ARP opcode."; + } + identity arp_spa { + base match-field; + description "Match for ARP source IPv4 address."; + } + identity arp_tpa { + base match-field; + description "Match for ARP target IPv4 address."; + } + identity arp_sha { + base match-field; + description "Match for ARP source hardware address."; + } + identity arp_tha { + base match-field; + description "Match for ARP target hardware address."; + } + identity ipv6_src { + base match-field; + description "Match for IPv6 source address."; + } + identity ipv6_dst { + base match-field; + description "Match for IPv6 destination address."; + } + identity ipv6_flabel { + base match-field; + description "Match for IPv6 Flow Label"; + } + identity icmpv6_type { + base match-field; + description "Match for ICMPv6 type."; + } + identity icmpv6_code { + base match-field; + description "Match for ICMPv6 code."; + } + identity ipv6_nd_target { + base match-field; + description "Match for Target address for ND."; + } + identity ipv6_nd_sll { + base match-field; + description "Match for Source link-layer for ND."; + } + identity ipv6_nd_tll { + base match-field; + description "Match for Target link-layer for ND."; + } + identity mpls_label { + base match-field; + description "Match for MPLS label."; + } + identity mpls_tc { + base match-field; + description "Match for MPLS TC."; + } + identity mpls_bos { + base match-field; + description "Match for MPLS BoS bit."; + } + identity pbb_isid { + base match-field; + description "Match for PBB I-SID."; + } + identity tunnel_id { + base match-field; + description "Match for Logical Port Metadata"; + } + identity ipv6_exthdr { + base match-field; + description "Match for IPv6 Extension Header pseudo-field"; + } + identity tcp_flag { + base match-field; + description "TCP Flag Match"; + } + identity tunnel_ipv4_dst { + base match-field; + description "IPv4 destination tunnel endpoint address."; + } + identity tunnel_ipv4_src { + base match-field; + description "IPv4 source tunnel endpoint address."; + } + + grouping set-field-match { + list set-field-match { + key "match-type"; + leaf match-type { + type identityref { + base match-field; + } + } + leaf has-mask { + type boolean; + } + } + } + + grouping table-feature-prop-type { + choice table-feature-prop-type { + case instructions { + container instructions { + uses flow:instruction-list; + } + } + + case instructions-miss { + container instructions-miss { + uses flow:instruction-list; + } + } + + case next-table { + container tables { + leaf-list table-ids { + type uint8; + } + } + } + + case next-table-miss { + container tables-miss { + leaf-list table-ids { + type uint8; + } + } + } + + case write-actions { + container write-actions { + uses action:action-list; + } + } + + case write-actions-miss { + container write-actions-miss { + uses action:action-list; + } + } + + case apply-actions { + container apply-actions { + uses action:action-list; + } + } + + case apply-actions-miss { + container apply-actions-miss { + uses action:action-list; + } + } + + case match { + container match-setfield { + uses set-field-match; + } + } + + case wildcards { + container wildcard-setfield { + uses set-field-match; + } + } + + case write-setfield { + container write-setfield { + uses set-field-match; + } + } + + case write-setfield-miss { + container write-setfield-miss { + uses set-field-match; + } + } + + case apply-setfield { + container apply-setfield { + uses set-field-match; + } + } + + case apply-setfield-miss { + container apply-setfield-miss { + uses set-field-match; + } + } + } + } + + grouping table-features { + list table-features { + key "table-id"; + + leaf table-id { + type uint8; + } + + leaf name { + description "Name of the table"; + type string; + } + + leaf metadata-match { + description "Bits of metadata table can match"; + type uint64; + } + + leaf metadata-write { + description "Bits of metadata table can write"; + type uint64; + } + + leaf max-entries { + description "Max number of entries supported"; + type uint32; + } + + leaf config { + description "Bitmap of OFPTC_ values"; + type table-config; + } + + container table-properties { + list table-feature-properties { + key "order"; + uses action:ordered; + uses table-feature-prop-type; + } + } + } + } +} diff --git a/model/model-flow-service/pom.xml b/model/model-flow-service/pom.xml new file mode 100644 index 0000000000..b42ecfbf9a --- /dev/null +++ b/model/model-flow-service/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + + + org.opendaylight.openflowplugin.model + model-parent + 1.2.0-SNAPSHOT + + model-flow-service + bundle + + + + ${project.groupId} + model-flow-base + ${project.version} + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main + HEAD + + + diff --git a/model/model-flow-service/src/main/yang/flow-capable-transaction.yang b/model/model-flow-service/src/main/yang/flow-capable-transaction.yang new file mode 100644 index 0000000000..160291cf21 --- /dev/null +++ b/model/model-flow-service/src/main/yang/flow-capable-transaction.yang @@ -0,0 +1,62 @@ +module flow-capable-transaction { + namespace "urn:opendaylight:flow:transaction"; + prefix type; + + import opendaylight-inventory {prefix inv; revision-date "2013-08-19";} + import ietf-inet-types {prefix inet; revision-date "2010-09-24";} + import yang-ext {prefix ext; revision-date "2013-07-09";} + + revision "2013-11-03" { + description "Initial revision"; + } + + typedef transaction-id { + type uint64; + } + // This refers to MD-SAL transaction reference. + grouping transaction-metadata { + leaf transaction-uri { + type inet:uri; + } + } + + grouping transaction-aware { + leaf transaction-id { + type transaction-id; + } + } + + grouping multipart-transaction-aware { + uses transaction-aware; + + leaf moreReplies { + type boolean; + default false; + } + } + + rpc get-next-transaction-id { + input { + leaf node { + ext:context-reference "inv:node-context"; + type inv:node-ref; + } + } + output { + uses transaction-aware; + } + } + + // Barier request? + rpc finish-transaction { + input { + leaf node { + ext:context-reference "inv:node-context"; + type inv:node-ref; + } + leaf transaction-id { + type transaction-id; + } + } + } +} diff --git a/model/model-flow-service/src/main/yang/flow-errors.yang b/model/model-flow-service/src/main/yang/flow-errors.yang new file mode 100644 index 0000000000..3e9d1ee75f --- /dev/null +++ b/model/model-flow-service/src/main/yang/flow-errors.yang @@ -0,0 +1,62 @@ +module flow-errors { + namespace "urn:opendaylight:flow:errors"; + prefix error; + + revision "2013-11-16" { + description "Initial revision of error"; + } + + typedef error-type { + type enumeration { + enum hello-failed; + enum bad-request; + enum bad-action; + enum bad-instruction; + enum bad-match; + enum flow-mod-failed; + enum group-mod-failed; + enum port-mod-failed; + enum table-mod-failed; + enum queue-op-failed; + enum switch-config-failed; + enum role-request-failed; + enum meter-mod-failed; + enum table-features-failed; + enum experimenter { + value "65535"; + } + } + } + + grouping error-message { + leaf type { + type error-type; + } + + leaf code { + type uint16; + } + + leaf data { + type string; + } + } + + grouping experimenter-error-message { + leaf type { + type error-type; + } + + leaf exp-type { + type uint16; + } + + leaf experimenter-id { + type uint32; + } + + leaf data { + type string; + } + } +} \ No newline at end of file diff --git a/model/model-flow-service/src/main/yang/flow-node-inventory.yang b/model/model-flow-service/src/main/yang/flow-node-inventory.yang new file mode 100644 index 0000000000..fc0eb4cf72 --- /dev/null +++ b/model/model-flow-service/src/main/yang/flow-node-inventory.yang @@ -0,0 +1,254 @@ +module flow-node-inventory { + namespace "urn:opendaylight:flow:inventory"; + prefix flownode; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import ietf-inet-types {prefix inet; revision-date "2010-09-24";} + import opendaylight-port-types {prefix port;revision-date "2013-09-25";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-table-types {prefix table;revision-date "2013-10-26";} + import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";} + import opendaylight-group-types {prefix group;revision-date "2013-10-18";} + import opendaylight-meter-types {prefix meter;revision-date "2013-09-18";} + + revision "2013-08-19" { + description "Flow Capable Node extensions to the Inventory model"; + } + + identity feature-capability { + } + + identity flow-feature-capability-flow-stats { + description "Flow statistics"; + base feature-capability; + } + + identity flow-feature-capability-table-stats { + description "Table statistics"; + base feature-capability; + } + + identity flow-feature-capability-port-stats { + description "Port statistics"; + base feature-capability; + } + + identity flow-feature-capability-stp { + description "802.1d spanning tree"; + base feature-capability; + } + + identity flow-feature-capability-reserved { + description "Reserved, must be zero"; + base feature-capability; + } + + identity flow-feature-capability-ip-reasm { + description "Can reassemble IP fragments"; + base feature-capability; + } + + identity flow-feature-capability-queue-stats { + description "Queue statistics"; + base feature-capability; + } + + identity flow-feature-capability-arp-match-ip { + description "Match IP addresses in ARP pkts"; + base feature-capability; + } + + identity flow-feature-capability-group-stats { + description "Group statistics"; + base feature-capability; + } + + identity flow-feature-capability-port-blocked { + description "Switch will block looping ports"; + base feature-capability; + } + + grouping feature { + leaf support-state { + type inv:support-type; + } + } + + grouping queue { + leaf queue-id { + type uint32; + description "id for the specific queue"; + mandatory true; + } + container properties { + leaf minimum-rate { + type uint32; + } + leaf maximum-rate{ + type uint32; + } + } + } + + typedef flow-id { + type inet:uri; + } + + grouping tables { + list table { + key "id"; + + leaf id { + type uint8; + } + + uses table:table-features; + + list flow { + key "id"; + + leaf id { + type flow-id; + } + + uses flow:flow; + } + } + } + + grouping meters { + list meter { + key "meter-id"; + uses meter:meter; + } + } + + grouping ip-address-grouping { + leaf ip-address { + description "IP address of a flow capable node."; + type inet:ip-address; + } + } + + grouping flow-node { + leaf manufacturer { + type string; + } + leaf hardware { + type string; + } + leaf software { + type string; + } + leaf serial-number { + type string; + } + leaf description { + type string; + } + + uses tables; + uses group:groups; + uses meters; + uses ip-address-grouping; + // TODO: ports + + container supported-match-types { + list match-type { + key "match"; + uses feature; + leaf match { + type string; // FIXME: Add identity + } + + } + } + + container supported-instructions { + list instruction-type { + key "instruction"; + uses feature; + leaf instruction { + type string; // FIXME: Add identity + } + } + } + + container supported-actions { + list action-type { + key "action"; + uses feature; + + leaf action { + type string; // FIXME: Add identity + } + } + } + + container switch-features { + + leaf max_buffers { + type uint32; + } + + leaf max_tables { + type uint8; + } + + leaf-list capabilities { + type identityref { + base feature-capability; + } + } + + } + } + + grouping flow-node-connector { + + uses port:flow-capable-port; + } + + augment "/inv:nodes/inv:node" { + ext:augment-identifier "flow-capable-node"; + uses flow-node; + } + + augment "/inv:nodes/inv:node/inv:node-connector" { + ext:augment-identifier "flow-capable-node-connector"; + uses flow-node-connector; + } + + augment "/inv:node-updated" { + ext:augment-identifier "flow-capable-node-updated"; + uses flow-node; + } + + augment "/inv:node-updated/inv:node-connector" { + //ext:identical-augment "flow-capable-node-connector"; + ext:augment-identifier "flow-capable-node-connector-update-fields"; + uses flow-node-connector; + } + + augment "/inv:node-connector-updated" { + ext:augment-identifier "flow-capable-node-connector-updated"; + uses flow-node-connector; + } + + augment "/inv:nodes/inv:node/table" { + ext:augment-identifier "flow-hash-id-mapping"; + description "Flow is identified by match and priority on device. So Operational/DS + has to simulate that behavior and contract between FlowId and match+priority + identification should represent Flow hashCode. Flow has to contain only + match priority and flowCookie for create a hashCode"; + list flow-hash-id-map { + key "hash"; + leaf hash { + type string; + } + leaf flow-id { + type flow-id; + } + } + } +} diff --git a/model/model-flow-service/src/main/yang/flow-topology-discovery.yang b/model/model-flow-service/src/main/yang/flow-topology-discovery.yang new file mode 100644 index 0000000000..05c413d7bb --- /dev/null +++ b/model/model-flow-service/src/main/yang/flow-topology-discovery.yang @@ -0,0 +1,42 @@ +module flow-topology-discovery { + namespace "urn:opendaylight:flow:topology:discovery"; + prefix flow-node-topo; + + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + + revision "2013-08-19" { + description "Flow Capable Node extensions to the Inventory model"; + } + + + grouping link { + leaf source { + type inv:node-connector-ref; + } + leaf destination { + type inv:node-connector-ref; + } + } + + + notification link-discovered { + uses link; + } + + notification link-overutilized { + uses link; + } + + notification link-removed { + uses link; + } + + notification link-utilization-normal { + uses link; + } + + rpc solicit-refresh { + + } + +} diff --git a/model/model-flow-service/src/main/yang/node-config.yang b/model/model-flow-service/src/main/yang/node-config.yang new file mode 100644 index 0000000000..98c3228190 --- /dev/null +++ b/model/model-flow-service/src/main/yang/node-config.yang @@ -0,0 +1,39 @@ +module node-config { + namespace "urn:opendaylight:module:config"; + prefix node-config; + + import flow-capable-transaction {prefix tr;} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + + revision "2014-10-15" { + description "Initial revision of node configuration service"; + } + + grouping node-ref { + uses "inv:node-context-ref"; + } + + + + /** Base configuration structure **/ + grouping node-config { + leaf flag { + type string; + description "Switch config flag. Expected values FRAGNORMAL, OFPCFRAGDROP, OFPCFRAGREASM, OFPCFRAGMASK"; + } + leaf miss-search-length{ + type uint16; + } + } + + rpc set-config { + input { + uses node-config; + uses tr:transaction-aware; + uses node-ref; + } + output { + uses tr:transaction-aware; + } + } +} diff --git a/model/model-flow-service/src/main/yang/node-errors.yang b/model/model-flow-service/src/main/yang/node-errors.yang new file mode 100644 index 0000000000..69db856b73 --- /dev/null +++ b/model/model-flow-service/src/main/yang/node-errors.yang @@ -0,0 +1,167 @@ +module node-error { + namespace "urn:opendaylight:node:error:service"; + prefix node-error; + + import sal-flow {prefix flow; revision-date "2013-08-19";} + import flow-errors {prefix error;} + import flow-capable-transaction {prefix tr;} + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-flow-types {prefix types;revision-date "2013-10-26";} + import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;} + import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";} + + revision "2014-04-10" { + description "Initial revision of errors received from a node"; + } + + notification hello-failed-error-notification { + description "Model for ofp_error-Type=0, Hello protocol failed"; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification bad-request-error-notification { + description "Model for ofp_error-Type=1, Request was not understood."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification bad-action-error-notification { + description "Model for ofp_error-Type=2, Error in action description."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification bad-instruction-error-notification { + description "Model for ofp_error-Type=3, Error in instruction list."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification bad-match-error-notification { + description "Model for ofp_error-Type=4, Error in match."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification flow-mod-error-notification { + description "Model for ofp_error-Type=5 - Problem modifying flow entry."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification group-mod-error-notification { + description "Model for ofp_error-Type=6 - Problem modifying group entry."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification port-mod-error-notification { + description "Model for ofp_error-Type=7 - Port mod request failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification table-mod-error-notification { + description "Model for ofp_error-Type=8 - Table mod request failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification queue-op-error-notification { + description "Model for ofp_error-Type=9 - Queue operation failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification switch-config-error-notification { + description "Model for ofp_error-Type=10 - Switch Config request failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification role-request-error-notification { + description "Model for ofp_error-Type=11 - Controller Role request failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification meter-mod-error-notification { + description "Model for ofp_error-Type=12 - Error in meter."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification table-features-error-notification { + description "Model for ofp_error-Type=13 - Setting table features failed."; + + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } + + notification experimenter-error-notification { + description "Model for ofp_error-Type=65535 - Experimenter Error Messages"; + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses flow:base-node-error-notification; + uses flow:node-error-reference; + } +} + diff --git a/model/model-flow-service/src/main/yang/packet-processing.yang b/model/model-flow-service/src/main/yang/packet-processing.yang new file mode 100644 index 0000000000..50368e46a6 --- /dev/null +++ b/model/model-flow-service/src/main/yang/packet-processing.yang @@ -0,0 +1,106 @@ +module packet-processing { + namespace "urn:opendaylight:packet:service"; + prefix flow; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import ietf-yang-types {prefix yang;revision-date "2010-09-24";} + import opendaylight-l2-types {prefix types;revision-date "2013-08-27";} + import opendaylight-match-types {prefix match-type;revision-date "2013-10-26";} + import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";} + import opendaylight-action-types {prefix action-type;revision-date "2013-11-12";} + import opendaylight-flow-types {prefix flow-type;revision-date "2013-10-26";} + + + revision "2013-07-09" { + description ""; + } + + typedef connection-cookie { + type uint32; + } + + grouping raw-packet { + leaf ingress { + type inv:node-connector-ref; + } + leaf payload { + type binary; + } + } + + grouping ethernet-packet { + leaf source { + type yang:mac-address; + } + + leaf destination { + type yang:mac-address; + } + } + + identity packet-in-reason { + description "Base identity for all the available packet in reason"; + } + + identity no-match { + base packet-in-reason; + description "No matching flow in the classifier"; + } + + identity send-to-controller { + base packet-in-reason; + description "Explicit instruction to send packet to controller"; + } + + identity invalid-ttl { + base packet-in-reason; + description "Packet with invalid TTL"; + } + + notification packet-received { + leaf connection-cookie { + type connection-cookie; + } + + leaf flow-cookie { + type flow-type:flow-cookie; + } + + leaf table-id { + type table-type:table-id; + } + + leaf packet-in-reason { + type identityref { + base packet-in-reason; + } + } + + container match { + uses match-type:match; + } + + uses raw-packet; + } + + rpc transmit-packet { + input { + uses inv:node-context-ref; + + leaf connection-cookie { + type connection-cookie; + } + + leaf egress { + type inv:node-connector-ref; + } + leaf buffer-id { + type uint32; + } + + uses raw-packet; + uses action-type:action-list; + } + } +} diff --git a/model/model-flow-service/src/main/yang/sal-flow.yang b/model/model-flow-service/src/main/yang/sal-flow.yang new file mode 100644 index 0000000000..4cb1d08917 --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-flow.yang @@ -0,0 +1,162 @@ +module sal-flow { + namespace "urn:opendaylight:flow:service"; + prefix flow; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-flow-types {prefix types;revision-date "2013-10-26";} + import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;} + import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";} + import flow-capable-transaction {prefix tr;} + import flow-errors {prefix error;} + + revision "2013-08-19" { + description "Initial revision of flow service"; + } + + typedef flow-table-ref { + type instance-identifier; + } + + grouping node-flow-removed { + leaf node { + ext:context-reference "inv:node-context"; + type inv:node-ref; + } + leaf flow-table { + type flow-table-ref; + } + uses types:flow-mod-removed; + } + + grouping node-flow { + uses "inv:node-context-ref"; + + leaf flow-table { + type flow-table-ref; + } + uses types:flow; + } + + grouping base-node-error-notification { + leaf node { + ext:context-reference "inv:node-context"; + type inv:node-ref; + } + } + + grouping node-error-reference { + choice object-reference { + case flow-ref{ + leaf flow-ref { + type types:flow-ref; + } + } + case group-ref{ + leaf group-ref { + type group-type:group-ref; + } + } + case meter-ref{ + leaf meter-ref { + type meter-type:meter-ref; + } + } + } + } + + /** Base configuration structure **/ + grouping flow-update { + uses "inv:node-context-ref"; + + container original-flow { + uses types:flow; + } + container updated-flow { + uses types:flow; + } + } + + rpc add-flow { + input { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses node-flow; + } + output { + uses tr:transaction-aware; + } + } + + rpc remove-flow { + input { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses node-flow; + } + output { + uses tr:transaction-aware; + } + } + + rpc update-flow { + input { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses flow-update; + } + output { + uses tr:transaction-aware; + } + } + + notification flow-added { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses node-flow; + uses tr:transaction-aware; + } + + notification flow-updated { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses node-flow; + uses tr:transaction-aware; + } + + notification flow-removed { + uses tr:transaction-metadata; + leaf flow-ref { + type types:flow-ref; + } + uses node-flow; + uses tr:transaction-aware; + } + + notification switch-flow-removed { + uses node-flow-removed; + } + + notification node-error-notification { + uses error:error-message; + uses tr:transaction-aware; + uses tr:transaction-metadata; + uses node-error-reference; + uses base-node-error-notification; + } + + notification node-experimenter-error-notification { + uses error:experimenter-error-message; + uses tr:transaction-aware; + } +} diff --git a/model/model-flow-service/src/main/yang/sal-group.yang b/model/model-flow-service/src/main/yang/sal-group.yang new file mode 100644 index 0000000000..7543bf412b --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-group.yang @@ -0,0 +1,95 @@ +module sal-group { + namespace "urn:opendaylight:group:service"; + prefix group; + + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-group-types {prefix group-type;revision-date 2013-10-18;} + import flow-capable-transaction {prefix tr;} + + revision "2013-09-18" { + description "Initial revision of group service"; + } + + grouping node-group { + uses "inv:node-context-ref"; + uses group-type:group; + } + + /** Base configuration structure **/ + grouping group-update { + uses "inv:node-context-ref"; + + container original-group { + uses group-type:group; + } + container updated-group { + uses group-type:group; + } + } + + rpc add-group { + input { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses node-group; + } + output { + uses tr:transaction-aware; + } + } + + rpc remove-group { + input { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses node-group; + } + output { + uses tr:transaction-aware; + } + } + + rpc update-group { + input { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses group-update; + } + output { + uses tr:transaction-aware; + } + } + + notification group-added { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses node-group; + uses tr:transaction-aware; + } + + notification group-updated { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses node-group; + uses tr:transaction-aware; + } + + notification group-removed { + uses tr:transaction-metadata; + leaf group-ref { + type group-type:group-ref; + } + uses node-group; + uses tr:transaction-aware; + } +} diff --git a/model/model-flow-service/src/main/yang/sal-meter.yang b/model/model-flow-service/src/main/yang/sal-meter.yang new file mode 100644 index 0000000000..50f65df8e5 --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-meter.yang @@ -0,0 +1,98 @@ +module sal-meter { + namespace "urn:opendaylight:meter:service"; + prefix meter; + + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-meter-types {prefix meter-type;revision-date "2013-09-18";} + import flow-capable-transaction {prefix tr;} + + revision "2013-09-18" { + description "Initial revision of meter service"; + } + + grouping node-meter { + uses "inv:node-context-ref"; + + uses meter-type:meter; + } + + /** Base configuration structure **/ + grouping meter-update { + uses "inv:node-context-ref"; + + container original-meter { + uses meter-type:meter; + } + container updated-meter { + uses meter-type:meter; + } + } + + rpc add-meter { + input { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + uses node-meter; + } + output { + uses tr:transaction-aware; + } + } + + rpc remove-meter { + input { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + + uses node-meter; + } + output { + uses tr:transaction-aware; + } + } + + rpc update-meter { + input { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + + uses meter-update; + } + output { + uses tr:transaction-aware; + } + } + + notification meter-added { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + uses node-meter; + uses tr:transaction-aware; + } + + notification meter-updated { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + uses node-meter; + uses tr:transaction-aware; + } + + notification meter-removed { + uses tr:transaction-metadata; + leaf meter-ref { + type meter-type:meter-ref; + } + uses node-meter; + uses tr:transaction-aware; + } +} diff --git a/model/model-flow-service/src/main/yang/sal-port.yang b/model/model-flow-service/src/main/yang/sal-port.yang new file mode 100644 index 0000000000..047300a61b --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-port.yang @@ -0,0 +1,50 @@ +module sal-port { + namespace "urn:opendaylight:port:service"; + prefix port; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-port-types {prefix port-type;revision-date "2013-09-25";} + import flow-capable-transaction {prefix tr;} + + revision "2013-11-07" { + description "Initial revision of port service"; + } + + grouping node-port { + uses "inv:node-context-ref"; + + uses port-type:flow-port-status; + } + + /** Base configuration structure **/ + grouping port-update { + uses "inv:node-context-ref"; + + container original-port { + uses port-type:port-mod; + } + container updated-port { + uses port-type:port-mod; + } + } + + rpc update-port { + input { + uses port-update; + uses tr:transaction-aware; + } + output { + uses tr:transaction-aware; + } + } + + notification port-updated { + uses port-update; + uses tr:transaction-aware; + } + + notification port-removed { + uses node-port; + } +} diff --git a/model/model-flow-service/src/main/yang/sal-queue.yang b/model/model-flow-service/src/main/yang/sal-queue.yang new file mode 100644 index 0000000000..4fa9fb0e57 --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-queue.yang @@ -0,0 +1,28 @@ +module sal-queue { + namespace "urn:opendaylight:queue:service"; + prefix queue; + + import opendaylight-inventory {prefix inv; revision-date "2013-08-19";} + import opendaylight-queue-types {prefix queue-type; revision-date "2013-09-25";} + + revision "2013-11-07" { + description "Initial revision of queue service"; + } + + grouping node-queue { + uses "inv:node-context-ref"; + + uses queue-type:queue-packet; + } + + + rpc get-queue { + output { + uses queue-type:queue-packet; + } + } + + notification queue-get-config-reply { + uses node-queue; + } +} diff --git a/model/model-flow-service/src/main/yang/sal-table.yang b/model/model-flow-service/src/main/yang/sal-table.yang new file mode 100644 index 0000000000..b125116bb1 --- /dev/null +++ b/model/model-flow-service/src/main/yang/sal-table.yang @@ -0,0 +1,39 @@ +module sal-table { + namespace "urn:opendaylight:table:service"; + prefix table; + + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-table-types {prefix table-type;revision-date "2013-10-26";} + import flow-capable-transaction {prefix tr;} + + revision "2013-10-26" { + description "Initial revision of table service"; + } + + /** Base configuration structure **/ + grouping table-update { + uses "inv:node-context-ref"; + container original-table { + uses table-type:table-features; + } + container updated-table { + uses table-type:table-features; + } + } + + rpc update-table { + input { + uses table-update; + uses tr:transaction-aware; + } + output { + uses tr:transaction-aware; + } + } + + notification table-updated { + uses "inv:node-context-ref"; + uses tr:multipart-transaction-aware; + uses table-type:table-features; + } +} diff --git a/model/model-flow-statistics/pom.xml b/model/model-flow-statistics/pom.xml new file mode 100644 index 0000000000..5a866666d7 --- /dev/null +++ b/model/model-flow-statistics/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + + org.opendaylight.openflowplugin.model + model-parent + 1.2.0-SNAPSHOT + + model-flow-statistics + bundle + + + + ${project.groupId} + model-flow-base + ${project.version} + + + ${project.groupId} + model-flow-service + ${project.version} + + + org.opendaylight.controller.model + model-inventory + + + org.opendaylight.yangtools.model + opendaylight-l2-types + + + + + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main + HEAD + + + diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang new file mode 100644 index 0000000000..f7a0652e45 --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang @@ -0,0 +1,148 @@ +module opendaylight-flow-statistics { + namespace "urn:opendaylight:flow:statistics"; + prefix flowstat; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-flow-types {prefix flow-types;revision-date "2013-10-26";} + import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";} + import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";} + import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} + import flow-capable-transaction {prefix tr;} + import ietf-inet-types {prefix inet; revision-date "2010-09-24";} + + + revision "2013-08-19" { + description "Initial revision of flow statistics service"; + } + + //Augment flow statistics data to the flow-capable-node->table->flow + augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" { + ext:augment-identifier "flow-statistics-data"; + uses flow-statistics; + } + + grouping flow-statistics { + container flow-statistics { + //config "false"; + uses stat-types:generic-statistics; + } + } + + typedef flow-id { + description "flow id"; + type inet:uri; + } + + grouping flow-and-statistics-map-list { + description "List of flow and statistics map"; + list flow-and-statistics-map-list { + key "flow-id"; + leaf flow-id { + type flow-id; + } + uses flow-and-statistics-map; + } + } + + grouping flow-and-statistics-map{ + description "Mapping between flow and its statistics"; + uses flow-types:flow; + uses stat-types:generic-statistics; + } + + // RPC calls to fetch flow statistics + rpc get-all-flows-statistics-from-all-flow-tables { + description "Fetch statistics of all the flow present in all the flow tables of the switch"; + input { + uses inv:node-context-ref; + } + output { + uses flow-and-statistics-map-list; + uses tr:transaction-aware; + } + + } + + rpc get-all-flow-statistics-from-flow-table { + description "Fetch statistics of all the flow present in the specific flow table of the switch"; + input { + uses inv:node-context-ref; + leaf table-id { + type table-types:table-id; + } + } + output { + uses flow-and-statistics-map-list; + uses tr:transaction-aware; + } + } + + rpc get-flow-statistics-from-flow-table { + description "Fetch statistics of the specific flow present in the specific flow table of the switch"; + input { + uses inv:node-context-ref; + uses flow-types:flow; + } + output { + uses flow-and-statistics-map-list; + uses tr:transaction-aware; + } + } + + notification flows-statistics-update { + description "Flows statistics sent by switch"; + leaf moreReplies { + type boolean; + } + uses inv:node; + uses flow-and-statistics-map-list; + uses tr:transaction-aware; + } + + //Models for aggregate flow statistics collection + augment "/inv:nodes/inv:node/flow-node:table" { + ext:augment-identifier "aggregate-flow-statistics-data"; + uses aggregate-flow-statistics; + } + + grouping aggregate-flow-statistics { + container aggregate-flow-statistics { + //config "false"; + uses stat-types:aggregate-flow-statistics; + } + } + + // RPC calls to fetch aggregate flow statistics + rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows { + description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch"; + input { + uses inv:node-context-ref; + leaf table-id { + type table-types:table-id; + } + } + output { + uses stat-types:aggregate-flow-statistics; + uses tr:transaction-aware; + } + } + rpc get-aggregate-flow-statistics-from-flow-table-for-given-match { + description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch"; + input { + uses inv:node-context-ref; + uses flow-types:flow; + } + output { + uses stat-types:aggregate-flow-statistics; + uses tr:transaction-aware; + } + } + + notification aggregate-flow-statistics-update { + description "Aggregate flow statistics for a table, sent by switch"; + uses inv:node; + uses stat-types:aggregate-flow-statistics; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang new file mode 100644 index 0000000000..431ef50624 --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang @@ -0,0 +1,65 @@ +module opendaylight-flow-table-statistics { + namespace "urn:opendaylight:flow:table:statistics"; + prefix flowtablestat; + + import flow-capable-transaction {prefix tr;} + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} + import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";} + import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";} + + + contact + "Anilkumar Vishnoi + Email: avishnoi@in.ibm.com"; + + revision "2013-12-15" { + description "Initial revision of flow table statistics model"; + } + + //Augment flow table statistics data to the table + augment "/inv:nodes/inv:node/flow-node:table" { + ext:augment-identifier "flow-table-statistics-data"; + uses flow-table-statistics; + } + + grouping flow-table-statistics { + container flow-table-statistics { + //config "false"; + uses stat-types:generic-table-statistics; + } + } + + //RPC calls to fetch flow table statistics + grouping flow-table-and-statistics-map { + list flow-table-and-statistics-map { + key "table-id"; + leaf table-id { + type table-types:table-id; + } + uses stat-types:generic-table-statistics; + } + } + + rpc get-flow-tables-statistics { + description "Fetch statistics of all the flow tables present on the tarnet node"; + input { + uses inv:node-context-ref; + } + output { + uses flow-table-and-statistics-map; + uses tr:transaction-aware; + } + } + + //Notification to receive table statistics update + + notification flow-table-statistics-update { + description "Receive flow table statistics update"; + + uses inv:node; + uses flow-table-and-statistics-map; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang new file mode 100644 index 0000000000..7779819918 --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang @@ -0,0 +1,122 @@ +module opendaylight-group-statistics { + namespace "urn:opendaylight:group:statistics"; + prefix groupstat; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-group-types {prefix group-types;revision-date "2013-10-18";} + import flow-capable-transaction {prefix tr;} + import flow-node-inventory {prefix fni;} + + contact + "Anilkumar Vishnoi + Email: avishnoi@in.ibm.com"; + + revision "2013-11-11" { + description "Initial revision of group statistics service"; + } + + grouping group-statistics { + container group-statistics { + //config "false"; + uses group-types:group-statistics; + } + } + + augment "/inv:nodes/inv:node/fni:group" { + ext:augment-identifier "node-group-statistics"; + uses group-statistics; + } + + grouping group-desc { + container group-desc { + //config "false"; + uses group-types:group; + } + } + + augment "/inv:nodes/inv:node/fni:group" { + ext:augment-identifier "node-group-desc-stats"; + uses group-desc; + } + + grouping group-features { + container group-features { + //config "false"; + uses group-types:group-features-reply; + } + } + + augment "/inv:nodes/inv:node" { + ext:augment-identifier "node-group-features"; + uses group-features; + } + + // RPC calls + rpc get-all-group-statistics { + input { + uses inv:node-context-ref; + } + output { + uses group-types:group-statistics-reply; + uses tr:transaction-aware; + } + + } + + rpc get-group-statistics { + input { + uses inv:node-context-ref; + leaf group-id{ + type group-types:group-id; + } + + } + output { + uses group-types:group-statistics-reply; + uses tr:transaction-aware; + } + + } + + rpc get-group-description { + input { + uses inv:node-context-ref; + } + output { + uses group-types:group-desc-stats-reply; + uses tr:transaction-aware; + } + } + + rpc get-group-features { + input { + uses inv:node-context-ref; + } + output { + uses group-types:group-features-reply; + uses tr:transaction-aware; + } + } + + + //Notification calls + + notification group-statistics-updated { + uses inv:node; + uses group-types:group-statistics-reply; + uses tr:multipart-transaction-aware; + } + + notification group-desc-stats-updated { + uses inv:node; + uses group-types:group-desc-stats-reply; + uses tr:multipart-transaction-aware; + } + + notification group-features-updated { + uses inv:node; + uses group-types:group-features-reply; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang new file mode 100644 index 0000000000..0055dc39bd --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang @@ -0,0 +1,109 @@ +module opendaylight-meter-statistics { + namespace "urn:opendaylight:meter:statistics"; + prefix meterstat; + + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} + import opendaylight-meter-types {prefix meter-types;revision-date "2013-09-18";} + import flow-capable-transaction {prefix tr;} + + contact + "Anilkumar Vishnoi + Email: avishnoi@in.ibm.com"; + + revision "2013-11-11" { + description "Initial revision of meter statistics service"; + } + + augment "/inv:nodes/inv:node/flow-node:meter" { + ext:augment-identifier "node-meter-statistics"; + container meter-statistics { + //config "false"; + uses meter-types:meter-statistics; + } + } + + augment "/inv:nodes/inv:node/flow-node:meter" { + ext:augment-identifier "node-meter-config-stats"; + container meter-config-stats { + //config "false"; + uses meter-types:meter; + } + } + + augment "/inv:nodes/inv:node" { + ext:augment-identifier "node-meter-features"; + container meter-features { + //config "false"; + uses meter-types:meter-features-reply; + } + } + + // RPC calls + rpc get-all-meter-statistics { + input { + uses inv:node-context-ref; + } + output { + uses meter-types:meter-statistics-reply; + uses tr:transaction-aware; + } + + } + + rpc get-meter-statistics { + input { + uses inv:node-context-ref; + leaf meter-id{ + type meter-types:meter-id; + } + } + output { + uses meter-types:meter-statistics-reply; + uses tr:transaction-aware; + } + + } + + rpc get-all-meter-config-statistics { + input { + uses inv:node-context-ref; + } + output { + uses meter-types:meter-config-stats-reply; + uses tr:transaction-aware; + } + } + + rpc get-meter-features { + input { + uses inv:node-context-ref; + } + output { + uses meter-types:meter-features-reply; + uses tr:transaction-aware; + } + } + + + //Notification calls + + notification meter-statistics-updated { + uses inv:node; + uses meter-types:meter-statistics-reply; + uses tr:multipart-transaction-aware; + } + + notification meter-config-stats-updated { + uses inv:node; + uses meter-types:meter-config-stats-reply; + uses tr:multipart-transaction-aware; + } + + notification meter-features-updated { + uses inv:node; + uses meter-types:meter-features-reply; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang new file mode 100644 index 0000000000..e711877a02 --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang @@ -0,0 +1,74 @@ +module opendaylight-port-statistics { + namespace "urn:opendaylight:port:statistics"; + prefix portstat; + + import flow-capable-transaction {prefix tr;} + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";} + + contact + "Anilkumar Vishnoi + Email: avishnoi@in.ibm.com"; + + revision "2013-12-14" { + description "Initial revision of port statistics model"; + } + + //Augment port statistics data to the flow-capable-node-connector + augment "/inv:nodes/inv:node/inv:node-connector" { + ext:augment-identifier "flow-capable-node-connector-statistics-data"; + uses flow-capable-node-connector-statistics; + } + + grouping flow-capable-node-connector-statistics { + container flow-capable-node-connector-statistics { + //config "false"; + uses stat-types:node-connector-statistics; + } + } + + // RPC calls + rpc get-all-node-connectors-statistics { + description "Get statistics for all node connectors from the node"; + input { + uses inv:node-context-ref; + } + output { + uses node-connector-statistics-and-port-number-map; + uses tr:transaction-aware; + } + } + + rpc get-node-connector-statistics { + description "Get statistics for given node connector from the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + } + output { + uses stat-types:node-connector-statistics; + uses tr:transaction-aware; + } + } + + //Notification for node connector statistics update + grouping node-connector-statistics-and-port-number-map { + description "List of map - node connectors and their statistics"; + list node-connector-statistics-and-port-number-map { + key "node-connector-id"; + leaf node-connector-id { + type inv:node-connector-id; + } + uses stat-types:node-connector-statistics; + } + } + + notification node-connector-statistics-update { + uses inv:node; + uses node-connector-statistics-and-port-number-map; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang b/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang new file mode 100644 index 0000000000..caf52aa9ef --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang @@ -0,0 +1,97 @@ +module opendaylight-queue-statistics { + namespace "urn:opendaylight:queue:statistics"; + prefix queuestat; + + import flow-capable-transaction {prefix tr;} + import yang-ext {prefix ext; revision-date "2013-07-09";} + import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} + import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} + import opendaylight-queue-types {prefix queue-types;revision-date "2013-09-25";} + import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";} + + contact + "Anilkumar Vishnoi + Email: avishnoi@in.ibm.com"; + + revision "2013-12-16" { + description "Initial revision of queue statistics model"; + } + + //Augment queue statistics data to the flow-capable-node-connector + augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" { + ext:augment-identifier "flow-capable-node-connector-queue-statistics-data"; + uses flow-capable-node-connector-queue-statistics; + } + + grouping flow-capable-node-connector-queue-statistics { + container flow-capable-node-connector-queue-statistics { + //config "false"; + uses stat-types:generic-queue-statistics; + } + } + + //RPC calls to fetch queue statistics + grouping queue-id-and-statistics-map { + list queue-id-and-statistics-map { + key "queue-id node-connector-id"; + leaf queue-id { + type queue-types:queue-id; + } + leaf node-connector-id { + type inv:node-connector-id; + } + + uses stat-types:generic-queue-statistics; + } + } + + rpc get-all-queues-statistics-from-all-ports { + description "Get statistics for all the queues attached to all the ports from the node"; + input { + uses inv:node-context-ref; + } + output { + uses queue-id-and-statistics-map; + uses tr:transaction-aware; + } + } + + rpc get-all-queues-statistics-from-given-port { + description "Get statistics for all queues for given port of the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + } + output { + uses queue-id-and-statistics-map; + uses tr:transaction-aware; + } + } + + rpc get-queue-statistics-from-given-port { + description "Get statistics for given queues from given port of the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + leaf queue-id { + type queue-types:queue-id; + } + } + output { + uses queue-id-and-statistics-map; + uses tr:transaction-aware; + } + } + + //Notification for port statistics update + + notification queue-statistics-update { + uses inv:node; + uses queue-id-and-statistics-map; + uses tr:multipart-transaction-aware; + } +} diff --git a/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang b/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang new file mode 100644 index 0000000000..19d6eafa78 --- /dev/null +++ b/model/model-flow-statistics/src/main/yang/opendaylight-statistics-types.yang @@ -0,0 +1,121 @@ +module opendaylight-statistics-types { + namespace "urn:opendaylight:model:statistics:types"; + prefix stat-types; + + import ietf-yang-types {prefix yang; revision-date "2010-09-24";} + + revision "2013-09-25" { + description "Initial revision of flow service"; + } + + grouping duration { + container duration { + leaf second { + type yang:counter32; + } + leaf nanosecond { + type yang:counter32; + } + } + } + + grouping node-connector-statistics { + container packets { + leaf received { + type uint64; + } + leaf transmitted { + type uint64; + } + } + container bytes { + leaf received { + type uint64; + } + leaf transmitted { + type uint64; + } + } + leaf receive-drops { + type uint64; + } + leaf transmit-drops { + type uint64; + } + leaf receive-errors { + type uint64; + } + leaf transmit-errors { + type uint64; + } + leaf receive-frame-error { + type uint64; + } + leaf receive-over-run-error { + type uint64; + } + leaf receive-crc-error { + type uint64; + } + leaf collision-count { + type uint64; + } + uses duration; + } + + grouping generic-statistics { + description "Generic grouping for statistics"; + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + uses duration; + } + + grouping generic-table-statistics { + description "Generic grouping holding generic statistics related to switch table"; + leaf active-flows { + type yang:counter32; + } + leaf packets-looked-up { + type yang:counter64; + } + leaf packets-matched { + type yang:counter64; + } + } + + grouping aggregate-flow-statistics { + description "Aggregate flow statistics"; + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + leaf flow-count { + type yang:counter32; + } + } + + grouping generic-queue-statistics { + description "Generic statistics of switch port attached queues."; + leaf transmitted-bytes { + type yang:counter64; + } + + leaf transmitted-packets { + type yang:counter64; + } + + leaf transmission-errors { + type yang:counter64; + } + uses duration; + } + +} diff --git a/model/pom.xml b/model/pom.xml new file mode 100644 index 0000000000..5ce937fb48 --- /dev/null +++ b/model/pom.xml @@ -0,0 +1,117 @@ + + + + 4.0.0 + + + org.opendaylight.openflowplugin + openflowplugin-parent + 0.1.0-SNAPSHOT + + org.opendaylight.openflowplugin.model + model-parent + 1.2.0-SNAPSHOT + pom + + + model-flow-base + model-flow-service + model-flow-statistics + + + + 2.4.0 + UTF-8 + + + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools.model + ietf-inet-types + + + org.opendaylight.yangtools.model + ietf-yang-types + + + org.opendaylight.yangtools.model + yang-ext + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.groupId}.${project.artifactId} + org.opendaylight.yangtools.yang.binding.annotations, * + + + + + org.opendaylight.yangtools + yang-maven-plugin + + + org.opendaylight.yangtools + maven-sal-api-gen-plugin + ${yangtools.version} + jar + + + org.opendaylight.yangtools + yang-binding + ${yangtools.version} + jar + + + + + + generate-sources + + + src/main/yang + + + org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl + ${salGeneratorPath} + + + org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl + target/site/models + + + org.opendaylight.yangtools.yang.wadl.generator.maven.WadlGenerator + target/site/models + + + true + + + + + + + + + + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git + https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main + HEAD + + + diff --git a/pom.xml b/pom.xml index 270e579d3b..87324f8348 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,12 @@ 1.5.0-SNAPSHOT 0.7.0-SNAPSHOT 0.2.0-SNAPSHOT + 0.3.0-SNAPSHOT + 0.7.0-SNAPSHOT + 2013.08.27.7-SNAPSHOT + 2010.09.24.7-SNAPSHOT + 2010.09.24.7-SNAPSHOT + 2013.09.07.7-SNAPSHOT @@ -78,6 +84,32 @@ yang-binding ${yang.binding.version} + + org.opendaylight.yangtools + yang-common + ${yang.binding.version} + + + org.opendaylight.yangtools.model + ietf-inet-types + ${ietf-inet-types.version} + + + org.opendaylight.yangtools.model + ietf-yang-types + ${ietf-yang-types.version} + + + org.opendaylight.yangtools.model + yang-ext + ${yang-ext.version} + + + org.opendaylight.yangtools.model + opendaylight-l2-types + ${opendaylight-l2-types.version} + + org.opendaylight.openflowplugin openflowplugin-api @@ -128,11 +160,28 @@ model-inventory ${controller.model.version} + + org.opendaylight.controller.model + model-topology + ${controller.model.version} + + org.opendaylight.controller sal-binding-api ${controller.model.version} + + org.opendaylight.controller + sal-binding-config + ${controller.model.version} + + + org.opendaylight.controller + sal-binding-util + ${controller.model.version} + + org.opendaylight.controller liblldp @@ -613,6 +662,7 @@ features samples/sample-consumer samples/learning-switch - applications + applications + model