Documentation ¶
Overview ¶
Package packets searches for a string in a TCP/UDP packet
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNonTCPUDPPacket = errors.New("not a tcp or a UDP packet") ErrEmptyStringMatch = errors.New("empty string can not be matched against the packet data") ErrNilPacket = errors.New("nil packet sent for matching") )
Sentinel errors for various scenarios
Functions ¶
This section is empty.
Types ¶
type PacketData ¶
type PacketData interface {
LayerPayload() []byte
}
PacketData is an interface that defines the methods required to process TCP or UDP layer
type StringPacketFinder ¶
type StringPacketFinder interface { FindStringInTCPOrUDPPacket( ctx context.Context, gp gopacket.Packet, searchString string, ) (bool, error) }
StringPacketFinder - Searches for a string in a TCP or UDP packet
type StringSearchService ¶
type StringSearchService struct {
Log *zap.SugaredLogger
}
StringSearchService - Exposes the Packet capture service
func NewStringSearchService ¶ added in v1.1.4
func NewStringSearchService(log *zap.SugaredLogger) *StringSearchService
NewStringSearchService - returns a new instance of the StringSearchService
func (*StringSearchService) FindStringInTCPOrUDPPacket ¶
func (svc *StringSearchService) FindStringInTCPOrUDPPacket( ctx context.Context, gp gopacket.Packet, searchString string, ) (bool, error)
FindStringInTCPOrUDPPacket - processes TCP or UDP packets and checks if the data payload contains a string
Click to show internal directories.
Click to hide internal directories.