Trap Multiplexer Subagent/Manager
SNMP Configuration and Management Manual — 424777-006
12 -61
Application Source Code
/* reset event buffer */
event_buf = eve sizeof(short); /* skip the length field */
spi_err = SSPUTTKN ((short*)event_buf, <-- 16
ZSPI_TKN_RESET_BUFFER,
(char*) (ibuflen - sizeof(short)));
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* check if the event obtained is from a trap mux ssid */
spi_err = EMSGETTKN ((short*)event_buf, /* buffer */ <-- 17
ZSPI_TKN_SSID, /* token-id */
(char*)&tmpssid, /* token-value */
1); /* index */
if (spi_err != ZSPI_ERR_OK)
DEBUG();
if (strcmp(tmpssid.u_z_filler.z_filler,ZSPI_VAL_TANDEM))
{
printf ("A non-HP event has been reported\n");
continue;
}
if (tmpssid.z_number != ZSPI_SSN_ZTMX)
{
printf ("A non-Trap-Multiplexer event has been reported\n");
continue;
}
/* check whether the event obtained is a trap event */
spi_err = EMSGETTKN ((short*)event_buf, /* buffer */ <-- 18
ZEMS_TKN_EVENTNUMBER, /* token-id */
(char*)&evt_num, /* token-value */
1); /* index */
if (spi_err != ZSPI_ERR_OK)
DEBUG();
if ((evt_num != ZTMX_EVT_TRAP_COLDSTART) &&
(evt_num != ZTMX_EVT_TRAP_WARMSTART) &&
(evt_num != ZTMX_EVT_TRAP_LINKDOWN ) &&
(evt_num != ZTMX_EVT_TRAP_LINKUP ) &&
(evt_num != ZTMX_EVT_TRAP_AUTH_FAILURE) &&
(evt_num != ZTMX_EVT_TRAP_EGP_LOSS ) &&
(evt_num != ZTMX_EVT_TRAP_ENT_SPECIFIC))
{
printf ("A non-trap event has been reported\n");
continue;
}
spi_err = EMSGETTKN ((short*)event_buf, /* buffer */ <-- 19
ZTMX_TKN_TRAP_PDU, /* token-id */
(char*)&trap_buf, /* token-value */
1); /* index */
if (spi_err != ZSPI_ERR_OK)
DEBUG();
Example 12-3. Sample Application Source Code
(page 6 of 14)
Summary of Contents for T9576G06
Page 24: ...Contents SNMP Configuration and Management Manual 424777 006 xxii Tables continued ...
Page 38: ...Part I Installing and Configuring SNMP SNMP Configuration and Management Manual 424777 006 ...
Page 140: ...Part II SCF for the SNMP Agent SNMP Configuration and Management Manual 424777 006 ...
Page 208: ...Part III Troubleshooting SNMP Configuration and Management Manual 424777 006 ...
Page 230: ...Part IV SNMP Subagents SNMP Configuration and Management Manual 424777 006 ...
Page 704: ...Part V Appendices SNMP Configuration and Management Manual 424777 006 ...
Page 778: ...Index SNMP Configuration and Management Manual 424777 006 Index 32 Special Characters ...