sendDPIpacket()--Send a DPI Packet to the SNMP Agent


  Syntax
 #include <qtossapi.h>

 int  sendDPIpacket( void *dpimsg_p, int length );   


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The sendDPIpacket() function sends a copy of a Distributed Protocol Interface (DPI®) packet to the SNMP agent (on the same system as the subagent).


Authorities and Locks

None.


Parameters

dpimsg_p
(Input) A pointer to the serialized DPI packet.

length
(Input) The length in bytes of the DPI packet to be sent.

Return Value

The return values are defined in the <qtossapi.h> file.

0 snmpsa_RC_ok

The routine was successful.

-1 snmpsa_RC_err

An exception occurred. Check the subagent job log for the exception information, correct the condition, and resubmit the subagent job. (This return code is only used when a more specific return code is not available.)

-2 snmpsa_RC_noagent

The SNMP agent is not available.

-4 snmpsa_RC_timedout

An internal time-out occurred. See the job log for further information about the exception.

-7 snmpsa_RC_parmerr

A parameter error occurred, probably a null pointer.

-8 snmpsa_RC_lengtherr

The length parameter may be incorrect, or the DPI packet to be sent is longer than the maximum length supported, or the length specified is not a positive number. See any messages in the job log and correct any errors that are indicated, then retry the operation.

-9 snmpsa_RC_buffer

If the subagent was trying to send a response to an SNMP agent request (for example, using get packets), it cannot be sent. The subagent may continue. (The SNMP manager may retry the original request.) If the subagent was trying to send a subagent-initiated packet (for example, using open or register packets), then a dynamic buffer was unavailable, probably due to agent workload. The subagent may try to send the packet again.

-11 snmpsa_RC_canttrap

A trap cannot be sent to the SNMP agent at this time, probably due to pending agent workload. The subagent may retry.

-12 snmpsa_RC_connectfirst

The subagent must connect to the SNMP agent before making this call.

For more information, see the Simple Network Management Protocol (SNMP) SupportLink to PDF manual.


Usage Notes

The sendDPIpacket() function sends a copy of a DPI packet that was sent to the SNMP agent.


Related Information


Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

  #include  <qtossapi.h>
  unsigned  char *pack_p;
  int       rc;

  pack_p = mkDPIopen("1.3.6.1.2.3.4.5",
                "Sample DPI sub-agent"
                0L,2L, DPI_NATIVE_CSET,
                0,(char *)0);
  if (pack_p) {

     /* Send packet to the agent. */
     rc = sendDPIpacket( pack_p, DPI_PACKET_LEN(pack_p) );

  }


API introduced: V3R6

[ Back to top | UNIX-Type APIs | APIs by category ]