smux_init Subroutine
Purpose
Initiates the transmission control protocol (TCP) socket that the SNMP multiplexing (SMUX) agent uses and clears the basic SMUX data structures.
Library
SNMP Library (libsnmp.a)
Syntax
#include <isode/snmp/smux.h>
int debug;
Description
The smux_init subroutine initializes the TCP socket that is used by the SMUX agent to communicate with the SNMP daemon. The subroutine assumes that loopback is used to define the path to the SNMP daemon. Name resolution attempts to find an IPv6 address mapping for loopback. If it cannot find an IPv6 address, it tries to find an IPv4 address for loopback. The subroutine also clears the base structures that the SMUX code uses. The smux_init subroutine also sets the debug level that is used when it runs the SMUX subroutines.
This subroutine is part of the SNMP Application Programming Interface in the TCP/IP facility.
Parameters
Item | Description |
---|---|
debug | Indicates the level of debug to be printed during SMUX subroutines. |
Return Values
If the subroutine is successful, the socket descriptor is returned. Otherwise, the value of NOTOK is returned and the smux_errno global variable is set.
Error Codes
Possible values for the smux_errno global variable are:
Value | Description |
---|---|
congestion | Indicates memory allocation problems |
youLoseBig | Signifies problem with SNMP library code |
systemError | Indicates TCP connection failure. |
These are defined in the /usr/include/isode/snmp/smux.h file.