Merge "Fix for Bugs 324"
authorGiovanni Meo <gmeo@cisco.com>
Mon, 20 Jan 2014 21:19:31 +0000 (21:19 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 20 Jan 2014 21:19:31 +0000 (21:19 +0000)
opendaylight/distribution/opendaylight/src/main/resources/run.sh
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.xtend
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang [moved from opendaylight/md-sal/model/model-flow-base/src/main/yang/meter-types.yang with 94% similarity]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang [moved from opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang with 92% similarity]
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-table-types.yang [moved from opendaylight/md-sal/model/model-flow-base/src/main/yang/table-types.yang with 92% similarity]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsUpdateCommiter.java

index 1f3e8e20f3c9b596275868549ac1707f3a2e69d3..90e3b03ae4b7168fcc51a70a32499caca2086515 100755 (executable)
@@ -190,7 +190,7 @@ if [ "${statusdaemon}" -eq 1 ]; then
         else
             echo "Controller with PID: ${daemonpid} -- Doesn't seem to exist"
             rm -f "${pidfile}"
-            exit 0
+            exit 1
         fi
     else
         echo "Doesn't seem any Controller daemon is currently running, at least no PID file has been found"
index 4378e7dffece701592936ce85dba77884c6ce8d8..a3be5dd970f775141ad5483ec7ebeb8260641ad9 100644 (file)
@@ -234,21 +234,21 @@ public class NodeMapping {
 
     public static def toAdBandwidth(PortFeatures pf) {
         var Bandwidth bw = null
-        if (pf.is_10mbHd || pf.is_10mbFd) {
+        if (pf.isTenMbHd || pf.isTenMbFd) {
             bw = new Bandwidth(Bandwidth.BW10Mbps)
-        } else if (pf.is_100mbHd || pf.is_100mbFd) {
+        } else if (pf.isHundredMbHd || pf.isHundredMbFd) {
             bw = new Bandwidth(Bandwidth.BW100Mbps)
-        } else if (pf.is_1gbHd || pf.is_1gbFd) {
+        } else if (pf.isOneGbHd || pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW1Gbps)
-        } else if (pf.is_1gbFd) {
+        } else if (pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_10gbFd) {
+        } else if (pf.isTenGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_40gbFd) {
+        } else if (pf.isFortyGbFd) {
             bw = new Bandwidth(Bandwidth.BW40Gbps)
-        } else if (pf.is_100gbFd) {
+        } else if (pf.isHundredGbFd) {
             bw = new Bandwidth(Bandwidth.BW100Gbps)
-        } else if (pf.is_1tbFd) {
+        } else if (pf.isOneTbFd) {
             bw = new Bandwidth(Bandwidth.BW1Tbps)
         }
         return bw;
similarity index 94%
rename from opendaylight/md-sal/model/model-flow-base/src/main/yang/meter-types.yang
rename to opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-meter-types.yang
index d84b2f08511f466848886cb75aa4f418341d5563..1686cad3de0aacc365bcc195acc16314180cbb51 100644 (file)
@@ -2,7 +2,6 @@ module opendaylight-meter-types {
     namespace "urn:opendaylight:meter:types";
     prefix meter;
 
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
 
 
@@ -73,21 +72,21 @@ module opendaylight-meter-types {
     grouping band-type {
         choice band-type {
             case drop {
-                leaf rate {
+                leaf drop-rate {
                     type uint32;
                 }
                 
-                leaf burst-size {
+                leaf drop-burst-size {
                     type uint32;
                 }
             }
 
             case dscp-remark {
-                leaf rate {
+                leaf dscp-remark-rate {
                     type uint32;
                 }
                 
-                leaf burst-size {
+                leaf dscp-remark-burst-size {
                     type uint32;
                 }
                 
@@ -97,11 +96,11 @@ module opendaylight-meter-types {
             }
             
             case experimenter {
-                leaf rate {
+                leaf experimenter-rate {
                     type uint32;
                 }
                 
-                leaf burst-size {
+                leaf experimenter-burst-size {
                     type uint32;
                 }
                 
@@ -151,11 +150,11 @@ module opendaylight-meter-types {
                     }
                 }
             
-                leaf rate {
+                leaf band-rate {
                     type uint32;
                 }
         
-                leaf burst-size {
+                leaf band-burst-size {
                     type uint32;
                 }
                 uses band-type;
@@ -262,4 +261,4 @@ module opendaylight-meter-types {
        uses meter-features;
     }
     
-}
\ No newline at end of file
+}
similarity index 92%
rename from opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang
rename to opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang
index 2554fffadb7a047d0e8bb525688a20ba1423ba13..f1cbd8dc29e7b2a5d0b29cef831c9c0068752a7d 100644 (file)
@@ -2,7 +2,6 @@ module opendaylight-port-types {
     namespace "urn:opendaylight:flow:types:port";
     prefix port-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-queue-types {prefix queue-types; revision-date "2013-09-25";}
     
@@ -41,16 +40,16 @@ module opendaylight-port-types {
     
     typedef port-features {
         type bits {
-            bit 10mb-hd;
-            bit 10mb-fd;
-            bit 100mb-hd;
-            bit 100mb-fd;
-            bit 1gb-hd;
-            bit 1gb-fd;
-            bit 10gb-fd;
-            bit 40gb-fd;
-            bit 100gb-fd;
-            bit 1tb-fd;
+            bit ten-mb-hd;
+            bit ten-mb-fd;
+            bit hundred-mb-hd;
+            bit hundred-mb-fd;
+            bit one-gb-hd;
+            bit one-gb-fd;
+            bit ten-gb-fd;
+            bit forty-gb-fd;
+            bit hundred-gb-fd;
+            bit one-tb-fd;
             bit other;
             bit copper;
             bit fiber;
@@ -171,4 +170,4 @@ module opendaylight-port-types {
             }            
         }    
     }
-}
\ No newline at end of file
+}
similarity index 92%
rename from opendaylight/md-sal/model/model-flow-base/src/main/yang/table-types.yang
rename to opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-table-types.yang
index 5e747e47221ae7557f98b9a22ec9a5caf9fbccc9..118db1af06fdbd809ec1f21217bbfe1a84c27cbe 100644 (file)
@@ -2,8 +2,6 @@ module opendaylight-table-types {
     namespace "urn:opendaylight:table:types";
     prefix table;
 
-    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;}
 
@@ -227,7 +225,7 @@ module opendaylight-table-types {
             }
             
             case next-table-miss {   
-                container tables {
+                container tables-miss {
                     leaf-list table-ids {
                         type uint8;
                     }
@@ -259,27 +257,39 @@ module opendaylight-table-types {
             }
             
             case match {
-                uses set-field-match; 
+                       container match-setfield {
+                           uses set-field-match; 
+                       }
             }
             
             case wildcards {   
-                uses set-field-match;
+                       container wildcard-setfield {
+                    uses set-field-match;
+                }
             }
             
             case write-setfield {   
-                uses set-field-match;
+                       container write-setfield {
+                    uses set-field-match;
+                }
             }
             
             case write-setfield-miss {   
-                uses set-field-match;
+                container write-setfield-miss {
+                    uses set-field-match;
+                }
             }
             
             case apply-setfield {   
-                uses set-field-match; 
+                container apply-setfield {
+                    uses set-field-match; 
+                }
             }
             
             case apply-setfield-miss {   
-                uses set-field-match; 
+                container apply-setfield-miss {
+                    uses set-field-match; 
+                }
             }
         }
     } 
@@ -326,7 +336,6 @@ module opendaylight-table-types {
                      uses table-feature-prop-type;
                 }
             }
-
         }
     }    
 }
index 62ba04687e67eb368f47e61f07d64d4ee3de0618..f3188e1d0e83dbfd7870fd20b4e67d77d01b2219 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.md.statistics.manager;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ConcurrentMap;
+
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
@@ -84,10 +88,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatisticsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.config.stats.reply.MeterConfigStats;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.statistics.reply.MeterStats;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericQueueStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.GenericStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.FlowCapableNodeConnectorStatisticsData;
@@ -107,10 +107,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdenti
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-
 /**
  * Class implement statistics manager related listener interface and augment all the 
  * received statistics data to data stores.
@@ -810,6 +806,7 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
      * @param storedFlow
      * @return
      */
+    
     public boolean matchEquals(Match statsFlow, Match storedFlow) {
         if (statsFlow == storedFlow) {
             return true;
@@ -819,12 +816,9 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         }
         if (storedFlow.getEthernetMatch() == null) {
             if (statsFlow.getEthernetMatch() != null) {
-                if(!statsFlow.getEthernetMatch().getEthernetDestination().getAddress().getValue().equals("00:00:00:00:00:00") ||
-                        !statsFlow.getEthernetMatch().getEthernetSource().getAddress().getValue().equals("00:00:00:00:00:00")){
-                    return false;
-                }
+                return false;
             }
-        } else if(!EthernetMatchEquals(statsFlow.getEthernetMatch(),storedFlow.getEthernetMatch())) {
+        } else if(!storedFlow.getEthernetMatch().equals(statsFlow.getEthernetMatch())) {
             return false;
         }
         if (storedFlow.getIcmpv4Match()== null) {
@@ -850,12 +844,7 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         }
         if (storedFlow.getInPort()== null) {
             if (statsFlow.getInPort() != null) {
-                String[] portArr = statsFlow.getInPort().getValue().split(":");
-                if(portArr.length >= 3){
-                    if(Integer.parseInt(portArr[2]) != 0){
-                        return false;
-                    }
-                }
+                return false;
             }
         } else if(!storedFlow.getInPort().equals(statsFlow.getInPort())) {
             return false;
@@ -869,22 +858,14 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         }
         if (storedFlow.getLayer3Match()== null) {
             if (statsFlow.getLayer3Match() != null) {
-                Ipv4Match ipv4Match = (Ipv4Match)statsFlow.getLayer3Match();
-                if(!ipv4Match.getIpv4Source().getValue().equals("0.0.0.0/0") ||
-                        !ipv4Match.getIpv4Destination().getValue().equals("0.0.0.0/0")){
                     return false;
-                }
             }
         } else if(!storedFlow.getLayer3Match().equals(statsFlow.getLayer3Match())) {
             return false;
         }
         if (storedFlow.getLayer4Match()== null) {
             if (statsFlow.getLayer4Match() != null) {
-                TcpMatch tcpMatch = (TcpMatch)statsFlow.getLayer4Match();
-                if(!tcpMatch.getTcpDestinationPort().getValue().equals(0) ||
-                    !tcpMatch.getTcpSourcePort().getValue().equals(0)){
-                        return false;
-                }
+                return false;
             }
         } else if(!storedFlow.getLayer4Match().equals(statsFlow.getLayer4Match())) {
             return false;
@@ -912,49 +893,11 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
         }
         if (storedFlow.getVlanMatch()== null) {
             if (statsFlow.getVlanMatch() != null) {
-                VlanMatch vlanMatch = statsFlow.getVlanMatch();
-                if(!vlanMatch.getVlanId().getVlanId().getValue().equals(0) ||
-                        !vlanMatch.getVlanPcp().getValue().equals((short)0)){
-                    return false;
-                }
+                return false;
             }
         } else if(!storedFlow.getVlanMatch().equals(statsFlow.getVlanMatch())) {
             return false;
         }
         return true;
     }
-
-    public boolean EthernetMatchEquals(EthernetMatch statsEtherMatch, EthernetMatch storedEtherMatch) {
-        if (statsEtherMatch == storedEtherMatch) {
-            return true;
-        }
-        if (storedEtherMatch.getEthernetDestination()== null) {
-            if (statsEtherMatch.getEthernetDestination() != null) {
-                if(!statsEtherMatch.getEthernetDestination().getAddress().getValue().equals("00:00:00:00:00:00")){
-                    return false;
-                }
-            }
-        } else if(!storedEtherMatch.getEthernetDestination().equals(statsEtherMatch.getEthernetDestination())) {
-            return false;
-        }
-        if (storedEtherMatch.getEthernetSource() == null) {
-            if (statsEtherMatch.getEthernetSource() != null) {
-                if(!statsEtherMatch.getEthernetSource().getAddress().getValue().equals("00:00:00:00:00:00")){
-                    return false;
-                }
-            }
-        } else if(!storedEtherMatch.getEthernetSource().equals(statsEtherMatch.getEthernetSource())) {
-            return false;
-        }
-        if (storedEtherMatch.getEthernetType() == null) {
-            if (statsEtherMatch.getEthernetType() != null) {
-                if(!statsEtherMatch.getEthernetType().getType().getValue().equals(0)){
-                    return false;
-                }
-            }
-        } else if(!storedEtherMatch.getEthernetType().equals(statsEtherMatch.getEthernetType())) {
-            return false;
-        }
-        return true;
-    }
 }