Documentation ¶
Overview ¶
Package pdump implements a packet dumper.
Index ¶
Constants ¶
const ( // MaxNames is the maximum number of name filters. MaxNames = 4 // WriterBurstSize is the burst size in the writer. WriterBurstSize = 64 // NgTypeSHB is PCAPNG section header block type. NgTypeSHB = 0x0A0D0D0A // NgTypeIDB is PCAPNG interface description block type. NgTypeIDB = 0x00000001 // NgTypeIDB is PCAPNG enhanced packet block type. NgTypeEPB = 0x00000006 // MbufTypeRaw indicates mbuf should be written unchanged. MbufTypeRaw = 0xF0010000 // MbufTypeSLL indicates mbuf should be written with SLL header. MbufTypeSLL = 0xF0020000 )
const ( MinFileSize = 1 << 16 DefaultFileSize = 1 << 24 )
Limits and defaults.
const Role = "PDUMP"
Role is writer thread role name.
Variables ¶
var ( GqlDirectionEnum *graphql.Enum GqlEthGrabEnum *graphql.Enum GqlNameFilterEntryInput *graphql.InputObject GqlNameFilterEntryType *graphql.Object GqlWriterType *gqlserver.NodeType[*Writer] GqlFaceSourceType *gqlserver.NodeType[*FaceSource] GqlEthPortSourceType *gqlserver.NodeType[*EthPortSource] GqlSourceType *graphql.Union )
GraphQL types.
var ( // GqlLCore is the LCore used for writer created via GraphQL. GqlLCore eal.LCore )
Functions ¶
This section is empty.
Types ¶
type EthGrab ¶
type EthGrab string
EthGrab indicates an opportunity to grab packets from Ethernet port.
const (
EthGrabRxUnmatched EthGrab = "RxUnmatched"
)
EthGrab values.
type EthPortConfig ¶
type EthPortConfig struct { Writer *Writer Port *ethport.Port Grab EthGrab // contains filtered or unexported fields }
EthPortConfig contains EthPortSource configuration.
type EthPortSource ¶
type EthPortSource struct { EthPortConfig // contains filtered or unexported fields }
EthPortSource is a packet dump source attached to an Ethernet port on a grab opportunity.
func NewEthPortSource ¶
func NewEthPortSource(cfg EthPortConfig) (s *EthPortSource, e error)
NewEthPortSource creates a EthPortSource.
type FaceConfig ¶
type FaceConfig struct { Writer *Writer Face iface.Face Dir Direction Names []NameFilterEntry }
FaceConfig contains FaceSource configuration.
type FaceSource ¶
type FaceSource struct { FaceConfig // contains filtered or unexported fields }
FaceSource is a packet dump source attached to a face on a single direction.
func NewFaceSource ¶
func NewFaceSource(cfg FaceConfig) (s *FaceSource, e error)
NewFaceSource creates a FaceSource.
type NameFilterEntry ¶
type NameFilterEntry struct { Name ndn.Name `json:"name" gqldesc:"NDN name prefix."` SampleProbability float64 `json:"sampleProbability" gqldesc:"Sample probability between 0.0 and 1.0." gqldflt:"1.0"` }
NameFilterEntry matches a name prefix and specifies its sample rate. An empty name matches all packets.
type Writer ¶
type Writer struct { ealthread.ThreadWithCtrl // contains filtered or unexported fields }
Writer is a packet dump writer thread.
func NewWriter ¶
func NewWriter(cfg WriterConfig) (w *Writer, e error)
NewWriter creates a pdump writer thread.
func (*Writer) ThreadRole ¶
ThreadRole implements ealthread.ThreadWithRole interface.
type WriterConfig ¶
type WriterConfig struct { Filename string MaxSize int RingCapacity int Socket eal.NumaSocket }
WriterConfig contains writer configuration.