163 lines
5.3 KiB
HTML
163 lines
5.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
|
<title>fDPIset()--Free Storage from DPI Set Packet</title>
|
|
<!-- Begin Header Records ========================================== -->
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body>
|
|
<!--End Header Records --><!-- Edited by Kersten Feb 02 -->
|
|
<!-- Java sync-link -->
|
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
|
</script>
|
|
|
|
<a name="Top_Of_Page"></a>
|
|
|
|
<h2>fDPIset()--Free Storage from DPI Set Packet</h2>
|
|
|
|
<div class="box" style="width: 80%;">
|
|
<br>
|
|
Syntax<br>
|
|
<pre>
|
|
#include <qtossapi.h>
|
|
|
|
void fDPIset( snmp_dpi_set_packet <em>*packet_p</em> );
|
|
|
|
</pre>
|
|
|
|
<br>
|
|
Service Program Name: QTOSSAPI<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: No<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The <strong>fDPIset()</strong> function frees storage that was previously
|
|
allocated for snmp_dpi_set_packet structures.</p>
|
|
|
|
<br>
|
|
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
|
|
<!-- Instead, use the commented out coding below to indicate NONE. -->
|
|
<h3>Authorities and Locks</h3>
|
|
|
|
<!-- Use this if there are no authorities and locks. -->
|
|
<p>None.</p>
|
|
|
|
<br>
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>packet_p</strong></dt>
|
|
|
|
<dd>(Input) A pointer to the first snmp_dpi_set_packet structure in a chain of
|
|
such structures.</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
<h3>Usage Notes</h3>
|
|
|
|
<p>The <strong>fDPIset()</strong> function is typically used if you must free a
|
|
chain of one or more snmp_dpi_set_packet structures. This may be the case if
|
|
you are in the middle of preparing a chain of such structures for a DPI
|
|
RESPONSE packet, but then run into an error before you can actually make the
|
|
response.</p>
|
|
|
|
<p>If you get to the point where you make a DPI response packet to which you
|
|
pass the chain of snmp_dpi_set_packet structures, then the
|
|
<strong>mkDPIresponse()</strong> function will free the chain of
|
|
snmp_dpi_set_packet structures. Similarly, if you pass the chain of
|
|
snmp_dpi_set_packet structures to <strong>mkDPItrap()</strong> to make a DPI
|
|
trap request, the storage will be freed.</p>
|
|
|
|
<p>Unnecessary free operations may result in an MCH6902 (type 2). If this
|
|
occurs, remove the call to <strong>fDPIset()</strong>.</p>
|
|
|
|
<br>
|
|
<h3>Related Information</h3>
|
|
|
|
<ul>
|
|
<li>The <<strong>qtossapi.h</strong>> file (see <a href="unix13.htm">Header
|
|
Files for UNIX-Type Functions</a>)<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="respsnmp.htm">mkDPIresponse()</a>--Make a DPI Response Packet<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li><a href="setsnmp.htm">mkDPIset()</a>--Make a DPI Set Packet</li>
|
|
</ul>
|
|
<br>
|
|
<h3>Example</h3>
|
|
|
|
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
|
|
for information pertaining to code examples.</p>
|
|
|
|
<pre>
|
|
#include <qtossapi.h>
|
|
unsigned char *pack_p;
|
|
snmp_dpi_hdr *hdr_p;
|
|
snmp_dpi_set_packet *set_p, *first_p;
|
|
long int num1 = 0, num2 = 0;
|
|
|
|
/* ... */
|
|
|
|
/* The subagent was waiting for work from the SNMP agent, and */
|
|
/* a message arrives... */
|
|
|
|
hdr_p = pDPIpacket(pack_p); /* Assume pack_p */
|
|
/* analyze packet and assume all OK */ /* points to the */
|
|
/* now prepare response; 2 varBinds */ /* incoming packet. */
|
|
|
|
set_p = mkDPIset(snmp_dpi_NULL_p, /* Create first one */
|
|
"1.3.6.1.2.3.4.5.","1.0", /* OID=1, instance=0.*/
|
|
SNMP_TYPE_Integer32,
|
|
sizeof(num1), &num1);
|
|
if (set_p) { /* If successful, then */
|
|
first_p = set_p; /* save pointer to first */
|
|
set_p = mkDPIset(set_p, /* chain. Next one */
|
|
"1.3.6.1.2.3.4.5.","1.1", /* OID=1, instance=1.*/
|
|
SNMP_TYPE_Integer32,
|
|
sizeof(num2), &num2);
|
|
if (set_p) { /*If successful, 2nd one */
|
|
pack_p = mkDPIresponse(hdr_p, /* makes response. */
|
|
SNMP_ERROR_noError, /* It will also free */
|
|
0L, first_p); /* the set_p tree. */
|
|
/* Send DPI response to agent. */
|
|
} else { /* If 2nd mkDPIset fails, */
|
|
fDPIset(first_p); /* it must free chain. */
|
|
}
|
|
}
|
|
|
|
</pre>
|
|
|
|
<br>
|
|
<hr>
|
|
API introduced: V3R6
|
|
|
|
<hr>
|
|
<center>
|
|
<table cellpadding="2" cellspacing="2">
|
|
<tr align="center">
|
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> |
|
|
<a href="unix.htm">UNIX-Type APIs</a> |
|
|
<a href="aplist.htm">APIs by category</a> </td>
|
|
</tr>
|
|
</table></center>
|
|
</body>
|
|
</html>
|
|
|