📄 classcradiusserverstack.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>ace-radius: CRadiusServerStack Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.7-20040704 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a></div><h1>CRadiusServerStack Class Reference</h1>Server RADIUS stack implementation. <a href="#_details">More...</a><p><code>#include <<a class="el" href="CRadiusServerStack_8h-source.html">CRadiusServerStack.h</a>></code><p><a href="classCRadiusServerStack-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a0">CRadiusServerStack</a> (<a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> *p_secret=NULL, ACE_UINT16 p_port=D_RADIUS_AUTHENTICATION_PORT, const char *p_hostname=NULL)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a1">start</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Start underlying thread. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a2">sendPacket</a> (<a class="el" href="classCRadiusPacket.html">CRadiusPacket</a> *p_packet, const ACE_INET_Addr &p_clientAddress, int p_calculateAuthenticator=D_TRUE)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Send packet to the network. <a href="#a2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a3">handleRequest</a> (<a class="el" href="classCRadiusPacket.html">CRadiusPacket</a> *p_packet, const ACE_INET_Addr &p_clientAddress)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Callback on request packet receive. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a5" doxytag="CRadiusServerStack::abort" ></a>void </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a5">abort</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Abort task. <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a6">getSecret</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Get instance of RADIUS secret class. <a href="#a6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#a7">setSecret</a> (<a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> *p_secret)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set instance of RADIUS secret class. <a href="#a7"></a><br></td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r0" doxytag="CRadiusServerStack::m_packet" ></a><a class="el" href="classCRadiusPacket.html">CRadiusPacket</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r0">m_packet</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">RADIUS packet that is being currently received. <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r1" doxytag="CRadiusServerStack::m_serverAddress" ></a>ACE_INET_Addr </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r1">m_serverAddress</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Server address. <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r2" doxytag="CRadiusServerStack::m_clientAddress" ></a>ACE_INET_Addr </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r2">m_clientAddress</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">client address <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r3" doxytag="CRadiusServerStack::m_socket" ></a>ACE_SOCK_Dgram </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r3">m_socket</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">UDP socket. <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r4" doxytag="CRadiusServerStack::m_AbortTask" ></a>int </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r4">m_AbortTask</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Abort task flag. <br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="r5" doxytag="CRadiusServerStack::m_secret" ></a><a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classCRadiusServerStack.html#r5">m_secret</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">RADIUS secret key. <br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Server RADIUS stack implementation. <p>CRadiusServerStack class is typically needed by RADIUS servers or proxies. It receives incoming RADIUS requests and passes them to the user application for processing. The latter has an option to build response packet and send it over the network or silently discard the incoming packet.<p>The default implementation is "fully synchronic" - each time the packet is received from the network it is immediately passed to the user application callback and there and only there application may build the response packet and send it to the network. If application needs "asynchronic" architecture - i.e. it wishes to continue processing incoming packets while it constructs the response packet, it should take responsibility for packet allocation and deallocation. <p><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="CRadiusServerStack::CRadiusServerStack" ></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"> CRadiusServerStack::CRadiusServerStack </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> * </td> <td class="mdname" nowrap> <em>p_secret</em> = <code>NULL</code>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>ACE_UINT16 </td> <td class="mdname" nowrap> <em>p_port</em> = <code>D_RADIUS_AUTHENTICATION_PORT</code>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>p_hostname</em> = <code>NULL</code></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>Constructor. <p>Note that constructing CRadiusServerStack is not enough - you should explicitly call <a class="el" href="classCRadiusServerStack.html#a1">start()</a> method in order to create underlying thread.<p>Specifying secret key is optional, however if your application doesn't do it User-Password attributes in incoming packets will not be decoded properly. Application may specify or modify secret key later on by using <a class="el" href="classCRadiusServerStack.html#a6">getSecret()</a> and <a class="el" href="classCRadiusServerStack.html#a7">setSecret()</a> methods.<p>It's worth noting that only pointer to the secret key object is stored inside the class, so application should keep instance of <a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> class as long as this instance of CRadiusServerStack class exists.<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_secret</em> </td><td>- secret key (optional) </td></tr> <tr><td><tt>[in]</tt> </td><td valign=top><em>p_port</em> </td><td>- RADIUS server port (optional) </td></tr> <tr><td><tt>[in]</tt> </td><td valign=top><em>p_hostname</em> </td><td>- RADIUS server hostname (optional, if you have only one IP address there is no need to specify it) </td></tr> </table></dl> </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a6" doxytag="CRadiusServerStack::getSecret" ></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"> <a class="el" href="classCRadiusSecret.html">CRadiusSecret</a> * CRadiusServerStack::getSecret </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 instance of RADIUS secret class. <p>Use this interface to modify shared secret key associated with this Server Stack. </td> </tr></table><a class="anchor" name="a3" doxytag="CRadiusServerStack::handleRequest" ></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 CRadiusServerStack::handleRequest </td> <td class="md" valign="top">( </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -