Define public YANG models for all the VTN functionalities. 15/26715/6
authorShigeru Yasuda <s-yasuda@da.jp.nec.com>
Wed, 9 Sep 2015 10:53:31 +0000 (19:53 +0900)
committerShigeru Yasuda <s-yasuda@da.jp.nec.com>
Tue, 29 Sep 2015 08:49:46 +0000 (17:49 +0900)
Note that this patch includes only YANG models. Implementations for those
models will be added later.

Change-Id: I4f03539044205851345f5023bc872105fdab821d
Signed-off-by: Shigeru Yasuda <s-yasuda@da.jp.nec.com>
13 files changed:
manager/model/src/main/yang/vtn-flow-condition.yang
manager/model/src/main/yang/vtn-flow-filter.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-mac-map.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-mac-table.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-path-map.yang
manager/model/src/main/yang/vtn-path-policy.yang
manager/model/src/main/yang/vtn-port-map.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-types.yang
manager/model/src/main/yang/vtn-vbridge.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-vinterface.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-vlan-map.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn-vterminal.yang [new file with mode: 0644]
manager/model/src/main/yang/vtn.yang

index 37ddba047107a05a3456dee0afa5d158ab5f6dcc..b5e04dc2fe6214a6ec319f878ee709651bb490bc 100644 (file)
@@ -283,10 +283,10 @@ module vtn-flow-condition {
 
            `status' in RPC output descripts the result of the operation.
 
-           CREATED indicates that the specified flow condition has been newly
-           created.
+           `CREATED' indicates that the specified flow condition has been
+           newly created.
 
-           CHANGED indicates that existing flow condition configuraiton has
+           `CHANGED' indicates that existing flow condition configuraiton has
            been successfully changed.
 
            Null indicates that existing flow condition configuration has not
@@ -311,16 +311,17 @@ module vtn-flow-condition {
                   "Describes how to update the specified flow condition if it
                    already exists.
 
-                   If SET is specified, the given flow condition configuration
-                   will be applied as specified. In other words, existing
-                   flow condition configuration will be removed, and the given
-                   flow condition will be created.
+                   If `SET' is specified, the given flow condition
+                   configuration will be applied as specified. In other words,
+                   existing flow condition configuration will be removed, and
+                   the given flow condition will be created.
 
-                   If ADD is specified, the given flow condition configuration
-                   will be merged with existing configuration. The target
-                   flow condition will be created if it is not present.
+                   If `ADD' is specified, the given flow condition
+                   configuration will be merged with existing configuration.
+                   The target flow condition will be created if it is not
+                   present.
 
-                   Null will be treated as if ADD is specified.
+                   Null will be treated as if `ADD' is specified.
 
                    Note that the operation will fail if true is set to
                    `present' field and the target flow condition is not
@@ -377,10 +378,10 @@ module vtn-flow-condition {
            RPC output, and `status' field in `vtn-flow-match-result' describes
            the result of the operation.
 
-           CREATED indicates that the flow match configuration specified by
+           `CREATED` indicates that the flow match configuration specified by
            the index value has been newly created.
 
-           CHANGED indicates that the flow match configuration specified by
+           `CHANGED' indicates that the flow match configuration specified by
            the index value has been successfully changed.
 
            Null indicates that the flow match configuration specified by
@@ -430,7 +431,7 @@ module vtn-flow-condition {
            output, and `status' field in `vtn-flow-match-result' describes
            the result of the operation.
 
-           REMOVED indicates that the flow match associated with the match
+           `REMOVED' indicates that the flow match associated with the match
            index has been successfully removed.
 
            Null indicates that the flow match is not associated with the
@@ -477,7 +478,7 @@ module vtn-flow-condition {
 
            `status' in RPC output descripts the result of the operation.
 
-           REMOVED indicates that at least one flow condition has been
+           `REMOVED' indicates that at least one flow condition has been
            removed.
 
            Null indicates that no flow condition is present.
diff --git a/manager/model/src/main/yang/vtn-flow-filter.yang b/manager/model/src/main/yang/vtn-flow-filter.yang
new file mode 100644 (file)
index 0000000..06c8f07
--- /dev/null
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-flow-filter {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:flow:filter";
+    prefix vfilter;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+    import vtn-flow-action {
+        prefix vaction;
+        revision-date 2015-04-10;
+    }
+
+    description
+      "The module that describes the data models for flow filter, which
+       provides packet filtering feature for packets forwarded in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-redirect-filter-config {
+        description
+          "Describes the configuration for the redirect flow filter.";
+
+        container redirect-destination {
+            description
+              "Describes the path to the virtual interface where the
+               specified packets are forwarded.
+
+               - The VTN name configured in `tenant-name' field is always
+                 ignored. The VTN name is always determined by the location
+                 of the virtual node that contains the flow filter.
+
+               - The path to the virtual interface that contains this flow
+                 filter cannot be specified.
+
+               - Note that every packet redirected by the flow filter is
+                 discarded if the virtual interface specified by this field
+                 is not present in the  VTN.
+
+               Packet redirection should be configured not to cause the
+               packet loop. The number of virtual node hops per a flow
+               (the number of packet redirections) is limited to 100.
+               If the number of virtual node hops exceeds the limit,
+               it is treated as the packet loop and then the packet is
+               discarded.";
+            uses vtype:vnode-path-fields;
+        }
+
+        leaf output {
+            description
+              "Determine the direction of the packet redirection.
+
+               - If true is specified, the packet is redirected as outgoing
+                 packet.
+                 + The redirected packet will be treated as if it is
+                   transmitted from the virtual interface specified by
+                   `redirect-destination'.
+                 + A list of flow filters for outgoing packets configured in
+                   the virtual interface specified by `redirect-destination'
+                   wil be evaluated against the redirected packet.
+                   If the packet is passed by the flow filter, it is
+                   transmitted to the physical network mapped to the virtual
+                   interface by port mapping. The packet will be discarded
+                   if port mapping is not configured to the virtual interface.
+
+               - If false is specified or omitted, the packet is redirected
+                 as incoming packet.
+                 + The redirected packet will be treated as if it is received
+                   from the virtual interface specified by
+                   `redirect-destination'.
+                   The packet is redirected even if no physical network is
+                   mapped to the destination virtual interface by port
+                   mapping.
+                 + A list of flow filters for incoming packets configured in
+                   the virtual interface specified by `redirect-destination'
+                   will be evaluated against the redirected packet.
+                   If the packet is passed by the flow filter, it is forwarded
+                   to the virtual node that contains the virtual interface.";
+            type boolean;
+        }
+    }
+
+    grouping vtn-flow-filter-type-fields {
+        description "Describes the type of flow filter.";
+
+        choice vtn-flow-filter-type {
+            description "Describes the abstract type of flow filter.";
+
+            case vtn-drop-filter-case {
+                description
+                  "The branch of the `vtn-flow-filter-type' choice for the
+                   `vtn-drop-filter'.";
+
+                container vtn-drop-filter {
+                    description
+                      "Describes the DROP flow filter which discards the
+                       specified packet.";
+                }
+            }
+
+            case vtn-pass-filter-case {
+                description
+                  "The branch of the `vtn-flow-filter-type' choice for the
+                   `vtn-pass-filter'.";
+
+                container vtn-pass-filter {
+                    description
+                      "Describes the PASS flow filter which lets the
+                       specified packet through the virtual node in the VTN.";
+                }
+            }
+
+            case vtn-redirect-filter-case {
+                description
+                  "The branch of the `vtn-flow-filter-type' choice for the
+                   `vtn-redirect-filter'.";
+
+                container vtn-redirect-filter {
+                    description
+                      "Describes the REDIRECT flow filter which forwards
+                       the specified packet to another virtual interface
+                       in the VTN.";
+                    uses vtn-redirect-filter-config;
+                }
+            }
+        }
+    }
+
+    grouping vtn-flow-filter-config {
+        description
+          "Describes a rule of a packet filter applied to packets
+           forwarded in VTN. If a flow condition configured in a flow
+           filter matches a packet, flow actions configured in `actions'
+           are applied to the packet in ascending order of `order' field
+           in each action.
+
+             - If `actions' is omitted or it is empty, the flow filter is
+               applied to the packet without modifying the packet.
+
+             - Actions in `actions' field will be evaluated in ascending order
+               of `order' value.
+
+             - Note that the VLAN ID of the packet cannot be modified by
+               flow action because it is always determined by the virtual
+               mapping configuration, such as port mapping.
+
+             - `actions' is ignored if the type of the flow filter is `drop'.
+
+           Only the following flow actions can be configured into `actions'.
+
+              - `vtn-set-dl-src-action'
+              - `vtn-set-dl-dst-action'
+              - `vtn-set-vlan-pcp-action'
+              - `vtn-set-inet-src-action'
+              - `vtn-set-inet-dst-action'
+              - `vtn-set-inet-dscp-action'
+              - `vtn-set-port-src-action'
+              - `vtn-set-port-dst-action'
+              - `vtn-set-icmp-type-action'
+              - `vtn-set-icmp-code-action'";
+
+        /* An index value assigned to the flow filter. */
+        uses vtype:vtn-index;
+
+        leaf condition {
+            description
+              "The name of the flow condition that selects packets.
+               This flow filter is invalidated if the flow condition
+               specified by this field is not present.";
+            type vtype:vnode-name;
+            mandatory true;
+        }
+
+        /* The type of this flow filter. */
+        uses vtn-flow-filter-type-fields;
+
+        /*
+         * A list of flow actions that modifies the packet when this flow
+         * filter is applied to the packet.
+         */
+        uses vaction:vtn-flow-action-list;
+    }
+
+    grouping vtn-flow-filter-list {
+        description "Describes a list of flow filters.";
+
+        list vtn-flow-filter {
+            description
+              "Describes a list of flow filters configured in a virtual node
+               in VTN. Each flow filter in this list needs to have a unique
+               index in `index' field. `index' value is used to determine
+               order of flow filter evaluation. Flow filters in this list are
+               evaluated against packet in ascending order of `index' value,
+               and only the first matched flow filter is applied to the
+               packet.";
+
+            key "index";
+            uses vtn-flow-filter-config;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    grouping vtn-flow-filter-id {
+        description
+          "Specifies the target flow filter for RPC.
+
+           If `tenant-name', `bridge-name', and `interface-name' is
+           configured, the flow filter in the virtual interface attached
+           to the vBridge is targeted. `output' field determines the
+           flow direction for the flow filter.
+
+           If `tenant-name' and `bridge-name' is configured and
+           `interface-name' is omitted, the flow filter in the specified
+           vBridge is targeted. `output' field determines the flow direction
+           for the flow filter.
+
+           If `tenant-name', `terminal-name', and `interface-name' is
+           configured, the flow filter in the virtual interface attached to
+           the vTerminal is targeted. `output' field determines the flow
+           direction for the flow filter.
+
+           If `tenant-name' is configured and `bridge-name', `terminal-name',
+           and `interface-name' are omitted, the flow filter in the VTN is
+           targeted. In this case `output' field is ignored because the VTN
+           has a flow filter only for incoming packets.
+
+           Otherwise RPC will fail.";
+
+        /* The location of the virtual node. */
+        uses vtype:vnode-path-fields;
+
+        leaf output {
+            description
+              "Describes the flow direction for the flow filter.
+
+               If true, the flow filter for outgoing packets is targeted.
+               If false or omitted, the flow filter for incoming packets is
+               targeted.";
+            type boolean;
+        }
+    }
+
+    grouping vtn-flow-filter-result {
+        description
+          "Describes pairs of flow filter indices and `vtn-update-type'
+           values.
+
+           This grouping is used as output of RPC that modifies the flow
+           filter configuration.";
+
+        list flow-filter-result {
+            description
+              "Describes a pair of flow filter index and `vtn-update-type'
+               value.";
+
+            leaf index {
+                description
+                  "One of flow filter indicies specified by the RPC input.";
+                type int32;
+            }
+
+            uses vtype:vtn-rpc-result;
+        }
+    }
+
+    rpc set-flow-filter {
+        description
+          "Create or modify the flow filter.
+
+           This operation takes a list of `vtn-flow-filter-config', and
+           put all configurations into the flow filter list specified by
+           `vtn-flow-filter-id' in the RPC input.
+
+           Flow filter indices specified in the RPC input will be copied to
+           the RPC output, and `status' field in `vtn-flow-filter-result'
+           describes the result of the operation. Note that a duplicate flow
+           filter index in the RPC input will cause a `BADREQUEST' error.
+
+           `CREATED' indicates that new flow filter has been associated with
+           the given index number in the specified flow filter list.
+
+           `CHANGED' indicates that the flow filter specified by the given
+           index number has been modified as specified by the RPC input.
+
+           Null indicates that the flow filter specified by the given index
+           was not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the virtual node which contains the specified
+           flow filter list is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* Specifies the target flow filter list. */
+            uses vtn-flow-filter-id;
+
+            /* Flow filter configuration. */
+            uses vtn-flow-filter-list;
+        }
+
+        output {
+            uses vtn-flow-filter-result;
+        }
+    }
+
+    rpc remove-flow-filter {
+        description
+          "Remove the specified flow filters.
+
+           Index numbers for flow filters passed to `indices' list in the RPC
+           input will be copied to the RPC output, and `status' field in the
+           RPC output describes the result of the operation.
+
+           `REMOVED' indicates that the flow filter specified by `index' field
+           in the RPC output has been removed.
+
+           Null indicates that the flow filter specified by `index' field is
+           not present in the flow filter list specified by the RPC input.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the virtual node which contains the specified
+           flow filter list is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* Specifies the flow filter to be set. */
+            uses vtn-flow-filter-id;
+
+            leaf-list indices {
+                description
+                  "A list of flow filter index numbers to be removed from the
+                   flow filter list specified by the RPC input.
+                   If this field is omitted or an empty list is specified,
+                   all the flow filters present in the specified flow filter
+                   list will be removed.
+                   Duplicates in this list will be eliminated automatically.";
+                type int32;
+            }
+        }
+
+        output {
+            uses vtn-flow-filter-result;
+        }
+    }
+}
diff --git a/manager/model/src/main/yang/vtn-mac-map.yang b/manager/model/src/main/yang/vtn-mac-map.yang
new file mode 100644 (file)
index 0000000..a5e93cd
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-mac-map {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:mapping:mac";
+    prefix macmap;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+    import vtn-mac-table {
+        prefix mactable;
+        revision-date 2015-09-07;
+    }
+
+    /* OpenDaylight yangtools */
+    import ietf-yang-types {
+        prefix yang;
+        revision-date 2010-09-24;
+    }
+
+    description
+      "The module that describes the data models for MAC mapping, which
+       associates a host with a vBridge in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-mac-map-config {
+        description
+          "Describes configuration for a MAC mapping.";
+
+        container allowed-hosts {
+            description
+              "A set of hosts to be mapped by MAC mapping.
+               If a host in this container does not specify a MAC address,
+               all the hosts detected over the specified VLAN will be mapped.
+               For example, if \"@10\" is configured in this container,
+               all hosts detected on VLAN 10 will be mapped.
+
+               Note that zero, broadcast address, and multicast address
+               cannot be specified as MAC address. In addition, multiple host
+               information with the same MAC address cannot be configured in
+               this set.";
+            uses vtype:vlan-host-desc-set;
+        }
+
+        container denied-hosts {
+            description
+              "A set of hosts not to be mapped by MAC mapping.
+               This container is used to exclude specific hosts from mapping
+               when host information in `allowed-hosts' does not specify any
+               MAC address. Unlike `allowed-hosts', every hosts in this
+               container must specify a MAC address.
+
+               The hosts in this container is evaluated before
+               `allowed-hosts'. If the same host information is specified in
+               both `allowed-hosts' and this container, that host will not be
+               mapped by this MAC mapping.
+
+               Note that zero, broadcast address, and multicast address
+               cannot be specified as MAC address.";
+            uses vtype:vlan-host-desc-set;
+        }
+    }
+
+    grouping vtn-mac-map-status {
+        description
+          "Describes runtime status information about MAC mapping.";
+
+        list mapped-hosts {
+            description
+              "A list of MAC addresses actually mapped to the vBridge.";
+            key "mac-address";
+
+            leaf mac-address {
+                description "MAC address actually mapped to the vBridge.";
+                type yang:mac-address;
+            }
+        }
+    }
+
+    grouping vtn-mac-map-info {
+        description
+          "Describes information about MAC mapping, which maps hosts
+           specified by MAC address and VLAN ID to a vBridge.";
+
+        container mac-map-config {
+            description
+              "The container which contains configuration for MAC mapping.";
+            uses vtn-mac-map-config;
+        }
+
+        container mac-map-status {
+            description
+              "The container which contains runtime status information about
+               MAC mapping.";
+            uses vtn-mac-map-status;
+        }
+    }
+
+    grouping vtn-mac-mappable {
+        description
+          "Describes the data model which can contain MAC mapping
+           configuration.";
+
+        container mac-map {
+            description
+              "Describes information about MAC mapping, which maps hosts
+               specified by MAC address and VLAN ID to a vBridge.";
+            uses vtn-mac-map-info;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc set-mac-map {
+        description
+          "Configure MAC mapping in the specified vBridge.
+
+           This operation changes the MAC addresses to be mapped and not to
+           be mapped at the same time.
+
+           Upon successful completion, the result of this operation will
+           be set to the `status' field in the RPC output.
+
+           `CREATED' indicates that new MAC mapping configuration has been
+           created in the specified vBridge.
+
+           `CHANGED' indicates that existing MAC mapping configuration has
+           been changed.
+
+           `REMOVED' indicates that MAC mapping configuration has been removed
+           from the specified vBridge.
+
+           Null indicates that MAC mapping configuration in the specified
+           vBridge was not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `CONFLICT' is set if this operation tries to map a host already
+           mapped by another MAC mapping.
+
+           `CONFLICT' is set if this operation tries to add a MAC address
+           into `allowed-hosts' in the MAC mapping configuration, and that
+           MAC address is already configured in `allowed-hosts'.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            leaf operation {
+                description
+                  "Describes how to update the specified MAC mapping.
+
+                   If `SET' is specified, the given MAC mapping configuration
+                   will be applied as specified. In other words, existing
+                   MAC mapping configuration will be removed, and then the
+                   given MAC mapping will be created. Note that MAC mapping
+                   will be removed if both `allowed-hosts' and `denied-hosts'
+                   fields in the RPC input are empty.
+
+                   If `ADD' is specified, the given MAC mapping configuration
+                   will be merged with existing configuration. Hosts configured
+                   in `allowed-hosts' and `denied-hosts' fields in the RPC
+                   input will be added to `allowed-hosts' and `denied-hosts'
+                   container in the MAC mapping configuration respectively.
+
+                   If `REMOVE' is specified, the given MAC mapping
+                   configuration will be removed from existing configuration.
+                   Hosts configured in `allowed-hosts' and `denied-hosts'
+                   fields in the RPC input will be removed from `allowed-hosts'
+                   and `denied-hosts' container in the MAC mapping
+                   configuration respectively.
+                   Note that MAC mapping will be removed if both
+                   `allowed-hosts' and `denied-hosts' container in the MAC
+                   mapping configuration become empty.
+
+                   Null will be treated as if `ADD' is specified.";
+                type vtype:vtn-update-operation-type;
+            }
+
+            leaf-list allowed-hosts {
+                description
+                  "A set of hosts to be added to or removed from
+                  `allowed-hosts' container in the MAC mapping configuration.
+                   Duplicate hosts will be eliminated automatically.
+                   Note that multiple host information with the same MAC
+                   address cannot be specified in this list.";
+                type vtype:vlan-host-desc;
+            }
+
+            leaf-list denied-hosts {
+                description
+                  "A set of hosts to be added to or removed from `denied-hosts'
+                   container in the MAC mapping configuration.
+                   Duplicate hosts will be eliminated automatically.";
+                type vtype:vlan-host-desc;
+            }
+        }
+
+        output {
+            uses vtype:vtn-rpc-result;
+        }
+    }
+
+    rpc set-mac-map-acl {
+        description
+          "Configure MAC mapping in the specified vBridge.
+
+           This operation changes the specified access control list of the
+           MAC mapping.
+
+           Upon successful completion, the result of this operation will
+           be set to the `status' field in the RPC output.
+
+           `CREATED' indicates that new MAC mapping configuration has been
+           created in the specified vBridge.
+
+           `CHANGED' indicates that existing MAC mapping configuration has
+           been changed.
+
+           `REMOVED' indicates that MAC mapping configuration has been removed
+           from the specified vBridge.
+
+           Null indicates that MAC mapping configuration in the specified
+           vBridge was not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `CONFLICT' is set if this operation tries to map a host already
+           mapped by another MAC mapping.
+
+           `CONFLICT' is set if this operation tries to add a MAC address
+           into `allowed-hosts' in the MAC mapping configuration, and that
+           MAC address is already configured in `allowed-hosts'.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            leaf acl-type {
+                description
+                  "The type of the target access control list.
+                   `ALLOW' indicates that the `allowed-hosts' container in the
+                   MAC mapping configuration should be modified.
+                   `DENY' indicates that the `denied-hosts' container in the
+                   MAC mapping configuration should be modified.
+
+                   Null is treated as if `ALLOW' is specified.";
+                type vtype:vtn-acl-type;
+            }
+
+            leaf operation {
+                description
+                  "Describes how to update the specified access control list
+                   in the MAC mapping configuration.
+
+                   If `SET' is specified, the given list of host information
+                   will be applied to the specified access control list as
+                   specified. In other words, the specified access control
+                   list is cleared, and then the given host information will
+                   be added to the specified access control list.
+                   Note that MAC mapping will be removed if both
+                   `allowed-hosts' and `denied-hosts' container in the MAC
+                   mapping configuration become empty.
+
+                   If `ADD' is specified, the given list of host information
+                   will be added to the specified access control list in the
+                   MAC mapping configuration.
+
+                   If `REMOVE' is specified, the host information configured
+                   in the RPC input will be removed from the specified access
+                   conrol list in the MAC mapping configuration.
+                   Note that MAC mapping will be removed if both
+                   `allowed-hosts' and `denied-hosts' container in the MAC
+                   mapping configuration become empty.
+
+                   Null will be treated as if `ADD' is specified.";
+                type vtype:vtn-update-operation-type;
+            }
+
+            leaf-list hosts {
+                description
+                  "A set of host information to be added to or removed from
+                   the access control list in the MAC mapping configuration.
+                   Duplicate hosts will be eliminated automatically.";
+                type vtype:vlan-host-desc;
+            }
+        }
+    }
+
+    rpc get-mac-mapped-host {
+        description
+          "Get a list of hosts where mapping is actually active based on MAC
+           mapping configured in the specified vBridge.
+
+           Upon successful completion, a list of host information is will be
+           set to the RPC output.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            leaf-list mac-addresses {
+                description
+                  "A list of MAC addresses to be searched.
+                   If this field is omitted or an empty list is specified,
+                   all the host information mapped to the specified vBridge by
+                   the MAC mapping will be set to the RPC output.
+                   Duplicates in this list will be eliminated automatically.";
+                type yang:mac-address;
+            }
+        }
+
+        output {
+            list mac-mapped-hosts {
+                description
+                  "A list of host information mapped to the specified vBridge
+                   by MAC mapping.";
+                uses mactable:vtn-mac-entry;
+            }
+        }
+    }
+}
diff --git a/manager/model/src/main/yang/vtn-mac-table.yang b/manager/model/src/main/yang/vtn-mac-table.yang
new file mode 100644 (file)
index 0000000..0214707
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-mac-table {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:vbridge:mac";
+    prefix mactable;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+
+    /* OpenDaylight controller */
+    import opendaylight-inventory {
+        prefix inv;
+        revision-date 2013-08-19;
+    }
+
+    /* OpenDaylight yangtools */
+    import ietf-yang-types {
+        prefix yang;
+        revision-date 2010-09-24;
+    }
+    import ietf-inet-types {
+        prefix inet;
+        revision-date 2010-09-24;
+    }
+
+    description
+      "The module that describes the data models for MAC address table,
+       which keeps MAC addresses learned inside vBridge.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-mac-entry {
+        description
+          "Describes information about a MAC address learned inside vBridge.";
+
+        leaf mac-address {
+            description
+              "A string representation of a learned MAC address.";
+            type yang:mac-address;
+        }
+
+        leaf vlan-id {
+            description
+              "A VLAN ID detected inside Ethernet frame where the MAC address
+               was detected. Zero implies that VLAN tag was not detected.";
+            type uint16;
+        }
+
+        /*
+         * Describes a physical switch port where the MAC address was
+         * detected.
+         */
+        uses vtype:vtn-port-location;
+
+        leaf-list ip-addresses {
+            description
+              "A set of IP addresses detected inside Ethernet frame where the
+               MAC address was detected.";
+            type inet:ip-address;
+        }
+    }
+
+    grouping vtn-mac-table-list {
+        description "A list of MAC address tables.";
+
+        list mac-address-table {
+            description
+              "MAC address table keeps MAC address information learned by
+               a vBridge.";
+            key "name";
+
+            leaf name {
+                description
+                  "The name of the vBridge associated with this MAC address
+                   table.";
+                type string;
+            }
+
+            list mac-table-entry {
+                description "MAC address information learned by a vBridge.";
+                key "mac-address";
+                uses vtn-mac-entry;
+
+                leaf entry-id {
+                    description
+                      "An opaque identifier assigned to this entry.
+                       This field is only for internal use.";
+                    type string;
+                }
+            }
+        }
+    }
+
+    container mac-tables {
+        description
+          "The root container of all the MAC address tables for vBridges.
+           Do not edit this container directly.";
+        config false;
+        presence
+          "Indicates that the MAC address table management is active.";
+
+        list tenant-mac-table {
+            description
+              "Keeps a list of MAC address tables for all the vBridges in
+               the VTN.";
+            key "name";
+
+            leaf name {
+                description "The name of the VTN.";
+                type string;
+            }
+
+            uses vtn-mac-table-list;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc remove-mac-entry {
+        description
+          "Remove the specified MAC address information from the MAC address
+           table in the specified vBridge.
+
+           MAC addresses passed to `mac-addresses' list will be copied to the
+           RPC output, and `status' field in the RPC output descripes the
+           result of the operation.
+
+           `REMOVED' indicates that the MAC address specified by `mac-address'
+           field in the RPC output has been successfully removed.
+
+           Null indicates that the MAC address specified by `mac-address'
+           field in the RPC output is not learned by the vBridge specified by
+           the RPC input.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN or the vBridge specified by the RPC
+           input is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            leaf-list mac-addresses {
+                description
+                  "A list of MAC addresses to be removed from the MAC address
+                   table in the specified vBridge. If this field is omitted or
+                   an empty list is specified, all the learned MAC addresses
+                   by the specified vBridge will be removed.
+                   Duplicates in this list will be eliminated automatically.";
+                type yang:mac-address;
+            }
+        }
+
+        output {
+            list remove-mac-entry-result {
+                description
+                  "Describes pairs of MAC addresses and operation results.";
+
+                leaf mac-address {
+                    description
+                      "One of the MAC address specified by the RPC input.";
+                    type yang:mac-address;
+                }
+
+                uses vtype:vtn-rpc-result;
+            }
+        }
+    }
+}
index 83fdc70c67d4107cad9a0286cb8cd67634cae1f5..fd20a9a4c04120e3b1d98866173c5bd00042a777 100644 (file)
@@ -122,10 +122,10 @@ module vtn-path-map {
            RPC output, and `status' field in `vtn-path-map-result' describes
            the result of the operation.
 
-           CREATED indicates that the path map configuration specified by
+           `CREATED' indicates that the path map configuration specified by
            the index value has been newly created.
 
-           CHANGED indicates that the path map configuration specified by
+           `CHANGED' indicates that the path map configuration specified by
            the index value has been successfully changed.
 
            Null indicates that the path map configuration specified by the
@@ -178,7 +178,7 @@ module vtn-path-map {
            output, and `status' field in `vtn-path-map-result' describes
            the result of the operation.
 
-           REMOVED indicates that the path map associated with the map index
+           `REMOVED' indicates that the path map associated with the map index
            has been successfully removed.
 
            Null indicates that the path map is not associated with the map
@@ -232,7 +232,7 @@ module vtn-path-map {
 
            `status' in RPC output descripts the result of the operation.
 
-           REMOVED indicates that at least one path map in the specified
+           `REMOVED' indicates that at least one path map in the specified
            path map container has been removed.
 
            Null indicates that no configuration is present in the specified
index 3501a97cff674ad53c0cc47379667e9b483eeeaa..a4ca665508674d803eb4e98860a399ffb29e03bf 100644 (file)
@@ -132,11 +132,11 @@ module vtn-path-policy {
 
            `status' in RPC output describes the result of the operation.
 
-           CREATED indicates that the specified path policy has been newly
+           `CREATED' indicates that the specified path policy has been newly
            created.
 
-           CHANGED indicates that existing path policy configuration has been
-           successfully changed.
+           `CHANGED' indicates that existing path policy configuration has
+           been successfully changed.
 
            Null indicates that existing path policy configuration was not
            changed.
@@ -160,16 +160,16 @@ module vtn-path-policy {
                   "Describes how to update the specified path policy if it
                    already exists.
 
-                   If SET is specified, the given path policy configuration
+                   If `SET' is specified, the given path policy configuration
                    will be applied as specified. In other words, existing
                    path policy configuration will be removed, and the given
                    path policy will be created.
 
-                   If ADD is specified, the given path policy configuration
+                   If `ADD' is specified, the given path policy configuration
                    will be merged with existing configuration. The target
                    path policy will be created if it is not present.
 
-                   Null will be treated as if ADD is specified.
+                   Null will be treated as if `ADD' is specified.
 
                    Note that the operation will fail if true is set to
                    `present' field and the target path policy is not
@@ -225,11 +225,11 @@ module vtn-path-policy {
            to the RPC output, and `status' field in `vtn-port-desc-result'
            describes the result of the opration.
 
-           CREATED indicates that the link cost configuration for the switch
-           port specified by `port-desc' has been newly created.
+           `CREATED' indicates that the link cost configuration for the
+           switch port specified by `port-desc' has been newly created.
 
-           CHANGED indicates that the link cost configuration for the switch
-           port specified by `port-desc' has been successfully changed.
+           'CHANGED' indicates that the link cost configuration for the
+           switch port specified by `port-desc' has been successfully changed.
 
            Null indicates that the link cost configuration for the switch
            port specified by `port-desc' was not changed.
@@ -279,7 +279,7 @@ module vtn-path-policy {
            and `status' field in `vtn-port-desc-result' describes the result
            of the opration.
 
-           REMOVED indicates that the link cost configuration for the switch
+           `REMOVED' indicates that the link cost configuration for the switch
            port associated with the `vtn-port-desc' value has been
            successfully removed.
 
@@ -328,7 +328,7 @@ module vtn-path-policy {
 
            `status' in RPC output descripts the result of the operation.
 
-           REMOVED indicates that at least one path policy has been removed.
+           `REMOVED' indicates that at least one path policy has been removed.
 
            Null indicates that no path policy is present.
 
diff --git a/manager/model/src/main/yang/vtn-port-map.yang b/manager/model/src/main/yang/vtn-port-map.yang
new file mode 100644 (file)
index 0000000..b9697c4
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-port-map {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:mapping:port";
+    prefix portmap;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+
+    description
+      "The module that describes the data models for port mapping, which
+       associates a physical switch port with a virtual interface in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-port-map-config {
+        description
+          "Describes configuration for a port mapping.
+
+           Actual physical port of switch that gets mapped to a virtual
+           interface is decided as follows:
+
+             - If `port-name' field is configured, then out of physical ports
+               in the switch specified by `node' field, the physical port that
+               has the specified port name will get mapped.
+
+             - If `port-id' field is configured, the out of the physical ports
+               in the switch specified by `node' field, the physical port
+               corresponding to the specified port ID will get mapped.
+
+             - If both `port-name' and `port-id' are configured, the out of
+               the physical ports in the switch specified by `node' field,
+               the physical port that has the specified port name and port ID
+               will get mapped.";
+
+        uses vtype:vtn-port-location;
+
+        /* VLAN ID to be mapped. */
+        uses vtype:vtn-vlan-id-field;
+    }
+
+    grouping vtn-port-mappable {
+        description
+          "Describes the data model which can contain port mapping
+           configuration.";
+
+        container port-map-config {
+            description
+              "The container which contains port mapping configuration,
+               which maps a physical switch port to a virtual interface in
+               a virtual node.";
+            uses vtn-port-map-config;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc set-port-map {
+        description
+          "Configure port mapping in the specified virtual interface.
+
+           The target virtual interface is determined by the RPC input.
+           If `bridge-name' field in the RPC input is configured, port
+           mapping is configured in the virtual interface attached to the
+           vBridge specified by `tenant-name' and `bridge-name'.
+           If `bridge-name' field is omitted and `terminal-name' field in
+           the RPC input is configured, port mapping is configured in the
+           virtual interface attached to the vTerminal specified by
+           `tenant-name' and `terminal-name'.
+
+           If port mapping is already configured in the specified virtual
+           interface, the specified settins are applied after old
+           configuration is deleted.
+
+           Upon successful completion, the result of this operation will
+           be set to the `status' field in the RPC output.
+
+           `CREATED' indicates that new port mapping configuration has been
+           created successfully.
+
+           `CHANGED' indicates that old port mapping configuration has been
+           replaced with the configuration specified by the RPC input.
+
+           Null indicates that the port mapping configuration specified by
+           the RPC input is already applied to the specified virtual
+           interface.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the vTerminal specified by `tenant-name' and
+           `terminal-name' is not present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the virtual interface specified by
+           `tenant-name' and `bridge-name' (or `terminal-name') and
+           `interface-name' is not present.
+
+           `CONFLICT' is set if the specified combination of physical
+           switch port and VLAN ID is mapped to another virtual interface.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the virtual interface. */
+            uses vtype:vnode-path-fields;
+
+            /* Port mapping configuration. */
+            uses vtn-port-map-config;
+        }
+
+        output {
+            uses vtype:vtn-rpc-result;
+        }
+    }
+
+    rpc remove-port-map {
+        description
+          "Remove port mapping configuration from the specified virtual
+           interface.
+
+           The target virtual interface is determined by the RPC input.
+           If `bridge-name' field in the RPC input is configured, port
+           mapping configured in the virtual interface attached to the
+           vBridge specified by `tenant-name' and `bridge-name' will be
+           removed.
+           If `bridge-name' field is omitted and `terminal-name' field in
+           the RPC input is configured, port mapping configured in the
+           virtual interface attached to the vTerminal specified by
+           `tenant-name' and `terminal-name' will be removed.
+
+           Upon successful completion, the result of this operation will
+           be set to the `status' field in the RPC output.
+
+           `REMOVED' indicates that port mapping configuration has been
+           removed successfully from the virtual interface specified by the
+           RPC input.
+
+           Null indicates that port mapping configuration is not present in
+           the virtual interface specified by the RPC input.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the vTerminal specified by `tenant-name' and
+           `terminal-name' is not present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the virtual interface specified by
+           `tenant-name' and `bridge-name' (or `terminal-name') and
+           `interface-name' is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the virtual interface. */
+            uses vtype:vnode-path-fields;
+        }
+
+        output {
+            uses vtype:vtn-rpc-result;
+        }
+    }
+}
index 7a8bbd7903474d3a2ad85ec2e105b9e238c2399b..6dedfc65466dd9140259cd6895879c58bbf13e4d 100644 (file)
@@ -49,6 +49,38 @@ module vtn-types {
         }
     }
 
+    grouping vbridge-path-fields {
+        description
+          "Describes a set of fields which specify the location of the
+           vBridge inside the VTN.";
+
+        leaf tenant-name {
+            description "The name of the VTN.";
+            type string;
+        }
+
+        leaf bridge-name {
+            description "The name of the vBridge.";
+            type string;
+        }
+    }
+
+    grouping vterminal-path-fields {
+        description
+          "Describes a set of fields which specify the location of the
+           vTerminal inside the VTN.";
+
+        leaf tenant-name {
+            description "The name of the VTN.";
+            type string;
+        }
+
+        leaf terminal-name {
+            description "The name of the vTerminal.";
+            type string;
+        }
+    }
+
     grouping vnode-path-fields {
         description
           "Describes a set of fields which specify the location of the
@@ -71,7 +103,6 @@ module vtn-types {
         leaf router-name {
             description
               "The name of the vRouter.
-               This field is ignored if `bridge-name' field is configured.
                Currently the VTN Manager never uses this field because the
                virtual router is not yet supported.";
             type string;
@@ -80,8 +111,7 @@ module vtn-types {
         leaf terminal-name {
             description
               "The name of the vTerminal.
-               This field is ignored if either `bridge-name' or `router-name'
-               field is configured.
+               This field is ignored if `bridge-name' field is configured.
                This field is omitted if the virtual node specified by this
                model is neither a vTerminal nor a virtual node attached to
                the vTerminal.";
@@ -95,9 +125,6 @@ module vtn-types {
                - If the virtual interface specified by this model is attached
                  to a vBridge, the name of the vBridge is set to `bridge-name'
                  field.
-               - If the virtual interface specified by this model is attached
-                 to a vRouter, the name of the vRouter is set to
-                 `router-name' field.
                - If the virtual interface specified by this model is attached
                  to a vTerminal, the name of the vTerminal is set to
                  `terminal-name' field.
@@ -129,6 +156,36 @@ module vtn-types {
         }
     }
 
+    typedef vnode-update-mode {
+        description "Describes how to update a virtual node.";
+
+        type enumeration {
+            enum UPDATE {
+                description
+                  "Indicates that the specified virtual node needs to be
+                   created if it is not present. The specified virtual node
+                   will be modified if it is present.";
+                value 0;
+            }
+
+            enum CREATE {
+                description
+                  "Indicates that a new virtual node needs to be created.
+                   Operation will fail if the specified virtual node is
+                   present.";
+                value 1;
+            }
+
+            enum MODIFY {
+                description
+                  "Indicates that existing virtual node needs to be modified.
+                   Operation will fail if the specified virtual node is not
+                   present.";
+                value 2;
+            }
+        }
+    }
+
     typedef vtn-update-type {
         description
           "Describes the result of the operation that updates the
@@ -316,6 +373,18 @@ module vtn-types {
         uses vtn-switch-port;
     }
 
+    grouping vtn-vlan-id-field {
+        description "Describes a field which specifies the VLAN ID.";
+
+        leaf vlan-id {
+            description
+              "Specifies the VLAN ID.
+               Zero implies untagged Ethernet frame.
+               If omitted, it will be treated as zero is specified.";
+            type l2:vlan-id;
+        }
+    }
+
     grouping vlan-host {
         description
           "Describes the host in VLAN.
@@ -326,11 +395,26 @@ module vtn-types {
             type yang:mac-address;
         }
 
-        leaf vlan-id {
-            description
-              "VLAN ID that specifies the VLAN to which the host belongs.
-               Zero means the untagged network.";
-            type l2:vlan-id;
+        uses vtn-vlan-id-field;
+    }
+
+    typedef vlan-host-desc {
+        description
+          "Describes the host in VLAN.
+           The value must be a pair of MAC address and VLAN ID joined with
+           `@'.
+
+           The first element must be a string representation of MAC
+           address in lower-case hex format (e.g. 00:11:22:33:aa) or an
+           empty string. An empty string implies that the MAC address is
+           not specified.
+
+           The second element must be a string representation of VLAN ID
+           in decimal format. Zero means the untagged Ethernet frame.
+           Note that VLAN ID is mandatory.";
+
+        type string {
+            pattern "([0-9a-f]{2}(:[0-9a-f]{2}){5})?@[0-9]+";
         }
     }
 
@@ -418,4 +502,20 @@ module vtn-types {
             mandatory true;
         }
     }
+
+    grouping vlan-host-desc-set {
+        description
+          "Describes a set of `vlan-host-desc' values.";
+
+        list vlan-host-desc-list {
+            description
+              "Describes a list of unique `vlan-host-desc' values.";
+
+            key "host";
+            leaf host {
+                description "A pair of MAC address and VLAN ID.";
+                type vlan-host-desc;
+            }
+        }
+    }
 }
diff --git a/manager/model/src/main/yang/vtn-vbridge.yang b/manager/model/src/main/yang/vtn-vbridge.yang
new file mode 100644 (file)
index 0000000..9efbf8c
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-vbridge {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:vbridge";
+    prefix vbr;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+    import vtn-vinterface {
+        prefix vif;
+        revision-date 2015-09-07;
+    }
+    import vtn-vlan-map {
+        prefix vlanmap;
+        revision-date 2015-09-07;
+    }
+    import vtn-mac-map {
+        prefix macmap;
+        revision-date 2015-09-07;
+    }
+    import vtn-flow-filter {
+        prefix vfilter;
+        revision-date 2015-09-07;
+    }
+
+    /* OpenDaylight controller */
+    import opendaylight-inventory {
+        prefix inv;
+        revision-date 2013-08-19;
+    }
+
+    description
+      "The module that describes the data models for vBridge, which
+       represents a virtual broadcast domain in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-bridge-status {
+        description
+          "Describes runtime status information about a virtual bridge node
+           in the VTN.";
+
+        leaf state {
+            description
+              "State of the virtual bridge node.
+
+               `UNKNOWN' indicates that no physical network is mapped to
+               the virtual bridge node.
+
+               `DOWN' indicates that the physical network mapped to the
+               virtual bridge node is not operating correctly.
+
+               `UP' indicates that the physical network mapped to the
+               virtual bridge node is operating correctly.";
+            type vtype:vnode-state;
+            default UNKNOWN;
+        }
+
+        leaf path-faults {
+            description
+              "The number of path faults detected inside the virtual bridge
+               node. The number of elements in `faulted-paths' will be set
+               to this field.
+
+               This shows the number of paths between the switches,
+               constituting a virtual bridge node, that could not be
+               configured by the VTN Manager because the paths were broken.
+               Zero is set when no path fault has been detected.
+
+               The number of path faults is counted for each direction of
+               path. For example, if switch A and switch B are separated, then
+               the path from switch A to switch B and path from switch B to
+               switch A are treated as different and both are counted.";
+            type int32 {
+                range "0 .. max";
+            }
+            default 0;
+        }
+
+        list faulted-paths {
+            description "A set of faulted paths.";
+            key "source destination";
+
+            leaf source {
+                description "The source node of the faulted path.";
+                type inv:node-id;
+            }
+
+            leaf destination {
+                description "The destination node of the faulted path.";
+                type inv:node-id;
+            }
+        }
+    }
+
+    grouping vtn-port-mappable-bridge {
+        description
+          "Describes a virtual node in the VTN, which contains a list of
+           port-mappable virtual interfaces.";
+
+        container bridge-status {
+            description
+              "The container which contains runtime information about
+               this virtual bridge.";
+            uses vtn-bridge-status;
+        }
+
+        /* A list of virtual interfaces. */
+        uses vif:vtn-mappable-vinterface-list;
+    }
+
+    grouping vtn-vbridge-config {
+        description "Describes configuration for a vBridge.";
+
+        leaf description {
+            description "An arbitrary description about the vBridge.";
+            type string;
+        }
+
+        leaf age-interval {
+            description
+              "The number of seconds between MAC address table aging.
+               The default value is 600.";
+            type int32 {
+                range "10 .. 1000000";
+            }
+        }
+    }
+
+    grouping vtn-vbridge-info {
+        description
+          "Describes information about vBridge.
+
+           `state' field indicates the state of the vBridge.
+           If all the following conditions are met, the vBridge status will be
+           `UNKNOWN':
+             - Neigher VLAN mapping nor MAC mapping is configured in the
+               vBridge.
+             - Port mapping is not set for all the enabled virtual interfaces
+               inside the vBridge.
+
+           `DOWN' indicates that the physical network mapped to the vBridge
+           is not operating correctly. If any of the following conditions are
+           met, then the vBridge status will be `DOWN':
+             - VLAN mapping with specifying physical switch is configured in
+               the vBridge, and that physical switch is meeting any one of the
+               following conditions:
+               + Physical switch does not exist.
+               + All the ports of the physical switch are connected to some
+                 other physical switch.
+               + Except for the ports that connect two physical switches,
+                 no other ports are operational.
+
+             - MAC mapping is configured in the vBridge, and the target host
+               for MAC mapping is not yet detected.
+
+             - One or more than one interface out of the enabled virtual
+               interfaces inside the vBridge is in `DOWN' state.
+
+             - There is no reachable route available while configuring network
+               routes mapped to the vBridge.
+
+           `UP' indicates that the physical network mapped to the vBridge is
+           operating correctly.";
+
+        leaf name {
+            description "The name of the vBridge.";
+            type vtype:vnode-name;
+        }
+
+        container vbridge-config {
+            description
+              "The container which contains configuration for vBridge.";
+            uses vtn-vbridge-config;
+        }
+
+        /* Virtual interface list and runtime information. */
+        uses vtn-port-mappable-bridge;
+
+        /* VLAN mapping. */
+        uses vlanmap:vtn-vlan-mappable;
+
+        /* MAC mapping. */
+        uses macmap:vtn-mac-mappable;
+
+        container vbridge-input-filter {
+            description
+              "A list of flow filters applied to packets forwarded to the
+               vBridge.
+               Note that this container may not be present if no input flow
+               filter is configured in this vBridge.";
+            uses vfilter:vtn-flow-filter-list;
+        }
+
+        container vbridge-output-filter {
+            description
+              "A list of flow filters applied to packets transmitted to the
+               physical network mapped to the vBridge by VLAN mapping or
+               MAC mapping. This flow filter list is not evaluated when a
+               packet is forwarded to the virtual interface in the same
+               vBridge.
+               Note that this container may not be present if no output flow
+               filter is configured in this vBridge.";
+            uses vfilter:vtn-flow-filter-list;
+        }
+    }
+
+    grouping vtn-vbridge-list {
+        description "Describes a list of vBridges.";
+
+        list vbridge {
+            description
+              "vBridge is a virtual layer 2 switch inside VTN, and it
+               represents one virtual broadcast domain.";
+            key "name";
+            uses vtn-vbridge-info;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc update-vbridge {
+        description
+          "Create or modify the specified vBridge.
+
+           Upon successful completion, the result of this operation will be
+           set to the `status' field in the RPC output.
+
+           `CREATED' indicates that the specified vBridge has been newly
+           created.
+
+           `CHANGED' indicates that the configuration for the specified
+           vBridge has been changed.
+
+           Null indicates that the configuration for the specified vBridge was
+           not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if `update-mode' field in the RPC input is
+           `MODIFY' and the specified vBridge is not present.
+
+           `CONFLICT' is set if `update-mode' field in the RPC input is
+           `CREATE' and the specified vBridge is present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+         input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            leaf update-mode {
+                description
+                  "Describes how to update the vBridge specified by
+                   `tenant-name' and `bridge-name';
+
+                   If `UPDATE' is specified, the specified vBridge is created
+                   if it is not present. Otherwise the specified vBridge
+                   configuration is applied to the specified vBridge.
+
+                   If `CREATE' is specified, the specified vBridge is created
+                   only if it is not present. If the specified vBridge is
+                   present, this operation will cause a `CONFLICT' error.
+
+                   If `MODIFY' is specified, the specified vBridge
+                   configuration is applied to the specified vBridge only if
+                   it is present. If the specified vBridge is not present,
+                   this operation will cause a `NOTFOUND' error.";
+
+                type vtype:vnode-update-mode;
+                default UPDATE;
+            }
+
+            leaf operation {
+                description
+                  "Describes how to update the existing vBridge specified by
+                   `tenant-name' and `bridge-name'. This field will be ignored
+                   if the specified vBridge is not present.
+
+                   If `ADD' is specified, omitted fields will not be
+                   modified. For example, `description' field is not modified
+                   if `description' field is omitted. This is the default
+                   behavior.
+
+                   If `SET' is specified, all the fields defined by
+                   `vtn-vbridge-config' will be applied to the vBridge
+                   configuration as-is.
+                     - If `description' field is omitted, `description' field
+                       will be removed from the configuration.
+                     - If `age-interval' field is omitted, `age-interval'
+                       field in the vBridge configuration will be reset to the
+                       default value (600).";
+
+                type vtype:vtn-update-operation-type;
+                default ADD;
+            }
+
+            /* vBridge configuration. */
+            uses vtn-vbridge-config;
+         }
+
+         output {
+            uses vtype:vtn-rpc-result;
+         }
+    }
+
+    rpc remove-vbridge {
+        description
+          "Remove the specified vBridge.
+
+           All the virtual interfaces inside the specified vBridge will also
+           be removed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the specified vBridge is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+        }
+    }
+}
diff --git a/manager/model/src/main/yang/vtn-vinterface.yang b/manager/model/src/main/yang/vtn-vinterface.yang
new file mode 100644 (file)
index 0000000..9b086da
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-vinterface {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:vinterface";
+    prefix vif;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+    import vtn-port-map {
+        prefix portmap;
+        revision-date 2015-09-07;
+    }
+    import vtn-flow-filter {
+        prefix vfilter;
+        revision-date 2015-09-07;
+    }
+
+    /* OpenDaylight controller */
+    import opendaylight-inventory {
+        prefix inv;
+        revision-date 2013-08-19;
+    }
+
+    description
+      "The module that describes the data models for virtual interface,
+       which is an input and output interface that could be set in virtual
+       node in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-vinterface-config {
+        description
+          "Describes configuration for a virtual interface.";
+
+        leaf description {
+            description
+              "An arbitrary description about the virtual interface.";
+            type string;
+        }
+
+        leaf enabled {
+            description
+              "A boolean value which determines whether the virtual
+               interface is to be enabled or not. True means that the
+               virtual interface is enabled.
+               If a virtual interface is disabled, then all the inputs
+               from that virtual interface will be ignored. Also, there
+               will be no output against that virtual interface.
+
+               If this field is omitted, it will be treated as true is
+               specified.";
+            type boolean;
+        }
+    }
+
+    grouping vtn-vinterface-info {
+        description
+          "Describes information about virtual interface.";
+
+        leaf name {
+            description "The name of the virtual interface.";
+            type vtype:vnode-name;
+        }
+
+        container vinterface-config {
+            description
+              "The container which contains configuration for virtual
+               interface.";
+            uses vtn-vinterface-config;
+        }
+
+        container vinterface-input-filter {
+            description
+              "A list of flow filters applied to packets received from this
+               virtual interface.
+               Note that this container may not be present if no input flow
+               filter is configured in this virtual interface.";
+            uses vfilter:vtn-flow-filter-list;
+        }
+
+        container vinterface-output-filter {
+            description
+              "A list of flow filters applied to packets transmitted from
+               this virtual interface.
+               Note that this container may not be present if no output flow
+               filter is configured in this virtual interface.";
+            uses vfilter:vtn-flow-filter-list;
+        }
+    }
+
+    grouping vtn-mappable-vinterface-status {
+        description
+          "Describes runtime status information about a virtual interface
+           which can contain port mapping configuration.";
+
+        leaf state {
+            description
+              "State of the virtual interface.
+
+               `UNKNOWN' indicates that other network element is not mapped
+               to the virtual interface.
+
+               `DOWN' indicates that the network element mapped to the
+               virtual interface is not operating. It will be in `DOWN'
+               state even when the virtual interface is disabled.
+
+               `UP' indicates that the network element mapped to the
+               virtual interface is operating.";
+            type vtype:vnode-state;
+        }
+
+        leaf entity-state {
+            description
+              "State of the network element mapped to this virtual
+               interface.";
+            type vtype:vnode-state;
+        }
+
+        leaf mapped-port {
+            description
+              "A physical switch port actually mapped by the port mapping.
+               This field is omitted if no physical switch port meets the
+               condition specified by the port mapping configuration.";
+            type inv:node-connector-id;
+        }
+    }
+
+    grouping vtn-mappable-vinterface {
+        description
+          "Describes information about a virtual interface which can
+           contain port mapping configuration.";
+        uses vtn-vinterface-info;
+
+        container vinterface-status {
+            description
+              "The container which contains runtime status information about
+               the virtual interface which can contain port mapping
+               configuration.";
+            uses vtn-mappable-vinterface-status;
+        }
+
+        /* Port mapping configuration. */
+        uses portmap:vtn-port-mappable;
+    }
+
+    grouping vtn-mappable-vinterface-list {
+        description
+          "Describes a list of virtual interfaces which can have port
+           mapping confuguration.";
+
+        list vinterface {
+            description
+              "Describes virtual interface which can contain port mapping
+               configuration.";
+            key "name";
+            uses vtn-mappable-vinterface;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc update-vinterface {
+        description
+          "Create or modify the specified virtual interface.
+
+           If `bridge-name' field in the RPC input is configured, the virtual
+           interface inside the specified vBridge will be creted or modified.
+           If `bridge-name field is omitted and `terminal-name' field in the
+           RPC input is configured, the virtual interface inside the
+           specified vTerminal will be created or modified.
+
+           Upon successful completion, the result of this operation will be
+           set to the `status' field in the RPC output.
+
+           `CREATED' indicates that the specified virtual interface has
+           been newly created.
+
+           `CHANGED' indicates that the configuration for the specified
+           virtual interface has been changed.
+
+           Null indicates that the configuration for the specified virtual
+           interface was not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the vTerminal specified by `tenant-name' and
+           `terminal-name' is not present.
+
+           `NOTFOUND' is set if `update-mode' field in the RPC input is
+           `MODIFY' and the specified virtual interface is not present.
+
+           `CONFLICT' is set if `update-mode' field in the RPC input is
+           `CREATE' and the specified virtual interface is present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+         input {
+            /* The location of the virtual interface. */
+            uses vtype:vnode-path-fields;
+
+            leaf update-mode {
+                description
+                  "Describes how to update the virtual interface specified by
+                   the RPC input.
+
+                   If `UPDATE' is specified, the specified virtual interface
+                   is created if it is not present. Otherwise the specified
+                   virtual interface configuration is applied to the
+                   specified virtual interface.
+
+                   If `CREATE' is specified, the specified virtual interface
+                   is created only if it is not present. If the specified
+                   virtual interface is present, this operation will cause a
+                   `CONFLICT' error.
+
+                   If `MODIFY' is specified, the specified virtual interface
+                   configuration is applied to the specified virtual
+                   interface only if it is present. If the specified virtual
+                   interface  is not present, this operation will cause a
+                   `NOTFOUND' error.";
+
+                type vtype:vnode-update-mode;
+                default UPDATE;
+            }
+
+            leaf operation {
+                description
+                  "Describes how to update the existing virtual interface
+                   specified by the RPC input. This field will be ignored
+                   if the specified virtual interface is not present.
+
+                   If `ADD' is specified, omitted fields will not be
+                   modified. For example, `description' field is not modified
+                   if `description' field is omitted. This is the default
+                   behavior.
+
+                   If `SET' is specified, all the fields defined by
+                   `vtn-vinterface-config' will be applied to the virtual
+                   interface configuration as-is.
+                     - If `description' field is omitted, `description' field
+                       will be removed from the configuration.
+                     - If `enabled' field is omitted, `enabled' field in the
+                       virtual interface configuration will be reset to the
+                       default value (true).";
+
+                type vtype:vtn-update-operation-type;
+                default ADD;
+            }
+
+            /* Virtual interface configuration. */
+            uses vtn-vinterface-config;
+         }
+
+         output {
+            uses vtype:vtn-rpc-result;
+         }
+    }
+
+    rpc remove-vinterface {
+        description
+          "Remove the specified virtual interface.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `NOTFOUND' is set if the vTerminal specified by `tenant-name' and
+           `terminal-name' is not present.
+
+           `NOTFOUND' is set if the virtual interface specified by the RPC
+           input is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the virtual interface. */
+            uses vtype:vnode-path-fields;
+        }
+    }
+}
diff --git a/manager/model/src/main/yang/vtn-vlan-map.yang b/manager/model/src/main/yang/vtn-vlan-map.yang
new file mode 100644 (file)
index 0000000..bea9aa7
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-vlan-map {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:mapping:vlan";
+    prefix vlanmap;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+
+    /* OpenDaylight controller */
+    import opendaylight-inventory {
+        prefix inv;
+        revision-date 2013-08-19;
+    }
+
+    description
+      "The module that describes the data models for VLAN mapping, which
+       associates a VLAN with a vBridge in VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-vlan-map-config {
+        description "Describes configuration for a VLAN mapping.";
+
+        leaf node {
+            description
+              "Identifier for a physical switch to be mapped.
+
+               If this field is specified, only the VLAN specified by
+               `vlan-id' on the specified physical switch is mapped to
+               vBridge.
+               If this field is omitted, the VLAN specified by `vlan-id'
+               on all the switches managed by the OpenDaylight controller
+               are mapped to vBridge.";
+            type inv:node-id;
+        }
+
+        /* VLAN ID to be mapped. */
+        uses vtype:vtn-vlan-id-field;
+    }
+
+    grouping vtn-vlan-map-status {
+        description
+          "Describes runtime status information about VLAN mapping.";
+
+        leaf active {
+            description
+              "Determine whether the VLAN mapping is active or not.
+               True is set if VLAN specified by the VLAN mapping
+               configuration is detected.";
+            type boolean;
+        }
+    }
+
+    grouping vtn-vlan-map-info {
+        description
+          "Describes information about VLAN mapping, which associates
+           a VLAN with a vBridge in VTN.";
+
+        leaf map-id {
+            description
+              "The identifier assigned to the VLAN mapping, which is
+               unique in the vBridge.";
+            type string;
+        }
+
+        container vlan-map-config {
+            description
+              "The container which contains configuration for VLAN mapping.";
+            uses vtn-vlan-map-config;
+        }
+
+        container vlan-map-status {
+            description
+              "The container which contains runtime status information about
+               VLAN mapping.";
+            uses vtn-vlan-map-status;
+        }
+    }
+
+    grouping vtn-vlan-mappable {
+        description
+          "Describes the data model which can contain VLAN mapping
+           configuration.";
+
+        list vlan-map {
+            description
+              "A list of VLAN mappings configured in this data model.";
+            key "map-id";
+            uses vtn-vlan-map-info;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc add-vlan-map {
+        description
+          "Configure VLAN mapping in the specified vBridge.
+
+           VLAN specified by the RPC input will get mapped to the specified
+           vBridge.
+
+           Upon successful completion, the identifier assigned to the
+           configured VLAN mapping and status status information about the
+           VLAN mapping are set into the RPC output.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `CONFLICT' is set if the VLAN network speccified by the RPC input
+           is already mapped to the specified vBridge or another vBridge.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            /* VLAN mapping configuration. */
+            uses vtn-vlan-map-config;
+        }
+
+        output {
+            leaf map-id {
+                description
+                  "The identifier assigned to newly configured VLAN mapping.";
+                type string;
+            }
+
+            /* Status information */
+            uses vtn-vlan-map-status;
+        }
+    }
+
+    rpc remove-vlan-map {
+        description
+          "Remove the specified VLAN mappings from the vBridge.
+
+           IDs for VLAN mappings passed to `map-ids' list will be copied to
+           the RPC output, and `status' field in the RPC output describes the
+           result of the operation.
+
+           `REMOVED' indicates that the VLAN mapping specified by `map-id'
+           field in the RPC output has been removed.
+
+           Null indicates that the VLAN mapping specified by `map-id' field
+           in the RPC output is not present.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the vBridge specified by `tenant-name' and
+           `bridge-name' is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            leaf-list map-ids {
+                description
+                  "A list of VLAN mapping IDs to be removed from the specified
+                   vBridge. If this field is omitted or an empty list is
+                   specified, all the VLAN mappings present in the specified
+                   vBridge will be removed.
+                   Duplicates in this list will be eliminated automatically.";
+                type string;
+            }
+        }
+
+        output {
+            list remove-vlan-map-result {
+                description
+                  "Describes pairs of VLAN mapping IDs and operation
+                   results.";
+
+                leaf map-id {
+                    description
+                      "One of VLAN mapping ID specified by the RPC input.";
+                    type string;
+                }
+
+                uses vtype:vtn-rpc-result;
+            }
+        }
+    }
+
+    rpc get-vlan-map {
+        description
+          "Search for a VLAN mapping with the specified VLAN mapping
+           configuration in the specified vBridge.
+
+           If a VLAN mapping with the VLAN mapping configuration that
+           exactly matches with the configuration specified by the RPC
+           input is present in the specified vBridge, identifier assigned
+           to that VLAN mapping and status information about the VLAN mapping
+           are set to the RPC output.
+           The RPC output will be empty if not found.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN or the vBridge specified by the RPC
+           input is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vBridge. */
+            uses vtype:vbridge-path-fields;
+
+            /* VLAN mapping configuration. */
+            uses vtn-vlan-map-config;
+        }
+
+        output {
+            leaf map-id {
+                description
+                  "The identifier assigned to the VLAN mapping whose
+                   configuration exactly matches the configuration specified
+                   by the RPC input. Null is set if not found.";
+                type string;
+            }
+
+            /* Status information */
+            uses vtn-vlan-map-status;
+        }
+    }
+}
diff --git a/manager/model/src/main/yang/vtn-vterminal.yang b/manager/model/src/main/yang/vtn-vterminal.yang
new file mode 100644 (file)
index 0000000..d72e1a4
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2015 NEC Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module vtn-vterminal {
+    yang-version 1;
+    namespace "urn:opendaylight:vtn:vterminal";
+    prefix vterm;
+
+    import vtn-types {
+        prefix vtype;
+        revision-date 2015-02-09;
+    }
+    import vtn-vbridge {
+        prefix vbr;
+        revision-date 2015-09-07;
+    }
+    import vtn-vinterface {
+        prefix vif;
+        revision-date 2015-09-07;
+    }
+
+    description
+      "The module that describes the data models for vTerminal, which is
+       isolated input and output terminal inside VTN.";
+
+    revision 2015-09-07 {
+        description "Initial revision.";
+    }
+
+    grouping vtn-vterminal-config {
+        description "Describes configuration for a vTerminal.";
+
+        leaf description {
+            description "An arbitrary description about the vTerminal.";
+            type string;
+        }
+    }
+
+    grouping vtn-vterminal-info {
+        description
+          "Describes information about vTerminal.
+           Unlike vBridge, vTerminal can have only one virtual interface.
+           vTerminal is always used in conjunction with redirection by
+           flow filter.
+
+          `state' field indicates the state of the vTerminal.
+          If any of the following conditions are met, the vTerminal status
+          will be `UNKNOWN':
+            - No virtual interface is configured in the vTerminal.
+            - A virtual interface inside the vTerminal is disabled.
+            - Port mapping is not configured in a virtual interface inside
+              the vTerminal.
+
+          `DOWN' indicates that the physical network mapped to the
+          vTerminal is not operating correctly. If an enabled virtual
+          interface inside the vTerminal is in `DOWN' state, then the
+          vTerminal status will be `DOWN'.
+
+          `UP indicates that the physical network mapped to the vTerminal
+          is operating correctly.";
+
+        leaf name {
+            description "The name of the vTerminal.";
+            type vtype:vnode-name;
+        }
+
+        container vterminal-config {
+            description
+              "The container which contains configuration for vTerminal.";
+            uses vtn-vterminal-config;
+        }
+
+        /*
+         * Virtual interface list and runtime information.
+         * Note that only one virtual interface can be configured.
+         */
+        uses vbr:vtn-port-mappable-bridge;
+    }
+
+    grouping vtn-vterminal-list {
+        description "Describes a list of vTerminals.";
+
+        list vterminal {
+            description
+              "vTerminal is isolated input and output terminal inside VTN.
+               vTerminal can have only one virtual interface, and it can
+               map a physical switch port by port mapping.";
+            key "name";
+            uses vtn-vterminal-info;
+        }
+    }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc update-vterminal {
+        description
+          "Create or modify the specified vTerminal.
+
+           Upon successful completion, the result of this operation will be
+           set to the `status' field in the RPC output.
+
+           `CREATED' indicates that the specified vTerminal has been newly
+           created.
+
+           `CHANGED' indicates that the configuration for the specified
+           vTerminal has been changed.
+
+           Null indicates that the configuration for the specified vTerminal
+           was not changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if `update-mode' field in the RPC input is
+           `MODIFY' and the specified vTerminal is not present.
+
+           `CONFLICT' is set if `update-mode' field in the RPC input is
+           `CREATE' and the specified vTerminal is present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+         input {
+            /* The location of the vTerminal. */
+            uses vtype:vterminal-path-fields;
+
+            leaf update-mode {
+                description
+                  "Describes how to update the vTerminal specified by
+                   `tenant-name' and `terminal-name';
+
+                   If `UPDATE' is specified, the specified vTerminal is
+                   created if it is not present. Otherwise the specified
+                   vTerminal configuration is applied to the specified
+                   vTerminal.
+
+                   If `CREATE' is specified, the specified vTerminal is
+                   created only if it is not present. If the specified
+                   vTerminal is present, this operation will cause a
+                   `CONFLICT' error.
+
+                   If `MODIFY' is specified, the specified vTerminal
+                   configuration is applied to the specified vTerminal only
+                   if it is present. If the specified vTerminal is not
+                   present, this operation will cause a `NOTFOUND' error.";
+
+                type vtype:vnode-update-mode;
+                default UPDATE;
+            }
+
+            leaf operation {
+                description
+                  "Describes how to update the existing vTerminal specified
+                   by `tenant-name' and `terminal-name'. This field will be
+                   ignored if the specified vTerminal is not present.
+
+                   If `ADD' is specified, omitted fields will not be
+                   modified. For example, `description' field is not modified
+                   if `description' field is omitted. This is the default
+                   behavior.
+
+                   If `SET' is specified, all the fields defined by
+                   `vtn-vterminal-config' will be applied to the vTerminal
+                   configuration as-is. In this case the `description'
+                   field will be removed from the configuration if
+                   `description' field is omitted.";
+
+                type vtype:vtn-update-operation-type;
+                default ADD;
+            }
+
+            /* vTerminal configuration. */
+            uses vtn-vterminal-config;
+         }
+
+         output {
+            uses vtype:vtn-rpc-result;
+         }
+    }
+
+    rpc remove-vterminal {
+        description
+          "Remove the specified vTerminal.
+
+           All the virtual interfaces inside the specified vTerminal will
+           also be removed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the VTN specified by `tenant-name' is not
+           present.
+
+           `NOTFOUND' is set if the specified vTerminal is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            /* The location of the vTerminal. */
+            uses vtype:vterminal-path-fields;
+        }
+    }
+}
index 7e97e97e0cb2daac9308a5d614046d1d252e1ba5..8eec4aa77cefa08eb6e49bd459dcb8566dc66155 100644 (file)
@@ -20,6 +20,18 @@ module vtn {
         prefix pathmap;
         revision-date 2015-03-28;
     }
+    import vtn-vbridge {
+        prefix vbr;
+        revision-date 2015-09-07;
+    }
+    import vtn-vterminal {
+        prefix vterm;
+        revision-date 2015-09-07;
+    }
+    import vtn-flow-filter {
+        prefix vfilter;
+        revision-date 2015-09-07;
+    }
 
     description
       "The module that describes the configuration of the VTN
@@ -29,6 +41,23 @@ module vtn {
         description "Initial revision.";
     }
 
+    grouping vtn-vtenant-config {
+        description
+          "Describes configuration for a VTN.
+
+           If flow timeout configuration is missing, the default value will
+           be applied. Default value for `idle-timeout' and `hard-timeout'
+           are 300 and 0 respectively.";
+
+        leaf description {
+            description "An arbitrary description about the VTN.";
+            type string;
+        }
+
+        /* Timeout configuration for flow entries configured by the VTN. */
+        uses vtype:vtn-flow-timeout-config;
+    }
+
     grouping vtn-info {
         description "Describes information about a VTN.";
 
@@ -37,6 +66,19 @@ module vtn {
             type vtype:vnode-name;
         }
 
+        container vtenant-config {
+            description
+              "The container which contains configuration for the Virtual
+               Tenant Network (VTN).";
+            uses vtn-vtenant-config;
+        }
+
+        /* A list of vBridges. */
+        uses vbr:vtn-vbridge-list;
+
+        /* A list of vTerminals. */
+        uses vterm:vtn-vterminal-list;
+
         container vtn-path-maps {
             description
               "A list of VTN path maps affect flows in this VTN.
@@ -49,22 +91,158 @@ module vtn {
                is configured.";
             uses pathmap:vtn-path-map-list;
         }
+
+        container vtn-input-filter {
+            description
+              "A list of flow filters applied to incoming packet.
+               Flow filters in this container are evaluated when an incoming
+               packet is mapped to this VTN. Flow filters in this list are
+               evaluated only once before other flow filter lists are
+               evaluated.
+               Note that this container may not be present if no flow
+               filter is configured in this VTN.";
+            uses vfilter:vtn-flow-filter-list;
+        }
     }
 
     container vtns {
         description
           "The root container of all VTNs (Virtual Tenant Network).
            Note that the VTN configuration must be modified by RPC.
-           Do not edit this container directly.
+           Do not edit this container directly.";
 
-           Remarks: This model is still in development.";
         config false;
         presence "Indicates the VTN management is active.";
 
         list vtn {
-            description  "A list of VTNs.";
+            description
+              "VTN is a virtual network environment that gets created inside
+               the OpenDaylight controller. The VTN Manager manages the
+               virtual network at VTN level. At least one VTN should be
+               created for setting up virtual network using the VTN Manager.";
             key "name";
             uses vtn-info;
         }
     }
+
+    /*
+     * RPC definitions
+     */
+
+    rpc update-vtn {
+        description
+          "Create or modify the VTN specified by the name.
+
+           Upon successful completion, the result of this operation will be
+           set to the `status' field in the RPC output.
+
+           `CREATED' indicates that the specified VTN has been newly created.
+
+           `CHANGED' indicates that the configuration for the specified VTN
+           has been changed.
+
+           Null indicates that the configuration for the specified VTN was not
+           changed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `CONFLICT' is set if `update-mode' field in the RPC input is
+           `CREATE' and the specified VTN is present.
+
+           `NOTFOUND' is set if `update-mode' field in the RPC input is
+           `MODIFY' and the specified VTN is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            leaf tenant-name {
+                description "The name of the VTN to be created or modified.";
+                type string;
+            }
+
+            leaf update-mode {
+                description
+                  "Describes how to update the VTN specified by `tenant-name'.
+
+                   If `UPDATE' is specified, the specified VTN is created if
+                   it is not present. Otherwise the specified VTN
+                   configuration is applied to the specified VTN.
+
+                   If `CREATE' is specified, the specified VTN is created
+                   only if it is not present. If the specified VTN is present,
+                   this operation will cause a `CONFLICT' error.
+
+                   If `MODIFY' is specified, the specified VTN configuration
+                   is applied to the specified VTN only if it is present.
+                   If the specified VTN is not present, this operation will
+                   cause a `NOTFOUND' error.";
+
+                type vtype:vnode-update-mode;
+                default UPDATE;
+            }
+
+            leaf operation {
+                description
+                  "Describes how to update the existing VTN specified by
+                   `tenant-name'. This field will be ignored if the specified
+                   VTN is not present.
+
+                   If `ADD' is specified, omitted fields will not be
+                   modified. For example, `description' field is not modified
+                   if `description' field is omitted. This is the default
+                   behavior.
+
+                   If `SET' is specified, all the fields defined by
+                   `vtn-vtenant-config' will be applied to the VTN
+                   configuration as-is.
+                     - If `description' field is omitted, `description' field
+                       will be removed from the configuration.
+                     - If `idle-timeout' field is omitted, `idle-timeout'
+                       field in the VTN configuration will be reset to the
+                       default value (300).
+                     - If `hard-timeout' field is omitted, `hard-timeout'
+                       field in the VTN configuration will be reset to the
+                       default value (0).";
+
+                type vtype:vtn-update-operation-type;
+                default ADD;
+            }
+
+            /* VTN configuration. */
+            uses vtn-vtenant-config;
+        }
+
+        output {
+            uses vtype:vtn-rpc-result;
+        }
+    }
+
+    rpc remove-tenant {
+        description
+          "Remove the VTN specified by the name.
+
+           All the virtual networking node in the specified VTN, such as
+           vBridge, will also be removed.
+
+           On failure, one of vtn-error-tag value which indicates the cause
+           of error is set into application tag in RPC error.
+
+           `BADREQUEST' is set if the RPC input contains invalid data.
+
+           `NOTFOUND' is set if the specified VTN is not present.
+
+           `INTERNALERROR' is set if the operation failed due to internal
+           error.";
+
+        input {
+            leaf tenant-name {
+                description "The name of the VTN to be removed.";
+                type string;
+            }
+        }
+    }
 }