Documentation ¶
Overview ¶
Package packettransport implements a transport based on GoPacket library. It may be used to create Ethernet faces based on AF_PACKET or libpcap.
Index ¶
Constants ¶
View Source
const ( // MinVLAN is the minimum VLAN number. MinVLAN = 0x001 // MaxVLAN is the maximum VLAN number. MaxVLAN = 0xFFE // EthernetTypeNDN is the NDN EtherType. EthernetTypeNDN = an.EtherTypeNDN )
Variables ¶
View Source
var ( ErrMacAddr = errors.New("invalid MAC address") ErrUnicastMacAddr = errors.New("invalid unicast MAC address") ErrVLAN = errors.New("invalid VLAN") )
Error conditions.
View Source
var MulticastAddressNDN = net.HardwareAddr{ an.EtherMulticastNDN >> 40 & 0xFF, an.EtherMulticastNDN >> 32 & 0xFF, an.EtherMulticastNDN >> 24 & 0xFF, an.EtherMulticastNDN >> 16 & 0xFF, an.EtherMulticastNDN >> 8 & 0xFF, an.EtherMulticastNDN >> 0 & 0xFF, }
MulticastAddressNDN is the default NDN multicast address.
Functions ¶
This section is empty.
Types ¶
type Locator ¶
type Locator struct { // Local is the local MAC address. // This must be a 48-bit unicast address. Local macaddr.Flag `json:"local"` // Remote is the remote MAC address. // This must be a 48-bit unicast or multicast address. Remote macaddr.Flag `json:"remote"` // VLAN is the VLAN number. // This must be between MinVLAN and MaxVLAN. // Zero indicates there's no VLAN header. VLAN int `json:"vlan,omitempty"` }
Locator identifies local and remote endpoints.
type PacketDataHandle ¶
type PacketDataHandle interface { gopacket.ZeroCopyPacketDataSource WritePacketData(pkt []byte) error }
PacketDataHandle represents a network interface to send and receive Ethernet frames.
type Transport ¶
type Transport interface { l3.Transport // Handle returns the underlying PacketDataHandle. Handle() PacketDataHandle }
Transport is an l3.Transport that communicates over Ethernet via PacketDataHandle.
Click to show internal directories.
Click to hide internal directories.