Use latest sfc-model 76/28576/1
authorSam Hague <shague@redhat.com>
Tue, 20 Oct 2015 01:17:55 +0000 (21:17 -0400)
committerSam Hague <shague@redhat.com>
Tue, 20 Oct 2015 01:17:55 +0000 (21:17 -0400)
Change-Id: Iff72fcdb945e19e70675e89fc83687c6731b9271
Signed-off-by: Sam Hague <shague@redhat.com>
openstack/net-virt-sfc/api/pom.xml
openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang [deleted file]
openstack/net-virt-sfc/api/src/main/yang/netvirt-acl.yang
openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang [deleted file]
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcAclListener.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcClassifierListener.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/openflow13/INetvirtSfcOF13Provider.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/openflow13/NetvirtSfcOF13Provider.java
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcIT.java
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/utils/AclUtils.java

index 8b4e1874ad956373aa21efa1338cab398d51685b..8ffd3c9421adb835e4694a4df851530d5e358136 100644 (file)
@@ -22,6 +22,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <version>1.2.1-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
+  <properties>
+    <sfc.project.version>0.2.0-SNAPSHOT</sfc.project.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
@@ -35,6 +39,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>yang-ext</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.sfc</groupId>
+      <artifactId>sfc-model</artifactId>
+      <version>${sfc.project.version}</version>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang b/openstack/net-virt-sfc/api/src/main/yang/ietf-acl.yang
deleted file mode 100644 (file)
index 3549cb4..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-module ietf-acl {
-  yang-version 1;
-
-  namespace "urn:ietf:params:xml:ns:yang:ietf-acl";
-
-  prefix acl;
-
-  import ietf-yang-types {
-      prefix "ietf";
-  }
-
-  import packet-fields {
-      prefix "packet-fields";
-  }
-
-  organization
-    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
-
-  contact
-    "WG Web: http://tools.ietf.org/wg/netmod/
-    WG List: netmod@ietf.org
-
-    WG Chair: Juergen Schoenwaelder
-    j.schoenwaelder@jacobs-university.de
-
-    WG Chair: Tom Nadeau
-    tnadeau@lucidvision.com
-
-    Editor: Dean Bogdanovic
-    deanb@juniper.net
-
-    Editor: Kiran Agrahara Sreenivasa
-    kkoushik@brocade.com
-
-    Editor: Lisa Huang
-    yihuan@cisco.com
-
-    Editor: Dana Blair
-    dblair@cisco.com";
-
-  description
-    "This YANG module defines a component that describing the
-    configuration of Access Control Lists (ACLs).";
-
-  revision 2014-10-10 {
-    description "Creating base model for netmod.";
-    reference
-      "RFC 6020: YANG - A Data Modeling Language for the
-      Network Configuration Protocol (NETCONF)";
-  }
-
-  identity acl-base {
-    description "Base acl type for all ACL type identifiers.";
-  }
-
-  identity ip-acl {
-    base "acl:acl-base";
-    description "layer 3 ACL type";
-  }
- identity eth-acl {
-    base "acl:acl-base";
-    description "layer 2 ACL type";
-  }
-
-  typedef acl-type {
-    type identityref {
-      base "acl-base";
-    }
-    description
-      "This type is used to refer to an Access Control List
-      (ACL) type";
-  }
-
-  typedef acl-ref {
-    type leafref {
-      path "/acl:access-lists/acl:access-list/acl:acl-name";
-    }
-    description "This type is used by data models that
-    need to referenced an acl";
-  }
-
-  container access-lists {
-    description
-      "Access control lists.";
-
-    list access-list {
-      key acl-name;
-      description "
-        An access list (acl) is an ordered list of
-        access list entries (ace). Each ace has a
-        sequence number to define the order, list
-        of match criteria, and a list of actions.
-        Since there are several kinds of acls
-        implementeded with different attributes for
-        each and different for each vendor, this
-        model accomodates customizing acls for
-        each kind and for each vendor.
-        ";
-
-      leaf acl-name {
-        type string;
-        description "The name of access-list.
-        A device MAY restrict the length and value of
-        this name, possibly space and special
-        characters are not allowed.";
-      }
-
-      leaf acl-type {
-        type acl-type;
-        description "Type of ACL";
-      }
-
-      container acl-oper-data {
-        config false;
-
-        description "Overall ACL operational data";
-        leaf match-counter {
-          type ietf:counter64;
-          description "Total match count for ACL";
-        }
-
-        leaf-list targets {
-          type string;
-          description "List of targets where ACL is applied";
-        }
-      }
-
-      container access-list-entries {
-        description "The access-list-entries container contains
-          a list of access-list-entry(ACE).";
-
-          list access-list-entry {
-            key rule-name;
-            ordered-by user;
-
-            description "List of access list entries(ACE)";
-            leaf rule-name {
-              type string;
-              description "Entry name.";
-            }
-
-            container matches {
-              description "Define match criteria";
-              choice ace-type {
-                description "Type of ace.";
-                case ace-ip {
-                  uses packet-fields:acl-ip-header-fields;
-                  choice ace-ip-version {
-                    description "Choice of IP version.";
-                    case ace-ipv4 {
-                      uses packet-fields:acl-ipv4-header-fields;
-                    }
-                    case ace-ipv6 {
-                      uses packet-fields:acl-ipv6-header-fields;
-                    }
-                  }
-                }
-                case ace-eth {
-                  uses packet-fields:acl-eth-header-fields;
-                }
-              }
-              uses packet-fields:metadata;
-          }
-
-          container actions {
-            description "Define action criteria";
-            choice packet-handling {
-              default deny;
-
-              description "Packet handling action.";
-              case deny {
-                leaf deny {
-                  type empty;
-                  description "Deny action.";
-                }
-              }
-              case permit {
-                leaf permit {
-                  type empty;
-                  description "Permit action.";
-                }
-              }
-            }
-          }
-
-          container ace-oper-data {
-            config false;
-
-            description "Per ace operational data";
-            leaf match-counter {
-              type ietf:counter64;
-              description "Number of matches for an ace";
-            }
-          }
-        }
-      }
-    }
-  }
-}
index 50b90bdb449e44c35f276a8804b491ed3069f3d9..3d1a813e155f39a79751643c8c000736e2441921 100644 (file)
@@ -3,7 +3,7 @@ module netvirt-sfc-acl {
     namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc:acl";
     prefix "acl";
 
-    import ietf-acl { prefix ietf-acl;}
+    import ietf-access-control-list { prefix ietf-acl;}
     import yang-ext { prefix ext; }
 
     revision "2015-01-05" {
@@ -11,8 +11,8 @@ module netvirt-sfc-acl {
     }
 
     // TODO: Add choice for Neutron and add fields there instead of at the root of matches
-    augment "/ietf-acl:access-lists/ietf-acl:access-list/ietf-acl:access-list-entries" +
-            "/ietf-acl:access-list-entry/ietf-acl:matches" {
+  //augment "/ietf-acl:access-lists/ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:access-list-entry/ietf-acl:matches" {
+    augment "/ietf-acl:access-lists/ietf-acl:acl/ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:matches" {
         description "Neutron network uuid";
         leaf network-uuid {
             type string;
@@ -20,8 +20,7 @@ module netvirt-sfc-acl {
     }
 
     // TODO: Add choice for Neutron and add fields there instead of at the root of matches
-    augment "/ietf-acl:access-lists/ietf-acl:access-list/ietf-acl:access-list-entries" +
-            "/ietf-acl:access-list-entry/ietf-acl:actions" {
+    augment "/ietf-acl:access-lists/ietf-acl:acl/ietf-acl:access-list-entries/ietf-acl:ace/ietf-acl:actions" {
         description "Redirect traffic to SFC identified by SFC Path ID";
         leaf redirect-sfc {
             type string;
diff --git a/openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang b/openstack/net-virt-sfc/api/src/main/yang/packet-fields.yang
deleted file mode 100644 (file)
index bea6777..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-module packet-fields {
-    yang-version 1;
-
-    namespace "urn:ietf:params:xml:ns:yang:packet-fields";
-
-    prefix packet-fields;
-
-    import ietf-inet-types {
-        prefix "inet";
-    }
-
-    import ietf-yang-types {
-        prefix "yang";
-    }
-
-    revision 2014-06-25 {
-        description "Initial version of packet fields used by access-lists";
-    }
-
-    grouping acl-transport-header-fields {
-        description "Transport header fields";
-
-        container source-port-range {
-             description "inclusive range of source ports";
-             leaf lower-port {
-                 mandatory true;
-                 type inet:port-number;
-             }
-             leaf upper-port {
-                 type inet:port-number;
-             }
-        }
-
-        container destination-port-range {
-             description "inclusive range of destination ports";
-             leaf lower-port {
-                 mandatory true;
-                 type inet:port-number;
-             }
-             leaf upper-port {
-                 type inet:port-number;
-             }
-        }
-    }
-
-    grouping acl-ip-header-fields {
-        description "Header fields common to ipv4 and ipv6";
-
-        uses acl-transport-header-fields;
-
-        leaf dscp {
-            type inet:dscp;
-        }
-
-        leaf ip-protocol {
-            type uint8;
-        }
-
-    }
-
-    grouping acl-ipv4-header-fields {
-        description "fields in IPv4 header";
-
-        leaf destination-ipv4-address {
-            type inet:ipv4-prefix;
-        }
-
-        leaf source-ipv4-address {
-            type inet:ipv4-prefix;
-        }
-
-    }
-
-    grouping acl-ipv6-header-fields {
-        description "fields in IPv6 header";
-
-        leaf destination-ipv6-address {
-            type inet:ipv6-prefix;
-        }
-
-        leaf source-ipv6-address {
-            type inet:ipv6-prefix;
-        }
-
-        leaf flow-label {
-            type inet:ipv6-flow-label;
-        }
-
-    }
-
-    grouping acl-eth-header-fields {
-        description "fields in ethernet header";
-
-        leaf destination-mac-address {
-            type yang:mac-address;
-        }
-
-        leaf destination-mac-address-mask {
-            type yang:mac-address;
-        }
-
-        leaf source-mac-address {
-            type yang:mac-address;
-        }
-
-        leaf source-mac-address-mask {
-            type yang:mac-address;
-        }
-    }
-
-    grouping timerange {
-        description "Define time range entries to restrict
-            the access. The time range is identified by a name
-            and then referenced by a function, so that those
-            time restrictions are imposed on the function itself.";
-
-        container absolute {
-            description
-                "Absolute time and date that
-                the associated function starts
-                going into effect.";
-
-            leaf start {
-                type yang:date-and-time;
-                description
-                "Start time and date";
-            }
-            leaf end {
-                type yang:date-and-time;
-                description "Absolute end time and date";
-            }
-            leaf active {
-                type boolean;
-                default "true";
-                description
-                    "Specify the associated function
-                    active or inactive state when
-                    starts going into effect";
-            }
-        } // container absolute
-    } //grouping timerange
-
-    grouping metadata {
-        description "Fields associated with a packet but not in the header";
-
-        leaf input-interface {
-             description "Packet was received on this interface";
-             type string;
-        }
-        uses timerange;
-    }
-}
index 302be54ae402e7d8f80144f16436ee66d7cb0c55..f263c0f5dfd45a559755163592c0297b2f9bab40 100644 (file)
@@ -14,12 +14,12 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.openflow13.INetvirtSfcOF13Provider;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessList;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessListKey;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.AccessListEntries;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntry;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntryKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.AclKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.AccessListEntries;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.Ace;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.AceKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.classifier.sffs.Sff;
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Data tree listener for AccessList.
  */
-public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList> {
+public class NetvirtSfcAclListener extends AbstractDataTreeListener<Acl> {
     private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcAclListener.class);
     private ListenerRegistration<NetvirtSfcAclListener> listenerRegistration;
     private MdsalUtils dbutils;
@@ -42,7 +42,7 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList>
      * @param db MdSal {@link DataBroker}
      */
     public NetvirtSfcAclListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
-        super(provider, AccessList.class);
+        super(provider, Acl.class);
         Preconditions.checkNotNull(db, "DataBroker can not be null!");
 
         dbutils = new MdsalUtils(db);
@@ -50,10 +50,10 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList>
     }
 
     private void registrationListener(final DataBroker db) {
-        final DataTreeIdentifier<AccessList> treeId =
+        final DataTreeIdentifier<Acl> treeId =
                 new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getIetfAclIid());
         try {
-            LOG.info("Registering Data Change Listener for Netvirt AccesList configuration.");
+            LOG.info("Registering Data Change Listener for NetvirtSfc AccesList configuration.");
             listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
         } catch (final Exception e) {
             LOG.warn("Netvirt AccesList DataChange listener registration fail!");
@@ -76,8 +76,8 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList>
     }
 
     @Override
-    public void remove(final InstanceIdentifier<AccessList> identifier,
-                       final AccessList removeDataObj) {
+    public void remove(final InstanceIdentifier<Acl> identifier,
+                       final Acl removeDataObj) {
         Preconditions.checkNotNull(removeDataObj, "Removed object can not be null!");
         String aclName = removeDataObj.getAclName();
 
@@ -96,13 +96,13 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList>
     }
 
     @Override
-    public void update(final InstanceIdentifier<AccessList> identifier,
-                       final AccessList original, final AccessList update) {
+    public void update(final InstanceIdentifier<Acl> identifier,
+                       final Acl original, final Acl update) {
     }
 
     @Override
-    public void add(final InstanceIdentifier<AccessList> identifier,
-                    final AccessList addDataObj) {
+    public void add(final InstanceIdentifier<Acl> identifier,
+                    final Acl addDataObj) {
         Preconditions.checkNotNull(addDataObj, "Added object can not be null!");
         String aclName = addDataObj.getAclName();
         LOG.debug("Adding accesslist = {}", identifier);
@@ -124,19 +124,19 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<AccessList>
         return InstanceIdentifier.create(Classifiers.class);
     }
 
-    public InstanceIdentifier<AccessList> getIetfAclIid() {
-        return InstanceIdentifier.create(AccessLists.class).child(AccessList.class);
+    public InstanceIdentifier<Acl> getIetfAclIid() {
+        return InstanceIdentifier.create(AccessLists.class).child(Acl.class);
     }
 
     /**
-     * Create an {@link AccessListEntry} {@link InstanceIdentifier}.
+     * Create an {@link Ace} {@link InstanceIdentifier}.
      * @param aclName is the name of the ACL
      * @param ruleName is the name of the rule
-     * @return the {@link AccessListEntry} {@link InstanceIdentifier}
+     * @return the {@link Ace} {@link InstanceIdentifier}
      */
-    public InstanceIdentifier<AccessListEntry> getIetfAclEntryIid(String aclName, String ruleName) {
-        return InstanceIdentifier.create(AccessLists.class).child(AccessList.class,
-                new AccessListKey(aclName)).child(AccessListEntries.class).child(AccessListEntry.class,
-                new AccessListEntryKey(ruleName));
+    public InstanceIdentifier<Ace> getIetfAclEntryIid(String aclName, String ruleName) {
+        return InstanceIdentifier.create(AccessLists.class).child(Acl.class,
+                new AclKey(aclName)).child(AccessListEntries.class).child(Ace.class,
+                new AceKey(ruleName));
     }
 }
index df1102f83c5dfe2b371bcd58ccd1e56009295703..af8c8968f335bd3f5fbc73dce5413efb0c5ad2f5 100644 (file)
@@ -14,9 +14,9 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.openflow13.INetvirtSfcOF13Provider;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessList;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessListKey;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.AclKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.classifier.sffs.Sff;
@@ -51,7 +51,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
         final DataTreeIdentifier<Classifier> treeId =
                 new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getClassifierIid());
         try {
-            LOG.info("Registering Data Change Listener for Netvirt Classifier configuration.");
+            LOG.info("Registering Data Change Listener for NetvirtSfc Classifier configuration.");
             listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
         } catch (final Exception e) {
             LOG.warn("Netvirt Classifier DataChange listener registration fail!");
@@ -79,7 +79,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
         Preconditions.checkNotNull(removeDataObj, "Added object can not be null!");
         String aclName = removeDataObj.getAcl();
         // Read the ACL information from data store and make sure it exists.
-        AccessList acl = dbutils.read(LogicalDatastoreType.CONFIGURATION,getIetfAclIid(aclName));
+        Acl acl = dbutils.read(LogicalDatastoreType.CONFIGURATION, getIetfAclIid(aclName));
         if (acl == null) {
             LOG.debug("IETF ACL with name ={} is not yet configured. skip this operation", aclName);
             return;
@@ -108,7 +108,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
         Preconditions.checkNotNull(addDataObj, "Added object can not be null!");
         String aclName = addDataObj.getAcl();
         // Read the ACL information from data store and make sure it exists.
-        AccessList acl = dbutils.read(LogicalDatastoreType.CONFIGURATION,getIetfAclIid(aclName));
+        Acl acl = dbutils.read(LogicalDatastoreType.CONFIGURATION,getIetfAclIid(aclName));
         if (acl == null) {
             LOG.debug("IETF ACL with name ={} is not yet configured. skip this operation", aclName);
             return;
@@ -128,7 +128,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
         return InstanceIdentifier.create(Classifiers.class).child(Classifier.class);
     }
 
-    private InstanceIdentifier<AccessList> getIetfAclIid(String aclName) {
-        return InstanceIdentifier.create(AccessLists.class).child(AccessList.class, new AccessListKey(aclName));
+    private InstanceIdentifier<Acl> getIetfAclIid(String aclName) {
+        return InstanceIdentifier.create(AccessLists.class).child(Acl.class, new AclKey(aclName));
     }
 }
index 067999ec2d61fdf596728068594ed04ebfe1fd1c..43ff43f02175361e8c952bbcd11ff90302bc86d6 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.ovsdb.openstack.netvirt.sfc.openflow13;
 
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessList;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.classifier.sffs.Sff;
 
 /**
@@ -24,7 +24,7 @@ public interface INetvirtSfcOF13Provider {
      * @param sff - Service Function Forwarder
      * @param acl - Access list includes rules that need to be installed in a SFF.
      */
-    public void addClassifierRules(Sff sff, AccessList acl);
+    public void addClassifierRules(Sff sff, Acl acl);
 
     /**
      * Method removes the OF rules corresponding to rules within ACL
@@ -33,5 +33,5 @@ public interface INetvirtSfcOF13Provider {
      * @param sff - Service Function Forwarder
      * @param acl - Access list includes rules that need to be installed in a SFF.
      */
-    public void removeClassifierRules(Sff sff, AccessList acl);
+    public void removeClassifierRules(Sff sff, Acl acl);
 }
index 1621e722c32d54f1135bbf590f798633e83ecb3f..24fb0913733a28a7be9a12ea3ed0400caa8fff60 100644 (file)
@@ -28,15 +28,15 @@ import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
 import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
 import org.opendaylight.sfc.sfc_ovs.provider.SfcOvsUtil;
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessList;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntry;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.Actions;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.Matches;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.actions.packet.handling.Deny;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.actions.packet.handling.Permit;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.matches.ace.type.AceEth;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.matches.ace.type.AceIp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.matches.ace.type.ace.ip.ace.ip.version.AceIpv4;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.Ace;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Actions;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.actions.packet.handling.Deny;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.actions.packet.handling.Permit;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.ace.ip.ace.ip.version.AceIpv4;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
@@ -87,7 +87,7 @@ public class NetvirtSfcOF13Provider implements INetvirtSfcOF13Provider{
     }
 
     @Override
-    public void addClassifierRules(Sff sff, AccessList acl) {
+    public void addClassifierRules(Sff sff, Acl acl) {
         Preconditions.checkNotNull(sff, "Input service function forwarder cannot be NULL!");
         Preconditions.checkNotNull(acl, "Input accesslist cannot be NULL!");
 
@@ -128,15 +128,15 @@ public class NetvirtSfcOF13Provider implements INetvirtSfcOF13Provider{
         LOG.debug("Processing the Classifier rules on Node={}", datapathId);
         if (datapathId != null) {
             // Program the OF flow on the corresponding open flow node.
-            Iterator<AccessListEntry> itr = acl.getAccessListEntries().getAccessListEntry().iterator();
+            Iterator<Ace> itr = acl.getAccessListEntries().getAce().iterator();
             while (itr.hasNext()) {
-                AccessListEntry entry = itr.next();
+                Ace entry = itr.next();
                 programOFRules(entry, datapathId, true);
             }
         }
     }
 
-    private void programOFRules(AccessListEntry entry, String datapathId, boolean write) {
+    private void programOFRules(Ace entry, String datapathId, boolean write) {
         NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setId(new NodeId(Constants.OPENFLOW_NODE_PREFIX + datapathId));
         nodeBuilder.setKey(new NodeKey(nodeBuilder.getId()));
@@ -207,10 +207,10 @@ public class NetvirtSfcOF13Provider implements INetvirtSfcOF13Provider{
             AceIp aceIp = (AceIp)matches.getAceType();
             if (aceIp.getAceIpVersion() instanceof AceIpv4) {
                 AceIpv4 aceIpv4 = (AceIpv4) aceIp.getAceIpVersion();
-                MatchUtils.createSrcL3IPv4Match(matchBuilder, aceIpv4.getSourceIpv4Address());
-                MatchUtils.createDstL3IPv4Match(matchBuilder, aceIpv4.getDestinationIpv4Address());
-                MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getIpProtocol());
-                MatchUtils.addLayer4Match(matchBuilder, aceIp.getIpProtocol().intValue(),
+                MatchUtils.createSrcL3IPv4Match(matchBuilder, aceIpv4.getSourceIpv4Network());
+                MatchUtils.createDstL3IPv4Match(matchBuilder, aceIpv4.getDestinationIpv4Network());
+                MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getProtocol());
+                MatchUtils.addLayer4Match(matchBuilder, aceIp.getProtocol().intValue(),
                         aceIp.getSourcePortRange().getLowerPort().getValue().intValue(),
                         aceIp.getDestinationPortRange().getLowerPort().getValue().intValue());
             }
@@ -226,7 +226,7 @@ public class NetvirtSfcOF13Provider implements INetvirtSfcOF13Provider{
     }
 
     @Override
-    public void removeClassifierRules(Sff sff, AccessList acl) {
+    public void removeClassifierRules(Sff sff, Acl acl) {
         // TODO Auto-generated method stub
 
     }
index ee023bef086a783510b9e551f4049e9d591bc011..443656e68e4c4597f8de2452a3b35aff4e52c868 100644 (file)
@@ -9,7 +9,6 @@
 package org.opendaylight.ovsdb.openstack.netvirt.sfc;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -36,17 +35,17 @@ import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.AclUtils;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.ClassifierUtils;
 import org.opendaylight.ovsdb.openstack.netvirt.sfc.utils.SfcUtils;
-import org.opendaylight.ovsdb.southbound.SouthboundConstants;
 import org.opendaylight.ovsdb.southbound.SouthboundUtil;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessListsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessListBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.AccessListEntriesBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.ActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.MatchesBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessListsBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.AccessListEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.AceBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.ActionsBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.ClassifiersBuilder;
@@ -274,11 +273,11 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
     private AccessListsBuilder setAccessLists () {
         MatchesBuilder matchesBuilder = aclUtils.createMatches(new MatchesBuilder(), 80);
         ActionsBuilder actionsBuilder = aclUtils.createActions(new ActionsBuilder(), Boolean.TRUE);
-        AccessListEntryBuilder accessListEntryBuilder = aclUtils.createAccessListEntryBuilder(
-                new AccessListEntryBuilder(), "http", matchesBuilder, actionsBuilder);
+        AceBuilder accessListEntryBuilder = aclUtils.createAccessListEntryBuilder(
+                new AceBuilder(), "http", matchesBuilder, actionsBuilder);
         AccessListEntriesBuilder accessListEntriesBuilder = aclUtils.createAccessListEntries(
                 new AccessListEntriesBuilder(), accessListEntryBuilder);
-        AccessListBuilder accessListBuilder = aclUtils.createAccessList(new AccessListBuilder(),
+        AclBuilder accessListBuilder = aclUtils.createAccessList(new AclBuilder(),
                 "http", accessListEntriesBuilder);
         AccessListsBuilder accessListsBuilder = aclUtils.createAccessLists(new AccessListsBuilder(),
                 accessListBuilder);
index ac214bb98f3717c664396f54caf3f7d463fff0f5..dd6cce50dce3072505e21e58898bb567e934cdf6 100644 (file)
@@ -10,18 +10,18 @@ package org.opendaylight.ovsdb.openstack.netvirt.sfc.utils;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.AccessListsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessList;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.AccessListBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.AccessListEntriesBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntry;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.AccessListEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.ActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.MatchesBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.actions.packet.handling.PermitBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev141010.access.lists.access.list.access.list.entries.access.list.entry.matches.ace.type.AceIpBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessListsBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.AccessListEntriesBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.Ace;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.AceBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.ActionsBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.actions.packet.handling.PermitBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIpBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.packet.fields.rev140625.acl.transport.header.fields.DestinationPortRangeBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev150611.acl.transport.header.fields.DestinationPortRangeBuilder;
 
 public class AclUtils {
     public MatchesBuilder createMatches (MatchesBuilder matchesBuilder, int destPort) {
@@ -45,10 +45,10 @@ public class AclUtils {
         return actionsBuilder;
     }
 
-    public AccessListEntryBuilder createAccessListEntryBuilder(AccessListEntryBuilder accessListEntryBuilder,
-                                                               String ruleName,
-                                                               MatchesBuilder matchesBuilder,
-                                                               ActionsBuilder actionsBuilder) {
+    public AceBuilder createAccessListEntryBuilder(AceBuilder accessListEntryBuilder,
+                                                   String ruleName,
+                                                   MatchesBuilder matchesBuilder,
+                                                   ActionsBuilder actionsBuilder) {
         accessListEntryBuilder.setRuleName(ruleName);
         accessListEntryBuilder.setMatches(matchesBuilder.build());
         accessListEntryBuilder.setActions(actionsBuilder.build());
@@ -57,16 +57,16 @@ public class AclUtils {
     }
 
     public AccessListEntriesBuilder createAccessListEntries(AccessListEntriesBuilder accessListEntriesBuilder,
-                                                            AccessListEntryBuilder accessListEntryBuilder) {
-        List<AccessListEntry> accessListEntriesList = new ArrayList<>();
+                                                            AceBuilder accessListEntryBuilder) {
+        List<Ace> accessListEntriesList = new ArrayList<>();
         accessListEntriesList.add(accessListEntryBuilder.build());
 
         return accessListEntriesBuilder;
     }
 
-    public AccessListBuilder createAccessList(AccessListBuilder accessListBuilder,
-                                              String aclName,
-                                              AccessListEntriesBuilder accessListEntriesBuilder) {
+    public AclBuilder createAccessList(AclBuilder accessListBuilder,
+                                       String aclName,
+                                       AccessListEntriesBuilder accessListEntriesBuilder) {
         accessListBuilder.setAclName(aclName);
         accessListBuilder.setAccessListEntries(accessListEntriesBuilder.build());
 
@@ -74,10 +74,10 @@ public class AclUtils {
     }
 
     public AccessListsBuilder createAccessLists(AccessListsBuilder accessListsBuilder,
-                                                AccessListBuilder accessListBuilder) {
-        List<AccessList> accessListList = new ArrayList<>();
+                                                AclBuilder accessListBuilder) {
+        List<Acl> accessListList = new ArrayList<>();
         accessListList.add(accessListBuilder.build());
-        accessListsBuilder.setAccessList(accessListList);
+        accessListsBuilder.setAcl(accessListList);
 
         return accessListsBuilder;
     }