📄 classcradiuspacket.html
字号:
<td> </td> <td><p>Add new attribute to the packet. <p>Updates p_attr to point at the free space in the packet. Returns <a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> structure should be used by application in order to set attribute's value. If packet is full, "invalid" attribute is returned.<p>Actual attribute's data is not encoded into the packet until proper attribute's set() method is called. So if application calls <a class="el" href="classCRadiusPacket.html#a18">addAttribute()</a> and then suddenly changes it's mind, it's perfectly OK to simply call <a class="el" href="classCRadiusPacket.html#a18">addAttribute()</a> again or send the packet "as is".<p>Application can analyze return code or use isValid() method of <a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> to verify validity of the returned attribute.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td><tt>[in]</tt> </td><td valign=top><em>p_attrType</em> </td><td>- attribute type </td></tr> <tr><td><tt>[out]</tt> </td><td valign=top><em>p_attr</em> </td><td>- reference to the added attribute </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>RC_SUCCESS or RC_FAIL </dd></dl> </td> </tr></table><a class="anchor" name="a20" doxytag="CRadiusPacket::adjustLength" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int CRadiusPacket::adjustLength </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">ACE_UINT16 </td> <td class="mdname1" valign="top" nowrap> <em>p_length</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adjust packet's length. <p>Adjust (increase) packet's length by specified number of bytes. If packet has not enough space to accomodate requested data, RC_FAIL is returned.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td><tt>[in]</tt> </td><td valign=top><em>p_length</em> </td><td>- how many bytes should be added to the packet </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>RC_SUCCESS or RC_FAIL </dd></dl> </td> </tr></table><a class="anchor" name="a14" doxytag="CRadiusPacket::dump" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void CRadiusPacket::dump </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char * </td> <td class="mdname1" valign="top" nowrap> <em>p_buf</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Dump radius packet in readable text format to the text buffer. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td><tt>[in]</tt> </td><td valign=top><em>p_buf</em> </td><td>- buffer where the packet will be dumped to; buffer should have enough space to carry the dump output </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a17" doxytag="CRadiusPacket::findAttribute" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int CRadiusPacket::findAttribute </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned char </td> <td class="mdname" nowrap> <em>p_attrType</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap><a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> & </td> <td class="mdname" nowrap> <em>p_attr</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Find specific attribute in the packet. <p>Updates p_attr to point at the first attribute of specified type in the packet. If attribute is not found "invalid" attribute is returned. If more than one instance of the same attribute exist in the packet, application should use <a class="el" href="classCRadiusPacket.html#a16">getNextAttribute()</a> interface to retrieve them.<p>Application can analyze return code or use isValid() method of <a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> to verify validity of the returned attribute.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td><tt>[in,out]</tt> </td><td valign=top><em>p_attr</em> </td><td>- input - current attribute; output - next attribute </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>RC_SUCCESS or RC_FAIL </dd></dl> </td> </tr></table><a class="anchor" name="a5" doxytag="CRadiusPacket::getCode" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> unsigned char CRadiusPacket::getCode </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get packet code. <p><dl compact><dt><b>Returns:</b></dt><dd>packet code </dd></dl> </td> </tr></table><a class="anchor" name="a15" doxytag="CRadiusPacket::getFirstAttribute" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int CRadiusPacket::getFirstAttribute </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> & </td> <td class="mdname1" valign="top" nowrap> <em>p_attr</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get first attribute in the packet. <p>Updates p_attr to point at the first attribute in the packet. If packet has no attributes "invalid" attribute is returned.<p>Typical code that goes over all attributes in the packet looks as follows: <div class="fragment"><pre> <a class="code" href="classCRadiusAttribute.html">CRadiusAttribute</a> l_attr; <span class="keywordflow">for</span> (packet->getFirstAttribute(l_attr); l_attr.<a class="code" href="classCRadiusAttribute.html#a11">isValid</a>(); packet->getNextAttribute(l_attr)) { <span class="comment">// do something with the attribute</span> }</pre></div<p>Application can analyze return code or use isValid() method of <a class="el" href="classCRadiusAttribute.html">CRadiusAttribute</a> to verify validity of the returned attribute.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td><tt>[out]</tt> </td><td valign=top><em>p_attr</em> </td><td>- first attribute in the packet </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>RC_SUCCESS or RC_FAIL </dd></dl> </td> </tr></table><a class="anchor" name="a8" doxytag="CRadiusPacket::getID" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> unsigned char CRadiusPacket::getID </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get packet identifier. <p><dl compact><dt><b>Returns:</b></dt><dd>packet identifier </dd></dl> </td> </tr></table><a class="anchor" name="a7" doxytag="CRadiusPacket::getLength" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> ACE_UINT16 CRadiusPacket::getLength </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -