commands

package
v0.0.0-...-8d45d05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_DOH_SERVER         = "cloudflare-dns.com"
	DOH_CONTENT_TYPE           = "application/dns-message"
	OBLIVIOUS_DOH_CONTENT_TYPE = "application/oblivious-dns-message"
	TARGET_HTTP_MODE           = "https"
	PROXY_HTTP_MODE            = "https"
	ODOH_CONFIG_WELLKNOWN_PATH = "/.well-known/odohconfigs"
	DOH_DEFAULT_PATH           = "/dns-query"
	ODOH_DEFAULT_PATH          = "/dns-query"
	ODOH_PROXY_DEFAULT_PATH    = "/proxy"
)

Variables

View Source
var Commands = []cli.Command{
	{
		Name:   "doh",
		Usage:  "An application/dns-message request",
		Action: plainDnsRequest,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "domain, d",
				Value: "www.cloudflare.com.",
			},
			cli.StringFlag{
				Name:  "dnstype, t",
				Value: "AAAA",
			},
			cli.StringFlag{
				Name:  "target",
				Value: "localhost:8080",
			},
		},
	},
	{
		Name:   "odoh",
		Usage:  "An application/oblivious-dns-message request",
		Action: obliviousDnsRequest,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "domain, d",
				Value: "www.cloudflare.com.",
				Usage: "Domain name which needs to be resolved. Use trailing period (.).",
			},
			cli.StringFlag{
				Name:  "dnstype, t",
				Value: "AAAA",
				Usage: "Type of DNS Question. Currently supports A, AAAA, CAA, CNAME",
			},
			cli.StringFlag{
				Name:  "target",
				Value: "localhost:8080",
				Usage: "Hostname:Port format declaration of the target resolver hostname",
			},
			cli.StringFlag{
				Name:  "proxy, p",
				Usage: "Hostname:Port format declaration of the proxy hostname",
			},
			cli.StringFlag{
				Name:  "customcert, cc",
				Usage: "Use --customcert to indicate the path to the custom certificates if using localhost certs",
				Value: "",
			},
			cli.StringFlag{
				Name:  "config, c",
				Usage: "ODoHConfigs to use for the query, encoded as a hexadecimal string",
			},
		},
	},
	{
		Name:   "odohconfig-fetch",
		Usage:  "Retrieves the ObliviousDoHConfigs of the target resolver",
		Action: getTargetConfigs,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "target",
				Value: "localhost:8080",
			},
			cli.BoolFlag{
				Name: "pretty",
			},
		},
	},
	{
		Name:   "odohconfig-mint",
		Usage:  "Mints a singleton ObliviousDoHConfig with the specified (KEM, KDF, AEAD) HPKE ciphersuite",
		Action: createConfigurations,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "kemid",
				Value: "32",
			},
			cli.StringFlag{
				Name:  "kdfid",
				Value: "1",
			},
			cli.StringFlag{
				Name:  "aeadid",
				Value: "1",
			},
		},
	},
	{
		Name:   "bench",
		Usage:  "Performs a benchmark for ODOH Target Resolver",
		Action: benchmarkClient,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "data",
				Value: "dataset.csv",
			},
			cli.Uint64Flag{
				Name:  "pick",
				Value: 10,
			},
			cli.Uint64Flag{
				Name:  "numclients",
				Value: 10,
			},
			cli.Uint64Flag{
				Name:  "rate",
				Value: 15,
			},
			cli.StringFlag{
				Name:  "logout",
				Value: "log.txt",
			},
			cli.StringFlag{
				Name:  "out",
				Value: "",
				Usage: "Filename to save serialized JSON response from benchmark execution (eg. output.json). " +
					"If no filename is provided, or failure to write to file, the default will print to console.",
			},
			cli.StringFlag{
				Name:  "target",
				Value: "localhost:8080",
				Usage: "Hostname:Port format declaration of the target resolver hostname",
			},
			cli.StringFlag{
				Name:  "proxy, p",
				Usage: "Hostname:Port format declaration of the proxy hostname",
			},
			cli.StringFlag{
				Name:  "dnstype, t",
				Value: "A",
			},
		},
	},
}

Functions

func GetInstance

func GetInstance(N uint64) *state

Types

type DiscoveryServiceResponse

type DiscoveryServiceResponse struct {
	Proxies []string `json:"proxies"`
	Targets []string `json:"targets"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL