Documentation ¶
Index ¶
- Constants
- func BPFFilter(r *scan.Range) (filter string, maxPacketLength int)
- type PacketFiller
- type PacketFillerOption
- func WithCode(code uint8) PacketFillerOption
- func WithIPFlags(flags uint8) PacketFillerOption
- func WithIPProtocol(proto uint8) PacketFillerOption
- func WithIPTotalLength(length uint16) PacketFillerOption
- func WithPayload(payload []byte) PacketFillerOption
- func WithTTL(ttl uint8) PacketFillerOption
- func WithType(typ uint8) PacketFillerOption
- func WithVPNmode(vpnMode bool) PacketFillerOption
- type PacketProcessor
- type Response
- type ScanMethod
- type ScanResult
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 ¶
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 ScanMethod ¶
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
Click to show internal directories.
Click to hide internal directories.