DPI_PACKET_LEN()--Get Length of DPI Packet


  Syntax
 #include <qtossapi.h>

 int    DPI_PACKET_LEN( unsigned char *packet_p );   


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The DPI_PACKET_LEN() macro returns the length (number of bytes) of a Distributed Protocol Interface (DPI®) packet.


Authorities and Locks

None.


Parameters

packet_p
(Input) A pointer to a (serialized) DPI packet.

Return Value

value An integer value that represents the total DPI packet length.

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


Usage Notes

The DPI_PACKET_LEN() macro generates a C expression that returns an integer that represents the total length of a DPI packet. It uses the first 2 bytes (in network byte order) of the packet to calculate the length. The length returned includes these first 2 bytes.


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            length;

  pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
  if (pack_p) {
     length = DPI_PACKET_LEN(pack_p);
     /* Send packet to agent or subagent. */
  }



API introduced: V3R6

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