snmpd

package
v0.0.0-...-44b4573 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

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

func (daemon *Daemon) GetUDPStatsCollector() *misc.Stats

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

func (daemon *Daemon) Initialise() error

Initialise validates configuration and initialises internal states.

func (*Daemon) StartAndBlock

func (daemon *Daemon) StartAndBlock() error

StartAndBlock starts UDP listener to serve SNMP clients. You may call this function only after having called Initialise().

func (*Daemon) Stop

func (daemon *Daemon) Stop()

Stop closes server listener so that it ceases to process incoming requests.

Directories

Path Synopsis
snmp implements a rudimentary encoder and decoder of SNMP packets.
snmp implements a rudimentary encoder and decoder of SNMP packets.

Jump to

Keyboard shortcuts

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