예제 #1
0
  public void FindParentClusters(TrafficCluster TCluster) {
    Iterator<Entry<Long, TrafficCluster>> ClusterIterator = BaseClusters.entrySet().iterator();
    TrafficCluster TempBaseCluster;
    while (ClusterIterator.hasNext()) {
      boolean IsParent = false;
      Map.Entry<Long, TrafficCluster> BaseClusterEntry =
          (Map.Entry<Long, TrafficCluster>) ClusterIterator.next();
      TempBaseCluster = BaseClusterEntry.getValue();
      IsParent =
          TrafficCluster.CompareTwoNwAddr(
                  TempBaseCluster.MatchOnSrcIP,
                  TempBaseCluster.SrcIPMatch,
                  TempBaseCluster.SrcMask,
                  TCluster.SrcIPMatch)
              && TrafficCluster.CompareTwoNwAddr(
                  TempBaseCluster.MatchOnDstIP,
                  TempBaseCluster.DstIPMatch,
                  TempBaseCluster.DstMask,
                  TCluster.DstIPMatch)
              && TrafficCluster.CheckPortMatches(
                  TempBaseCluster, TCluster.SrcPort, TCluster.DstPort)
              && TrafficCluster.CheckProtocolMatches(
                  TempBaseCluster.MatchOnProtocol, TempBaseCluster.Protocol, TCluster.Protocol);

      if (IsParent == true) {
        TCluster.ParentClusterIDs.add(TempBaseCluster.ClusterID);
      }
    }
  }