smux_close Subroutine

Purpose

Ends communications with the SNMP agent.

Library

SNMP Library (libsnmp.a)

Syntax

#include <isode/snmp/smux.h>

int smux_close ( reason)
int reason;

Description

The smux_close subroutine closes the transmission control protocol (TCP) connection from the SNMP multiplexing (SMUX) peer. The smux_close subroutine sends the close protocol data unit (PDU) with the error code set to the reason value. The subroutine closes the TCP connection and frees the socket. This subroutine also frees information it was maintaining for the connection.

This subroutine is part of the SNMP Application Programming Interface in the TCP/IP facility.

Parameters

Item Description
reason Indicates an integer value denoting the reason the close PDU message is being sent.

Return Values

If the subroutine is successful, OK is returned. Otherwise, NOTOK is returned.

Error Codes

If the subroutine returns NOTOK, the smux_errno global variable is set to one of the following values:

Value Description
invalidOperation Indicates that the smux_init subroutine has not been executed successfully.
congestion Indicates that memory could not be allocated for the close PDU. The TCP connection is closed.
youLoseBig Indicates that the SNMP code has a problem. The TCP connection is closed.