def set_pagesize(self, min, max):
     ValueChecker.is_number(min)
     ValueChecker.is_number(max)
     self.__pagesize_min = min
     self.__pagesize_max = max
     self.__pagesize = True
     return self
    def remove_least_port_strength(self, ip, port, strength):
        ValueChecker.is_number(port)
        ValueChecker.is_string(ip)
        self.validate_strength(strength)

        config = ip + '/' + str(port) + '/' + '/' + strength
        self.__least_port_strength.remove(config)

        return self
Beispiel #3
0
    def remove_allowed_port(self, port, protocol):
        ValueChecker.is_number(port)
        ValueChecker.is_string(protocol)
        protocol = protocol.lower()

        config = (port, protocol)
        self.__open_ports.remove(config)

        return self
Beispiel #4
0
    def add_partition(self, id, path, warning_percent, critical_percent):
        ValueChecker.is_string(id)
        ValueChecker.is_string(path)
        ValueChecker.is_number(warning_percent)
        ValueChecker.is_number(critical_percent)
        self.__check_partitions.append(
            (id, path, warning_percent, critical_percent))

        return self
    def add_least_port_strength(self, ip, port, strength):
        ValueChecker.is_number(port)
        ValueChecker.is_string(ip)
        self.validate_strength(strength)

        config = ip + '/' + str(port) + '/' + strength
        if config not in self.__least_port_strength:
            self.__least_port_strength.append(config)

        return self
Beispiel #6
0
    def add_allowed_port(self, port, protocol):
        ValueChecker.is_number(port)
        ValueChecker.is_string(protocol)
        protocol = protocol.lower()

        config = (port, protocol)
        if config not in self.__open_ports:
            self.__open_ports.append(config)

        return self
    def remove_allowed_cipher(self, ip, port, protocol, cipher_names):
        ValueChecker.is_number(port)
        ValueChecker.is_string(protocol)
        ValueChecker.is_string(ip)
        ValueChecker.is_array(cipher_names)

        config = ip + '/' + str(port) + '/' + protocol + '/' + ','.join(
            cipher_names)
        self.__allowed_ciphers.remove(config)

        return self
Beispiel #8
0
    def remove_allowed_port(self, port, protocol):
        ValueChecker.is_number(port)
        ValueChecker.is_string(protocol)
        protocol = protocol.lower()

        if protocol not in ['udp', 'tcp']:
            raise Exception('Protocol must be UDP or TCP in ' + self.get_id())

        config = str(port) + '/' + protocol
        self.__allowed_ports.remove(config)

        return self
    def add_allowed_cipher(self, ip, port, protocol, cipher_names):
        ValueChecker.is_number(port)
        ValueChecker.is_string(ip)
        ValueChecker.is_string(protocol)
        ValueChecker.is_array(cipher_names)

        config = ip + '/' + str(port) + '/' + protocol + '/' + ','.join(
            cipher_names)
        if config not in self.__allowed_ciphers:
            self.__allowed_ciphers.append(config)

        return self
Beispiel #10
0
 def set_timeout(self, timeout):
     ValueChecker.is_number(timeout)
     self.__timeout = timeout
     return self
Beispiel #11
0
 def set_warning_time(self, warning_time):
     ValueChecker.is_number(warning_time)
     self.__warning_time = warning_time
     return self
Beispiel #12
0
 def set_cert_warning(self, cert_warning):
     ValueChecker.is_number(cert_warning)
     self.__cert_warning = cert_warning
     return self
Beispiel #13
0
 def set_maxbytes(self, maxbytes):
     ValueChecker.is_number(maxbytes)
     self.__maxbytes = maxbytes
     return self
Beispiel #14
0
 def set_state(self, state):
     ValueChecker.is_number(state)
     self.__state = state
     return self
Beispiel #15
0
    def add_ignored_port(self, port):
        ValueChecker.is_number(port)
        if port not in self.__ignored_ports:
            self.__ignored_ports.append(port)

        return self
Beispiel #16
0
    def set_spoof_mac(self, spoof_mac):
        ValueChecker.is_number(spoof_mac)
        self.__spoof_mac = spoof_mac

        return self
Beispiel #17
0
    def set_datadir(self, datadir):
        ValueChecker.is_number(datadir)
        self.__datadir = datadir

        return self
Beispiel #18
0
    def set_max_scan_delay(self, max_scan_delay):
        ValueChecker.is_number(max_scan_delay)
        self.__max_scan_delay = max_scan_delay

        return self
Beispiel #19
0
    def remove_ignored_port(self, port):
        ValueChecker.is_number(port)
        self.__ignored_ports.remove(port)

        return self
Beispiel #20
0
    def set_mtu(self, mtu):
        ValueChecker.is_number(mtu)
        self.__mtu = mtu

        return self
 def set_warning(self, warning):
     ValueChecker.is_number(warning)
     self.__warning = warning
     return self
Beispiel #22
0
    def set_S(self, S):
        ValueChecker.is_number(S)
        self.__S = S

        return self
Beispiel #23
0
 def set_delay(self, delay):
     ValueChecker.is_number(delay)
     self.__delay = delay
     return self
Beispiel #24
0
    def set_e(self, e):
        ValueChecker.is_number(e)
        self.__e = e

        return self
Beispiel #25
0
 def set_cert_critical(self, cert_critical):
     ValueChecker.is_number(cert_critical)
     self.__cert_critical = cert_critical
     return self
Beispiel #26
0
    def set_data(self, data):
        ValueChecker.is_number(data)
        self.__data = data

        return self
Beispiel #27
0
 def set_critical_time(self, critical_time):
     ValueChecker.is_number(critical_time)
     self.__critical_time = critical_time
     return self
Beispiel #28
0
    def set_data_string(self, data_string):
        ValueChecker.is_number(data_string)
        self.__data_string = data_string

        return self
Beispiel #29
0
 def set_port(self, port):
     ValueChecker.is_number(port)
     self.__port = port
     return self
Beispiel #30
0
    def set_ip_options(self, ip_options):
        ValueChecker.is_number(ip_options)
        self.__ip_options = ip_options

        return self