Documentation ¶
Index ¶
Constants ¶
const ( IF_ADD linkOp = 1 IF_DEL linkOp = 2 )
Variables ¶
This section is empty.
Functions ¶
func NewNLListener ¶
func NewNLListener(log Logger) *nlListener
NewNLListener listens on rtnetlink for addition and removal of interfaces and inform users on the Messages channel.
Types ¶
type InterfaceFilterFn ¶
InterfaceFilterFn is the function used to filter interface This function is called once for every interface the daemon can potentially listen on. It should return true if the daemon should listen on the interface.
type LLDPD ¶
type LLDPD struct {
// contains filtered or unexported fields
}
LLDPD is the server for LLDP PDU's It will always listen passively. This means, it will only send LLDP PDU's in response to a received PDU.
func (*LLDPD) CancelListenOn ¶
CancelListenOn will stop listening on the interface
type Logger ¶
type Logger interface { // Info logs informational messages. Info(keyvals ...interface{}) // Error logs error messages. Error(keyvals ...interface{}) }
Logger is a logging adapter interface
type Option ¶
Option is a functional option handler for LLDPD.
func InterfaceFilter ¶
func InterfaceFilter(fn InterfaceFilterFn) Option
InterfaceFilter allows a user to filter interfaces
func PortLookup ¶
func PortLookup(fn PortLookupFn) Option
PortLookup allows a user to use a different port description lookup mechanism
func ReplyUnicast ¶
func ReplyUnicast() Option
ReplyUnicast instructs the daemon to send lldp PDU's to the src mac address, instead of the lldp broadcast address
func SourceAddress ¶
func SourceAddress(addr net.HardwareAddr) Option
SourceAddress sets the ethernet source address to use for LLDP PDU's
type PortLookupFn ¶
PortLookupFn is the function used to respond with a different port description. This function is called once, on first receive of an LLDP PDU on a port and the reply is cached untill restart.