Documentation
¶
Overview ¶
Package pdmltree contains a type used as the model for a PDML document for a packet, and associated functions.
Index ¶
- type EmptyIterator
- type ExpandedIterator
- type ExpandedModel
- type ExpandedPaths
- type Iterator
- type Model
- func (p *Model) ApplyExpandedPaths(exp *ExpandedPaths)
- func (p *Model) Children() tree.IIterator
- func (m *Model) ExpandByPosition(pos *tree.TreePos)
- func (p *Model) HasChildren() bool
- func (n *Model) HexLayers(pos int, includeFirst bool) []hexdumper2.LayerStyler
- func (p *Model) IsCollapsed() bool
- func (p *Model) Leaf() string
- func (p *Model) MakeParentLinks(exp *ExpandedPaths)
- func (p *Model) PathToRoot() []string
- func (p *Model) SetCollapsed(app gowid.IApp, isCollapsed bool)
- func (p *Model) String() string
- func (p *Model) TCPStreamIndex() gwutil.IntOption
- func (p *Model) UDPStreamIndex() gwutil.IntOption
- func (n *Model) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
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.
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 ¶
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) ExpandByPosition ¶
Note that this expands every node along the way to the position cf expandByPath which only expands the leaf node
func (*Model) HasChildren ¶
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 (*Model) MakeParentLinks ¶
func (p *Model) MakeParentLinks(exp *ExpandedPaths)
func (*Model) PathToRoot ¶
func (*Model) TCPStreamIndex ¶
func (*Model) UDPStreamIndex ¶
func (*Model) UnmarshalXML ¶
Implement xml.Unmarshaler. Create a Model struct by unmarshaling the provided XML. Takes special action before deferring to DecodeElement.