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 smux_init ( debug)
int debug;

Description

The smux_init subroutine initializes the TCP socket used by the SMUX agent to talk to the SNMP daemon. The subroutine assumes that loopback will be used to define the path to the SNMP daemon. The subroutine also clears the base structures the SMUX code uses. This subroutine also sets the debug level that is used when running 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.