Documentation ¶
Index ¶
- Constants
- type Buckets
- type Conf
- type Hamburg
- type Lua
- type Parser
- func (s *Parser) GetLayers(pkt gopacket.Packet) string
- func (s *Parser) ParseEthernetLayer(pkt gopacket.Packet) *layers.Ethernet
- func (s *Parser) ParseIPLayer(pkt gopacket.Packet) *layers.IPv4
- func (s *Parser) ParseTCPLayer(pkt gopacket.Packet) *layers.TCP
- func (s *Parser) ParseUDPLayer(pkt gopacket.Packet) *layers.UDP
- func (s *Parser) Run(v *p.Packet)
- func (s *Parser) RunScript(pkt *p.Packet) error
- func (s *Parser) UnpackLayers(gop *gopacket.Packet) *p.Packet
- type Sniffer
- type StatPair
- type State
Constants ¶
View Source
const ( SignalExit = 1 TimeoutExit = 2 )
Flags for exit
View Source
const ( TCP = "TCP" UDP = "UDP" )
Protocol type
View Source
const ( FIN = 0x01 SYN = 0x02 RST = 0x04 PSH = 0x08 ACK = 0x10 URG = 0x20 ECE = 0x40 CWR = 0x80 )
Flags for tcp
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buckets ¶
type Buckets struct {
// contains filtered or unexported fields
}
Buckets time-consuming interval statistics block
type Conf ¶
type Conf struct { InterFile string // Network interface or offline pcap file Outfile string // Save the capture packet file FilterIPs string // Filtering IPs in packets FilterPorts string // Filtering Ports in packets FilterCustom string // Custom filtering rules Protocol string // Application layer protocol of data packet Script string // Lua script for parsing packets SlowThreshold int64 // Threshold for slow requests Duration int64 // Time of continuous data capture ShowReply bool // Whether to display the content of the reply packet SnapLen int // Capture the data length of the packet ReadTimeout int64 // Timeout for reading packets from NIC Promisc bool // Whether to use promisc mode to monitor packets }
Conf conf
type Hamburg ¶
Hamburg main
func (*Hamburg) ParsePackets ¶
ParsePackets parser packets
func (*Hamburg) SavePackets ¶
SavePackets save packets to local file
func (*Hamburg) SetDirection ¶
SetDirection set request direction
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parser
func (*Parser) ParseEthernetLayer ¶
ParseEthernetLayer ethernet layer
func (*Parser) ParseIPLayer ¶
ParseIPLayer ip layer
func (*Parser) ParseTCPLayer ¶
ParseTCPLayer tcp layer
func (*Parser) ParseUDPLayer ¶
ParseUDPLayer udp layer
type Sniffer ¶
type Sniffer struct {
// contains filtered or unexported fields
}
Sniffer sniffer
func (*Sniffer) GetDuration ¶
GetDuration get duration
func (*Sniffer) GetStartTime ¶
GetStartTime set start time
type State ¶
type State struct {
// contains filtered or unexported fields
}
State status summary
func (*State) AddDuration ¶
AddDuration incr time-consuming interval count
func (*State) IncrReqRsp ¶
IncrReqRsp incr request and response
Click to show internal directories.
Click to hide internal directories.