SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-27
Managers Supporting UDP and IPC
short read_cnt;
short send_cnt;
short status;
short temp_file_num;
short written_cnt;
*rpkt = 0;
if (host_int->version != 1)
return HOST_INT_ERROR;
EBufferReset(ebuffp); /* Reset the buffer to a known state */ <--34
host_int->err_num = 0;
host_int->count_read = 0;
host_int->count_written = 0;
/* Make sure it is pointing to something */
if (ebuffp->remaining < 20)
{
if (PRINT_DEBUG_MSG)
{
fprintf(stdout, "Buffer pointer (EBUFFP) is too small.\n");
}
return BAD_EBUFF_PARAM;
}
/* now create myEBuff from *ebuffp. myEBuff will then be bumped */
/* up to take into account the SOCKADDR_IN structure at the */
/* beginning of the TCP/IP data message interface. */
memcpy ((char*) &myEBuff, (void *) ebuffp, sizeof(myEBuff));
if(host_int->local_flag == REMOTE_HOSTNAME) <--35
{
myEBuff.start_bp += sizeof(struct sockaddr_in);
myEBuff.next_bp += sizeof(struct sockaddr_in);
myEBuff.remaining -= sizeof(struct sockaddr_in);
} /* end of if(host_int->local_flag == REMOTE_HOSTNAME) */
err = tdm_SNMP_Encode_Packet(spkt, &myEBuff, host_int->local_flag); <--36
Example 2-2. Contents of snmpfsc (page 14 of 19)