parser

package
v0.0.0-...-8951dca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIPLayer          = errors.New("ipLayer is nil")
	ErrTransportLayer   = errors.New("transport layer is nil")
	ErrApplicationLayer = errors.New("application layer is nil")
)

Functions

This section is empty.

Types

type ParsedPacket

type ParsedPacket struct {
	ID            int
	Timestamp     string
	SrcIP         string
	DstIP         string
	SrcPort       string
	DstPort       string
	Protocol      string
	Payload       []byte
	PayloadLenght int
}

type ParsedPacketStorage

type ParsedPacketStorage interface {
	Save(parsedPacket *ParsedPacket) error
	FindByID(id string) (*ParsedPacket, error)
	FindAll() ([]*ParsedPacket, error)
	DeleteByID(id string) error
	Count() (int, error)
}

type Parser

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

func NewParser

func NewParser(storage ParsedPacketStorage) *Parser

func (*Parser) Listen

func (p *Parser) Listen(chPackets chan gopacket.Packet, chPP chan *ParsedPacket, chInfo chan cli.Info)

func (*Parser) ParsePacket

func (p *Parser) ParsePacket(packet gopacket.Packet) (*ParsedPacket, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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