z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


The pDPIpacket() function

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

Format

#include <snmp_dpi.h>
 
snmp_dpi_hdr *pDPIpacket(unsigned char *packet_p);

Parameters

packet_p
A pointer to a serialized DPI packet.

Return codes

  • If successful, a pointer to a DPI parse tree (snmp_dpi_hdr) is returned. Memory for the parse tree has been dynamically allocated, and it is the callers responsibility to free it when no longer needed. You can use the fDPIparse() function to free the parse tree.
  • If not successful, a NULL pointer is returned.

Usage

The pDPIpacket() function parses the buffer pointed to by the packet_p parameter. It ensures that the buffer contains a valid DPI packet and that the packet is for a DPI version and release that is supported by the DPI functions in use.

Examples

  #include <snmp_dpi.h>
  unsigned char       *pack_p;
  snmp_dpi_hdr        *hdr_p;
 
  hdr_p = pDPIpacket(pack_p);       /* parse incoming packet */
                                    /* assume it's in pack_p */
  if (hdr_p) {
     /* analyze packet, and handle it */
  }

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014