icmp

package
v0.0.0-...-4c1d026 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPacketLength = 1518

Set to typical maximum Ethernet frame size = MTU (1500 bytes) + Ethernet header (14 bytes) + FCS (4 bytes)

View Source
const ScanType = "icmp"

Variables

This section is empty.

Functions

func BPFFilter

func BPFFilter(r *scan.Range) (filter string, maxPacketLength int)

Types

type PacketFiller

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

func NewPacketFiller

func NewPacketFiller(opts ...PacketFillerOption) *PacketFiller

func (*PacketFiller) Fill

func (f *PacketFiller) Fill(packet gopacket.SerializeBuffer, r *scan.Request) (err error)

type PacketFillerOption

type PacketFillerOption func(f *PacketFiller)

func WithCode

func WithCode(code uint8) PacketFillerOption

func WithIPFlags

func WithIPFlags(flags uint8) PacketFillerOption

func WithIPProtocol

func WithIPProtocol(proto uint8) PacketFillerOption

func WithIPTotalLength

func WithIPTotalLength(length uint16) PacketFillerOption

func WithPayload

func WithPayload(payload []byte) PacketFillerOption

func WithTTL

func WithTTL(ttl uint8) PacketFillerOption

func WithType

func WithType(typ uint8) PacketFillerOption

func WithVPNmode

func WithVPNmode(vpnMode bool) PacketFillerOption

type PacketProcessor

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

func NewPacketProcessor

func NewPacketProcessor(scanType string, results scan.ResultChan, vpnMode bool) *PacketProcessor

func (*PacketProcessor) ProcessPacketData

func (p *PacketProcessor) ProcessPacketData(data []byte, _ *gopacket.CaptureInfo) (err error)

func (*PacketProcessor) Results

func (p *PacketProcessor) Results() <-chan scan.Result

type Response

type Response struct {
	Type uint8 `json:"type"`
	Code uint8 `json:"code"`
}

type ScanMethod

type ScanMethod struct {
	scan.PacketSource
	packet.Processor
	scan.Resulter
}

func NewScanMethod

func NewScanMethod(psrc scan.PacketSource, results scan.ResultChan, vpnMode bool) *ScanMethod

type ScanResult

type ScanResult struct {
	ScanType string    `json:"scan"`
	IP       string    `json:"ip"`
	TTL      uint8     `json:"ttl"`
	ICMP     *Response `json:"icmp"`
}

func (*ScanResult) ID

func (r *ScanResult) ID() string

func (ScanResult) MarshalEasyJSON

func (v ScanResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ScanResult) MarshalJSON

func (v ScanResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ScanResult) String

func (r *ScanResult) String() string

func (*ScanResult) UnmarshalEasyJSON

func (v *ScanResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ScanResult) UnmarshalJSON

func (v *ScanResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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