arp

package
v1.2.0-rc.1.0...-65ced95 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderEthernetIp4Bytes = 8 + 6 + 4

Variables

This section is empty.

Functions

func GetPacketHeader

func GetPacketHeader(r *vnet.Ref) vnet.PacketHeader

Types

type EthernetIp4Addr

type EthernetIp4Addr struct {
	Ethernet ethernet.Address
	Ip4      ip4.Address
}

Typical case for arp: ip4 over ethernet.

type Header struct {
	L2Type          vnet.Uint16
	L3Type          vnet.Uint16
	NL2AddressBytes uint8
	NL3AddressBytes uint8
	Opcode          vnet.Uint16
}

func (*Header) GetL2Type

func (h *Header) GetL2Type() L2Type

func (*Header) GetL3Type

func (h *Header) GetL3Type() ethernet.Type

func (*Header) GetOpcode

func (h *Header) GetOpcode() Opcode

type HeaderEthernetIp4

type HeaderEthernetIp4 struct {
	Header
	Addrs [2]EthernetIp4Addr
}

func GetHeader

func GetHeader(r *vnet.Ref) *HeaderEthernetIp4

func (*HeaderEthernetIp4) Len

func (h *HeaderEthernetIp4) Len() uint

Implement vnet.Header interface.

func (*HeaderEthernetIp4) Read

func (h *HeaderEthernetIp4) Read(b []byte) vnet.PacketHeader

func (*HeaderEthernetIp4) String

func (h *HeaderEthernetIp4) String() (s string)

func (*HeaderEthernetIp4) Write

func (h *HeaderEthernetIp4) Write(b []byte)

type L2Type

type L2Type uint16
const (
	L2TypeEthernet L2Type = 1
)

func (L2Type) FromHost

func (x L2Type) FromHost() vnet.Uint16

func (L2Type) String

func (x L2Type) String() string

type Opcode

type Opcode uint16
const (
	Request Opcode = 1 + iota
	Reply
	ReverseRequest
	ReverseReply
)

func (Opcode) FromHost

func (x Opcode) FromHost() vnet.Uint16

func (Opcode) String

func (x Opcode) String() string

Jump to

Keyboard shortcuts

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