def _to_proto_num(proto):
    if proto is None:
        return None
    if proto.lower() == 'tcp':
        return socket.IPPROTO_TCP
    elif proto.lower() == 'udp':
        return socket.IPPROTO_UDP
    else:
        assert False, 'unknown proto %s' % proto
dataset/ETHPy150Open facebook/gnlpy/ipvs.py/_to_proto_num/original