Documentation ¶
Index ¶
Constants ¶
View Source
const ( IOTimeoutSec = 60 // IOTimeoutSec is the number of seconds to tolerate for network IO operations. RateLimitIntervalSec = 1 // RateLimitIntervalSec is the interval for rate limit calculation. MaxPacketSize = 1500 // MaxPacketSize is the maximum acceptable UDP packet size. SNMP requests are small. )
Variables ¶
This section is empty.
Functions ¶
func TestSNMPD ¶
func TestSNMPD(daemon *Daemon, t testingstub.T)
TestSNMPD conducts unit tests on SNMP daemon, see TestSNMPD for daemon setup.
Types ¶
type Daemon ¶
type Daemon struct { Address string `json:"Address"` // Address to listen on, e.g. 0.0.0.0 to listen on all network interfaces. Port int `json:"Port"` // Port to listen on, by default SNMP uses port 161. PerIPLimit int `json:"PerIPLimit"` // PerIPLimit is approximately how many requests are allowed from an IP within a designated interval. /* CommunityName is a password-like string that grants access to all SNMP nodes. Be aware that it is transmitted in plain text due to protocol limitation. */ CommunityName string `json:"CommunityName"` // contains filtered or unexported fields }
func (*Daemon) GetUDPStatsCollector ¶
GetUDPStatsCollector returns the stats collector that counts and times UDP conversations.
func (*Daemon) HandleUDPClient ¶
func (daemon *Daemon) HandleUDPClient(logger *lalog.Logger, clientIP string, client *net.UDPAddr, reqPacket []byte, srv *net.UDPConn)
HandleUDPClient converses
func (*Daemon) Initialise ¶
Initialise validates configuration and initialises internal states.
func (*Daemon) StartAndBlock ¶
StartAndBlock starts UDP listener to serve SNMP clients. You may call this function only after having called Initialise().
Click to show internal directories.
Click to hide internal directories.