Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Returns Identifier part of subnet for use in reverse dns identification.

>>> rev_dns_identifier(IPNetwork("10.1.2.3/8"))
'0.0.10.in-addr.arpa.'

>>> rev_dns_identifier(IPNetwork("172.16.1.2/16"))
'16.172.in-addr.arpa.'

>>> rev_dns_identifier(IPNetwork("192.168.0.1/24"))
'0.0.168.192.in-addr.arpa.'(more...)

        def rev_dns_identifier(subnet):
    """ Returns Identifier part of subnet for use in reverse dns identification.

    >>> rev_dns_identifier(IPNetwork("10.1.2.3/8"))
    '0.0.10.in-addr.arpa.'

    >>> rev_dns_identifier(IPNetwork("172.16.1.2/16"))
    '16.172.in-addr.arpa.'

    >>> rev_dns_identifier(IPNetwork("192.168.0.1/24"))
    '0.0.168.192.in-addr.arpa.'

    Can only handle classful addreses, expect nothing if prefixlen is not divisible by 8
    >>> rev_dns_identifier(IPNetwork("192.168.0.1/22"))


    """
    if subnet.prefixlen % 8 != 0:
# Can only do classful subnets (config is too complicated otherwise)
        LOG.warn("Reverse DNS can only handle /8, /16, /24, unable to process %s"
                % subnet)
        return

    reversed = subnet.network.reverse_dns.split(".")
# Drop the first/second octets if class A/B
    if subnet.prefixlen == 8:
        reversed = reversed[1:]
    elif subnet.prefixlen == 16:
        reversed = reversed[2:]
    return ".".join(reversed)
        


src/a/n/ank_le-HEAD/AutoNetkit/compiler/netkitcompiler.py   ank_le(Download)
            for child in children:
                advertise_block = ip_as_allocs[child.asn]
                reverse_identifier = ank.rev_dns_identifier(advertise_block)
                child_servers.append( (child.domain, reverse_identifier, ank.server_ip(child)))
            f_root_db = open(os.path.join(bind_dir(self.network, server), "db.root"), 'wb')