|
NetBurner 3.5.7
PDF Version |
SNMP agent servlet that listens for and processes SNMP requests. More...
#include <snmp.h>
Inherits servlet.
Public Member Functions | |
| SnmpServlet (int port=161) | |
| Construct an SnmpServlet and bind to the specified UDP port. | |
Protected Member Functions | |
| virtual int | AddToSelectSet (fd_set &rd_set, fd_set &wr_set, fd_set &er_set) |
| Register the SNMP socket with the select read set. | |
| virtual void | ProcessSelectResult (fd_set &rd_set, fd_set &wr_set, fd_set &er_set) |
| Process incoming SNMP requests when the socket is readable. | |
Protected Attributes | |
| int | m_fd |
| UDP socket file descriptor for SNMP communication. | |
| int | m_port |
| UDP port number the SNMP agent listens on. | |
SNMP agent servlet that listens for and processes SNMP requests.
SnmpServlet integrates the SNMP agent into the system servlet select loop. It creates a UDP socket bound to the specified port (default 161) and handles incoming SNMP GET, GET-NEXT, and SET requests.
To enable SNMP in your application, create a global instance of this class. The servlet automatically registers itself with the system select loop.
Expand for Example Usage
| SnmpServlet::SnmpServlet | ( | int | port = 161 | ) |
Construct an SnmpServlet and bind to the specified UDP port.
Creates a UDP socket and registers the servlet with the system select loop to begin processing SNMP requests.
| port | The UDP port to listen on (default: 161, the standard SNMP port). |
|
protectedvirtual |
Register the SNMP socket with the select read set.
| rd_set | Read file descriptor set. |
| wr_set | Write file descriptor set. |
| er_set | Error file descriptor set. |
|
protectedvirtual |
Process incoming SNMP requests when the socket is readable.
| rd_set | Read file descriptor set. |
| wr_set | Write file descriptor set. |
| er_set | Error file descriptor set. |