payloads

package
v0.0.0-...-9b84add Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeARPReply = Type("PAYLOAD_ARP_REPLY")

TypeARPReply is the payload type for an ARP Reply

View Source
var TypeICMPEcho = Type("PAYLOAD_ICMP_ECHO_REQUEST")

TypeICMPEcho is the payload type for an ICMP Echo Request

Functions

func ARPReply

func ARPReply(sIP, dIP net.IP, sMAC, dMAC net.HardwareAddr) ([]byte, error)

ARPReply returns a wire-ready Ethernet frame encapsulating an (unsolicited) ARP reply

func Build

func Build(t Type, c Config) ([]byte, error)

Build returns a wire-ready payload of the specified type

func ICMPEchoReq

func ICMPEchoReq(sIP, dIP net.IP, sMAC, dMAC net.HardwareAddr) ([]byte, error)

ICMPEchoReq returns a wire-ready Ethernet frame encapsulating an IPv4 packet carrying an ICMP Echo Request

Types

type Config

type Config struct {
	SrcIP  net.IP
	DstIP  net.IP
	SrcMAC net.HardwareAddr
	DstMAC net.HardwareAddr
}

Config carries the payload configuration

type Type

type Type string

Type represents the payload type

Jump to

Keyboard shortcuts

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