Documentation
¶
Index ¶
- Constants
- type Client
- type Packet
- func (p *Packet) Marshal() []byte
- func (p *Packet) Unmarshal(input []byte)
- func (p *Packet) WithDstHarwAddr(addr net.HardwareAddr) *Packet
- func (p *Packet) WithDstProtocolAddr(addr netip.Addr) *Packet
- func (p *Packet) WithSrcHarwAddr(addr net.HardwareAddr) *Packet
- func (p *Packet) WithSrcProtocolAddr(addr netip.Addr) *Packet
Constants ¶
View Source
const ( OpcodeRequest = 1 OpcodeReply = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Packet ¶
type Packet struct {
// byte length of each hardware address
HarwAddrLength uint8
// byte length of each protocol address
ProtocolAddrLength uint8
// opcode (REQUEST | REPLY)
Opcode uint16
// Hardware address space (e.g., Ethernet, Packet Radio Net.)
HarwAddrSpace uint16
// Protocol address space. For Ethernet hardware, this is from the set of type fields <ether_type>
ProtocolAddrSpace uint16
// Hardware address of sender of this packet, with length <HarwAddrLength>
SrcHarwAddr net.HardwareAddr
// Hardware address of destination of this packet (if known)
DstHarwAddr net.HardwareAddr
// Protocol address of sender of this packet, with length <ProtocolAddrLength>
SrcProtocolAddr netip.Addr
// Protocol address of destination
DstProtocolAddr netip.Addr
}
ARP packet from RFC 826 https://www.rfc-editor.org/rfc/rfc826
func NewRequest ¶
func NewRequest() *Packet
func (*Packet) WithDstHarwAddr ¶
func (p *Packet) WithDstHarwAddr(addr net.HardwareAddr) *Packet
func (*Packet) WithSrcHarwAddr ¶
func (p *Packet) WithSrcHarwAddr(addr net.HardwareAddr) *Packet
Click to show internal directories.
Click to hide internal directories.