streamwidget

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

Package streamwidget provides a very specific stream reassembly termshark widget. This is probably not much use generally, but is separated out to ease testing. It is intended to render as mostly full screen, with a title bar, the main view showing the reassembled stream, and controls at the bottom.

Index

Constants

This section is empty.

Variables

View Source
var PacketRowNotLoadedError = fmt.Errorf("The packet is not yet loaded.")

Functions

func MakeConvMenu

func MakeConvMenu(opener menu.IOpener) (*holder.Widget, *menu.Widget)

Types

type ConversationFilter

type ConversationFilter int
const (
	Entire     ConversationFilter = 0
	ClientOnly ConversationFilter = iota
	ServerOnly ConversationFilter = iota
)

type Data

type Data struct {
	// contains filtered or unexported fields
}

Represents all the streamed data

type DisplayFormat

type DisplayFormat int
const (
	Hex   DisplayFormat = 0
	Ascii DisplayFormat = iota
	Raw   DisplayFormat = iota
)

type IChunkClicked

type IChunkClicked interface {
	OnPacketClicked(pkt int, app gowid.IApp) error
	HandleError(row table.RowId, err error, app gowid.IApp)
}

Supplied by user of widget - what UI changes to make when packet is clicked

type IFilterOut

type IFilterOut interface {
	PreviousFilter() string
	DisplayFilter() string
}

type IOnError

type IOnError interface {
	OnError(msg string, app gowid.IApp)
}

type Options

type Options struct {
	DefaultDisplay func() DisplayFormat         // Start in ascii, hex, raw
	FilterOutFunc  func(IFilterOut, gowid.IApp) // UI changes to run when user clicks "filter out" button
	PreviousFilter string                       // so if we filter out, we can do "Previous and (! tcp.stream eq 0)"
	ChunkClicker   IChunkClicked                // UI changes to make when stream chunk in table is clicked
	ErrorHandler   IOnError                     // UI action to take on error
	CopyModeWidget gowid.IWidget                // What to display when copy-mode is started.
	MenuOpener     menu.IOpener                 // For integrating with UI app - the menu needs to be told what's underneath when opened
}

type ViewData

type ViewData struct {
	// contains filtered or unexported fields
}

Represents the view of the data from either both sides, client side or server side

type Widget

type Widget struct {
	gowid.IWidget

	Proto streams.Protocol // TCP, UDP
	// contains filtered or unexported fields
}

func New

func New(displayFilter string, captureDevice string, proto streams.Protocol,
	convMenu *menu.Widget, convMenuHolder *holder.Widget, keyState *termshark.KeyState,
	opts ...Options) *Widget

func (*Widget) AddChunkEntire

func (w *Widget) AddChunkEntire(ch streams.IChunk, app gowid.IApp)

func (*Widget) AddHeader

func (w *Widget) AddHeader(hdr streams.FollowHeader, app gowid.IApp)

func (*Widget) DisplayFilter

func (w *Widget) DisplayFilter() string

func (*Widget) Finished

func (w *Widget) Finished() bool

func (*Widget) GoToMiddle

func (w *Widget) GoToMiddle(app gowid.IApp)

func (*Widget) MapChunkToTableRow

func (w *Widget) MapChunkToTableRow(chunk int) (int, error)

func (*Widget) NumChunks

func (w *Widget) NumChunks() int

func (*Widget) PreviousFilter

func (w *Widget) PreviousFilter() string

func (*Widget) SetCurrentRow

func (w *Widget) SetCurrentRow(row table.Position)

func (*Widget) SetFinished

func (w *Widget) SetFinished(f bool)

func (*Widget) SetFocusOnChunksIfPossible

func (w *Widget) SetFocusOnChunksIfPossible(app gowid.IApp)

func (*Widget) String

func (w *Widget) String() string

func (*Widget) TrackPayloadPacket

func (w *Widget) TrackPayloadPacket(packet int)

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Jump to

Keyboard shortcuts

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