SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-25
Managers Supporting UDP and IPC
  if (PRINT_DEBUG_MSG)
  {
   fprintf(stdout, "\n------ RUNNING REMOTE ------\n");
  }
  return 0;
 } else
 {
  /* Local Access using a file */
  memset(temp_file_name, NULL, sizeof(temp_file_name));
  /* Check for an empty host_name */
  if (strlen(host_int->host_name) != 0)
  {
   strcpy(temp_file_name, host_int->host_name);
   strcat(temp_file_name, ".");
  }
  strcat(temp_file_name, host_int->agent_name);
  strcat(temp_file_name, ".#MGR"); <--30
  host_int->err_num = FILE_OPEN_ (temp_file_name, <--31
   (short)strlen(temp_file_name),
   &host_int->file_num,,, 1);
  if (host_int->err_num)
  {
   /* Check if this also has a remote path using TCP/IP. */
   /* If it does, then turn off the local flag and use remote. */
   if (host_int->dest.sin_family == AF_INET)
   {
   host_int->local_flag = REMOTE_HOSTNAME;
   return SNMP_Open_(host_int, debug_flag);
   }
   fprintf(stdout, "Error %i, on the agent (%s) open \n",
   host_int->err_num, temp_file_name);
   return (host_int->err_num);
  }
  if (PRINT_DEBUG_MSG)
  {
   fprintf(stdout, "\n------ RUNNING LOCAL ------\n");
  }
  return 0;
 }
} /* End SNMP_Open_ */
Example 2-2. Contents of snmpfsc (page 12 of 19)










