Documentation ¶
Overview ¶
Package ipx implements common types for IPX header encoding and decoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CopyPackets ¶
CopyPackets copies packets from in to out until an error occurs whil reading or the context is cancelled. If the input returns EOF then CopyPackets returns nil to indicate copying completed successfully.
func DuplexCopyPackets ¶
func DuplexCopyPackets(ctx context.Context, x, y ReadWriter) error
Types ¶
type Header ¶
type Header struct { Checksum uint16 Length uint16 TransControl byte PacketType byte Dest, Src HeaderAddr }
Header represents an IPX header.
func (*Header) IsBroadcast ¶
func (*Header) MarshalBinary ¶
MarshalBinary populates a slice of bytes from an IPX header.
func (*Header) UnmarshalBinary ¶
UnmarshalBinary decodes an IPX header from a slice of bytes.
type HeaderAddr ¶
HeaderAddr represents a full IPX address and socket number.
func (*HeaderAddr) MarshalBinary ¶
func (a *HeaderAddr) MarshalBinary() ([]byte, error)
MarshalBinary populates a slice of bytes from an IPX header address.
func (*HeaderAddr) UnmarshalBinary ¶
func (a *HeaderAddr) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes an IPX header address from a slice of bytes.
type Packet ¶
Packet contains an unmarshaled IPX packet containing the header and payload bytes.
func (*Packet) MarshalBinary ¶
func (*Packet) UnmarshalBinary ¶
type ReadCloser ¶
type ReadWriteCloser ¶
type ReadWriteCloser interface { ReadWriter io.Closer }
type ReadWriter ¶
type Reader ¶
type Reader interface { // ReadPacket returns an IPX packet read from this source or an // error. If no packet is available yet it will block. An error // of io.EOF indicates that no more packets are available to read. ReadPacket(context.Context) (*Packet, error) }
Reader defines a common interface implemented by things from which IPX packets can be read.