Permalink
Browse files

radiusplugin_v2.1_beta2.tar.gz

  • Loading branch information...
1 parent 53fc920 commit b1ad7d7d9d6458872e18729c0dccda40b5c15e48 @squadette committed May 4, 2009
Showing with 35 additions and 11 deletions.
  1. +2 −1 AccountingProcess.cpp
  2. +2 −2 AcctScheduler.cpp
  3. +7 −5 ChangeLog
  4. +17 −1 User.cpp
  5. +5 −1 User.h
  6. +2 −1 radiusplugin.cpp
View
@@ -99,7 +99,8 @@ void AccountingProcess::Accounting(PluginContext * context)
user->setCommonname(context->acctsocketforegr.recvStr());
user->setAcctInterimInterval(context->acctsocketforegr.recvInt());
user->setFramedRoutes(context->acctsocketforegr.recvStr());
- user->setKey(context->acctsocketforegr.recvStr());
+ user->setKey(context->acctsocketforegr.recvStr());
+ user->setStatusFileKey(context->acctsocketforegr.recvStr());
user->setUntrustedPort(context->acctsocketforegr.recvStr());
context->acctsocketforegr.recvBuf(user);
if (DEBUG (context->getVerbosity()))
View
@@ -76,7 +76,7 @@ void AcctScheduler::delUser(PluginContext * context, UserAcct *user)
uint64_t bytesin=0, bytesout=0;
//get the sent and received bytes
- this->parseStatusFile(context, &bytesin, &bytesout,user->getKey().c_str());
+ this->parseStatusFile(context, &bytesin, &bytesout,user->getStatusFileKey().c_str());
user->setBytesIn(bytesin & 0xFFFFFFFF);
user->setBytesOut(bytesout & 0xFFFFFFFF);
@@ -162,7 +162,7 @@ void AcctScheduler::doAccounting(PluginContext * context)
if (DEBUG (context->getVerbosity()))
cerr << getTime() << "RADIUS-PLUGIN: BACKGROUND-ACCT: Scheduler: Update for User " << iter1->second.getUsername() << ".\n";
- this->parseStatusFile(context, &bytesin, &bytesout,iter1->second.getKey().c_str());
+ this->parseStatusFile(context, &bytesin, &bytesout,iter1->second.getStatusFileKey().c_str());
iter1->second.setBytesIn(bytesin & 0xFFFFFFFF);
iter1->second.setBytesOut(bytesout & 0xFFFFFFFF);
iter1->second.setGigaIn(bytesin >> 32);
View
@@ -79,12 +79,14 @@ radiusplugin_2.0d_beta:
- close socket in radiuspacket.cpp on retries
- add parenthesize to avoid compiler warnings
-radiusplugin_2.1_beta:
-- Support for OPENVPN_PLUGIN_FUNC_DEFERRED, the authentication is done a thread if an auth_control_file is defined.
--- The OpenVPN process needs write permission in the OpenVPN directory.
+radiusplugin_2.1:
+- Support of OPENVPN_PLUGIN_FUNC_DEFERRED:
+*** The communication to the radius server for authentication is outsourced in a thread.
+*** If an auth control file is defined and "useauthcontrolfile=true" is defined in the config file of plugin the authentication is done the background.
+*** The OpenVPN process needs write permission in the OpenVPN directory.
- Timestamps are included in the debug information.
- Adapted to OPENVPN_PLUGIN_VERSION 2
-- Option to swith on/off the usage of auth control files
- Internal key is now based on untrusted_ip and untrusted_before.
+- Separated key for status file is added.
+
-
View
@@ -27,6 +27,7 @@ User::User()
this->framedip="";
this->framedroutes="";
this->key="";
+ this->statusfilekey="";
this->untrustedport="";
this->acctinteriminterval=0;
this->portnumber=0;
@@ -68,6 +69,7 @@ User & User::operator=(const User & u)
this->framedroutes=u.framedroutes;
this->framedip=u.framedip;
this->key=u.key;
+ this->statusfilekey=u.statusfilekey;
this->callingstationid=u.callingstationid;
this->portnumber=u.portnumber;
this->acctinteriminterval=u.acctinteriminterval;
@@ -96,6 +98,7 @@ User::User(const User & u)
this->framedroutes=u.framedroutes;
this->framedip=u.framedip;
this->key=u.key;
+ this->statusfilekey=u.statusfilekey;
this->callingstationid=u.callingstationid;
this->portnumber=u.portnumber;
this->acctinteriminterval=u.acctinteriminterval;
@@ -171,14 +174,27 @@ string User::getKey(void)
{
return this->key;
}
-/** The setter method for a unique, it is build from commonname, ip and port.
+/** The setter method for a unique, it is build from ip and port.
* @param key The unique key.
*/
void User::setKey(string key)
{
this->key=key;
}
+/** The getter method for the status file key.
+ * @return The unique status file key as a string.*/
+string User::getStatusFileKey(void)
+{
+ return this->statusfilekey;
+}
+/** The setter method for a unique, it is build from commonname, ip and port.
+ * @param key The unique status file key.
+ */
+void User::setStatusFileKey(string key)
+{
+ this->statusfilekey=key;
+}
/** The getter method for the calling station id.
* @return The calling station id as a string.*/
View
6 User.h
@@ -47,7 +47,8 @@ class User
string framedroutes; /**<The framedroutes, they are stored as a string. if there are more routes, they must be delimted by an ';'*/
string framedip; /**<The framed ip.*/
string callingstationid; /**<The calling station id, in this case the real ip addres of the client.*/
- string key; /**<A unique key to find the user in a map. It is the same like the unique identifier in the status log file (version 1) "commonname,untrusted_ip:untrusted_port"*/
+ string key; /**<A unique key to find the user in a map. */
+ string statusfilekey; /**<Unique identifier in the status log file (version 1) "commonname,untrusted_ip:untrusted_port"*/
int portnumber; /**<The portnumber.*/
time_t acctinteriminterval; /**<The acct interim interval.*/
string untrustedport; /**<The untrusted port number from OpenVPN for a client.*/
@@ -77,6 +78,9 @@ class User
string getKey(void);
void setKey(string);
+
+ string getStatusFileKey(void);
+ void setStatusFileKey(string);
string getCallingStationId(void);
void setCallingStationId(string);
View
@@ -439,7 +439,7 @@ extern "C"
newuser->setUntrustedPort ( get_env ( "untrusted_port", envp ) );
- //newuser->setKey(newuser->getCommonname() +string ( "," ) + untrusted_ip + string ( ":" ) + get_env ( "untrusted_port", envp ) );
+ newuser->setStatusFileKey(newuser->getCommonname() +string ( "," ) + untrusted_ip + string ( ":" ) + get_env ( "untrusted_port", envp ) );
newuser->setKey(untrusted_ip + string ( ":" ) + get_env ( "untrusted_port", envp ) );
if ( DEBUG ( context->getVerbosity() ) ) cerr << getTime() << "RADIUS-PLUGIN: FOREGROUND: Key: " << newuser->getKey() << ".\n";
@@ -570,6 +570,7 @@ extern "C"
context->acctsocketbackgr.send ( newuser->getAcctInterimInterval() );
context->acctsocketbackgr.send ( newuser->getFramedRoutes() );
context->acctsocketbackgr.send ( newuser->getKey() );
+ context->acctsocketbackgr.send ( newuser->getStatusFileKey());
context->acctsocketbackgr.send ( newuser->getUntrustedPort() );
context->acctsocketbackgr.send ( newuser->getVsaBuf(), newuser->getVsaBufLen() );
//get the response

0 comments on commit b1ad7d7

Please sign in to comment.