sniff

package
v0.0.0-...-3121903 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sniff

func Sniff(ifname, filter string)

Sniff takes ifname and filter string as parameter. Packets are decoded and inserted to ES in handlePacket()

Types

type ApplicationLayerDoc

type ApplicationLayerDoc struct {
	Payload string `json:"payload"`
}

type LinkLayerDoc

type LinkLayerDoc struct {
	LayerType string `json:"layer_type"`
	SrcMAC    string `json:"src_mac"`
	DstMAC    string `json:"dst_mac"`
}

type NetworkLayerDoc

type NetworkLayerDoc struct {
	LayerType string `json:"layer_type"`
	SrcIP     string `json:"src_ip"`
	DstIP     string `json:"dst_ip"`
	Operation uint16 `json:"operation"`
}

type PacketDocument

type PacketDocument struct {
	Link      LinkLayerDoc        `json:"link_layer"`
	Network   NetworkLayerDoc     `json:"network_layer"`
	Transport TransportLayerDoc   `json:"transport_layer"`
	App       ApplicationLayerDoc `json:"application_layer"`
}

type TransportLayerDoc

type TransportLayerDoc struct {
	LayerType string `json:"layer_type"`
	SrcPort   string `json:"src_port"`
	DstPort   string `json:"dst_port"`
}

Jump to

Keyboard shortcuts

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