
Trap Multiplexer Subagent/Manager
SNMP Configuration and Management Manual — 424777-006
12 -59
Application Source Code
/* send the comand to the distributor */
send_spi_cmd (spi_buf, distr);
} /* spi_cmd_load_filter */
/*************************************************************************/
#pragma PAGE "insert_null()"
/* this routine inserts a NULL at the end of an array of characters so
that printf can print it as a string and returns the pointer to
the beginning of the printable string
Input : pointer to t_buffer and length of the data
Return : pointer to the beginning of the string
*/
char* insert_null(char* pt_buffer, short* len) <-- 8
{
char* b_ptr; /* base pointer */
pt+; /* skip the type */
*len = *pt_buffer; /* get the length from the second byte */
pt+; /* skip the length */
b_ptr = pt_ *len; /* point to the end of array */
*b_ptr = 0; /* insert a null to print as a string */
return pt_buffer;
} /* insert_null */
/*************************************************************************/
#pragma PAGE "print_octetstring()"
/* this routine prints an octet string variable. Nonprintable
chars are replaced with "."
Input : pointer to the buffer, length and title to be displayed
Return : None
*/
void print_octetstring(char* buffer, int buflen, char* title) <-- 9
{
static char printbuf[2048];
unsigned char c;
int i;
memcpy (printbuf, buffer, buflen);
printbuf[buflen] = '\0';
for (i = 0; i < buflen; i++) {
c = *+;
if (c < 32 || c >= 127)
printbuf[i] = '.';
}
printf ( "%s %s\n", title, printbuf);
} /* print_octetstring */
/*************************************************************************/
#pragma PAGE "getevent_loop()"
/* this procedure contains a loop to retrieve event messages. Each time
through the loop, the procedure gets all the tokens pertaining to this
event and displays them on the terminal.
Example 12-3. Sample Application Source Code
(page 4 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 ...