SNMP Configuration and Management Manual
Trap Multiplexer Subagent/Manager
SNMP Configuration and Management Manual—424777-006
12-68
Application Source Code
if (error)
{
printf ("FILENAME_RESOLVE_ returned %d\n", error);
exit (1);
}
/* this will convert an external filename into an internal filename for
passing it to the EMS routines */
error = FILENAME_TO_OLDFILENAME_ (filt_name_Dxx, /* filename */ <-- 39
file_name_len, /* length */
(short*)filt_name_Cxx); /* old filename */
if (error)
{
printf ("FILENAME_TO_OLDFILENAME_ returned %d\n", error);
exit (1);
}
/* initialize sub-system-ids */
cptr = strncpy(emsssid.u_z_filler.z_filler,ZSPI_VAL_TANDEM,8); <-- 40
emsssid.z_number = ZSPI_SSN_ZEMS;
emsssid.z_version = ZEMS_VAL_VERSION;
cptr = strncpy(tmxssid.u_z_filler.z_filler, ZSPI_VAL_TANDEM, 8);
tmxssid.z_number = ZSPI_SSN_ZTMX;
tmxssid.z_version = ZTMX_VAL_VERSION;
/* malloc some memory for spi buffers */
spi_buf = malloc(ZCOM_VAL_MAX_RSP_BUFLEN); <-- 41
if (spi_buf == NULL)
DEBUG();
/* Initialize the startup message structure */
error = get_startup_msg (&ci_startup, &startup_msg_actual_len);
ci_startup.param[0] = 0;
/* create a new process */
ccval = PROCESS_CREATE_ ("$system.system.emsdist", /* program file */ <-- 42
(short)strlen("$system.system.emsdist"), /* length */
,,,,,,,,, /* optional */
&err_detail,
4, /* name option */
,,
proc_name, /* process name */
proc_name_len, /* max length */
&proc_len); /* actual length */
if (ccval)
{
printf ("PROCESS_CREATE_ returned : %d\n", ccval);
exit(1);
}
Example 12-3. Sample Application Source Code (page 13 of 14)