HP T9576G06 Management Manual page 552

Snmp configuration and management manual
Table of Contents

Advertisement

Trap Multiplexer Subagent/Manager
Example 12-3. Sample Application Source Code (page 5 of 14)
Input
: pointer to spi_buffer and distributor file number
Return : None
*/
void getevent_loop(char* spi_buf, short distr)
{
char* event_buf;
short byteoffset, i;
zspi_ddl_int2_def t_version;
zspi_ddl_int2_def t_generic;
zspi_ddl_int2_def t_specific;
zspi_ddl_int2_def t_timeticks;
zspi_ddl_int_def
zspi_ddl_enum_def t_varbind_datatype; /* data type of each var bind */
zspi_ddl_char_def t_null = 0;
zspi_ddl_int2_def t_integer;
zspi_ddl_int2_def t_counter;
zspi_ddl_int2_def t_gauge;
short evt_num;
unsigned char trap_buf[ZEMS_VAL_BUFLEN];
ztmx_val_ssid_def tmpssid;
char
t_buffer[1024];
char* pt_buffer = t_buffer;
short len;
short ibuflen
/* malloc memory for the event buffer */
event_buf = malloc (ZEMS_VAL_BUFLEN);
if (event_buf == NULL)
DEBUG();
setmem (trap_buf,sizeof(trap_buf),0);
/* begin an infinite loop that collects and displays events */
while (1)
{
/* initialize spi_buf for getevent spi command
spi_err = SSINIT((short*)spi_buf,
if (spi_err != ZSPI_ERR_OK)
DEBUG();
/* send getevent command to distributor */
printf ("\n\nWaiting for the next Event.....\n\n");
send_spi_cmd (spi_buf, distr);
/* Extract the event into the buffer
spi_err = SSGETTKN ((short*) spi_buf,
if (spi_err != ZSPI_ERR_OK)
DEBUG();
t_varbind_count;
= ZEMS_VAL_BUFLEN;
ZEMS_VAL_BUFLEN,
(short*)&emsssid,
ZSPI_VAL_CMDHDR,
ZEMS_CMD_GETEVENT);
ZEMS_TKN_EVENT,
event_buf,
1);
SNMP Configuration and Management Manual—424777-006
/* pointer to event data
/* trap version
/* generic trap number
/* specific trap number
/* timeticks
/* number of var binds
/* temp buffer for string manipulation */
/* pointer to the temp buffer
/* initialise the trap buffer */
/* buffer
/* buffer length
/* ssid
/* header-type
/* command
*/
12-60
Application Source Code
<-- 10
*/
*/
<-- 11
*/
*/
*/
*/
*/
<-- 12
*/
*/
<-- 13
*/
*/
*/
*/
<-- 14
<-- 15

Advertisement

Table of Contents
loading

This manual is also suitable for:

T9576h01

Table of Contents