pdmltree

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: 13 Imported by: 0

Documentation

Overview

Package pdmltree contains a type used as the model for a PDML document for a packet, and associated functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyIterator

type EmptyIterator struct{}

func (EmptyIterator) Next

func (e EmptyIterator) Next() bool

func (EmptyIterator) Value

func (e EmptyIterator) Value() tree.IModel

type ExpandedIterator

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

pos points one head, so logically is -1 on init, but I use zero so the go default init makes sense.

func (*ExpandedIterator) Next

func (p *ExpandedIterator) Next() bool

func (*ExpandedIterator) Value

func (p *ExpandedIterator) Value() tree.IModel

type ExpandedModel

type ExpandedModel Model

func (*ExpandedModel) Children

func (p *ExpandedModel) Children() tree.IIterator

func (*ExpandedModel) Leaf

func (p *ExpandedModel) Leaf() string

func (*ExpandedModel) String

func (p *ExpandedModel) String() string

type ExpandedPaths

type ExpandedPaths [][]string

type Iterator

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

pos points one head, so logically is -1 on init, but I use zero so the go default init makes sense.

func (*Iterator) Next

func (p *Iterator) Next() bool

func (*Iterator) Value

func (p *Iterator) Value() tree.IModel

type Model

type Model struct {
	UiName         string            `xml:"-"`
	Name           string            `xml:"-"` // needed for stripping geninfo from UI
	Expanded       bool              `xml:"-"`
	Pos            int               `xml:"-"`
	Size           int               `xml:"-"`
	Show           string            `xml:"-"`
	Hide           bool              `xml:"-"`
	Children_      []*Model          `xml:",any"`
	Content        []byte            `xml:",innerxml"` // needed for copying PDML to clipboard
	NodeName       string            `xml:"-"`
	Attrs          map[string]string `xml:"-"`
	QueryModel     *xmlquery.Node    `xml:"-"`
	Parent         *Model            `xml:"-"`
	ExpandedFields *ExpandedPaths    `xml:"-"`
}

Model is a struct model of the PDML proto or field element.

func DecodePacket

func DecodePacket(data []byte) *Model

Make a *Model from the slice of bytes, and expand nodes according to the map parameter.

func (*Model) ApplyExpandedPaths

func (p *Model) ApplyExpandedPaths(exp *ExpandedPaths)

func (*Model) Children

func (p *Model) Children() tree.IIterator

func (*Model) ExpandByPosition

func (m *Model) ExpandByPosition(pos *tree.TreePos)

Note that this expands every node along the way to the position cf expandByPath which only expands the leaf node

func (*Model) HasChildren

func (p *Model) HasChildren() bool

func (*Model) HexLayers

func (n *Model) HexLayers(pos int, includeFirst bool) []hexdumper2.LayerStyler

This ignores the first child, "Frame 15", because its range covers the whole packet which results in me always including that in the layers for any position.

func (*Model) IsCollapsed

func (p *Model) IsCollapsed() bool

func (*Model) Leaf

func (p *Model) Leaf() string
func (p *Model) MakeParentLinks(exp *ExpandedPaths)

func (*Model) PathToRoot

func (p *Model) PathToRoot() []string

func (*Model) SetCollapsed

func (p *Model) SetCollapsed(app gowid.IApp, isCollapsed bool)

func (*Model) String

func (p *Model) String() string

func (*Model) TCPStreamIndex

func (p *Model) TCPStreamIndex() gwutil.IntOption

func (*Model) UDPStreamIndex

func (p *Model) UDPStreamIndex() gwutil.IntOption

func (*Model) UnmarshalXML

func (n *Model) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Implement xml.Unmarshaler. Create a Model struct by unmarshaling the provided XML. Takes special action before deferring to DecodeElement.

Jump to

Keyboard shortcuts

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