Documentation ¶
Overview ¶
Package pcapng implements a pcapng stream editor which edits the first Section Header Block (SHB), inserting additional meta data as comments.
Index ¶
Constants ¶
const ( // OptEndofOpt signals the end of options. OptEndofOpt = uint16(0) // OptComment contains a comment in form of an UTF-8 string. OptComment = uint16(1) // OptSHBHardware contains the description of the hardware used to create this // section, in form of an UTF-8 string. OptSHBHardware = uint16(2) // OptSHBOS contains the name of the operating system used to create this // section, in form of an UTF-8 string. OptSHBOS = uint16(3) // OptSHBUserAppl contains the name of the application used to create this // section, in form of an UTF-8 string. OptSHBUserAppl = uint16(4) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
UID string `yaml:"uid,omitempty"`
}
ClusterInfo represents the cluster information to be added to the capture comments of a packet capture stream.
type ContainerInfo ¶
type ContainerInfo struct { ContainerName string `yaml:"container-name"` ContainerType string `yaml:"container-type"` NodeName string `yaml:"node-name"` *ClusterInfo `yaml:"cluster,omitempty"` CaptureFilter string `yaml:"capture-filter,omitempty"` NoProm bool `yaml:"no-promiscuous-mode,omitempty"` }
ContainerInfo represents the container information to be added to the capture comments of a packet capture stream.
type Option ¶
Option represents a pcapng option, consisting of a Code uniquely identifying the type of option, as well as its (binary) value in form of an octet string.
func NewOption ¶
NewOption returns a new pcapng Option read from the buffer using the given endianness, as well as the number of octets to skip over to arrive at the next option. If the last option is reached, then nil is returned, together with the amount of octets to skip past the end-of-options mark.
type StreamEditor ¶
StreamEditor allows editing the first section header block (SHB) of a pcapng packet capture stream.
func NewStreamEditor ¶
func NewStreamEditor(sink io.Writer, container *api.Target, captureFilter string, noProm bool) *StreamEditor
NewStreamEditor returns a new pcapng packet stream data editor, connected to the specified writer (which can be a pipe, file, et cetera).