gtpg2m30General Macros

ITRPC-Send Simple Network Management Protocol User Trap

This general macro sends a Simple Network Management Protocol (SNMP) enterprise-specific trap to the remote SNMP destination managers specified in the /etc/snmp.cfg SNMP configuration file.

Format




label
is a symbolic name that can be assigned to the macro statement.

VARLIST
specifies a pointer to the variable binding list associated with the SNMP enterprise-specific trap being generated. See TPF Transmission Control Protocol/Internet Protocol for information about the variable binding lists and enterprise-specific traps used with SNMP agent support.

Rx
is the register in the range R1-R7 that contains the pointer to the variable binding list.

VARLEN
specifies the length, in bytes, of the list specified with the VARLIST parameter.

Ry
is the register in the range R1-R7 that contains the length of the variable binding list.

SPECTRAP
specifies an implementation-specific value for the SNMP enterprise-specific trap that describes the trap being generated. See TPF Transmission Control Protocol/Internet Protocol for information about the enterprise-specific traps used with SNMP agent support.

Rz
is the register in the range R1-R7 that contains the value of the SNMP enterprise-specific trap.

Entry Requirements

None.

Return Conditions

If an attempt to build an SNMP enterprise-specific trap is successful, R0 will contain a return code of 0. If an attempt to build an SNMP enterprise-specific trap is unsuccessful, R0 will contain one of the following error returns:

Table 7. ITRPC Error Return

Value Name Return Code Description
ISNMP_ITRPC_STATE_ERROR -1 The TPF system is not in CRAS state or above.
ISNMP_ITRPC_CONFIG_ERROR -2 The /etc/snmp.cfg SNMP configuration file was not refreshed successfully.

Do the following:

  1. Create or fix the /etc/snmp.cfg SNMP configuration file.
  2. Enter the ZSNMP command with the REFRESH parameter specified.
  3. Issue the ITRPC macro again.
ISNMP_ITRPC_NO_TRAPS -3 The /etc/snmp.cfg SNMP configuration file specifies that the TRAPIP keyword is coded as NONE, disabling SNMP trap support.

If you want to send traps, code the TRAPIP keyword on the /etc/snmp.cfg SNMP configuration file with a valid SNMP destination manager IP address or host name.

ISNMP_ITRPC_ENCODE_ERROR -4 An error occurred when encoding one of the trap values.
ISNMP_ITRPC_SIZE_ERROR -5 The size of the trap exceeded the maximum message size of 548 bytes.
Note:
These equates are defined in the ISNMP DSECT.

Programming Considerations

Examples

The following example sends enterprise-specific trap 5 as defined by the SPECTRAP parameter to all the SNMP destination managers specified in the /etc/snmp.cfg SNMP configuration file. This trap contains no variable binding list.

                             LA    R1,5
                             ITRPC SPECTRAP=R1