packet

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PacketCh = make(chan []byte, 1000)
)

Functions

func MergePcapStrings added in v1.0.7

func MergePcapStrings(pcapStrings []string, fileName, path string) (string, error)

MergePcapStrings 将多个pcap包字符串合并并保存到一个pcap文件中 outputFile:文件根路径(自动按照年月日创建文件夹)return currentPath

func OpenLive

func OpenLive(isDebug bool)

func OpenOffline

func OpenOffline(filePath string) chan []byte

Types

type FastParser

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

func NewFastParser

func NewFastParser() *FastParser

func (*FastParser) Parse

func (p *FastParser) Parse(packet []byte) (FiveTuple, error)

type FiveTuple

type FiveTuple struct {
	SrcIP    uint32 // 4
	DstIP    uint32 // 4
	SrcPort  uint16 // 2
	DstPort  uint16 // 2
	Protocol uint8  // 1
	// contains filtered or unexported fields
}

type Interface

type Interface struct {
	Name        string //设备名称
	Description string //设备描述信息
	Flags       uint32
	Addresses   []InterfaceAddress //网口的地址信息列表
}

type InterfaceAddress

type InterfaceAddress struct {
	IP        net.IP
	Netmask   net.IPMask // Netmask may be nil if we were unable to retrieve it.
	Broadaddr net.IP     // Broadcast address for this IP may be nil
	P2P       net.IP     // P2P destination address for this IP may be nil
}

InterfaceAddress describes an address associated with an Interface. Currently, it's IPv4/6 specific.

Jump to

Keyboard shortcuts

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