arp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package arp is a generated GoMock package.

Index

Constants

View Source
const PacketLen = 28 // byte

Variables

This section is empty.

Functions

func Receive

func Receive(packet []byte, dev mw.IDevice) psErr.E

func SendReply

func SendReply(tha mw.EthAddr, tpa mw.V4Addr, iface *mw.Iface) psErr.E

func SendRequest

func SendRequest(iface *mw.Iface, ip mw.IP) psErr.E

func Start

func Start(wg *sync.WaitGroup) psErr.E

func Stop

func Stop()

Types

type Hdr

type Hdr struct {
	HT     HwType     // hardware type
	PT     mw.EthType // protocol type
	HAL    uint8      // hardware address length
	PAL    uint8      // protocol address length
	Opcode Opcode
}

type HwType

type HwType uint16
const Ethernet HwType = 0x0001

func (HwType) String

func (v HwType) String() string

type IResolver added in v0.5.0

type IResolver interface {
	Resolve(iface *mw.Iface, ip mw.IP) (mw.EthAddr, Status)
}
var Resolver IResolver

type MockIResolver added in v0.5.0

type MockIResolver struct {
	// contains filtered or unexported fields
}

MockIResolver is a mock of IResolver interface.

func NewMockIResolver added in v0.5.0

func NewMockIResolver(ctrl *gomock.Controller) *MockIResolver

NewMockIResolver creates a new mock instance.

func (*MockIResolver) EXPECT added in v0.5.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIResolver) Resolve added in v0.5.0

func (m *MockIResolver) Resolve(iface *mw.Iface, ip mw.IP) (mw.EthAddr, Status)

Resolve mocks base method.

type MockIResolverMockRecorder added in v0.5.0

type MockIResolverMockRecorder struct {
	// contains filtered or unexported fields
}

MockIResolverMockRecorder is the mock recorder for MockIResolver.

func (*MockIResolverMockRecorder) Resolve added in v0.5.0

func (mr *MockIResolverMockRecorder) Resolve(iface, ip interface{}) *gomock.Call

Resolve indicates an expected call of Resolve.

type Opcode

type Opcode uint16
const Reply Opcode = 0x0002
const Request Opcode = 0x0001

func (Opcode) String

func (v Opcode) String() string

type Packet

type Packet struct {
	Hdr
	SHA mw.EthAddr // sender hardware address
	SPA mw.V4Addr  // sender protocol address
	THA mw.EthAddr // target hardware address
	TPA mw.V4Addr  // target protocol address
}

type Status

type Status int
const (
	Complete Status = iota
	Incomplete
	Error
)

Jump to

Keyboard shortcuts

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