Documentation ¶
Index ¶
- func GetDstMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
- func GetSrcMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
- func GetVlanTag(pkt gopacket.Packet) (uint16, error)
- func IsDhcpPacket(pkt gopacket.Packet) bool
- func IsIncomingPacket(packet gopacket.Packet) bool
- func IsLldpPacket(pkt gopacket.Packet) bool
- func PopDoubleTag(pkt gopacket.Packet) (gopacket.Packet, error)
- func PopSingleTag(pkt gopacket.Packet) (gopacket.Packet, error)
- func PushDoubleTag(stag int, ctag int, pkt gopacket.Packet) (gopacket.Packet, error)
- func PushSingleTag(tag int, pkt gopacket.Packet) (gopacket.Packet, error)
- type PacketType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDstMacAddressFromPacket ¶ added in v0.0.2
func GetDstMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
returns the Destination Mac Address contained in the packet
func GetSrcMacAddressFromPacket ¶ added in v0.0.2
func GetSrcMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
returns the Source Mac Address contained in the packet
func IsDhcpPacket ¶
func IsIncomingPacket ¶
return true if the packet is coming in the OLT from the NNI port it uses the ack to check if the source is the one we assigned to the dhcp server
func IsLldpPacket ¶ added in v0.0.5
func PushDoubleTag ¶ added in v0.0.2
Types ¶
type PacketType ¶ added in v0.0.2
type PacketType int
const ( UNKNOWN PacketType = iota EAPOL DHCP )
func IsEapolOrDhcp ¶ added in v0.0.2
func IsEapolOrDhcp(pkt gopacket.Packet) (PacketType, error)
returns wether it's an EAPOL or DHCP packet, error if it's none
func (PacketType) String ¶ added in v0.0.2
func (t PacketType) String() string
Click to show internal directories.
Click to hide internal directories.