def from_inet_ptoi(bgp_id):
    """Convert an IPv4 address string format to a four byte long.
    """
    four_byte_id = None
    try:
        packed_byte = socket.inet_pton(socket.AF_INET, bgp_id)
        four_byte_id = int(packed_byte.encode('hex'), 16)
    except __HOLE__:
        LOG.debug('Invalid bgp id given for conversion to integer value %s',
                  bgp_id)

    return four_byte_id
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/utils/bgp.py/from_inet_ptoi