Documentation
¶
Overview ¶
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Package ui contains user-interface functions and helpers for termshark.
Index ¶
- Variables
- func ApplyAutoScroll(ev *tcell.EventKey, app gowid.IApp) bool
- func ApplyCurrentProfile(app gowid.IApp, vp *viper.Viper, vc *viper.Viper) error
- func ApplyCurrentTheme(app gowid.IApp)
- func Build(tty string) (*gowid.App, error)
- func ClearProgressWidgetFor(app gowid.IApp, owner WidgetOwner)
- func ClosePleaseWait(app gowid.IApp)
- func ComputeConvFilterOp(dirOp FilterMask, comb FilterCombinator, model IFilterModel, curFilter string) string
- func ComputeFilterCombOp(comb FilterCombinator, newFilter string, curFilter string) string
- func EnsureTemplateData()
- func IsProgressIndeterminate() bool
- func IsTerminalLegible(app gowid.IApp)
- func MakeCheckGlobalJumpAfterPsml(jmp termshark.GlobalJumpPos) checkGlobalJumpAfterPsml
- func MakeMenuNavigatingKeyPress(left *NextMenu, right *NextMenu) appkeys.KeyInputFn
- func MakeMenuWithHotKeys(items []SimpleMenuItem) gowid.IWidget
- func MakePacketViewUpdater() updatePacketViews
- func MakeUpdateCurrentCaptureInTitle() updateCurrentCaptureInTitle
- func MaybeKeepThenRequestLoadPcap(pcapf string, displayFilter string, jump termshark.GlobalJumpPos, ...)
- func MenuNavigatingKeyPress(evk *tcell.EventKey, left *NextMenu, right *NextMenu, app gowid.IApp) bool
- func NewDefaultPsmlColumnsModel(app gowid.IApp) *psmlColumnsModel
- func NewPsmlColumnsModel(app gowid.IApp) *psmlColumnsModel
- func NewPsmlColumnsModelFrom(colsKey string, app gowid.IApp) *psmlColumnsModel
- func NewPsmlTableRowWidget(w *rowFocusTableWidget, c []pcap.PacketColors) *psmlTableRowWidget
- func NewRowFocusTableWidget(w iRowFocusTableWidgetNeeds, rs string, rf string) *rowFocusTableWidget
- func OpenError(msgt string, app gowid.IApp) *dialog.Widget
- func OpenLongError(msgt string, app gowid.IApp) *dialog.Widget
- func OpenLongMessage(msgt string, openOver gowid.ISettableComposite, app gowid.IApp) *dialog.Widget
- func OpenMessage(msgt string, openOver gowid.ISettableComposite, app gowid.IApp) *dialog.Widget
- func OpenMessageForCopy(msgt string, openOver gowid.ISettableComposite, app gowid.IApp) *dialog.Widget
- func OpenPleaseWait(container gowid.ISettableComposite, app gowid.IApp)
- func OpenTemplatedDialog(container gowid.ISettableComposite, tmplName string, app gowid.IApp) *dialog.Widget
- func OpenTemplatedDialogExt(container gowid.ISettableComposite, tmplName string, ...) *dialog.Widget
- func RequestLoadInterfaces(psrcs []pcap.IPacketSource, captureFilter string, displayFilter string, ...)
- func RequestLoadPcap(pcapf string, displayFilter string, jump termshark.GlobalJumpPos, ...)
- func RequestNewFilter(displayFilter string, app gowid.IApp)
- func RequestQuit()
- func RequestReload(app gowid.IApp)
- func SetDarkMode(mode bool)
- func SetProgressDeterminateFor(app gowid.IApp, owner WidgetOwner)
- func SetProgressIndeterminateFor(app gowid.IApp, owner WidgetOwner)
- func SetProgressWidget(app gowid.IApp)
- func SetProgressWidgetCustom(app gowid.IApp, c *columns.Widget, owner WidgetOwner)
- func SetSearchProgressWidget(app gowid.IApp)
- func SetupColors()
- func StopEmptyHexViewTimer()
- func StopEmptyStructViewTimer()
- func SuggestSwitchingTerm(app gowid.IApp)
- func UpdateProfileWidget(name string, app gowid.IApp)
- func UpdateProgressBarForFile(c *pcap.PacketLoader, prevRatio float64, app gowid.IApp) float64
- func UpdateProgressBarForInterface(c *pcap.InterfaceLoader, app gowid.IApp)
- func UpdateRecentMenu(app gowid.IApp)
- func WriteHelp(p *flags.Parser, w io.Writer)
- func WriteMarks(p *flags.Parser, marks map[rune]int, w io.Writer)
- func WriteTsharkVersion(p *flags.Parser, bin string, ver semver.Version, w io.Writer)
- func WriteVersion(p *flags.Parser, w io.Writer)
- type BytesResult
- type BytesSearchCallbacks
- func (s BytesSearchCallbacks) OnError(err error, app gowid.IApp)
- func (s BytesSearchCallbacks) OnTick(app gowid.IApp)
- func (w *BytesSearchCallbacks) Reset(app gowid.IApp)
- func (w *BytesSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
- func (s *BytesSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
- func (w *BytesSearchCallbacks) StartingPosition() (interface{}, error)
- type CancelledMessage
- type ClearMarksHandler
- type ClearWormholeState
- type ConvAddr
- type ConvsModel
- type ConvsUiOptions
- type ConvsUiWidget
- func (w *ConvsUiWidget) AbsoluteTime() bool
- func (w *ConvsUiWidget) Context() context.Context
- func (w *ConvsUiWidget) FilterValue() string
- func (w *ConvsUiWidget) OnCancel(app gowid.IApp)
- func (w *ConvsUiWidget) OnData(data string, app gowid.IApp)
- func (w *ConvsUiWidget) ReloadNeeded()
- func (w *ConvsUiWidget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func (w *ConvsUiWidget) ResolveNames() bool
- func (w *ConvsUiWidget) SetAbsoluteTime(val bool)
- func (w *ConvsUiWidget) SetResolveNames(val bool)
- func (w *ConvsUiWidget) SetUseFilter(val bool)
- func (w *ConvsUiWidget) UseFilter() bool
- type CsvTableCopier
- type Direction
- type FilterCombinator
- type FilterMask
- type FilterResult
- type FilterSearchCallbacks
- func (s FilterSearchCallbacks) OnError(err error, app gowid.IApp)
- func (s FilterSearchCallbacks) OnTick(app gowid.IApp)
- func (w *FilterSearchCallbacks) RequestStop(app gowid.IApp)
- func (w *FilterSearchCallbacks) Reset(app gowid.IApp)
- func (w *FilterSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
- func (s *FilterSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
- func (w *FilterSearchCallbacks) StartingPosition() (interface{}, error)
- type IFilterBuilder
- type IFilterModel
- type IOnDataSync
- type IPleaseWait
- type ListResult
- type ListSearchCallbacks
- func (s ListSearchCallbacks) OnError(err error, app gowid.IApp)
- func (s ListSearchCallbacks) OnTick(app gowid.IApp)
- func (w *ListSearchCallbacks) Reset(app gowid.IApp)
- func (w *ListSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
- func (s *ListSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
- func (w *ListSearchCallbacks) StartingPosition() (interface{}, error)
- type LoadResult
- type ManageCapinfoCache
- type ManageConvsCache
- type ManageSearchData
- type ManageStreamCache
- type MenuHolder
- type MultiMenuOpener
- type NextMenu
- type NoHandlers
- type OpenErrorDialog
- type PacketSearcher
- type PaletteSwitcher
- type Prog
- type RenderRatioUpTo
- type RenderWeightUpTo
- type SaveRecents
- type SearchStopper
- type SetStructWidgets
- type SimpleErrors
- type SimpleMenuItem
- type StartUIWhenThereArePackets
- type StructResult
- type StructSearchCallbacks
- func (w *StructSearchCallbacks) CheckNode(tr tree.IModel, pos tree.IPos) bool
- func (s StructSearchCallbacks) OnError(err error, app gowid.IApp)
- func (s StructSearchCallbacks) OnTick(app gowid.IApp)
- func (w *StructSearchCallbacks) Reset(app gowid.IApp)
- func (w *StructSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
- func (s *StructSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
- func (w *StructSearchCallbacks) StartingPosition() (interface{}, error)
- type WidgetOwner
Constants ¶
This section is empty.
Variables ¶
var ( YesNo *dialog.Widget MiniBuffer *minibuffer.Widget PleaseWait *dialog.Widget )
var ( RegularPalette gowid.Palette DarkModePalette gowid.Palette )
var AutoScroll bool // true if the packet list should auto-scroll when listening on an interface.
var CacheRequests []pcap.LoadPcapSlice
var CacheRequestsChan chan struct{} // false means started, true means finished
var CapinfoData string
var CapinfoLoader *capinfo.Loader
var CapinfoTime time.Time
var ColumnsFormatError = fmt.Errorf("The supplied list of columns and names is invalid")
var CopyModePredicate ifwidget.Predicate
var CopyModeWidget gowid.IWidget
var CurrentColsWidget *psmlColumnsModel
These are global variables used to hold the current model for the edit-columns widget, and the current line selected. This is hacky but it's so that I can tell, when a menu button is clicked within this PSML columns widget, which column it should apply to. I could generate unique menus for each row of the table, as an alternative...
var CurrentWormholeWidget *wormhole.Widget
var DarkMode bool // global state in app
var DoOnce sync.Once
var EmptyHexViewTimer *time.Timer
var EmptyStructViewTimer *time.Timer
var FieldCompleter *fields.TSharkFields // share this - safe once constructed
var FilterWidget *filter.Widget
var Fin *rossshark.Widget
var Goroutinewg *sync.WaitGroup
var Loader *pcap.PacketLoader
var Loadingw gowid.IWidget // "loading..."
var MissingMsgw gowid.IWidget // centered, holding singlePacketViewMsgHolder
var NoGlobalJump termshark.GlobalJumpPos // leave as default, like a placeholder
var PacketColors bool // global state in app
var PacketColorsSupported bool // global state in app - true if it's even possible
var QuitRequested bool // true if a quit has been issued, but not yet processed. Stops some handlers displaying errors.
var QuitRequestedChan chan struct{}
var Running bool // true if gowid/tcell is controlling the terminal
var SearchWidget *search.Widget
var StartUIChan chan struct{}
var StartUIOnce sync.Once
var StreamLoader *streams.Loader // DOC - one because it holds stream index state for pcap
var TemplateData map[string]interface{}
var Templates = template.Must(template.New("Help").Funcs(funcMap).Parse(`
{{define "NameVer"}}termshark {{.Version}}{{end}}
{{define "TsharkVer"}}using tshark {{.TsharkVersion}} (from {{.TsharkAbsolutePath}}){{end}}
{{define "OneLine"}}A wireshark-inspired terminal user interface for tshark. Analyze network traffic interactively from your terminal.{{end}}
{{define "Header"}}{{template "NameVer" .}}
{{template "OneLine"}}
See https://termshark.io for more information.{{end}}
{{define "Footer"}}
If --pass-thru is true (or auto, and stdout is not a tty), tshark will be
executed with the supplied command-line flags. You can provide
tshark-specific flags and they will be passed through to tshark (-n, -d, -T,
etc). For example:
$ termshark -r file.pcap -T psml -n | less{{end}}
{{define "UIUserGuide"}}{{.UserGuideURL}}
{{.CopyCommandMessage}}{{end}}
{{define "UIFAQ"}}{{.FAQURL}}
{{.CopyCommandMessage}}{{end}}
{{define "UIBug"}}{{.BugURL}}
{{.CopyCommandMessage}}{{end}}
{{define "UIFeature"}}{{.FeatureURL}}
{{.CopyCommandMessage}}{{end}}
{{define "UIHelp"}}{{template "NameVer" .}}
A wireshark-inspired tui for tshark. Analyze network traffic interactively from your terminal.
/__ - Go to display filter/stream search
q__ - Quit
tab - Switch panes
c__ - Switch to copy-mode
|__ - Cycle through pane layouts
\__ - Toggle pane zoom
esc - Activate menu
+/- - Adjust horizontal split
</> - Adjust vertical split
:__ - Activate cmdline mode (see help cmdline)
z__ - Maximize/restore any modal dialog
?__ - Display help
In the filter, type a wireshark display filter expression.
Most terminals will support using the mouse! Try clicking the Close button.
Use shift-left-mouse to copy and shift-right-mouse to paste.{{end}}
{{define "VimHelp"}}{{template "NameVer" .}}
Navigate the UI using vim-style keys.
hjkl___ - Move left/down/up/right in various views
gg_____ - Go to the top of the current table
G______ - Go to the bottom of the current table
5gg____ - Go to the 5th row of the table
C-w C-w - Switch panes (same as tab)
C-w_=__ - Equalize pane spacing
ma_____ - Mark current packet (use a through z)
'a_____ - Jump to packet marked 'a'
mA_____ - Mark current packet + pcap (use A through Z)
'A_____ - Jump to packet + pcap marked 'A'
''_____ - After a jump; jump back to prior packet
ZZ_____ - Quit without confirmation
See also help cmdline.{{end}}
{{define "CmdLineHelp"}}{{template "NameVer" .}}
Activate cmdline mode with the : key.
Hit tab to see and choose possible completions.
capinfo______ - Capture file properties
clear-filter_ - Clear the display filter and apply
clear-packets - Clear the current pcap
columns______ - Choose the columns to display
config_______ - Show termshark's config file (Unix-only)
convs________ - Open conversations view
filter_______ - Choose a display filter from recently-used
help_________ - Various help dialogs
load_________ - Load a pcap from the filesystem
logs_________ - Show termshark's log file (Unix-only)
map__________ - Map a keypress to a key sequence (see help map)
marks________ - Show file-local and global packet marks
menu_________ - Open the UI Misc menu
no-theme_____ - Clear theme for the current terminal color mode
profile______ - Profile actions - create, use, delete, etc
quit_________ - Quit termshark
recents______ - Load a pcap from those recently-used
set__________ - Set various config properties (see help set)
streams______ - Open stream reassembly view
theme________ - Choose a theme for the current terminal color mode
unmap________ - Remove a keypress mapping
wormhole_____ - Prepare to transfer the current pcap{{end}}
{{define "SetHelp"}}{{template "NameVer" .}}
Use the cmdline set command to change configuration.
Type :set and hit tab for options.
auto-scroll___________ - scroll during live captures
copy-timeout__________ - wait this long before failing a copy
dark-mode_____________ - enable or disable dark-mode
disable-shark-fin_____ - switch off the secret shark fin
packet-colors_________ - use colors in the packet list view
pager_________________ - pager (used for termshark's log file)
nopager_______________ - disable the pager (use PAGER instead)
suppress-tshark-errors - don't show tshark errors in the UI
term__________________ - make termshark assume this terminal type
noterm________________ - disable the terminal type (use TERM){{end}}
{{define "MapHelp"}}{{template "NameVer" .}}
Use the cmdline map command to set key macros e.g.
map <f1> ZZ - hit f1 key to quit
Use vim-style syntax for key-presses. Printable characters
represent themselves. Compound keys can be:
<space>
<esc>
<enter>
<f1>-<f12>
<C-s>, <A-/>
<up>, <down>, <left>, <right>
<pgup>, <pgdn>
<home>, <end>
Use the unmap command to remove a mapping.{{end}}
{{define "CopyModeHelp"}}{{template "NameVer" .}}
termshark is in copy-mode. You can press:
'q', 'c' - Exit copy-mode
ctrl-c__ - Copy from selected widget
left____ - Widen selection
right___ - Narrow selection
'?'_____ - Display copy-mode help
{{end}}
{{define "Marks"}}{{if not .Marks}}No local marks are set{{else}}Mark Packet Summary{{range $key, $value := .Marks }}
{{printf " %c" $key}}{{printf "%6d" $value.Pos}} {{printf "%s" $value.Summary}}{{end}}{{end}}
{{if not .GlobalMarks}}No cross-file marks are set{{else}}Mark Packet File Summary{{range $key, $value := .GlobalMarks }}
{{printf " %-4c" $key}} {{printf "%-7d" $value.Pos}}{{printf "%-18s" $value.Base}}{{printf "%s" $value.Summary}}{{end}}{{end}}{{end}}
{{define "Key Mappings"}}{{if .Maps.None}}No key mappings are set{{else}} From To {{range $mapping := .Maps.Get }}
{{printf " %-14v" $mapping.From}}{{printf "%v" $mapping.To}} {{end}}{{end}}
{{end}}
`))
var WriteToDeleted bool // true if the user deleted the temporary pcap before quitting
var WriteToSelected bool // true if the user provided the -w flag
Functions ¶
func ApplyAutoScroll ¶
don't claim the keypress
func ApplyCurrentProfile ¶
vp and vc guaranteed to be non-nil
func ApplyCurrentTheme ¶
func ClearProgressWidgetFor ¶
func ClearProgressWidgetFor(app gowid.IApp, owner WidgetOwner)
func ClosePleaseWait ¶
func ComputeConvFilterOp ¶
func ComputeConvFilterOp(dirOp FilterMask, comb FilterCombinator, model IFilterModel, curFilter string) string
func ComputeFilterCombOp ¶
func ComputeFilterCombOp(comb FilterCombinator, newFilter string, curFilter string) string
func EnsureTemplateData ¶
func EnsureTemplateData()
func IsProgressIndeterminate ¶
func IsProgressIndeterminate() bool
func IsTerminalLegible ¶
IsTerminalLegible will open up a dialog asking the user to confirm that their running termshark is legible, having upgraded the TERM variable to a 256-color version and restarted.
func MakeCheckGlobalJumpAfterPsml ¶
func MakeCheckGlobalJumpAfterPsml(jmp termshark.GlobalJumpPos) checkGlobalJumpAfterPsml
func MakeMenuNavigatingKeyPress ¶
func MakeMenuNavigatingKeyPress(left *NextMenu, right *NextMenu) appkeys.KeyInputFn
func MakeMenuWithHotKeys ¶
func MakeMenuWithHotKeys(items []SimpleMenuItem) gowid.IWidget
func MakePacketViewUpdater ¶
func MakePacketViewUpdater() updatePacketViews
func MakeUpdateCurrentCaptureInTitle ¶
func MakeUpdateCurrentCaptureInTitle() updateCurrentCaptureInTitle
func MaybeKeepThenRequestLoadPcap ¶
func MaybeKeepThenRequestLoadPcap(pcapf string, displayFilter string, jump termshark.GlobalJumpPos, app gowid.IApp)
MaybeKeepThenRequestLoadPcap loads a pcap after first checking to see whether the current load is a live load and the packets need to be kept.
func MenuNavigatingKeyPress ¶
func NewPsmlColumnsModel ¶
func NewPsmlColumnsModelFrom ¶
func NewPsmlTableRowWidget ¶
func NewPsmlTableRowWidget(w *rowFocusTableWidget, c []pcap.PacketColors) *psmlTableRowWidget
func NewRowFocusTableWidget ¶
func OpenLongMessage ¶
func OpenMessage ¶
func OpenMessageForCopy ¶
func OpenPleaseWait ¶
func OpenPleaseWait(container gowid.ISettableComposite, app gowid.IApp)
func OpenTemplatedDialog ¶
func OpenTemplatedDialogExt ¶
func OpenTemplatedDialogExt(container gowid.ISettableComposite, tmplName string, width gowid.IWidgetDimension, height gowid.IWidgetDimension, app gowid.IApp) *dialog.Widget
func RequestLoadInterfaces ¶
func RequestLoadPcap ¶
func RequestLoadPcap(pcapf string, displayFilter string, jump termshark.GlobalJumpPos, app gowid.IApp)
Call from app goroutine context
func RequestNewFilter ¶
func RequestQuit ¶
func RequestQuit()
func RequestReload ¶
func SetDarkMode ¶
func SetDarkMode(mode bool)
func SetProgressDeterminateFor ¶
func SetProgressDeterminateFor(app gowid.IApp, owner WidgetOwner)
func SetProgressIndeterminateFor ¶
func SetProgressIndeterminateFor(app gowid.IApp, owner WidgetOwner)
func SetProgressWidget ¶
func SetProgressWidgetCustom ¶
func SetProgressWidgetCustom(app gowid.IApp, c *columns.Widget, owner WidgetOwner)
func SetSearchProgressWidget ¶
func SetupColors ¶
func SetupColors()
func StopEmptyHexViewTimer ¶
func StopEmptyHexViewTimer()
func StopEmptyStructViewTimer ¶
func StopEmptyStructViewTimer()
func SuggestSwitchingTerm ¶
SuggestSwitchingTerm will open a dialog asking the user if they would like to try a more colorful TERM setting.
func UpdateProfileWidget ¶
func UpdateProgressBarForFile ¶
Runs in app goroutine
func UpdateProgressBarForInterface ¶
func UpdateProgressBarForInterface(c *pcap.InterfaceLoader, app gowid.IApp)
Runs in app goroutine
func UpdateRecentMenu ¶
func WriteTsharkVersion ¶
Types ¶
type BytesResult ¶
BytesResult represents a match for a search within the bytes of the packets loaded. A match is a packet number, and the position within the byte array representing the packet's data.
func (BytesResult) PacketNumber ¶
func (s BytesResult) PacketNumber() int
type BytesSearchCallbacks ¶
type BytesSearchCallbacks struct {
*SearchStopper
// contains filtered or unexported fields
}
Search in the packet hex view
func (*BytesSearchCallbacks) Reset ¶
func (w *BytesSearchCallbacks) Reset(app gowid.IApp)
func (*BytesSearchCallbacks) SearchPacketsFrom ¶
func (w *BytesSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
own goroutine startPacketNumber >= 1
func (*BytesSearchCallbacks) SearchPacketsResult ¶
func (s *BytesSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
func (*BytesSearchCallbacks) StartingPosition ¶
func (w *BytesSearchCallbacks) StartingPosition() (interface{}, error)
type CancelledMessage ¶
type CancelledMessage struct{}
func (CancelledMessage) AfterEnd ¶
func (t CancelledMessage) AfterEnd(code pcap.HandlerCode, app gowid.IApp)
type ClearMarksHandler ¶
type ClearMarksHandler struct{}
type ClearWormholeState ¶
type ClearWormholeState struct{}
func (ClearWormholeState) OnNewSource ¶
func (t ClearWormholeState) OnNewSource(code pcap.HandlerCode, app gowid.IApp)
type ConvsModel ¶
func (ConvsModel) GetAFilter ¶
func (m ConvsModel) GetAFilter(row int, dir Direction) string
func (ConvsModel) GetBFilter ¶
func (m ConvsModel) GetBFilter(row int, dir Direction) string
type ConvsUiOptions ¶
type ConvsUiWidget ¶
func NewConvsUi ¶
func NewConvsUi(captureDevice string, displayFilter string, pcapf string, pw IPleaseWait, opts ...ConvsUiOptions) *ConvsUiWidget
func (*ConvsUiWidget) AbsoluteTime ¶
func (w *ConvsUiWidget) AbsoluteTime() bool
func (*ConvsUiWidget) Context ¶
func (w *ConvsUiWidget) Context() context.Context
func (*ConvsUiWidget) FilterValue ¶
func (w *ConvsUiWidget) FilterValue() string
func (*ConvsUiWidget) OnCancel ¶
func (w *ConvsUiWidget) OnCancel(app gowid.IApp)
func (*ConvsUiWidget) ReloadNeeded ¶
func (w *ConvsUiWidget) ReloadNeeded()
func (*ConvsUiWidget) Render ¶
func (w *ConvsUiWidget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
func (*ConvsUiWidget) ResolveNames ¶
func (w *ConvsUiWidget) ResolveNames() bool
func (*ConvsUiWidget) SetAbsoluteTime ¶
func (w *ConvsUiWidget) SetAbsoluteTime(val bool)
func (*ConvsUiWidget) SetResolveNames ¶
func (w *ConvsUiWidget) SetResolveNames(val bool)
func (*ConvsUiWidget) SetUseFilter ¶
func (w *ConvsUiWidget) SetUseFilter(val bool)
func (*ConvsUiWidget) UseFilter ¶
func (w *ConvsUiWidget) UseFilter() bool
type CsvTableCopier ¶
type CsvTableCopier struct {
// contains filtered or unexported fields
}
func (CsvTableCopier) CopyRow ¶
func (c CsvTableCopier) CopyRow(id table.RowId) []gowid.ICopyResult
func (CsvTableCopier) CopyTable ¶
func (c CsvTableCopier) CopyTable() []gowid.ICopyResult
type FilterCombinator ¶
type FilterCombinator int
const ( Selected FilterCombinator = 0 NotSelected FilterCombinator = iota AndSelected FilterCombinator = iota OrSelected FilterCombinator = iota AndNotSelected FilterCombinator = iota OrNotSelected FilterCombinator = iota )
type FilterMask ¶
type FilterMask int
const ( AtfB FilterMask = 0 AtB FilterMask = iota BtA FilterMask = iota AtfAny FilterMask = iota AtAny FilterMask = iota AnytA FilterMask = iota AnytfB FilterMask = iota AnytB FilterMask = iota BtAny FilterMask = iota )
type FilterResult ¶
type FilterResult struct {
PacketNum int
}
FilterResult represents a match via a display filter search. This is no more specific than a packet/frame number to jump to.
func (FilterResult) PacketNumber ¶
func (s FilterResult) PacketNumber() int
type FilterSearchCallbacks ¶
type FilterSearchCallbacks struct {
// contains filtered or unexported fields
}
Search via a display filter
func NewFilterSearchCallbacks ¶
func NewFilterSearchCallbacks( callbacks *commonSearchCallbacks, searchCh chan search.IntermediateResult) *FilterSearchCallbacks
func (*FilterSearchCallbacks) RequestStop ¶
func (w *FilterSearchCallbacks) RequestStop(app gowid.IApp)
func (*FilterSearchCallbacks) Reset ¶
func (w *FilterSearchCallbacks) Reset(app gowid.IApp)
func (*FilterSearchCallbacks) SearchPacketsFrom ¶
func (w *FilterSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
startPacketNumber >= 1
func (*FilterSearchCallbacks) SearchPacketsResult ¶
func (s *FilterSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
func (*FilterSearchCallbacks) StartingPosition ¶
func (w *FilterSearchCallbacks) StartingPosition() (interface{}, error)
type IFilterBuilder ¶
type IFilterBuilder interface {
fmt.Stringer
FilterFrom(vals ...string) string
FilterTo(vals ...string) string
FilterAny(vals ...string) string
AIndex() []int
BIndex() []int
}
Use to construct a string like "ip.addr == 1.2.3.4 && tcp.port == 12345"
type IFilterModel ¶
type IOnDataSync ¶
type IPleaseWait ¶
type ListResult ¶
ListResult represents a match for a search within the packet list view. This is really just the PSML already generated by tshark. The result is a packet number and a column; on a match, the packet list view will be updated to show the matched row and column.
func (ListResult) PacketNumber ¶
func (s ListResult) PacketNumber() int
type ListSearchCallbacks ¶
type ListSearchCallbacks struct {
*SearchStopper
// contains filtered or unexported fields
}
Search in the packet list view: 1 0.000000 10.44.10.228 8.8.4.4 DNS 77 Standard query 0x51fe A ac.duckduckgo.com 2 0.024306 10.44.10.228 176.103.130. DNS 77 Standard query 0x51fe A ac.duckduckgo.com 3 0.024875 8.8.4.4 10.44.10.228 DNS 139 Standard query response 0x51fe A ac.duckduckgo.com CNAME 4 0.025500 10.44.10.228 184.72.104.1 TCP 66 55408 → 443 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 S 0
func (*ListSearchCallbacks) Reset ¶
func (w *ListSearchCallbacks) Reset(app gowid.IApp)
func (*ListSearchCallbacks) SearchPacketsFrom ¶
func (w *ListSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
own goroutine startPacketNumber >= 1
func (*ListSearchCallbacks) SearchPacketsResult ¶
func (s *ListSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
func (*ListSearchCallbacks) StartingPosition ¶
func (w *ListSearchCallbacks) StartingPosition() (interface{}, error)
type LoadResult ¶
type LoadResult struct {
// contains filtered or unexported fields
}
type ManageCapinfoCache ¶
type ManageCapinfoCache struct{}
func (ManageCapinfoCache) OnClear ¶
func (t ManageCapinfoCache) OnClear(pcap.HandlerCode, gowid.IApp)
func (ManageCapinfoCache) OnNewSource ¶
func (t ManageCapinfoCache) OnNewSource(pcap.HandlerCode, gowid.IApp)
Make sure that existing stream widgets are discarded if the user loads a new pcap.
type ManageConvsCache ¶
type ManageConvsCache struct{}
func (ManageConvsCache) OnNewSource ¶
func (t ManageConvsCache) OnNewSource(pcap.HandlerCode, gowid.IApp)
Make sure that existing data is discarded if the user loads a new pcap.
type ManageSearchData ¶
type ManageSearchData struct{}
func (ManageSearchData) OnClear ¶
func (t ManageSearchData) OnClear(c pcap.HandlerCode, app gowid.IApp)
func (ManageSearchData) OnNewSource ¶
func (t ManageSearchData) OnNewSource(c pcap.HandlerCode, app gowid.IApp)
Make sure that existing stream widgets are discarded if the user loads a new pcap.
type ManageStreamCache ¶
type ManageStreamCache struct{}
func (ManageStreamCache) OnClear ¶
func (t ManageStreamCache) OnClear(pcap.HandlerCode, gowid.IApp)
func (ManageStreamCache) OnNewSource ¶
func (t ManageStreamCache) OnNewSource(pcap.HandlerCode, gowid.IApp)
Make sure that existing stream widgets are discarded if the user loads a new pcap.
type MenuHolder ¶
type MenuHolder struct {
gowid.IMenuCompatible
}
type MultiMenuOpener ¶
type MultiMenuOpener struct {
// contains filtered or unexported fields
}
type NoHandlers ¶
type NoHandlers struct{}
type OpenErrorDialog ¶
type OpenErrorDialog struct{}
type PacketSearcher ¶
type PacketSearcher struct {
// contains filtered or unexported fields
}
PacketSearcher coordinates a packet search and communicates results back from the search implementations via resultChan.
func (*PacketSearcher) SearchPackets ¶
func (w *PacketSearcher) SearchPackets(term search.INeedle, cbs search.ICallbacks, app gowid.IApp)
SearchPackets looks for the given search term in the currently loaded packets. It is written generically, with the specifics of the packet details to be searched provided by a set of callbacks. These give the search algorithm the starting position, the mechanics of the search, and so on. An instance of a search can return a matching position, or a value indicating that the algorithm needs to wait until packet data is available (e.g. if PDML data needs to be searched but is not currently loaded). If a match is found, the callbacks also determine how to update the UI to represent the match.
type PaletteSwitcher ¶
func (PaletteSwitcher) CellStyler ¶
func (p PaletteSwitcher) CellStyler(name string) (gowid.ICellStyler, bool)
func (PaletteSwitcher) RangeOverPalette ¶
func (p PaletteSwitcher) RangeOverPalette(f func(key string, value gowid.ICellStyler) bool)
type Prog ¶
type Prog struct {
// contains filtered or unexported fields
}
Prog hold a progress model - a current value on the way up to the max value
type RenderRatioUpTo ¶
type RenderRatioUpTo struct {
gowid.RenderWithRatio
// contains filtered or unexported fields
}
func (RenderRatioUpTo) MaxUnits ¶
func (r RenderRatioUpTo) MaxUnits() int
func (RenderRatioUpTo) String ¶
func (r RenderRatioUpTo) String() string
type RenderWeightUpTo ¶
type RenderWeightUpTo struct {
gowid.RenderWithWeight
// contains filtered or unexported fields
}
func (RenderWeightUpTo) MaxUnits ¶
func (s RenderWeightUpTo) MaxUnits() int
type SaveRecents ¶
func MakeSaveRecents ¶
func MakeSaveRecents(pcap string, filter string) SaveRecents
func (SaveRecents) BeforeBegin ¶
func (t SaveRecents) BeforeBegin(code pcap.HandlerCode, app gowid.IApp)
type SearchStopper ¶
func (*SearchStopper) DoIfStopped ¶
func (s *SearchStopper) DoIfStopped(f func())
func (*SearchStopper) RequestStop ¶
func (s *SearchStopper) RequestStop(app gowid.IApp)
type SetStructWidgets ¶
type SetStructWidgets struct {
Ld *pcap.PacketLoader
}
used for the pdml loader
func (SetStructWidgets) AfterEnd ¶
func (s SetStructWidgets) AfterEnd(code pcap.HandlerCode, app gowid.IApp)
Close the channel before the callback. When the global loader state is idle, app.Quit() will stop accepting app callbacks, so the goroutine that waits for ch to be closed will never terminate.
func (SetStructWidgets) BeforeBegin ¶
func (s SetStructWidgets) BeforeBegin(code pcap.HandlerCode, app gowid.IApp)
func (SetStructWidgets) OnError ¶
func (s SetStructWidgets) OnError(code pcap.HandlerCode, app gowid.IApp, err error)
type SimpleErrors ¶
type SimpleErrors struct{}
func (SimpleErrors) OnError ¶
func (t SimpleErrors) OnError(code pcap.HandlerCode, app gowid.IApp, err error)
type SimpleMenuItem ¶
type SimpleMenuItem struct {
Txt string
Key gowid.IKey
CB gowid.WidgetChangedFunction
}
func MakeMenuDivider ¶
func MakeMenuDivider() SimpleMenuItem
type StartUIWhenThereArePackets ¶
type StartUIWhenThereArePackets struct{}
func (StartUIWhenThereArePackets) OnPsmlHeader ¶
func (t StartUIWhenThereArePackets) OnPsmlHeader(code pcap.HandlerCode, app gowid.IApp)
type StructResult ¶
StructResult represents a match for a search within the packet structure. The result is a specific location in the packet struct model. The UI will be updated to show this match, expanded, when a search succeeds.
func (StructResult) PacketNumber ¶
func (s StructResult) PacketNumber() int
type StructSearchCallbacks ¶
type StructSearchCallbacks struct {
*SearchStopper
// contains filtered or unexported fields
}
Search in the packet struct view:
<proto name="ip" showname="Internet Protocol Version 4, Src: 10.215.173.1, Dst: 64.13.139.230" size="20" pos="0">
<field name="ip.version" showname="0100 .... = Version: 4" size="1" pos="0" show="4" value="45"/> <field name="ip.hdr_len" showname=".... 0101 = Header Length: 20 bytes (5)" size="1" pos="0" show="20" value="45"/> <field name="ip.dsfield" showname="Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)" size="1" pos="1" show="0x00000000" value="00"> <field name="ip.dsfield.dscp" showname="0000 00.. = Differentiated Services Codepoint: Default (0)" size="1" pos="1" show="0" value="0" unmaskedvalue="00"/> <field name="ip.dsfield.ecn" showname=".... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)" size="1" pos="1" show="0" value="0" unmaskedvalue="00"/> </field>
func (*StructSearchCallbacks) CheckNode ¶
CheckNode is provided to implement ISearchPred for the gowid tree's depth first search.
func (*StructSearchCallbacks) Reset ¶
func (w *StructSearchCallbacks) Reset(app gowid.IApp)
func (*StructSearchCallbacks) SearchPacketsFrom ¶
func (w *StructSearchCallbacks) SearchPacketsFrom(ifrom interface{}, istart interface{}, term search.INeedle, app gowid.IApp)
own goroutine startPacketNumber >= 1
func (*StructSearchCallbacks) SearchPacketsResult ¶
func (s *StructSearchCallbacks) SearchPacketsResult(res search.Result, app gowid.IApp)
func (*StructSearchCallbacks) StartingPosition ¶
func (w *StructSearchCallbacks) StartingPosition() (interface{}, error)
Source Files
¶
- capinfoui.go
- convscallbacks.go
- convsui.go
- darkmode.go
- dialog.go
- filterconvs.go
- lastline.go
- logsui.go
- menu.go
- messages.go
- newprofile.go
- palette.go
- prochandlers.go
- psmlcols.go
- psmlcolsmodel.go
- searchalg.go
- searchbyfilter.go
- searchcommon.go
- searchpktbytes.go
- searchpktlist.go
- searchpktstruct.go
- streamui.go
- switchterm.go
- ui.go
- wormhole.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package menuutil contains user-interface functions and helpers for termshark.
|
Package menuutil contains user-interface functions and helpers for termshark. |
|
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 |