parser

package
v0.0.0-...-ece9af3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	CurrentSession uint64
	Sessions       map[uint64]Session
	Domains        map[string]string
}

Parser describes the parser object.

func NewParser

func NewParser() *Parser

NewParser returns a new Parser object.

func (*Parser) GetSession

func (p *Parser) GetSession() (Session, error)

GetSession returns the Session object corresponding to Parser.CurrentSession. Returns an error if no Session object is found.

func (*Parser) Parse

func (p *Parser) Parse(path string) error

Parse takes a file path to a PCAP/PCAPNG file and extract the content into the Parser.Sessions attribute.

type Session

type Session struct {
	Packets    []gopacket.Packet
	Transport  string
	SourceIP   string
	DestIP     string
	SourcePort string
	DestPort   string
	DomainSrc  string
	DomainDst  string
	TimeStamp  time.Time
}

Session describes the session object.

func (*Session) Summary

func (s *Session) Summary()

Summary prints a summary of the current Session.

Jump to

Keyboard shortcuts

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