aarp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Encodes and decodes AARP (AppleTalk Address Resolution Protocol) packets.

Index

Constants

View Source
const (
	HardwareEthernet  = Hardware(0x0001)
	ProtoLLAPBridging = Proto(0x809b)
)
View Source
const (
	RequestOp  = Opcode(0x01)
	ResponseOp = Opcode(0x02)
	ProbeOp    = Opcode(0x03)
)

Variables

View Source
var EthernetLLAPBridging = Header{
	Hardware:     HardwareEthernet,
	Proto:        ProtoLLAPBridging,
	HardwareSize: 6,
	ProtoSize:    4,
}

Functions

func Marshal

func Marshal(pak Packet) ([]byte, error)

Marshals a packet to bytes.

func Unmarshal

func Unmarshal(data []byte, pak *Packet) error

Unmarshals a packet from bytes.

Types

type AddrPair

type AddrPair struct {
	Hardware ethernet.Addr

	Proto ddp.Addr
	// contains filtered or unexported fields
}

type Body

type Body struct {
	Opcode Opcode
	Src    AddrPair
	Dst    AddrPair
}

type Hardware

type Hardware uint16
type Header struct {
	Hardware                Hardware
	Proto                   Proto
	HardwareSize, ProtoSize uint8
}

type Opcode

type Opcode uint16

type Packet

type Packet struct {
	Header
	Body
}

func Probe

func Probe(src ethernet.Addr, query ddp.Addr) Packet

AARP packet for checking that `query` is available, from `src`.

func Request

func Request(src AddrPair, query ddp.Addr) Packet

AARP packet for resolving `query` to a hardware address, from `src`.

func Response

func Response(src, dst AddrPair) Packet

AARP packet responding to a request or probe `dst` from `src`.

type Proto

type Proto uint16

Jump to

Keyboard shortcuts

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