예제 #1
0
    def remove(self, ip) -> bool:
        """
        Removed the given valid IPv4

        :param ip: An Ipv4 as String
        :returns: str: The IP which is removed
        :raises  :class:`ip_model.Exceptions.InvalidIpException` for invalid IPv4
        """
        num_ip = to_number(ip)
        self.head.remove(num_ip)
        return ip
예제 #2
0
    def is_present(self, ip) -> bool:
        """
        Checks if a given valid IPv4 is present or not

        :param ip: An Ipv4 as String
        :returns: True, if the element is present
                  False, if the element is not present
        :raises  :class:`ip_model.Exceptions.InvalidIpException` for invalid IPv4
        """
        num_ip = to_number(ip)
        return self.head.is_present(num_ip)
예제 #3
0
    def add(self, ip: str) -> bool:
        """
        Adds the given valid IPv4

        :param ip: An Ipv4 as String
        :returns: True for every new addition
        :raises  :class:`ip_model.Exceptions.InvalidIpException` for invalid IPv4
        """
        num_ip = to_number(ip)
        self.head.add(num_ip)
        return True