smux_trap Subroutine

Purpose

Sends SNMP multiplexing (SMUX) peer traps to the Simple Network Management Protocol (SNMP) agent.

Library

SNMP Library (libsnmp.a)

Syntax

#include <isode/snmp/smux.h>

int smux_trap ( generic,  specific,  bindings)

int generic;
int specific;
struct type_SNMP_VarBindList *bindings;

Description

The smux_trap subroutine allows the SMUX peer to generate traps and send them to the SNMP agent. The subroutine sets the generic and specific fields in the trap packet to values specified by the parameters. The subroutine also allows the SMUX peer to send a list of variable bindings to the SNMP agent. The variable bindings are values associated with specific variables. If the trap is to return a set of variables, the variables are sent in the variable binding list.

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

Parameters

Item Description
generic Contains an integer specifying the generic trap type. The value must be one of the following:
0
Specifies a cold start.
1
Specifies a warm start.
2
Specifies a link down.
3
Specifies a link up.
4
Specifies an authentication failure.
5
Specifies an EGP neighbor loss.
6
Specifies an enterprise-specific trap type.
specific Contains an integer that uniquely identifies the trap. The unique identity is typically assigned by the registration authority for the enterprise owning the SMUX peer.
bindings Indicates the variable bindings to assign to the trap protocol data unit (PDU).

Return Values

The subroutine returns NOTOK on failure and OK on success.

Error Codes

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

Value Description
invalidOperation Indicates the Transmission Control Protocol (TCP) connection was not completed.
congestion Indicates memory is not available. The TCP connection was closed.
youLoseBig Indicates an error occurred in the SNMP code. The TCP connection was closed.