Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias Import alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore TupleLoad TupleLoad Str Str TupleLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr keyword Num keyword NameLoad keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Num keyword NameLoad keyword NameLoad keyword Str ClassDef bases body Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad Num Call NameLoad NameLoad orelse Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore IfExp CompareEq AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad NameLoad If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad CompareIn AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Str Str Str body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Return AttributeLoad NameLoad attr Return BinOpAdd BinOpMult AttributeLoad NameLoad attr BinOpPow Num Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore BinOpRShift AttributeLoad NameLoad attr Num Assign NameStore BinOpBitAnd AttributeLoad NameLoad attr BinOpSub BinOpLShift Num Num Num Return TupleLoad NameLoad NameLoad decorator_list
N/A django.db models django.core.exceptions ValidationError mozdns.domain.models name_to_domain mozdns.ip.utils ip_to_domain_name nibbilize N/A ipaddr Ip N/A N/A models Model N/A N/A An :class:`Ip` instance represents either an IPv4 or IPv6 address.

    :class:`Ip` instances are used in the :ref:`address_record` (A and AAAA
    records), :ref:`ptr`, and the :ref:`staticinterface` classes.

    :class:`Ip` instances in a :ref:`ptr` record must be mapped back to a
    Reverse :ref:`domain` object. A :class:`ValidationError` is raised if an
    eligible Reverse :ref:`domain` cannot be found when trying to create the
    :ref:`ptr`'s :class:`Ip`.

    The reason why an IP must be mapped back to a Reverse :ref:`domain` has to
    do with how bind files are generated. In a reverse zone file, ip addresses
    are mapped from IP to DATA. For instance an :ref:`ptr` record would
    look like this::

        IP                  DATA
        197.1.1.1   PTR     foo.bob.com

    If we were building the file ``197.in-addr.arpa``, all IP addresses
    in the ``197`` domain would need to be in this file. To reduce the
    complexity of finding records for a reverse domain, an :class:`IP` is
    linked to it's appropriate reverse domain when it is created. It's
    mapping is updated when it's reverse domain is deleted or a more
    appropritate reverse domain is added.  Keeping the :class:`Ip` feild on
    :ref:`ptr` will help preformance when building reverse zone files.

    The algorithm for determineing which reverse domain an :class:`Ip`
    belongs to is done by applying a 'longest prefix match' to all
    reverse domains in the :ref:`domain` table.

    :ref:`address_record` objects need the ip validation that happens in this
    class but do not need their :class:`Ip`'s to be tied back to a reverse
    domain.

    :ref:`staticinterface` objects need to have their ip tied back to reverse
    domain because they represent a :ref:`PTR` record as well as an
    :ref:`address_record`.

    .. note::
        Django's BigInteger wasn't "Big" enough, so there is code
        in `mozdns/ip/sql/ip.sql` that Alters the IP table.

    .. note::
        This class is abstract.

     N/A IP_TYPE_CHOICES N/A N/A 4 ipv4 N/A 6 ipv6 N/A ip_str N/A N/A models CharField max_length 39 editable True verbose_name IP help_text IP Address in dotted quad or dotted colon format N/A ip_upper N/A N/A models BigIntegerField null True blank True N/A ip_lower N/A N/A models BigIntegerField null True blank True N/A ip_type N/A N/A models CharField max_length 1 choices IP_TYPE_CHOICES editable True help_text IPv4 or IPv6 Address type Meta N/A N/A N/A abstract True N/A clean_ip N/A N/A self update_reverse_domain N/A True N/A N/A The clean method in Ip is different from the rest. It needs
        to be called with the update_reverse_domain flag. Sometimes we
        need to not update the reverse domain of an IP (i.e. when we are
        deleting a reverse_domain).
         N/A N/A N/A self validate_ip_str N/A N/A N/A self ip_type 4 N/A N/A Klass N/A ipaddr IPv4Address N/A N/A N/A N/A self ip_type 6 N/A N/A Klass N/A ipaddr IPv6Address N/A N/A N/A ValidationError N/A N/A Invalid ip type {0} format N/A self ip_type N/A N/A N/A ip N/A Klass N/A self ip_str N/A N/A self ip_str N/A str ip N/A N/A N/A N/A ipaddr AddressValueError N/A N/A N/A ValidationError N/A N/A Invalid Ip address {0} format N/A self ip_str N/A N/A N/A self ip_type 4 N/A N/A N/A N/A self ip_upper N/A self ip_lower N/A 0 N/A int ip N/A N/A N/A N/A self ip_upper N/A self ip_lower N/A ipv6_to_longs N/A int ip N/A update_reverse_domain N/A N/A self N/A N/A N/A rvname N/A N/A N/A self ip_type 6 N/A nibbilize N/A self ip_str N/A self ip_str N/A rvname N/A ip_to_domain_name rvname ip_type N/A self ip_type N/A N/A self reverse_domain N/A name_to_domain rvname N/A N/A N/A N/A self reverse_domain None N/A N/A N/A self reverse_domain name N/A arpa in-addr.arpa ip6.arpa N/A N/A N/A ValidationError N/A N/A No reverse Domain found for {0}  format N/A self ip_str N/A __int__ N/A N/A self N/A N/A N/A N/A N/A self ip_type 4 N/A N/A N/A self ip_lower N/A N/A N/A N/A self ip_upper N/A 2 64 N/A self ip_lower N/A validate_ip_str N/A N/A self N/A N/A N/A N/A N/A isinstance N/A self ip_str basestring N/A N/A N/A ValidationError Plase provide the string representationof the IP N/A N/A ipv6_to_longs N/A N/A addr N/A N/A N/A This function will turn an IPv6 into two longs. The first number
    represents the first 64 bits of the address and second represents
    the lower 64 bits.

    :param addr: IPv6 to be converted.
    :type addr: str
    :returns: (ip_upper, ip_lower) -- (int, int)
    :raises: ValidationError
     N/A N/A N/A ip N/A N/A ipaddr IPv6Address addr N/A N/A N/A N/A ipaddr AddressValueError N/A N/A N/A ValidationError N/A N/A AddressValueError: Invalid IPv6 address {0} format addr N/A ip_upper N/A N/A ip _ip 64 N/A ip_lower N/A N/A ip _ip N/A N/A 1 64 1 N/A N/A ip_upper ip_lower N/A