packets

package
v0.0.0-...-ab9e86a Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DHCP6OptClientFQDN = 39
View Source
const DHCP6OptDNSDomains = 24
View Source
const DHCP6OptDNSServers = 23
View Source
const IPv6Prefix = "fe80::"

link-local

Variables

View Source
var (
	ErrNoCID = errors.New("Unexpected DHCPv6 packet, could not find client id.")
)

Functions

func DHCP6EncodeList

func DHCP6EncodeList(elements []string) (encoded []byte)

func DHCP6For

func DHCP6For(what dhcp6.MessageType, to dhcp6.Packet, duid []byte) (err error, p dhcp6.Packet)

func NewARP

func NewARP(from net.IP, from_hw net.HardwareAddr, to net.IP, req uint16) (layers.Ethernet, layers.ARP)

func NewARPReply

func NewARPReply(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr) (error, []byte)

func NewARPRequest

func NewARPRequest(from net.IP, from_hw net.HardwareAddr, to net.IP) (error, []byte)

func NewARPTo

func NewARPTo(from net.IP, from_hw net.HardwareAddr, to net.IP, to_hw net.HardwareAddr, req uint16) (layers.Ethernet, layers.ARP)

func NewUDPProbe

func NewUDPProbe(from net.IP, from_hw net.HardwareAddr, to net.IP, port int) (error, []byte)

func Serialize

func Serialize(layers ...gopacket.SerializableLayer) (error, []byte)

Types

type Activity

type Activity struct {
	IP     net.IP
	MAC    net.HardwareAddr
	Source bool
}

type DHCPv6Layer

type DHCPv6Layer struct {
	Raw []byte
}

func (DHCPv6Layer) SerializeTo

type Queue

type Queue struct {
	sync.Mutex

	Activities  chan Activity `json:"-"`
	Sent        uint64
	Received    uint64
	PktReceived uint64
	Errors      uint64
	Protos      map[string]uint64
	Traffic     map[string]*Traffic
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(iface *bnet.Endpoint) (*Queue, error)

func (*Queue) Send

func (q *Queue) Send(raw []byte) error

func (*Queue) Stop

func (q *Queue) Stop()

type Traffic

type Traffic struct {
	Sent     uint64
	Received uint64
}

Jump to

Keyboard shortcuts

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