packetHandlers

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 GetVlanTag added in v0.0.2

func GetVlanTag(pkt gopacket.Packet) (uint16, error)

func IsDhcpPacket

func IsDhcpPacket(pkt gopacket.Packet) bool

func IsIncomingPacket

func IsIncomingPacket(packet gopacket.Packet) bool

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 PopDoubleTag

func PopDoubleTag(pkt gopacket.Packet) (gopacket.Packet, error)

func PopSingleTag

func PopSingleTag(pkt gopacket.Packet) (gopacket.Packet, error)

func PushDoubleTag added in v0.0.2

func PushDoubleTag(stag int, ctag int, pkt gopacket.Packet) (gopacket.Packet, error)

func PushSingleTag

func PushSingleTag(tag int, pkt gopacket.Packet) (gopacket.Packet, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL