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

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Converts an IP address into an OSI Network Entity Title
suitable for use in IS-IS on IOS.

>>> ip_to_net_ent_title_ios(IPAddress("192.168.19.1"))
'49.1921.6801.9001.00'

        def ip_to_net_ent_title_ios(ip):
    """ Converts an IP address into an OSI Network Entity Title
    suitable for use in IS-IS on IOS.

    >>> ip_to_net_ent_title_ios(IPAddress("192.168.19.1"))
    '49.1921.6801.9001.00'
    """
    LOG.debug("Converting IP to OSI ENT format")
    area_id = "49"
# Pad with leading zeros, eg 1->001, 12->012, 123->123
    ip_octets = ["%03d" % int(octet) for octet in ip.words]
# Condense to single string
    ip_octets = "".join(ip_octets)
# and split into bytes
    ip_octets = ip_octets[0:4] + "." + ip_octets[4:8] + "." + ip_octets[8:12]
    return area_id + "." + ip_octets + "." + "00"
        


src/a/n/ank_le-HEAD/AutoNetkit/compiler/dynagencompiler.py   ank_le(Download)
            'prefixlen':    lo_ip.prefixlen,
            'network':       lo_ip.network,
            'net_ent_title': ank.ip_to_net_ent_title_ios(lo_ip.ip),
            'description': 'Loopback',
        })