tcp

package
v0.0.0-...-ef25644 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EchoRequest echoType = iota + 1
	EchoReply
)

'Echo' Types

Variables

This section is empty.

Functions

func EchoTargets

func EchoTargets(
	remotes interface{},
	conn *ip.Conn,
	targetPort layers.TCPPort,
	srcPortRange PortRange,
	QoSEnabled bool,
	currentDSCP *ip.DSCPValue,
	realBatchInterval time.Duration,
	batchEndCycle *time.Ticker,
	sentC chan Message,
	senderOnlyMode bool,
	completeCycleUpload chan bool,
	finishedCycleUpload *sync.WaitGroup,
	kill chan struct{},
	logger *log.Logger,
)

EchoTargets sends echoes (SYNs) to all targets included in 'remotes.'

func Receiver

func Receiver(
	conn *ip.Conn,
	sentC chan Message,
	rcvdC chan Message,
	kill chan struct{},
	logger *log.Logger,
) error

Receiver checks if the incoming packet is actually a response to our probe and acts accordingly. TODO Test IPv6

Types

type Message

type Message struct {
	Type    echoType
	SrcAddr net.IP
	DstAddr net.IP
	Af      int
	SrcPort layers.TCPPort
	DstPort layers.TCPPort
	QosDSCP ip.DSCPValue
	Ts      Timestamp
	Seq     uint32
	Ack     uint32
}

Message is filled with the info about the 'echo' request sent or 'echo' reply received and emitted onto the 'sent' and 'rcvd' channels, respectively, for further processing by the collector.

func (Message) FromExternalTarget

func (m Message) FromExternalTarget(servicePort layers.TCPPort) bool

FromExternalTarget returns true if message has been received from external server and not an arachne agent.

type PortRange

type PortRange [2]layers.TCPPort

PortRange is the inclusive range of src ports.

func (PortRange) Contains

func (t PortRange) Contains(p layers.TCPPort) bool

Contains returns true if p is included within the PortRange t.

type Timestamp

type Timestamp struct {
	Unix    time.Time
	Run     time.Time
	Payload time.Time
}

Timestamp holds all the different types of time stamps.

Jump to

Keyboard shortcuts

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