parameters: (self)
docstring: Detect SIMP (Single IP Multiple Port) DDoS attack.
  
          Args:
              None
  
          Raises:
              None
  
          Returns:
              None
docstring_summary: Detect SIMP (Single IP Multiple Port) DDoS attack.
docstring_tokens: Detect SIMP ( Single IP Multiple Port ) DDoS attack .
function: def detect_simp(self):
          """
          Detect SIMP (Single IP Multiple Port) DDoS attack.
  
          Args:
              None
  
          Raises:
              None
  
          Returns:
              None
          """
          # Check intrusion for simp
          for ip in self.simp.keys():
              count = self.simp[ip]["count"]
              len_port = len(self.simp[ip]["ports"])
              start_time = int(self.simp[ip]["start_time"])
              current_time = int(time.time())
              delta_time = int(current_time - start_time)
  
              try:
                  calc_count_threshold = int(count / delta_time)
              except ZeroDivisionError:
                  calc_count_threshold = int(count)
              try:
                  calc_portlen_threshold = int(len_port / delta_time)
              except ZeroDivisionError:
                  calc_portlen_threshold = int(len_port)
  
              if (calc_count_threshold > self._THRESHOLD or
                  calc_portlen_threshold > self._THRESHOLD):
                  self.logger.log(
                      "Possible Single IP Multiple Port DDoS attack",
                      logtype="warning"
                  )
function_tokens: def detect_simp ( self ) : # Check intrusion for simp for ip in self . simp . keys ( ) : count = self . simp [ ip ] [ "count" ] len_port = len ( self . simp [ ip ] [ "ports" ] ) start_time = int ( self . simp [ ip ] [ "start_time" ] ) current_time = int ( time . time ( ) ) delta_time = int ( current_time - start_time ) try : calc_count_threshold = int ( count / delta_time ) except ZeroDivisionError : calc_count_threshold = int ( count ) try : calc_portlen_threshold = int ( len_port / delta_time ) except ZeroDivisionError : calc_portlen_threshold = int ( len_port ) if ( calc_count_threshold > self . _THRESHOLD or calc_portlen_threshold > self . _THRESHOLD ) : self . logger . log ( "Possible Single IP Multiple Port DDoS attack" , logtype = "warning" )