Documentation ¶
Index ¶
- Variables
- func AddKeyMapping(km KeyMapping)
- func AddToRecentFiles(pcap string)
- func AddToRecentFilters(val string)
- func ApplyArguments(cmd []string, args []string) ([]string, int)
- func BrowseUrl(url string) error
- func CacheDir() string
- func CacheFile(bin string) string
- func CapinfosBin() string
- func CaptureBin() string
- func ConfFile(file string) string
- func ConvTypes() []string
- func ConvertArgToTShark(arg string) (string, string, bool)
- func CopyCommand(input io.Reader, cb interface{}) error
- func DateStringForFilename() string
- func DefaultPcapDir() string
- func DirOfPathCommand(bin string) (string, error)
- func DirOfPathCommandUnsafe(bin string) string
- func Does256ColorTermExist() error
- func DumpcapBin() string
- func ErrLogger(key string, val string) *io.PipeWriter
- func FileNewerThan(f1, f2 string) (bool, error)
- func FileSizeDifferentTo(filename string, cur int64) (int64, bool)
- func IndentPdml(in io.Reader, out io.Writer) error
- func Interfaces() (map[int][]string, error)
- func IsCommandInPath(bin string) bool
- func IsTerminal(fd uintptr) bool
- func KeyPressIsPrintable(key gowid.IKey) bool
- func KeyValueErrorString(err gowid.KeyValueError) string
- func KillIfPossible(p IProcess) error
- func LoadGlobalMarks(m map[rune]GlobalJumpPos) error
- func LoadOffsetFromConfig(name string) ([]resizable.Offset, error)
- func LocalIPs() []string
- func PcapDir() string
- func PrivilegedBin() string
- func ProfileCPUFor(secs int) bool
- func ProfileHeap()
- func PrunePcapCache() error
- func ReadGob(filePath string, object interface{}) error
- func RemoveFromStringSlice(pcap string, comps []string) []string
- func RemoveKeyMapping(kp vim.KeyPress)
- func ReverseStringSlice(s []string)
- func RootCause(err error) error
- func RunForExitCode(prog string, args []string, env []string) (int, error)
- func RunForStderr(prog string, args []string, env []string, stderr io.Writer) (int, error)
- func RunOnDoubleTicker(ch <-chan struct{}, fn func(), dur1 time.Duration, dur2 time.Duration, ...)
- func RunningRemotely() bool
- func SafePid(p IProcess) int
- func SaveGlobalMarks(m map[rune]GlobalJumpPos)
- func SaveKeyMappings(mappings []KeyMapping)
- func SaveOffsetToConfig(name string, offsets2 []resizable.Offset)
- func SetConvTypes(convs []string)
- func StringInSlice(a string, list []string) bool
- func StringIsArgPrefixOf(a string, list []string) bool
- func TSharkBin() string
- func TSharkPath() (string, *gowid.KeyValueError)
- func TSharkSupportsColor(tshark string) (bool, error)
- func TSharkVersion(tshark string) (semver.Version, error)
- func TSharkVersionFromOutput(output string) (semver.Version, error)
- func TailCommand() []string
- func TemplateToString(tmpl *template.Template, name string, data interface{}) string
- func TrackedGo(fn func(), wgs ...*sync.WaitGroup)
- func TsharkSetting(field string) (string, error)
- func TsharkSettings(fields ...string) (map[string]string, error)
- func ValidateTerm(term string) error
- func WiresharkProfileNames() []string
- func WriteEmptyPcap(filename string) error
- func WriteGob(filePath string, object interface{}) error
- type BadCommandError
- type BadStateError
- type ConfigError
- type ConvPktsCompare
- type GlobalJumpPos
- type ICommandDone
- type ICommandError
- type ICommandKillError
- type ICommandOutput
- type ICommandTimeout
- type ICommandWaitTicker
- type IPCompare
- type IProcess
- type InternalError
- type JumpPos
- type KeyMapping
- type KeyState
- type MACCompare
Constants ¶
This section is empty.
Variables ¶
var ( UserGuideURL string = "https://termshark.io/userguide" FAQURL string = "https://termshark.io/faq" BugURL string = "https://github.com/gcla/termshark/issues/new?assignees=&labels=&template=bug_report.md&title=" FeatureURL string = "https://github.com/gcla/termshark/issues/new?assignees=&labels=&template=feature_request.md&title=" OriginalEnv []string ShouldSwitchTerminal bool ShouldSwitchBack bool )
var BadCommand = BadCommandError{}
var BadState = BadStateError{}
var ConfigErr = ConfigError{}
var InternalErr = InternalError{}
var TSharkVersionUnknown = fmt.Errorf("Could not determine version of tshark")
var UnexpectedOutput = fmt.Errorf("Unexpected output")
var Version string = "v2.4.0"
Functions ¶
func AddKeyMapping ¶ added in v2.2.0
func AddKeyMapping(km KeyMapping)
func AddToRecentFiles ¶
func AddToRecentFiles(pcap string)
func AddToRecentFilters ¶
func AddToRecentFilters(val string)
func ApplyArguments ¶
ApplyArguments turns ["echo", "hello", "$2"] + ["big", "world"] into ["echo", "hello", "world"]
func CapinfosBin ¶ added in v2.1.0
func CapinfosBin() string
func CaptureBin ¶ added in v2.1.0
func CaptureBin() string
CaptureBin is the binary the user intends to use to capture packets i.e. with the -i switch. This might be distinct from DumpcapBin because dumpcap can't capture on extcap interfaces like randpkt, but while tshark can, it can drop packets more readily than dumpcap. This value is interpreted as the name of a binary, resolved against PATH. Note that the default is termshark - this invokes termshark in a special mode where it first tries DumpcapBin, then if that fails, TSharkBin - for the best of both worlds. To detect this, termshark will run CaptureBin with TERMSHARK_CAPTURE_MODE=1 in the environment, so when termshark itself is invoked with this in the environment, it switches to capture mode.
func CopyCommand ¶
func DateStringForFilename ¶
func DateStringForFilename() string
Down to the second for profiling, etc
func DefaultPcapDir ¶ added in v2.3.0
func DefaultPcapDir() string
DefaultPcapDir returns ~/.cache/pcaps by default. Termshark will check a couple of user settings first before using this.
func DirOfPathCommand ¶
func DirOfPathCommandUnsafe ¶
func Does256ColorTermExist ¶ added in v2.3.0
func Does256ColorTermExist() error
func DumpcapBin ¶
func DumpcapBin() string
func FileNewerThan ¶
func FileSizeDifferentTo ¶ added in v2.1.0
Returns true if error, too
func IndentPdml ¶
IndentPdml reindents XML, disregarding content between tags (because we knoe PDML doesn't use that capability of XML)
func Interfaces ¶
Use tshark's output, because the indices can then be used to select an interface to sniff on, and net.Interfaces returns the interfaces in a different order.
func IsCommandInPath ¶
func IsTerminal ¶
func KeyPressIsPrintable ¶ added in v2.2.0
func KeyValueErrorString ¶ added in v2.4.0
func KeyValueErrorString(err gowid.KeyValueError) string
KeyValueErrorString returns a string representation of a gowid KeyValueError intended to be suitable for displaying in a termshark error dialog.
func KillIfPossible ¶
func LoadGlobalMarks ¶ added in v2.2.0
func LoadGlobalMarks(m map[rune]GlobalJumpPos) error
func PcapDir ¶
func PcapDir() string
A separate dir from CacheDir because I need to use inotify under some circumstances for a non-existent file, meaning I need to track a directory, and I don't want to be constantly triggered by log file updates.
func PrivilegedBin ¶ added in v2.1.0
func PrivilegedBin() string
PrivilegedBin returns a capture binary that may require setcap privileges on Linux. This is a simple UI to cover the fact that termshark's default capture method is to run dumpcap and tshark as a fallback. I don't want to tell the user the capture binary is termshark - that'd be confusing. We know that on Linux, termshark will run dumpcap first, then fall back to tshark if needed. Only dumpcap should need access to live interfaces; tshark is needed for extcap interfaces only. This is used to provide advice to the user if packet capture fails.
func ProfileCPUFor ¶
func ProfileHeap ¶
func ProfileHeap()
func PrunePcapCache ¶ added in v2.3.0
func PrunePcapCache() error
func RemoveFromStringSlice ¶
func RemoveKeyMapping ¶ added in v2.2.0
func ReverseStringSlice ¶ added in v2.3.0
func ReverseStringSlice(s []string)
func RunForStderr ¶ added in v2.4.0
func RunOnDoubleTicker ¶
func RunningRemotely ¶
func RunningRemotely() bool
func SaveGlobalMarks ¶ added in v2.2.0
func SaveGlobalMarks(m map[rune]GlobalJumpPos)
func SaveKeyMappings ¶ added in v2.2.0
func SaveKeyMappings(mappings []KeyMapping)
func SaveOffsetToConfig ¶
func SetConvTypes ¶ added in v2.1.1
func SetConvTypes(convs []string)
func StringInSlice ¶
func StringIsArgPrefixOf ¶
func TSharkPath ¶
func TSharkPath() (string, *gowid.KeyValueError)
TSharkPath will return the full path of the tshark binary, if it's found in the path, otherwise an error
func TSharkSupportsColor ¶ added in v2.0.3
Depends on empty.pcap being present
func TailCommand ¶
func TailCommand() []string
func TemplateToString ¶
Must succeed - use on internal templates
func TsharkSetting ¶ added in v2.3.0
$ env TMPDIR=/foo tshark -G folders Temp Temp: /foo Personal configuration: /home/gcla/.config/wireshark Global configuration: /usr/share/wireshark
func TsharkSettings ¶ added in v2.4.0
func ValidateTerm ¶ added in v2.3.0
func WiresharkProfileNames ¶ added in v2.4.0
func WiresharkProfileNames() []string
func WriteEmptyPcap ¶
Types ¶
type BadCommandError ¶
type BadCommandError struct{}
func (BadCommandError) Error ¶
func (e BadCommandError) Error() string
type BadStateError ¶
type BadStateError struct{}
func (BadStateError) Error ¶
func (e BadStateError) Error() string
type ConfigError ¶
type ConfigError struct{}
func (ConfigError) Error ¶
func (e ConfigError) Error() string
type ConvPktsCompare ¶ added in v2.4.0
type ConvPktsCompare struct{}
ConvPktsCompare is a unit type that satisfies ICompare, and can be used for numerically comparing values emitted by the tshark -z conv,... e.g. "2,456 kB"
func (ConvPktsCompare) Less ¶ added in v2.4.0
func (s ConvPktsCompare) Less(i, j string) bool
type GlobalJumpPos ¶ added in v2.2.0
func (GlobalJumpPos) Base ¶ added in v2.2.0
func (g GlobalJumpPos) Base() string
For ease of use in the template
type ICommandDone ¶
type ICommandDone interface {
ProcessCommandDone()
}
type ICommandError ¶
type ICommandKillError ¶
type ICommandOutput ¶
type ICommandTimeout ¶
type ICommandTimeout interface {
ProcessCommandTimeout() error
}
type ICommandWaitTicker ¶
type ICommandWaitTicker interface {
ProcessWaitTick() error
}
type IPCompare ¶ added in v2.3.0
type IPCompare struct{}
IPCompare is a unit type that satisfies ICompare, and can be used for numerically comparing IP addresses.
type InternalError ¶
type InternalError struct{}
func (InternalError) Error ¶
func (e InternalError) Error() string
type KeyMapping ¶ added in v2.2.0
type KeyMapping struct { From vim.KeyPress To vim.KeySequence }
func LoadKeyMappings ¶ added in v2.2.0
func LoadKeyMappings() []KeyMapping
type MACCompare ¶ added in v2.4.0
type MACCompare struct{}
MacCompare is a unit type that satisfies ICompare, and can be used for numerically comparing MAC addresses.
func (MACCompare) Less ¶ added in v2.4.0
func (s MACCompare) Less(i, j string) bool
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
configs
|
|
pkg
|
|
format
Package format implements useful string/byte formatting functions.
|
Package format implements useful string/byte formatting functions. |
pdmltree
Package pdmltree contains a type used as the model for a PDML document for a packet, and associated functions.
|
Package pdmltree contains a type used as the model for a PDML document for a packet, and associated functions. |
theme
package theme provides utilities for customizing the styling of termshark.
|
package theme provides utilities for customizing the styling of termshark. |
theme/modeswap
package modeswap provides an IColor-conforming type Color that renders differently if in low-color mode
|
package modeswap provides an IColor-conforming type Color that renders differently if in low-color mode |
Package ui contains user-interface functions and helpers for termshark.
|
Package ui contains user-interface functions and helpers for termshark. |
menuutil
Package menuutil contains user-interface functions and helpers for termshark.
|
Package menuutil contains user-interface functions and helpers for termshark. |
tableutil
Package tableutil contains user-interface functions and helpers for termshark's tables - in particular, helpers for vim key sequences like 5gg and G
|
Package tableutil contains user-interface functions and helpers for termshark's tables - in particular, helpers for vim key sequences like 5gg and G |
appkeys
Package appkeys provides a widget which responds to keyboard input.
|
Package appkeys provides a widget which responds to keyboard input. |
copymodetable
Package copymodetable provides a wrapper around a table that supports copy mode.
|
Package copymodetable provides a wrapper around a table that supports copy mode. |
copymodetree
Package copymodetree provides a wrapper around a tree that supports copy mode.
|
Package copymodetree provides a wrapper around a tree that supports copy mode. |
enableselected
Package enableselected provides a widget that turns on focus.Selected.
|
Package enableselected provides a widget that turns on focus.Selected. |
expander
Package expander provides a widget that renders in one line when not in focus but that may render using more than one line when in focus.
|
Package expander provides a widget that renders in one line when not in focus but that may render using more than one line when in focus. |
fileviewer
Package fileviewer provides a widget to view a text file in a terminal via a pager program.
|
Package fileviewer provides a widget to view a text file in a terminal via a pager program. |
filter
Package filter provides a termshark-specific edit widget which changes color according to the validity of its input, and which activates a drop-down menu of possible completions for the term at point.
|
Package filter provides a termshark-specific edit widget which changes color according to the validity of its input, and which activates a drop-down menu of possible completions for the term at point. |
framefocus
Package framefocus provides a very specific widget to apply a frame around the widget in focus and an empty frame if not.
|
Package framefocus provides a very specific widget to apply a frame around the widget in focus and an empty frame if not. |
hexdumper
Package hexdumper provides a widget which displays selectable hexdump-like output.
|
Package hexdumper provides a widget which displays selectable hexdump-like output. |
hexdumper2
Package hexdumper2 provides a widget which displays selectable hexdump-like output.
|
Package hexdumper2 provides a widget which displays selectable hexdump-like output. |
ifwidget
Package ifwidget provides a simple widget that behaves differently depending on the condition supplied.
|
Package ifwidget provides a simple widget that behaves differently depending on the condition supplied. |
keepselected
Package keepselected turns on the selected bit when Render or UserInput is called.
|
Package keepselected turns on the selected bit when Render or UserInput is called. |
mapkeys
Package mapkeys provides a widget that can map one keypress to a sequence of keypresses.
|
Package mapkeys provides a widget that can map one keypress to a sequence of keypresses. |
minibuffer
Package minibuffer todo
|
Package minibuffer todo |
number
Package hexdumper provides a numeric widget with a couple of buttons that increase or decrease its value.
|
Package hexdumper provides a numeric widget with a couple of buttons that increase or decrease its value. |
regexstyle
Package regexstyle provides a widget that highlights the content of its subwidget according to a regular expression.
|
Package regexstyle provides a widget that highlights the content of its subwidget according to a regular expression. |
renderfocused
Package renderfocused will render a widget with focus true
|
Package renderfocused will render a widget with focus true |
resizable
Package resizable provides columns and piles that can be adjusted.
|
Package resizable provides columns and piles that can be adjusted. |
rossshark
Package rossshark provides a widget that draws a hi-tech shark fin over the background and allows it to move across the screen.
|
Package rossshark provides a widget that draws a hi-tech shark fin over the background and allows it to move across the screen. |
scrollabletable
Package scrollabletable makes a widget that some scrollbar interfaces suitable for passing to withscrollbar.New()
|
Package scrollabletable makes a widget that some scrollbar interfaces suitable for passing to withscrollbar.New() |
scrollabletext
Package scrollabletext provides a text widget that can be placed inside withscrollbar.Widget
|
Package scrollabletext provides a text widget that can be placed inside withscrollbar.Widget |
search
Package search provides termshark's search widget including the various drop down menus to control the type of search to be issued.
|
Package search provides termshark's search widget including the various drop down menus to control the type of search to be issued. |
streamwidget
Package streamwidget provides a very specific stream reassembly termshark widget.
|
Package streamwidget provides a very specific stream reassembly termshark widget. |
trackfocus
Package trackfocus provides a widget that issues callbacks when a widget loses or gains the focus.
|
Package trackfocus provides a widget that issues callbacks when a widget loses or gains the focus. |
withscrollbar
Package withscrollbar provides a widget that renders with a scrollbar on the right
|
Package withscrollbar provides a widget that renders with a scrollbar on the right |
wormhole
Package wormhole contains a widget that provides the UI for termshark's magic-wormhole pcap sending feature.
|
Package wormhole contains a widget that provides the UI for termshark's magic-wormhole pcap sending feature. |