Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteSingle ¶
func WriteSingle(dstMAC *MACAddress, ethertype EtherType, data []byte) (int, error)
WriteSingle is a helper method that is used for one-time sends that do not require a full Writer
Types ¶
type EtherType ¶
type EtherType uint16
EtherType implements the ethernet protocol's EtherType (https://en.wikipedia.org/wiki/EtherType).
type FrameHeader ¶
type FrameHeader struct { //Rmac, Lmac *MAC_Address Packet []byte }
A FrameHeader is used when returning data from Reader.Read() calls
type MACAddress ¶
type MACAddress struct {
Data []byte
}
The MACAddress type holds a 48-bit MAC Address
var ( LoopbackMACAddress *MACAddress ExternalMACAddress *MACAddress LoopbackBroadcastAddress *MACAddress ExternalBroadcastAddress *MACAddress )
Static MAC addresses and broadcast addresses
type Reader ¶
type Reader interface { Read() (*FrameHeader, error) io.Closer }
Reader allows for reading packets from all interfaces for a specific EtherType
type Writer ¶
Writer allows for writing packets to a specific MAC address and EtherType
func NewEthernetWriter ¶
func NewEthernetWriter(dstMAC *MACAddress, ethertype EtherType) (Writer, error)
NewEthernetWriter allows for the writing to a given MAC Address and EtherType
Click to show internal directories.
Click to hide internal directories.