Main Page | Class List | File List | Class Members

ace-radius/RadiusServerStack.h

00001 /* 00002 * This source file is part of the ace-radius library. This code was 00003 * written by Alex Agranov in 2004-2009, and is covered by the BSD open source 00004 * license. Refer to the accompanying documentation for details on usage and 00005 * license. 00006 */ 00007 00008 #ifndef _RADIUSSERVERSTACK_H__ 00009 #define _RADIUSSERVERSTACK_H__ 00010 00011 #include "Radius.h" 00012 #include "RadiusPacket.h" 00013 #include "RadiusAddress.h" 00014 #include "RadiusAttribute.h" 00015 #include "RadiusSecret.h" 00016 00017 #ifdef _MSC_VER 00018 #include <winsock2.h> 00019 #endif 00020 00042 class RadiusServerStack 00043 { 00044 public: 00046 00056 RadiusServerStack(RadiusSecret p_secret, 00057 uint16_t p_port = D_RADIUS_AUTHENTICATION_PORT, 00058 const char * p_hostname = NULL); 00059 00060 00062 ~RadiusServerStack(); 00063 00064 00066 bool isValid(); 00067 00068 00070 00080 int setBlockMode(bool p_block); 00081 00082 00084 00097 int receiveRequest(); 00098 00099 00101 00106 RadiusPacket & getRequest(); 00107 00108 00110 00116 RadiusAddress & getClientAddress(); 00117 00119 00128 int sendResponse(RadiusPacket & p_response, bool p_calculateAuthenticator = true); 00129 00130 private: 00131 00133 RadiusAddress m_serverAddress; 00134 00136 #ifdef _MSC_VER 00137 SOCKET m_socket; 00138 #else 00139 int m_socket; 00140 #endif 00141 00143 bool m_isValid; 00144 00146 RadiusPacket m_request; 00147 00149 RadiusSecret m_secret; 00150 00152 RadiusAddress m_clientAddress; 00153 }; 00154 00155 00156 00157 #endif // _RADIUSSERVERSTACK_H__ 00158

Generated on Tue Aug 11 18:35:07 2009 for ace-radius by doxygen 1.3.7-20040704