<modelVersion>4.0.0</modelVersion>
<artifactId>model-flow-base</artifactId>
-
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
--- /dev/null
+module opendaylight-flow-types {
+ namespace "urn:opendaylight:flow:types";
+ prefix flow;
+
+ import ietf-inet-types {prefix inet;}
+ import opendaylight-match-types {prefix match;}
+ import ietf-yang-types {prefix yang;}
+
+
+ revision "2013-08-19" {
+ description "Initial revision of flow service";
+ }
+
+ grouping action {
+ choice action {
+ case output-action {
+ leaf-list output-node-connector {
+ type inet:uri;
+ }
+ }
+
+ case controller-action {
+ leaf max-length {
+ type uint16 {
+ range "0..65294";
+ }
+ }
+ }
+
+ case set-queue-action {
+ leaf queue {
+ type string; // TODO: define queues
+ }
+ }
+
+ case pop-mpls-action {
+ leaf ethernet-type {
+ type uint16; // TODO: define ethertype type
+ }
+ }
+
+ case set-mpls-ttl-action {
+ leaf mpls-ttl {
+ type uint8;
+ }
+ }
+
+ case set-nw-ttl-action {
+ leaf nw-ttl {
+ type uint8;
+ }
+ }
+
+ case push-pbb-action {
+
+ }
+
+ case push-mpls-action {
+
+ }
+
+ case push-vlan-action {
+
+ }
+ }
+ }
+
+ grouping flow {
+ container match {
+ uses match:match;
+ }
+ list action {
+ key "order";
+ leaf order {
+ type int32;
+ }
+ uses action;
+ }
+ }
+
+ 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;
+ }
+ }
+}
\ No newline at end of file
-module opendaylight-flow-base {
- namespace "urn:opendaylight:flow:base";
- prefix "flowbase";
+module opendaylight-match-types {
+ namespace "urn:opendaylight:model:match:types";
+ prefix "match";
- import yang-ext {prefix ext;}
import ietf-inet-types {prefix inet;}
import ietf-yang-types {prefix yang;}
- import opendaylight-inventory {prefix inv;}
import opendaylight-l2-types {prefix l2t;}
revision "2013-08-19" {
description "Initial revision of flow service";
}
+ grouping "mac-address-filter" {
+ leaf address {
+ mandatory true;
+ type yang:mac-address;
+ }
+ leaf mask {
+ type binary;
+ }
+ }
+
/** Match Groupings **/
grouping "ethernet-match-fields" {
container ethernet-source {
- //description "Ethernet source address.";
- //presence "Match field is active and set";
- leaf address {
- mandatory true;
- type yang:mac-address;
- }
- leaf mask {
- type binary;
- }
+ 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";
- leaf address {
- mandatory true;
- type yang:mac-address;
- }
+ uses mac-address-filter;
}
container ethernet-type {
description "Ethernet frame type.";
description "VLAN priority.";
type l2t:vlan-pcp;
}
-
-
}
grouping "ip-match-fields" {
}
}
-
grouping "udp-match-fields" {
leaf udp-source-port {
description "UDP source port.";
}
}
- grouping "arp-match-fields" {
+ grouping "arp-match-fields" {
leaf arp-source-transport-address {
description "ARP source IPv4 address.";
type inet:ipv4-prefix;
container arp-source-hardware-address {
description "ARP source hardware address.";
presence "Match field is active and set";
- leaf address {
- mandatory true;
- type yang:mac-address;
- }
- leaf mask {
- type binary;
- }
+ uses mac-address-filter;
}
container arp-target-hardware-address {
description "ARP target hardware address.";
presence "Match field is active and set";
- leaf address {
- mandatory true;
- type yang:mac-address;
- }
- leaf mask {
- type binary;
- }
+ uses mac-address-filter;
}
}
grouping action {
choice action {
case output-action {
- leaf output-node-connector {
+ leaf-list output-node-connector {
type string;
}
}
}
}
- grouping flow {
- leaf node {
- type inv:node-id;
+
+ grouping match {
+ container "ethernet-match" {
+ uses "ethernet-match-fields";
}
- container match {
- container "ethernet-match" {
- uses "ethernet-match-fields";
- }
- container "vlan-match" {
- uses "vlan-match-fields";
- }
- container "ip-match" {
- uses "ip-match-fields";
- }
- container "ipv4-match" {
+ 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";
}
- container "ipv6-match" {
+ case "ipv6-match" {
uses "ipv6-match-fields";
}
- container "udp-match" {
+ case "arp-match" {
+ uses "arp-match-fields";
+ }
+ }
+
+ choice layer-4-match {
+ case "udp-match" {
uses "udp-match-fields";
}
- container "tcp-match" {
+ case "tcp-match" {
uses "tcp-match-fields";
}
- container "sctp-match" {
+ case "sctp-match" {
uses "sctp-match-fields";
}
- container "icmpv4-match" {
- uses "icmpv4-match-fields";
- }
- container "arp-match" {
- uses "arp-match-fields";
- }
}
- list action {
- key "order";
- leaf order {
- type int32;
- }
- uses action;
+ container "icmpv4-match" {
+ uses "icmpv4-match-fields";
}
}
}
\ No newline at end of file
--- /dev/null
+module sal-flow {
+ namespace "urn:opendaylight:flow:service";
+ prefix flow;
+
+ import yang-ext {prefix ext;}
+ import opendaylight-inventory {prefix inv;}
+ import ietf-inet-types {prefix inet;}
+ import opendaylight-flow-types {prefix types;}
+
+
+ revision "2013-08-19" {
+ description "Initial revision of flow service";
+ }
+
+
+ typedef flow-table-ref {
+ type instance-identifier;
+ }
+
+ grouping node-flow {
+ leaf node {
+ type inv:node-ref;
+ }
+ leaf flow-table {
+ type flow-table-ref;
+ }
+ uses types:flow;
+ }
+
+ /** Base configuration structure **/
+ grouping flow-update {
+ container original-flow {
+ uses types:flow;
+ }
+ container updated-flow {
+ uses types:flow;
+ }
+ }
+
+ rpc add-flow {
+ input {
+ uses node-flow;
+ }
+ }
+
+ rpc remove-flow {
+ input {
+ uses node-flow;
+ }
+ }
+
+ rpc update-flow {
+ input {
+ uses node-flow;
+ }
+ }
+
+ notification flow-added {
+ uses node-flow;
+ }
+
+ notification flow-updated {
+ uses node-flow;
+ }
+
+ notification flow-removed {
+ uses node-flow;
+ }
+
+ augment "/inv:nodes/inv:node" {
+ ext:augment-identifier "flow-capable-node";
+ container flow-tables {
+ list table {
+ key "id";
+ leaf "id" {
+ type inet:uri;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-module opendaylight-flow-config {
- namespace "urn:opendaylight:flow:config";
- prefix flow;
-
- import yang-ext {prefix ext;}
- import opendaylight-inventory {prefix inv;}
- import opendaylight-flow-base {prefix flowbase;}
-
- revision "2013-08-19" {
- description "Initial revision of flow service";
- }
-
- /** Base configuration structure
- container flows {
- list flow {
- uses flowbase:flow;
- }
- }
-
- **/
-}
\ No newline at end of file
+++ /dev/null
-module opendaylight-flow-service {
- namespace "urn:opendaylight:flow:service";
- prefix flow;
-
- import yang-ext {prefix ext;}
- import opendaylight-inventory {prefix inv;}
- import opendaylight-flow-base {prefix flowbase;}
-
- revision "2013-08-19" {
- description "Initial revision of flow service";
- }
-
- /** Base configuration structure **/
-
-
- grouping flow-update {
- container original-flow {
- uses flowbase:flow;
- }
- container updated-flow {
- uses flowbase:flow;
- }
- }
-
- rpc add-flow {
- input {
- uses flowbase:flow;
- }
- }
-
- rpc remove-flow {
- input {
- uses flowbase:flow;
- }
- }
-
- rpc update-flow {
- input {
- uses flow-update;
- }
- }
-
- notification flow-added {
- uses flowbase:flow;
- }
-
- notification flow-updated {
- input {
- uses flow-update;
- }
- }
-
- notification flow-removed {
- uses flowbase:flow;
- }
-}
\ No newline at end of file
--- /dev/null
+module packet-processing {
+ namespace "urn:opendaylight:packet:service";
+ prefix flow;
+
+ import opendaylight-inventory {prefix inv;}
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+ import opendaylight-l2-types {prefix types;}
+
+ revision "2013-07-09" {
+ description "";
+ }
+
+ 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;
+ }
+ }
+
+
+ notification packet-received {
+ uses raw-packet;
+ }
+
+ rpc transmit-packet {
+ input {
+ leaf egress {
+ type inv:node-connector-ref;
+ }
+ uses raw-packet;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+module opendaylight-flow-statistics {
+ namespace "urn:opendaylight:flow:statistics";
+ prefix flowstat;
+
+ import yang-ext {prefix ext;}
+ import opendaylight-inventory {prefix inv;}
+ import opendaylight-flow-types {prefix flow-types;}
+ import sal-flow {prefix flow;}
+ import opendaylight-statistics-types {prefix stat-types;}
+
+ revision "2013-08-19" {
+ description "Initial revision of flow service";
+ }
+
+ rpc get-node-connector-statistics {
+ input {
+ leaf node {
+ ext:context-reference "node-context";
+ type inv:node-ref;
+ }
+ leaf node-connector {
+ type inv:node-connector-ref;
+ }
+ }
+ output {
+ uses stat-types:node-connector-statistics;
+ }
+ }
+
+ notification node-connector-statistics-updated {
+ uses stat-types:node-connector-statistics;
+ }
+
+ rpc get-flow-statistics {
+ input {
+ leaf node {
+ ext:context-reference "node-context";
+ type inv:node-ref;
+ }
+ uses flow-types:flow;
+ }
+ output {
+ uses flow-types:flow-statistics;
+ }
+ }
+
+ notification flow-statistics-updated {
+ uses flow-types:flow-statistics;
+ }
+
+ rpc get-flow-table-statistics {
+ input {
+ leaf node {
+ ext:context-reference "node-context";
+ type inv:node-ref;
+ }
+ }
+ output {
+ uses flow-types:flow-table-statistics;
+ }
+ }
+
+ notification flow-table-statistics-updated {
+ leaf flow-table {
+ type flow:flow-table-ref;
+ }
+ uses flow-types:flow-table-statistics;
+ }
+
+}
\ No newline at end of file
-module opendaylight-flow-statistics {
- namespace "urn:opendaylight:flow:statistics";
- prefix flowstat;
+module opendaylight-statistics-types {
+ namespace "urn:opendaylight:model:statistics:types";
+ prefix stat-types;
- import yang-ext {prefix ext;}
- import ietf-inet-types {prefix inet;}
- import ietf-yang-types {prefix yang;}
- import opendaylight-flow-base {prefix flow;}
import opendaylight-inventory {prefix inv;}
+
revision "2013-08-19" {
description "Initial revision of flow service";
}
- /*
- augment "/flow:flows/flow:flow" {
- ext:augment-identifier "flow-statistics";
+
- leaf packet-count {
- type uint64;
- }
-
- leaf byte-count {
- type uint64;
- }
-
- container duration {
- leaf second {
- type uint64;
- }
- leaf nanosecond {
- type uint64;
- }
- }
- }
- */
-
- augment "/inv:nodes/inv:node/inv:node-connector" {
- ext:augment-identifier "node-connector-statistics";
-
- container packets {
+ grouping node-connector-statistics {
+ container packets {
leaf received {
type uint64;
}
leaf collision-count {
type uint64;
}
-
}
-
}
\ No newline at end of file
--- /dev/null
+module opendaylight-inventory {
+ namespace "urn:opendaylight:inventory";
+ prefix inv;
+
+ import yang-ext {prefix ext;}
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+
+
+ revision "2013-08-19" {
+ description "Initial revision of Inventory model";
+ }
+
+ typedef node-id {
+ type inet:uri;
+ }
+
+ typedef node-connector-id {
+ type inet:uri;
+ }
+
+ typedef node-ref {
+ type instance-identifier;
+ }
+
+ typedef node-connector-ref {
+ type instance-identifier;
+ }
+
+ identity node-context {
+ description "Identity used to mark node context";
+ }
+
+ identity node-connector-context {
+
+ }
+
+ grouping node {
+ leaf id {
+ type node-id;
+ }
+ }
+
+ grouping node-connector {
+ leaf id {
+ type node-connector-id;
+ }
+ }
+
+
+
+
+ /** Base structure **/
+ container nodes {
+ list node {
+ key "id";
+ ext:context-instance "node-context";
+
+ uses node;
+
+ list "node-connector" {
+ key "id";
+ ext:context-instance "node-connector-context";
+
+ use node-connector;
+ }
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-module opendaylight-inventory {
- namespace "urn:opendaylight:inventory";
- prefix flow;
-
- import yang-ext {prefix ext;}
- import ietf-inet-types {prefix inet;}
- import ietf-yang-types {prefix yang;}
-
-
- revision "2013-08-19" {
- description "Initial revision of Inventory model";
- }
-
- typedef node-id {
- type inet:uri;
- }
-
- typedef node-connector-id {
- type inet:uri;
- }
-
- /** Base structure **/
- container nodes {
- list node {
- key id;
- leaf id {
- type node-id;
- }
- list node-connector {
- key "id";
- leaf id {
- type node-connector-id;
- }
- }
- }
- }
-}
\ No newline at end of file