debugDPI()--Set DPI Packet Trace


  Syntax
 #include <qtossapi.h>

 void   debugDPI( int level );  


  Service Program Name: QTOSSAPI

  Default Public Authority: *USE

  Threadsafe: No

The debugDPI() function sets the level of the Distributed Protocol Interface (DPI®) packet trace. The trace consists of a representation (printed to STDERR) of DPI packets as they are parsed (by the pDPIpacket() function) or made (by one of the mkDPIxxx() APIs). The trace is written to ILE C standard error output.


Authorities and Locks

None.


Parameters

level
(Input) The level of tracing to perform. If this value is zero, tracing is turned off. If it has any other value, tracing is turned on at the specified level. The higher the value, the more detail. A higher level includes all lower levels of tracing. Possible values follow:
0 Turn off packet tracing
1 Display packet creation and parsing
2 Level 1, plus display the hexadecimal dump of incoming and outgoing DPI packets.

Usage Notes

The debugDPI() function is used to turn the DPI packet trace on or off.


Related Information


Example

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

  #include <qtossapi.h>

  debugDPI(2);

Following are some examples of the DPI packet trace. A simple way to view STDERR is to run your program in batch in a submitted job.

The following is an example of a trace, with the level parameter set to 1, of a register packet made by the subagent's call to mkDPIregister(). This is indicated in the trace by the letter c (for create) at the beginning of a trace line. Immediately following that is the parse of the response packet that the subagent got back from the SNMP agent. This is indicated in the trace by the letter p (for parse) at the beginning of a trace line.

 cDPIpacket: Major=2, Version=2, Release=0, Id=1, Type=SNMP_DPI_REGISTER
 cDPIreg: subtree=1.3.6.1.2.3.4.5.6., priority=0, timeout=4
          view_selection=No
          bulk_selection=No
 pDPIpacket: Major=2, Version=2, Release=0, Id=1, Type=SNMP_DPI_RESPONSE
 pDPIresp: ret_code=0 [0x0] (noError), ret_index=255
 pDPIset: subtree=1.3.6.1.2.3.4.5.6, instance=** NONE **
          object=1.3.6.1.2.3.4.5.6
          value_type=NULL ['04'H], value_len=0
          value=** NULL **

Next is an example of a "get" packet that is received by a subagent. Immediately following that is the response packet that the subagent built (indicated by the letter c) by calling mkDPIresponse().

 pDPIpacket: Major=2, Version=2, Release=0, Id=2, Type=SNMP_DPI_GET
             Community=** NONE **
 pDPIget: subtree=1.3.6.1.2.3.4.5.6., instance=1.0
          object=1.3.6.1.2.3.4.5.6.1.0
 cDPIpacket: Major=2, Version=2, Release=0, Id=2, Type=SNMP_DPI_RESPONSE
 cDPIresp: ret_code=0 [0x0] (noError), ret_index=0
 cDPIset: subtree=1.3.6.1.2.3.4.5.6., instance=1.0
          object=1.3.6.1.2.3.4.5.6.1.0
          value_type=Integer32 ['81'H], value_len=4
          value=1 [0x00000001]

Next is an example of the trace with the level parameter set to 2. This causes a hexadecimal dump of the DPI packet to be generated when pDPIpacket() is called, in addition to the trace level of 1. Next is the same packet as parsed by pDPIpacket(), and immediately following that is the response packet that the subagent built by calling mkDPIresponse().

 Dump of 33 byte incoming DPI packet:
   00 1f 02 02 00 00 03 02 00 00 f1 4b f3 4b f6 4b
   f1 4b f2 4b f3 4b f4 4b f5 4b f6 4b 00 f5 4b f0
   00
 pDPIpacket: Major=2, Version=2, Release=0, Id=3, Type=SNMP_DPI_GETNEXT
             Community=** NONE **
 pDPInext: subtree=1.3.6.1.2.3.4.5.6., instance=5.0
           object=1.3.6.1.2.3.4.5.6.5.0
 cDPIpacket: Major=2, Version=2, Release=0, Id=3, Type=SNMP_DPI_RESPONSE
 cDPIresp: ret_code=0 [0x0] (noError), ret_index=0
 cDPIset: subtree=1.3.6.1.2.3.4.5.6., instance=6.0
          object=1.3.6.1.2.3.4.5.6.6.0
          value_type=Counter32 ['86'H], value_len=4
          value=6 [0x00000006]



API introduced: V3R6

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