Documentation ¶
Index ¶
- func GetDstMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
- func GetPbit(pkt gopacket.Packet) (uint8, error)
- func GetSrcMacAddressFromPacket(packet gopacket.Packet) (net.HardwareAddr, error)
- func GetTagsFromPacket(pkt gopacket.Packet) (uint16, uint16, error)
- func GetVlanTag(pkt gopacket.Packet) (uint16, error)
- func IsDhcpPacket(pkt gopacket.Packet) bool
- func IsIgmpPacket(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, pbit uint8) (gopacket.Packet, error)
- func PushSingleTag(tag int, pkt gopacket.Packet, pbit uint8) (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 GetTagsFromPacket ¶ added in v1.4.0
godet inner and outer tag from a packet TODO unit test
func IsDhcpPacket ¶
func IsIgmpPacket ¶ added in v1.0.0
func IsIncomingPacket ¶
return true if the packet is coming in the OLT from the DHCP Server given that we only check DHCP packets we can use the Operation Request are outgoing (toward the server) Replies are incoming (toward the OLT)
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 IGMP )
func GetPktType ¶ added in v1.0.0
func GetPktType(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.