Merge "Added meter, action, group, flow models, mask and transactions support."
authorEd Warnicke <eaw@cisco.com>
Thu, 14 Nov 2013 12:42:58 +0000 (12:42 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 14 Nov 2013 12:42:58 +0000 (12:42 +0000)
18 files changed:
opendaylight/forwardingrulesmanager_mdsal/openflow/pom.xml
opendaylight/forwardingrulesmanager_mdsal/openflow/src/main/java/org/opendaylight/controller/forwardingrulesmanager_mdsal/consumer/impl/GroupConsumerImpl.java
opendaylight/forwardingrulesmanager_mdsal/openflow/src/main/java/org/opendaylight/controller/forwardingrulesmanager_mdsal/consumer/impl/MeterConsumerImpl.java [new file with mode: 0644]
opendaylight/md-sal/compatibility/pom.xml
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FromSalConversionsUtils.java
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/MDFlowMapping.xtend
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/ToSalConversionsUtils.java
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestFromSalConversionsUtils.java
opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/test/TestToSalConversionsUtils.java
opendaylight/md-sal/model/model-flow-base/src/main/yang/action-types.yang [new file with mode: 0644]
opendaylight/md-sal/model/model-flow-base/src/main/yang/flow-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/group-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/match-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/meter-types.yang
opendaylight/md-sal/model/model-flow-base/src/main/yang/table-types.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-service.yang

index 29de77270bb6d63c5f791f0ad70cce2eda6d9250..dcf119930b782af8eb4004f162410932acc897c5 100644 (file)
          <groupId>org.opendaylight.controller</groupId>
                <artifactId>sal-binding-api</artifactId>
                <version>1.0-SNAPSHOT</version>
-       </dependency>   
-       <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>flow-management-compatibility</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>    
+       </dependency>           
        <dependency>
       <groupId>org.opendaylight.controller.model</groupId>
       <artifactId>model-flow-service</artifactId>
       <version>1.0-SNAPSHOT</version>
       <scope>provided</scope>
     </dependency>
+     <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>    
+     <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+      <version>0.5.1-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 </project>
index acc0dc69cd4d059b074fc7691bc1b73d75130170..73295cc1e79a204575f6ffd72e00c2c7edf018a9 100644 (file)
@@ -62,16 +62,14 @@ public class GroupConsumerImpl {
     private ConcurrentMap<Node, List<Group>> nodeGroups;
     private ConcurrentMap<GroupKey, Group> inactiveGroups;
     
-    private IClusterContainerServices clusterGroupContainerService = null;
-    private ISwitchManager switchGroupManager;
+    private IClusterContainerServices clusterGroupContainerService = null;   
     private IContainer container;
     
     public GroupConsumerImpl() {
-           InstanceIdentifier<? extends DataObject> path = InstanceIdentifier.builder().node(Groups.class).toInstance();
+           InstanceIdentifier<? extends DataObject> path = InstanceIdentifier.builder().node(Groups.class).node(Group.class).toInstance();
         groupService = FRMConsumerImpl.getProviderSession().getRpcService(SalGroupService.class);
         
-        clusterGroupContainerService = FRMConsumerImpl.getClusterContainerService();
-        switchGroupManager = FRMConsumerImpl.getSwitchManager();
+        clusterGroupContainerService = FRMConsumerImpl.getClusterContainerService();        
         container = FRMConsumerImpl.getContainer();
         
         if (!(cacheStartup())) {
@@ -279,7 +277,7 @@ public class GroupConsumerImpl {
      * @param dataObject
      */
     private Status updateGroup(InstanceIdentifier<?> path, Group groupUpdateDataObject) {
-        GroupKey groupKey = groupUpdateDataObject.getKey();
+        GroupKey groupKey = groupUpdateDataObject.getKey();        
         Status groupOperationStatus = validateGroup(groupUpdateDataObject, FRMUtil.operation.UPDATE);
         
         if (!groupOperationStatus.isSuccess()) {
@@ -319,7 +317,7 @@ public class GroupConsumerImpl {
             logger.error("Group data object validation failed %s" + groupAddDataObject.getGroupName());
             return groupOperationStatus;
         }
-        validateGroup(groupAddDataObject, FRMUtil.operation.ADD);
+        
         originalSwGroupView.put(groupKey, groupAddDataObject);
         
         if (groupAddDataObject.isInstall()) {
@@ -363,7 +361,7 @@ public class GroupConsumerImpl {
         @Override
          public DataCommitTransaction requestCommit(DataModification<InstanceIdentifier<?>, DataObject> modification) {
              // We should verify transaction
-             System.out.println("Coming in FlowDatacommitHandler");
+             System.out.println("Coming in GroupDatacommitHandler");
              internalTransaction transaction = new internalTransaction(modification);
              transaction.prepareUpdate();
              return transaction;
diff --git a/opendaylight/forwardingrulesmanager_mdsal/openflow/src/main/java/org/opendaylight/controller/forwardingrulesmanager_mdsal/consumer/impl/MeterConsumerImpl.java b/opendaylight/forwardingrulesmanager_mdsal/openflow/src/main/java/org/opendaylight/controller/forwardingrulesmanager_mdsal/consumer/impl/MeterConsumerImpl.java
new file mode 100644 (file)
index 0000000..5eb971e
--- /dev/null
@@ -0,0 +1,514 @@
+package org.opendaylight.controller.forwardingrulesmanager_mdsal.consumer.impl;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import org.opendaylight.controller.clustering.services.CacheConfigException;
+import org.opendaylight.controller.clustering.services.CacheExistException;
+import org.opendaylight.controller.clustering.services.IClusterContainerServices;
+import org.opendaylight.controller.clustering.services.IClusterServices;
+import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
+import org.opendaylight.controller.md.sal.common.api.data.DataModification;
+import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction;
+import org.opendaylight.controller.sal.common.util.Rpcs;
+import org.opendaylight.controller.sal.core.IContainer;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
+import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.controller.switchmanager.ISwitchManager;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.config.rev131024.Meters;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.config.rev131024.meters.MeterKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.BandType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.Drop;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DscpRemark;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.Experimenter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.config.rev131024.meters.Meter;
+import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MeterConsumerImpl {
+    protected static final Logger logger = LoggerFactory.getLogger(MeterConsumerImpl.class);
+    private MeterEventListener meterEventListener = new MeterEventListener();
+    private Registration<NotificationListener> meterListener;
+    private SalMeterService meterService;    
+    private MeterDataCommitHandler commitHandler;
+    
+    private ConcurrentMap<MeterKey, Meter> originalSwMeterView;
+    private ConcurrentMap<MeterKey, Meter> installedSwMeterView;
+    
+    private ConcurrentMap<Node, List<Meter>> nodeMeters;
+    private ConcurrentMap<MeterKey, Meter> inactiveMeters;
+    
+    private IClusterContainerServices clusterMeterContainerService = null; 
+    private IContainer container;
+    
+    public MeterConsumerImpl() {
+        InstanceIdentifier<? extends DataObject> path = InstanceIdentifier.builder().node(Meters.class).node(Meter.class).toInstance();
+        meterService = FRMConsumerImpl.getProviderSession().getRpcService(SalMeterService.class);        
+        clusterMeterContainerService = FRMConsumerImpl.getClusterContainerService();
+        
+        container = FRMConsumerImpl.getContainer();
+        
+        if (!(cacheStartup())) {
+            logger.error("Unable to allocate/retrieve meter cache");
+            System.out.println("Unable to allocate/retrieve meter cache");
+        }
+        
+        if (null == meterService) {
+            logger.error("Consumer SAL Meter Service is down or NULL. FRM may not function as intended");
+            System.out.println("Consumer SAL Meter Service is down or NULL.");
+            return;
+        } 
+        
+        // For switch/plugin events
+        meterListener = FRMConsumerImpl.getNotificationService().registerNotificationListener(meterEventListener);
+        
+        if (null == meterListener) {
+            logger.error("Listener to listen on meter data modifcation events");
+            System.out.println("Listener to listen on meter data modifcation events.");
+            return;
+        }       
+        
+        commitHandler = new MeterDataCommitHandler();
+        FRMConsumerImpl.getDataProviderService().registerCommitHandler(path, commitHandler);
+    }
+    
+    
+    
+    private boolean allocateMeterCaches() {
+        if (this.clusterMeterContainerService == null) {
+            logger.warn("Meter: Un-initialized clusterMeterContainerService, can't create cache");
+            return false;
+        }       
+
+        try {
+            clusterMeterContainerService.createCache("frm.originalSwMeterView",
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
+
+            clusterMeterContainerService.createCache("frm.installedSwMeterView",
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
+
+            clusterMeterContainerService.createCache("frm.inactiveMeters",
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
+
+            clusterMeterContainerService.createCache("frm.nodeMeters",
+                    EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
+            
+//TODO for cluster mode
+           /* clusterMeterContainerService.createCache(WORK_STATUS_CACHE,
+                    EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL, IClusterServices.cacheMode.ASYNC));
+
+            clusterMeterContainerService.createCache(WORK_ORDER_CACHE,
+                    EnumSet.of(IClusterServices.cacheMode.NON_TRANSACTIONAL, IClusterServices.cacheMode.ASYNC));*/
+            
+        } catch (CacheConfigException cce) {            
+            logger.error("Meter CacheConfigException");
+            return false;
+            
+        } catch (CacheExistException cce) {
+            logger.error(" Meter CacheExistException");           
+        }
+        
+        return true;
+    }
+    
+    private void nonClusterMeterObjectCreate() {
+        originalSwMeterView = new ConcurrentHashMap<MeterKey, Meter>();
+        installedSwMeterView = new ConcurrentHashMap<MeterKey, Meter>();
+        nodeMeters = new ConcurrentHashMap<Node, List<Meter>>();        
+        inactiveMeters = new ConcurrentHashMap<MeterKey, Meter>();
+    }
+    
+    @SuppressWarnings({ "unchecked" })
+    private boolean retrieveMeterCaches() {
+        ConcurrentMap<?, ?> map;
+
+        if (this.clusterMeterContainerService == null) {
+            logger.warn("Meter: un-initialized clusterMeterContainerService, can't retrieve cache");
+            nonClusterMeterObjectCreate();
+            return false;
+        }       
+
+        map = clusterMeterContainerService.getCache("frm.originalSwMeterView");
+        if (map != null) {
+            originalSwMeterView = (ConcurrentMap<MeterKey, Meter>) map;
+        } else {
+            logger.error("Retrieval of cache(originalSwMeterView) failed");
+            return false;
+        }
+
+        map = clusterMeterContainerService.getCache("frm.installedSwMeterView");
+        if (map != null) {
+            installedSwMeterView = (ConcurrentMap<MeterKey, Meter>) map;
+        } else {
+            logger.error("Retrieval of cache(installedSwMeterView) failed");
+            return false;
+        }
+
+        map = clusterMeterContainerService.getCache("frm.inactiveMeters");
+        if (map != null) {
+            inactiveMeters = (ConcurrentMap<MeterKey, Meter>) map;
+        } else {
+            logger.error("Retrieval of cache(inactiveMeters) failed");
+            return false;
+        }
+
+        map = clusterMeterContainerService.getCache("frm.nodeMeters");
+        if (map != null) {
+            nodeMeters = (ConcurrentMap<Node, List<Meter>>) map;
+        } else {
+            logger.error("Retrieval of cache(nodeMeter) failed");
+            return false;
+        }
+        
+        return true;
+    }
+    
+    private boolean cacheStartup() {
+        if (allocateMeterCaches()) {
+            if (retrieveMeterCaches()) {
+                return true;
+            }
+        }
+        
+        return false;
+    }
+    
+    /**
+     * Adds Meter to the southbound plugin and our internal database
+     *
+     * @param path
+     * @param dataObject
+     */
+    private Status addMeter(InstanceIdentifier<?> path, Meter meterAddDataObject) {        
+        MeterKey meterKey = meterAddDataObject.getKey();
+        
+        if (null != meterKey && 
+                validateMeter(meterAddDataObject, FRMUtil.operation.ADD).isSuccess()) {
+            if (meterAddDataObject.isInstall()) {
+                AddMeterInputBuilder meterBuilder = new AddMeterInputBuilder();
+                
+                meterBuilder.setContainerName(meterAddDataObject.getContainerName());
+                meterBuilder.setFlags(meterAddDataObject.getFlags());
+                meterBuilder.setMeterBandHeaders(meterAddDataObject.getMeterBandHeaders());
+                meterBuilder.setMeterId(meterAddDataObject.getMeterId());
+                meterBuilder.setNode(meterAddDataObject.getNode());
+                originalSwMeterView.put(meterKey, meterAddDataObject);
+                meterService.addMeter(meterBuilder.build());
+            }
+            
+            originalSwMeterView.put(meterKey, meterAddDataObject);            
+        }
+        else {
+            return new Status(StatusCode.BADREQUEST, "Meter Key or attribute validation failed");
+        }
+      
+        return new Status(StatusCode.SUCCESS);
+    }
+    
+    /*
+     * Update Meter to the southbound plugin and our internal database
+     *
+     * @param path
+     * @param dataObject
+     */
+    private Status updateMeter(InstanceIdentifier<?> path, Meter meterUpdateDataObject) {        
+        MeterKey meterKey = meterUpdateDataObject.getKey();
+        
+        if (null != meterKey && 
+                validateMeter(meterUpdateDataObject, FRMUtil.operation.ADD).isSuccess()) {
+            if (meterUpdateDataObject.isInstall()) {
+                UpdateMeterInputBuilder updateMeterBuilder = new UpdateMeterInputBuilder();  
+                
+                originalSwMeterView.put(meterKey, meterUpdateDataObject);
+                meterService.updateMeter(updateMeterBuilder.build());
+            }
+            
+            originalSwMeterView.put(meterKey, meterUpdateDataObject);            
+        }
+        else {
+            return new Status(StatusCode.BADREQUEST, "Meter Key or attribute validation failed");
+        }
+      
+        return new Status(StatusCode.SUCCESS);
+    }
+    
+    /*
+     * Remove Meter to the southbound plugin and our internal database
+     *
+     * @param path
+     * @param dataObject
+     */
+    private Status RemoveMeter(InstanceIdentifier<?> path, Meter meterUpdateDataObject) {        
+        MeterKey meterKey = meterUpdateDataObject.getKey();
+        
+        if (null != meterKey && 
+                validateMeter(meterUpdateDataObject, FRMUtil.operation.ADD).isSuccess()) {
+            if (meterUpdateDataObject.isInstall()) {
+                UpdateMeterInputBuilder updateMeterBuilder = new UpdateMeterInputBuilder();                
+                
+                originalSwMeterView.put(meterKey, meterUpdateDataObject);
+                meterService.updateMeter(updateMeterBuilder.build());
+            }
+            
+            originalSwMeterView.put(meterKey, meterUpdateDataObject);            
+        }
+        else {
+            return new Status(StatusCode.BADREQUEST, "Meter Key or attribute validation failed");
+        }
+      
+        return new Status(StatusCode.SUCCESS);
+    }
+    
+    public Status validateMeter(Meter meter, FRMUtil.operation operation) {
+        String containerName;
+        String meterName;
+        Status returnStatus = null;
+        boolean returnResult;
+        
+        if (null != meter) {
+            containerName = meter.getContainerName();
+            
+            if (null == containerName) {
+                containerName = GlobalConstants.DEFAULT.toString();
+            }
+            else if (!FRMUtil.isNameValid(containerName)) {
+                logger.error("Container Name is invalid %s" + containerName);
+                returnStatus = new Status(StatusCode.BADREQUEST, "Container Name is invalid");
+                return returnStatus;
+            }
+            
+            meterName = meter.getMeterName();
+            if (!FRMUtil.isNameValid(meterName)) {
+                logger.error("Meter Name is invalid %s" + meterName);
+                returnStatus = new Status(StatusCode.BADREQUEST, "Meter Name is invalid");
+                return returnStatus;
+            }
+            
+            returnResult = doesMeterEntryExists(meter.getKey(), meterName, containerName);
+            
+            if (FRMUtil.operation.ADD == operation && returnResult) {
+                logger.error("Record with same Meter Name exists");
+                returnStatus = new Status(StatusCode.BADREQUEST, "Meter record exists");
+                return returnStatus;
+            }
+            else if (!returnResult) {
+                logger.error("Group record does not exist");
+                returnStatus = new Status(StatusCode.BADREQUEST, "Meter record does not exist");
+                return returnStatus;
+            }
+          
+            for (int i = 0; i < meter.getMeterBandHeaders().getMeterBandHeader().size(); i++) {
+                if (!meter.getFlags().isMeterBurst()) {
+                    if (0 < meter.getMeterBandHeaders().getMeterBandHeader().get(i).getBurstSize()) {
+                        logger.error("Burst size should only be associated when Burst FLAG is set");
+                        returnStatus = new Status(StatusCode.BADREQUEST, "Burst size should only be associated when Burst FLAG is set");
+                        break;
+                    }
+                }
+            }
+            
+            if (null != returnStatus && !returnStatus.isSuccess()) {
+                return returnStatus;
+            }
+            else {
+                BandType setBandType = null;
+                DscpRemark dscpRemark = null;
+                for (int i = 0; i < meter.getMeterBandHeaders().getMeterBandHeader().size(); i++) {
+                    setBandType = meter.getMeterBandHeaders().getMeterBandHeader().get(i).getBandType();
+                    if ( setBandType instanceof DscpRemark) {   
+                        dscpRemark = (DscpRemark)setBandType;
+                        if (0 > dscpRemark.getRate()) {
+                           
+                        }
+                    }
+                    else if (setBandType instanceof Drop) {
+                        if (0 < dscpRemark.getPercLevel()) {
+                            logger.error("Number of drop Precedence level");
+                        }                        
+                    }
+                    else if (setBandType instanceof Experimenter) {
+                        
+                    }
+                }                
+            }
+        }
+        return new Status(StatusCode.SUCCESS);
+    }
+    
+    private boolean doesMeterEntryExists(MeterKey key, String meterName, String containerName) {
+        if (! originalSwMeterView.containsKey(key)) {
+            return false;
+        }
+        
+        for (Entry<MeterKey, Meter> entry : originalSwMeterView.entrySet()) {
+            if (entry.getValue().getMeterName().equals(meterName)) {
+                if (entry.getValue().getContainerName().equals(containerName)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    
+    private RpcResult<Void> commitToPlugin(internalTransaction transaction) {
+        for(Entry<InstanceIdentifier<?>, Meter> entry :transaction.additions.entrySet()) {
+            
+            if (!addMeter(entry.getKey(),entry.getValue()).isSuccess()) {
+                return Rpcs.getRpcResult(false, null, null);
+            }
+        }
+        for(@SuppressWarnings("unused") Entry<InstanceIdentifier<?>, Meter> entry :transaction.updates.entrySet()) {
+           
+            if (!updateMeter(entry.getKey(),entry.getValue()).isSuccess()) {
+                return Rpcs.getRpcResult(false, null, null);
+            }
+        }
+        
+        for(InstanceIdentifier<?> removal : transaction.removals) {
+           /* if (!removeMeter(entry.getKey(),entry.getValue()).isSuccess()) {
+                return Rpcs.getRpcResult(false, null, null);
+            }*/
+        }
+        
+        return Rpcs.getRpcResult(true, null, null);
+    }
+    
+    private final class internalTransaction implements DataCommitTransaction<InstanceIdentifier<?>, DataObject> {
+
+        private final DataModification<InstanceIdentifier<?>, DataObject> modification;
+
+        @Override
+        public DataModification<InstanceIdentifier<?>, DataObject> getModification() {
+            return modification;
+        }
+
+        public internalTransaction(DataModification<InstanceIdentifier<?>, DataObject> modification) {
+            this.modification = modification;
+        }
+
+        Map<InstanceIdentifier<?>, Meter> additions = new HashMap<>();
+        Map<InstanceIdentifier<?>, Meter> updates = new HashMap<>();
+        Set<InstanceIdentifier<?>> removals = new HashSet<>();
+
+        /**
+         * We create a plan which flows will be added, which will be updated and
+         * which will be removed based on our internal state.
+         * 
+         */
+        void prepareUpdate() {
+
+            Set<Entry<InstanceIdentifier<?>, DataObject>> puts = modification.getUpdatedConfigurationData().entrySet();
+            for (Entry<InstanceIdentifier<?>, DataObject> entry : puts) {
+                if (entry.getValue() instanceof Meter) {                    
+                    Meter Meter = (Meter) entry.getValue();                    
+                    preparePutEntry(entry.getKey(), Meter);
+                }
+
+            }
+
+            removals = modification.getRemovedConfigurationData();
+        }
+
+        private void preparePutEntry(InstanceIdentifier<?> key, Meter meter) {
+            
+            Meter original = originalSwMeterView.get(key);
+            if (original != null) {
+                // It is update for us
+                
+                updates.put(key, meter);               
+            } else {
+                // It is addition for us
+                
+                additions.put(key, meter);
+            }
+        }
+
+        /**
+         * We are OK to go with execution of plan
+         * 
+         */
+        @Override
+        public RpcResult<Void> finish() throws IllegalStateException {
+            
+            RpcResult<Void> rpcStatus = commitToPlugin(this);
+            // We return true if internal transaction is successful.
+          //  return Rpcs.getRpcResult(true, null, Collections.emptySet());
+            return rpcStatus;
+        }
+
+        /**
+         * 
+         * We should rollback our preparation
+         * 
+         */
+        @Override
+        public RpcResult<Void> rollback() throws IllegalStateException {
+            // NOOP - we did not modified any internal state during
+            // requestCommit phase
+           // return Rpcs.getRpcResult(true, null, Collections.emptySet());
+            return Rpcs.getRpcResult(true, null, null);
+            
+        }
+        
+    }
+
+    private final class MeterDataCommitHandler implements DataCommitHandler<InstanceIdentifier<?>, DataObject> {
+        @Override
+        public org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction<InstanceIdentifier<?>, DataObject> requestCommit(
+                DataModification<InstanceIdentifier<?>, DataObject> modification) {
+            // We should verify transaction
+            System.out.println("Coming in MeterDataCommitHandler");
+            internalTransaction transaction = new internalTransaction(modification);
+            transaction.prepareUpdate();
+            return transaction;
+        }
+    }
+    
+    final class MeterEventListener implements SalMeterListener {
+        
+        List<MeterAdded> addedMeter = new ArrayList<>();
+        List<MeterRemoved> removeMeter = new ArrayList<>();
+        List<MeterUpdated> updatedMeter = new ArrayList<>();
+
+        @Override
+        public void onMeterAdded(MeterAdded notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void onMeterRemoved(MeterRemoved notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void onMeterUpdated(MeterUpdated notification) {
+            // TODO Auto-generated method stub
+            
+        }    
+    }
+}
index a829380e68426575ca70325f5de4b5466f1ba9f4..151fdbfaaa19ffcc229338080aa65768e59d3235 100644 (file)
@@ -8,7 +8,7 @@
     </parent>
     <artifactId>compatibility-parent</artifactId>
     <packaging>pom</packaging>
-    <name>MD-SAL to AD-SAL Adaptation</name>
+    <name>MD-SAL to AD-SAL Adaptation Parent</name>
     <scm>
         <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
index da652e65a7a28bf3e51bc637519c2dc8d94f0a73..7d9c93908ec8484d502d6ab91d1bd26080c631cb 100644 (file)
@@ -98,7 +98,7 @@ class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowLi
         return null;
     }
 
-    public static def toStatus(RpcResult<Void> result) {
+    public static def toStatus(RpcResult<?> result) {
         if (result.isSuccessful()) {
             return new Status(StatusCode.SUCCESS);
         } else {
index a31d8e265d26557c76a583dbdd1d212c43614f71..cc86659657883ad48d01ef45609d076d6cf7e590 100644 (file)
@@ -4,13 +4,10 @@ import static org.opendaylight.controller.sal.match.MatchType.DL_DST;
 import static org.opendaylight.controller.sal.match.MatchType.DL_SRC;
 import static org.opendaylight.controller.sal.match.MatchType.DL_TYPE;
 
-import java.math.BigInteger;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+
 
 import org.opendaylight.controller.sal.compatibility.MDFlowMapping;
 import org.opendaylight.controller.sal.core.NodeConnector;
@@ -28,9 +25,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 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.statistics.rev130819.GetNodeConnectorStatisticsInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetNodeConnectorStatisticsInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
index b43e8af6612c97d516373e49f5565ab51fc61b84..5dd149a99738f2b33fa9e9b024861ee56286835c 100644 (file)
@@ -41,34 +41,34 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Flow
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInputBuilder
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsInputBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.VlanCfi
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.ControllerActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.DropActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAllActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.HwPathActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.LoopbackActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.OutputActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopVlanActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushVlanActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlDstActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlSrcActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlTypeActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNextHopActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwDstActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwSrcActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTosActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpDstActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpSrcActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanCfiActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanIdActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanPcpActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SwPathActionBuilder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4Builder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv6Builder
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.ActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathActionBuilder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp
index 5009e5dfb79f6418058db177f90078ac2db8fbff..96b69618b0db78031a3bf20e2796af99ea42bef2 100644 (file)
@@ -33,40 +33,40 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 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.ietf.inet.types.rev100924.Uri;
 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.types.rev131026.ActionList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.ControllerAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.DropAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.FloodAllAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.HwPathAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.LoopbackAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.OutputAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopMplsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PopVlanAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushMplsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushPbbAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.PushVlanAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetDlTypeAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetMplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNextHopAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTosAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetNwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetQueueAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpDstAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetTpSrcAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanCfiAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanIdAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SetVlanPcpAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.SwPathAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.ActionList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.ControllerAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.FloodAllAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.HwPathAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.LoopbackAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlTypeAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNextHopAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanCfiAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SwPathAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
@@ -159,7 +159,7 @@ public class ToSalConversionsUtils {
     public static List<org.opendaylight.controller.sal.action.Action> actionFrom(List<Action> actions) {
         List<org.opendaylight.controller.sal.action.Action> targetAction = new ArrayList<>();
         for (Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.Action sourceAction = action
+               org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action sourceAction = action
                     .getAction();
 
             if (sourceAction instanceof ControllerAction) {
index ae427455a415344b75d5db2c7d1e1e13049d37d1..fd03ea4ca5cc5ddf46df3d8fe5fa2f3c524ac4f1 100644 (file)
@@ -1,5 +1,6 @@
 package org.opendaylight.controller.sal.compatibility.adsal;
 
+import java.math.BigInteger;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -14,10 +15,17 @@ import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerListener;
 import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerService;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -46,39 +54,46 @@ public class FlowServiceAdapter implements SalFlowService, IFlowProgrammerListen
     }
 
     @Override
-    public Future<RpcResult<Void>> addFlow(AddFlowInput input) {
+    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
 
         Flow flow = ToSalConversionsUtils.toFlow(input);
         @SuppressWarnings("unchecked")
         org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
                 .getNode().getValue());
         Status status = delegate.addFlowAsync(node, flow);
-        Void rpcResultType = null;
+        AddFlowOutputBuilder builder = new AddFlowOutputBuilder();
+        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
+        AddFlowOutput rpcResultType = builder.build();
         return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
     }
 
     @Override
-    public Future<RpcResult<Void>> removeFlow(RemoveFlowInput input) {
+    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
 
         Flow flow = ToSalConversionsUtils.toFlow(input);
         @SuppressWarnings("unchecked")
         org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
                 .getNode().getValue());
         Status status = delegate.removeFlowAsync(node, flow);
-        Void rpcResultType = null;
+        RemoveFlowOutputBuilder builder = new RemoveFlowOutputBuilder();
+        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
+        RemoveFlowOutput rpcResultType = builder.build();
         return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
 
     }
 
     @Override
-    public Future<RpcResult<Void>> updateFlow(UpdateFlowInput input) {
+    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
         @SuppressWarnings("unchecked")
         org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input
                 .getNode().getValue());
         Flow originalFlow = ToSalConversionsUtils.toFlow(input.getOriginalFlow());
         Flow updatedFlow = ToSalConversionsUtils.toFlow(input.getUpdatedFlow());
         Status status = delegate.modifyFlowAsync(node, originalFlow, updatedFlow);
-        Void rpcResultType = null;
-        return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
+        UpdateFlowOutputBuilder builder = new UpdateFlowOutputBuilder();
+        builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId())));
+        UpdateFlowOutput rpcResultType = builder.build();
+        throw new UnsupportedOperationException("Need to translate AD-SAL status to MD-SAL UpdateFlowOuptut - eaw@cisco.com");
+        // return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null));
     }
 }
index c37cce0837a00e6214ac8230d913bcb335781754..96b8cafdf8ca3ed512c1ab65fedf0e4d3919ba3d 100644 (file)
@@ -26,9 +26,9 @@ import org.opendaylight.controller.sal.flowprogrammer.Flow;
 import org.opendaylight.controller.sal.match.Match;
 import org.opendaylight.controller.sal.match.MatchType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer3Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Layer4Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
@@ -185,7 +185,7 @@ public class TestFromSalConversionsUtils {
     }
 
     private void checkOdActions(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action> actions) {
+            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions) {
         checkOdAction(actions, FloodAction.class, false);
         checkOdAction(actions, FloodAllAction.class, false);
         checkOdAction(actions, HwPathAction.class, false);
@@ -208,11 +208,11 @@ public class TestFromSalConversionsUtils {
     }
 
     private void checkOdAction(
-            List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action> actions, Class<?> cl,
+            List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions, Class<?> cl,
             boolean b) {
         int numOfFoundActions = 0;
-        for (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action action : actions) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.Action innerAction = action
+        for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action : actions) {
+               org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action innerAction = action
                     .getAction();
             if (cl.isInstance(innerAction)) {
                 numOfFoundActions++;
index e251dd02a0baf299e596cc9334459cd2342d70ac..e2ae7246063678bca99a9fe9fdce2186323942d1 100644 (file)
@@ -27,13 +27,13 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 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.service.rev130819.FlowAddedBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.VlanCfi;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.action.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.Address;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv4Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.address.address.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.VlanCfi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/action-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/action-types.yang
new file mode 100644 (file)
index 0000000..3bf7db6
--- /dev/null
@@ -0,0 +1,229 @@
+module opendaylight-action-types {
+    namespace "urn:opendaylight:action:types";
+    prefix action;
+
+    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
+    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
+    import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
+    
+    revision "2013-11-12" {
+        description "Initial revision of action service";
+    }
+    
+    typedef vlan-cfi {
+        type int32;    
+    }
+
+    grouping address {
+        choice address {
+            case ipv4 {
+                leaf ipv4-address {
+                    type inet:ipv4-prefix;
+                }
+            }
+            case ipv6 {
+                leaf ipv6-address {
+                    type inet:ipv6-prefix;
+                }
+            }
+        }
+    }  
+    
+    grouping action-list {
+        list action {
+            key "order";
+            leaf order {
+                type int32;
+            }
+            uses action;
+        }
+    }
+    
+    grouping action {
+        choice action {
+            case output-action {
+                leaf-list output-node-connector {
+                    type inet:uri;
+                }
+                
+                leaf max-length {
+                    type uint16 {
+                        range "0..65294";
+                    }
+                }                
+            }
+
+            case controller-action {
+                leaf max-length {
+                    type uint16 {
+                        range "0..65294";
+                    }
+                }
+            }
+
+            case set-queue-action {
+                leaf queue {
+                    type string; 
+                }
+            }
+
+            case pop-mpls-action {
+                leaf ethernet-type {
+                    type uint16; // TODO: define ethertype type
+                }
+            }
+
+            case set-mpls-ttl-action {
+                leaf mpls-ttl {
+                    type uint8;
+                }
+            }
+
+            case set-nw-ttl-action {
+                leaf nw-ttl {
+                    type uint8;
+                }
+            }
+
+            case push-pbb-action {
+                leaf ethernet-type {
+                    type uint16; // TODO: define ethertype type
+                }
+            }
+
+            case pop-pbb-action {
+                
+            }
+            
+            case push-mpls-action {
+                leaf ethernet-type {
+                    type uint16; // TODO: define ethertype type
+                }
+            }
+            
+            case dec-mpls-ttl {
+            }
+            
+            case dec-nw-ttl {
+            }
+            
+            case drop-action {
+            }
+            
+            case flood-action {
+            }
+            
+            case flood-all-action {
+            }
+            
+            case hw-path-action {
+            }
+            
+            case loopback-action {
+            }
+            
+            case pop-vlan-action {
+            }
+            
+            case push-vlan-action {
+                leaf ethernet-type {
+                    type uint16; // TODO: define ethertype type
+                }
+                leaf tag {               // TPID - 16 bits
+                    type int32;
+                } 
+                leaf pcp {               // PCP - 3 bits
+                    type int32;
+                }
+                leaf cfi {               // CFI - 1 bit (drop eligible)
+                    type vlan-cfi;
+                }
+                leaf vlan-id {           // VID - 12 bits
+                    type l2t:vlan-id;
+                }
+//                leaf tci {               //TCI = [PCP + CFI + VID]
+//                }
+//                leaf header {            //header = [TPID + TCI] 
+//                }
+            }
+            
+            case copy-ttl-out {
+            }
+            
+            case copy-ttl-in {
+            }
+            
+            case set-dl-dst-action {
+                leaf address {
+                    type yang:mac-address;
+                }
+            }
+            
+            case set-dl-src-action {
+                leaf address {
+                    type yang:mac-address;
+                }
+            }
+            case group-action {
+                leaf group {
+                    type string;
+                }
+            }
+            
+            case set-dl-type-action {
+                leaf dl-type {
+                    type l2t:ether-type;
+                }
+            }
+            
+            case set-next-hop-action {
+                uses address;
+            }
+            
+            case set-nw-dst-action {
+                uses address;            
+            }
+            
+            case set-nw-src-action{
+                uses address;            
+            }
+            
+            case set-nw-tos-action {
+                leaf tos {
+                    type int32;
+                }
+            }
+            
+            case set-tp-dst-action {
+                leaf port {
+                    type inet:port-number;
+                }                
+            }
+            case set-tp-src-action {
+                leaf port {
+                    type inet:port-number;
+                }                
+            }
+            case set-vlan-cfi-action {
+                leaf vlan-cfi {
+                    type vlan-cfi;
+                }
+            }
+            
+            case set-vlan-id-action {
+                leaf vlan-id {
+                    type l2t:vlan-id;
+                } 
+            }
+            
+            case set-vlan-pcp-action {
+                leaf vlan-pcp {
+                    type l2t:vlan-pcp;
+                }            
+            }
+            
+            case sw-path-action {            
+            }  
+        }
+    }
+}
\ No newline at end of file
index 8e8c82293505795d7a53e5ada9275320a05ad617..4145977f635c2cb59b2d9564712d087aad6a378b 100644 (file)
@@ -3,54 +3,22 @@ module opendaylight-flow-types {
     prefix flow;
 
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-l2-types {prefix l2t; revision-date "2013-08-27";}
+    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}    
     import opendaylight-match-types {prefix match; revision-date 2013-10-26";}
-    
+    import opendaylight-action-types {prefix action;}
 
     revision "2013-10-26" {
         description "Initial revision of flow service";
     }
     
-    
-    typedef vlan-cfi {
-           type int32;    
-    }
-    
-    
-    grouping action-list {
-        list action {
+    grouping instruction-list {
+        list instruction {
             key "order";
             leaf order {
                 type int32;
             }
-            uses action;
-        }
-    }
-    
-    grouping address {
-        choice address {
-            case ipv4 {
-                leaf ipv4-address {
-                    type inet:ipv4-prefix;
-                }
-            }
-            case ipv6 {
-                leaf ipv6-address {
-                    type inet:ipv6-prefix;
-                }
-            }
+            uses instruction;
         }
-    }    
-
-    grouping instruction-list {
-            list instruction {
-                key "order";
-                leaf order {
-                    type int32;
-                }
-                uses instruction;
-            }
     }
 
     grouping instruction {
@@ -72,15 +40,15 @@ module opendaylight-flow-types {
             }
             
             case write-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case apply-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case clear-actions {
-                uses action-list;
+                uses action:action-list;
             }
             
             case meter {
@@ -91,197 +59,13 @@ module opendaylight-flow-types {
         }
     }
     
-    grouping action {
-        choice action {
-            case output-action {
-                leaf-list output-node-connector {
-                    type inet:uri;
-                }
-                
-                leaf max-length {
-                    type uint16 {
-                        range "0..65294";
-                    }
-                }                
-            }
-
-            case controller-action {
-                leaf max-length {
-                    type uint16 {
-                        range "0..65294";
-                    }
-                }
-            }
-
-            case set-queue-action {
-                leaf queue {
-                    type string; 
-                }
-            }
-
-            case pop-mpls-action {
-                leaf ethernet-type {
-                    type uint16; // TODO: define ethertype type
-                }
-            }
-
-            case set-mpls-ttl-action {
-                leaf mpls-ttl {
-                    type uint8;
-                }
-            }
-
-            case set-nw-ttl-action {
-                leaf nw-ttl {
-                    type uint8;
-                }
-            }
-
-            case push-pbb-action {
-                leaf ethernet-type {
-                    type uint16; // TODO: define ethertype type
-                }
-            }
-
-            case pop-pbb-action {
-                
-            }
-            
-            case push-mpls-action {
-                leaf ethernet-type {
-                    type uint16; // TODO: define ethertype type
-                }
-            }
-            
-            case dec-mpls-ttl {
-            }
-            
-            case dec-nw-ttl {
-            }
-            
-            case drop-action {
-            }
-            
-            case flood-action {
-            }
-            
-            case flood-all-action {
-            }
-            
-            case hw-path-action {
-            }
-            
-            case loopback-action {
-            }
-            
-            case pop-vlan-action {
-            }
-            
-            case push-vlan-action {
-                leaf tag {               // TPID - 16 bits
-                    type int32;
-                } 
-                leaf pcp {               // PCP - 3 bits
-                    type int32;
-                }
-                leaf cfi {               // CFI - 1 bit (drop eligible)
-                    type vlan-cfi;
-                }
-                leaf vlan-id {           // VID - 12 bits
-                    type l2t:vlan-id;
-                }
-//                leaf tci {               //TCI = [PCP + CFI + VID]
-//                }
-//                leaf header {            //header = [TPID + TCI] 
-//                }
-            }
-            
-            case copy-ttl-out {
-            }
-            
-            case copy-ttl-in {
-            }
-            
-            case set-dl-dst-action {
-                leaf address {
-                    type yang:mac-address;
-                }
-            }
-            
-            case set-dl-src-action {
-                leaf address {
-                    type yang:mac-address;
-                }
-            }
-            case group-action {
-                leaf group {
-                    type string;
-                }
-            }
-            
-            case set-dl-type-action {
-                leaf dl-type {
-                    type l2t:ether-type;
-                }
-            }
-            
-            case set-next-hop-action {
-                uses address;
-            }
-            
-            case set-nw-dst-action {
-                uses address;            
-            }
-            
-            case set-nw-src-action{
-                uses address;            
-            }
-            
-            case set-nw-tos-action {
-                leaf tos {
-                    type int32;
-                }
-            }
-            
-            case set-tp-dst-action {
-                leaf port {
-                    type inet:port-number;
-                }                
-            }
-            case set-tp-src-action {
-                leaf port {
-                    type inet:port-number;
-                }                
-            }
-            case set-vlan-cfi-action {
-                leaf vlan-cfi {
-                    type vlan-cfi;
-                }
-            }
-            
-            case set-vlan-id-action {
-                leaf vlan-id {
-                    type l2t:vlan-id;
-                } 
-            }
-            
-            case set-vlan-pcp-action {
-                leaf vlan-pcp {
-                    type l2t:vlan-pcp;
-                }            
-            }
-            
-            case sw-path-action {            
-            }  
-        }
-    }
-
     typedef flow-mod-flags {
         type bits {
             bit CHECK_OVERLAP;
             bit RESET_COUNTS;
             bit NO_PKT_COUNTS;
             bit NO_BYT_COUNTS;
+            bit SEND_FLOW_REM;
         }
     }
     
@@ -341,6 +125,20 @@ module opendaylight-flow-types {
         leaf flow-name{
             type string;
         }
+        
+        leaf installHw {
+            type boolean;
+        }
+
+        leaf barrier {
+            type boolean;
+        }
+
+        leaf strict {
+            type boolean;
+            default "false";
+        }
+
     }
 
     grouping flow-statistics {
index 03e36924e77968ab2815f9b391055945a62dc69b..685728a88709cac4396294e375f22943113de17c 100644 (file)
@@ -3,8 +3,8 @@ module opendaylight-group-types {
     prefix group;
 
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
-    import opendaylight-flow-types {prefix flow-types;revision-date 2013-10-26";}
+    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}   
+    import opendaylight-action-types {prefix action;}
 
     revision "2013-10-18" {
         description "Initial revision of group service";
@@ -41,6 +41,10 @@ module opendaylight-group-types {
             type string; 
         }
         
+        leaf install {
+            type boolean; 
+        } 
+        
         leaf barrier {
             type boolean; 
         }       
@@ -64,16 +68,7 @@ module opendaylight-group-types {
                     type uint32;
                 }
                 
-                container actions {
-                    list action {
-                        key "action-order";
-                        leaf action-order {
-                            type int32;
-                        }
-            
-                        uses flow-types:action;
-                    }
-                }
+                uses action:action-list;
             }
         }
     }
@@ -164,6 +159,7 @@ module opendaylight-group-types {
             }
             
             uses group-types;
+            
             leaf capabilities { 
                 type enumeration {
                     enum select-weight;
index a2aca362e20a30662ebfd42d92b13b259409cf9f..f58f6a459741e569578c5133b8e6d118e953d2a6 100644 (file)
@@ -19,6 +19,16 @@ module opendaylight-match-types {
             type binary;
         }
     }
+    
+    grouping "of-metadata" {
+        leaf metadata {
+            type uint64;
+        }
+        
+        leaf metadata-mask {
+            type binary;
+        }
+    }
 
      /** Match Groupings **/
     grouping "ethernet-match-fields" {
@@ -40,6 +50,7 @@ module opendaylight-match-types {
                 mandatory true;
                 type l2t:ether-type; // Needs to define that as general model
             }
+
             leaf mask {
                 type binary;
             }
@@ -85,25 +96,27 @@ module opendaylight-match-types {
             description "IP Proto (IPv4 or IPv6 Protocol Number).";
             type inet:ip-version; 
         }
-    }
-
+    } 
+    
     grouping "ipv4-match-fields" {
         leaf ipv4-source {
             description "IPv4 source address.";
             type inet:ipv4-prefix;
         }
+        
         leaf ipv4-destination {
             description "IPv4 destination address.";
             type inet:ipv4-prefix;
         }
+        
     }
-
+    
     grouping "ipv6-match-fields" {
         leaf ipv6-source {
             description "IPv6 source address.";
             type inet:ipv6-prefix;
         }
-        
+    
         leaf ipv6-destination {
             description "IPv6 destination address.";
             type inet:ipv6-prefix;
@@ -111,11 +124,17 @@ module opendaylight-match-types {
         
         leaf ipv6-nd-target {
             description "IPv6 target address for neighbour discovery message";
-            type inet:ipv6-prefix;
+            type inet:ipv6-address;
         }
         
-        leaf ipv6-flabel {
-            type inet:ipv6-flow-label;
+        container "ipv6-label" {
+            leaf ipv6-flabel {
+                type inet:ipv6-flow-label;
+            }
+            
+            leaf flabel-mask {
+                type binary;
+            }
         }
         
         leaf ipv6-nd-sll {
@@ -161,11 +180,16 @@ module opendaylight-match-types {
             type uint8;
         }
         
-        leaf pbb-isid {
-            description "I-SID in the first PBB service instance tag";
-            type uint32;
-        }   
-        
+        container "pbb" {
+            leaf pbb-isid {
+                description "I-SID in the first PBB service instance tag";
+                type uint32;
+            }  
+
+            leaf pbb-mask {
+                type binary;
+            }
+        }
     }
     
     grouping "tcp-match-fields" {
@@ -247,13 +271,19 @@ module opendaylight-match-types {
             type uint32;
         }
         
-        leaf metadata {
-            type uint64;
+        container "metadata" {
+            uses of-metadata;
         }
         
-        leaf tunnel-id {
-            description "Metadata associated in the logical port";
-            type uint64;
+        container "tunnel" {
+            leaf tunnel-id {
+                description "Metadata associated in the logical port";
+                type uint64;
+            }
+            
+            leaf tunnel-mask {
+                type binary;
+            }
         }
         
         container "ethernet-match" {
index 20353af7852bd0b46834e7ad61364b222ec89640..148ac9687f5baa8d66fa0fbfb143d91b6fdafb6f 100644 (file)
@@ -107,6 +107,10 @@ module opendaylight-meter-types {
                     uses meter-band-type;
                 }
             
+                leaf rate {
+                    type uint32;
+                }
+        
                 leaf burst-size {
                     type uint32;
                 }
index 98cf93d4b3825acd320b7dead11b183840eb0e08..2a16bfcf503e41369912ea646c0cc974737528a3 100644 (file)
@@ -5,7 +5,7 @@ module opendaylight-table-types {
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
     import opendaylight-flow-types {prefix flow;revision-date 2013-10-26";}
-
+    import opendaylight-action-types {prefix action;}
 
     revision "2013-10-26" {
         description "Initial revision of table service";
@@ -61,25 +61,25 @@ module opendaylight-table-types {
             
             case write-actions {   
                 container write-actions {
-                    uses flow:action-list;
+                    uses action:action-list;
                 } 
             }
             
             case write-actions-miss {   
                 container write-actions-miss {
-                    uses flow:action-list;
+                    uses action:action-list;
                 } 
             }
             
             case apply-actions {   
                 container apply-actions {
-                    uses flow:action-list;
+                    uses action:action-list;
                 } 
             }
             
             case apply-actions-miss {   
                 container apply-actions-miss {
-                    uses flow:action-list;
+                    uses action:action-list;
                 } 
             }
             
index 7501d8a579293d9bfdcd23e875614c2a0b72667c..5a1b0070777d6afbe672c14ec27209d454761a8f 100644 (file)
@@ -6,13 +6,12 @@ module sal-flow {
     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
-
+    import flow-capable-transaction {prefix tr;}
 
     revision "2013-08-19" {
         description "Initial revision of flow service";
     }
 
-
     typedef flow-table-ref {
         type instance-identifier;
     }
@@ -41,18 +40,30 @@ module sal-flow {
     rpc add-flow {
         input {
             uses node-flow;
+            uses tr:transaction-aware;            
+        }
+        output {
+            uses tr:transaction-aware;
         }
     }
 
     rpc remove-flow {
         input {
             uses node-flow;
+            uses tr:transaction-aware;            
+        }
+        output {
+            uses tr:transaction-aware;
         }
     }
 
     rpc update-flow {
         input {
             uses flow-update;
+            uses tr:transaction-aware;            
+        }
+        output {
+            uses tr:transaction-aware;
         }
     }