cfg

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cfg defines the ID numbers as well as descriptions of config arguments used in the extcap configuration dialogs.

Please keep in mind that the ID numbers control the order in which the configuration arguments will be presented in Wireshark's configuration UI.

Index

Constants

View Source
const (
	ProxyOff   = 600
	HTTPProxy  = 666
	HTTPSProxy = 667
	NoProxy    = 668
)

Shared "Proxy" tab controls; please node that the control IDs were randomly chosen, see also https://xkcd.com/221/ for the algorithm used.

View Source
const (
	Containers    = 10
	ContainerNifs = 20

	ShowPods                 = 30
	ShowStandaloneContainers = 31
	ShowProcs                = 32
	ShowEmptyNetNS           = 33

	NoProm = 40
)

Shared "Standard" tab controls, except for the packetflix extcap network interface. These IDs do not start at 1 (or 0 fwiw) in order to give head space to extcap interface-specific configuration controls.

View Source
const (
	DockerHostURL = 1
	SkipVerify    = 2
)

Configuration UI controls identifiers for the Docker capture "Standard" tab controls; please note that these go first in the rendered dialog, as these are the most important ones.

View Source
const (
	ClusterContext = 1
)

Kubernetes capture "Standard" tab controls

View Source
const (
	PacketflixURL = 10
)

Packetflix configuration "Standard" tab controls

View Source
const ProxyTabName = "Proxy"

ProxyTabName specifies the tab name for proxy configuration options.

Variables

View Source
var CommonArgValues = map[int][]string{
	ContainerNifs: {"{value=any}{display=all}{default=true}"},
}

CommonArgValues defines the initial configuration values common to all extcap nifs (except packetflix)

View Source
var CommonArgs = map[int]string{}

CommonArgs are the configuration args common to all extcap nifs of this plugin, except the packetflix nif (which lacks the Standard tab common args completely).

View Source
var CommonOtherTabArgs = map[int]string{

	ProxyOff: "{group=" + ProxyTabName + "}{call=--proxyoff}{type=boolflag}{default=yes}" +
		"{display=Disable proxies}{tooltip=disables proxies completely}",
	HTTPProxy: "{group=" + ProxyTabName + "}{call=--httpproxy}{type=string}" +
		"{display=HTTP proxy}{placeholder=http://poxyproxy.acme.com:1234}",
	HTTPSProxy: "{group=" + ProxyTabName + "}{call=--httpsproxy}{type=string}" +
		"{display=HTTPS proxy}{placeholder=http://poxyproxy.acme.com:1234}",
	NoProxy: "{group=" + ProxyTabName + "}{call=--noproxy}{type=string}" +
		"{display=No proxy}{placeholder=destinations where no proxy should be used}",
}

CommonOtherTabArgs defines the configuration args common to all config tabs, except the "Standard" tab.

View Source
var CommonStdArgs = map[int]string{

	Containers: "{call=--container}{type=selector}{reload=true}" +
		"{display=Containers}{placeholder=refresh}",
	ContainerNifs: "{call=--nif}{type=selector}{reload=true}" +
		"{display=Interfaces}{placeholder=refresh}",

	ShowPods: "{call=--showpods}{type=boolflag}" +
		"{display=Show pods}",
	ShowStandaloneContainers: "{call=--showcontainers}{type=boolflag}" +
		"{display=Show standalone containers}",
	ShowProcs: "{call=--showprocs}{type=boolflag}" +
		"{display=Show processes}{default=false}",
	ShowEmptyNetNS: "{call=--showemptynetns}{type=boolflag}" +
		"{display=Show process-less IP stacks}{default=false}",

	NoProm: "{call=--noprom}{type=boolflag}" +
		"{display=No promiscuous mode}{default=false}",
}

CommonStdArgs defines the configuration args in the Standard tab, common to all extcap nifs except the packetflix nif.

Functions

func DumpConfigArgValues

func DumpConfigArgValues(w io.Writer, values map[int][]string)

DumpConfigArgValues dumps the values for configuration arguments. Here, order does not matter on the level of the config args, but only for the value set for a single config arg.

func DumpConfigArgs

func DumpConfigArgs(w io.Writer, options map[int]string)

DumpConfigArgs dumps all configuration "args" to a writer, sorted by their arg numbers. This allows us to assemble the configuration args from common and additional elements without having to ensure that they are already in the correct order. Instead, we just now bring our configuration args into order, sorted by their arg numbers. This is necessary, as Wireshark has some quirks in the way it generates the extcap configuration Qt UI dialog. In particular, while it sorts the args by their numbers, it places the initial focus on the first config arg seen in a group, not the first one by its number.

Types

type ArgVal

type ArgVal struct {
	Display   string // text displayed in selector
	Container string // container JSON data
}

ArgVal represents a single config argument value for the container list selector.

type ArgVals

type ArgVals []ArgVal

ArgVals is a (sortable) slice of ArgVal elements.

func (ArgVals) Dump

func (a ArgVals) Dump(w io.Writer, argid int)

Dump all ArgVal elements to the specified writer, as values of the specified argument ID.

func (ArgVals) Sort

func (a ArgVals) Sort()

Sort sorts a slice of ArgVal elements in place.

Jump to

Keyboard shortcuts

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