示例#1
0
def endpoint(text):
    addr, port = splitaddress(text.strip())
    host = addr if ishost(addr) else ip_to_host(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return host, port
示例#2
0
def is_endpoint(value):
    host, port = splitaddress(value)
    return is_host(host) and is_port(port)
示例#3
0
def socket(text):
    addr, port = splitaddress(text.strip())
    ip = addr if isip(addr) else host_to_ip(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return ip, port
示例#4
0
def is_socket(value):
    ip, port = splitaddress(value)
    return isip(ip) and is_port(port)
示例#5
0
文件: parse.py 项目: GammaC0de/pyload
def endpoint(text):
    addr, port = splitaddress(text.strip())
    host = addr if ishost(addr) else ip_to_host(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return host, port
示例#6
0
文件: parse.py 项目: GammaC0de/pyload
def socket(text):
    addr, port = splitaddress(text.strip())
    ip = addr if isip(addr) else host_to_ip(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return ip, port
示例#7
0
文件: check.py 项目: GammaC0de/pyload
def isendpoint(value):
    host, port = splitaddress(value)
    return ishost(host) and isport(port)
示例#8
0
文件: check.py 项目: GammaC0de/pyload
def issocket(value):
    ip, port = splitaddress(value)
    return isip(ip) and isport(port)