Ejemplo n.º 1
0
def prepare_doh(address,
                hashes,
                hostname,
                path,
                options=None,
                bootstrap_ips=None):
    parameter = Parameter()
    parameter.protocol = Protocol.DOH

    if options is None:
        parameter.options = []
    else:
        parameter.options = options

    parameter.address = address
    parameter.hashes = hashes
    parameter.hostname = hostname
    parameter.path = path

    if bootstrap_ips is None:
        parameter.bootstrap_ips = []
    else:
        parameter.bootstrap_ips = bootstrap_ips

    return parameter
Ejemplo n.º 2
0
def prepare_doh_target(hostname, path, options=None):
    parameter = Parameter()
    parameter.protocol = Protocol.DOH_TARGET

    if options is None:
        parameter.options = []
    else:
        parameter.options = options

    parameter.hostname = hostname
    parameter.path = path
    return parameter