}
#include "stg_client.h"
-#include "common.h"
+#include "stg/common.h"
STG_CLIENT * cli;
volatile time_t stgTime;
/*
* Set up a storage area for instance data
*/
- DEBUG("rlm_stg: stg_instantiate()");
+ DEBUG("rlm_stg: stg_instantiate()");
data = (rlm_stg_t *)rad_malloc(sizeof(rlm_stg_t));
if (!data) {
return -1;
return -1;
}
- if (cli->Start()) {
- DEBUG("rlm_stg: stg_instantiate() error: '%s'", cli->GetError().c_str());
- return -1;
- }
-
*instance = data;
return 0;
* from the database. The authentication code only needs to check
* the password, the rest is done here.
*/
-static int stg_authorize(void *instance, REQUEST *request)
+static int stg_authorize(void *, REQUEST *request)
{
VALUE_PAIR *uname;
VALUE_PAIR *pwd;
VALUE_PAIR *svc;
DEBUG("rlm_stg: stg_authorize()");
- /* quiet the compiler */
- instance = instance;
- request = request;
-
uname = pairfind(request->packet->vps, PW_USER_NAME);
if (uname) {
DEBUG("rlm_stg: stg_authorize() user name defined as '%s'", uname->vp_strvalue);
/*
* Authenticate the user with the given password.
*/
-static int stg_authenticate(void *instance, REQUEST *request)
+static int stg_authenticate(void *, REQUEST *request)
{
/* quiet the compiler */
VALUE_PAIR *svc;
- instance = instance;
- request = request;
+
DEBUG("rlm_stg: stg_authenticate()");
+
svc = pairfind(request->packet->vps, PW_SERVICE_TYPE);
if (svc) {
DEBUG("rlm_stg: stg_authenticate() Service-Type defined as '%s'", svc->vp_strvalue);
/*
* Massage the request before recording it or proxying it
*/
-static int stg_preacct(void *instance, REQUEST *request)
+static int stg_preacct(void *, REQUEST *)
{
- /* quiet the compiler */
- instance = instance;
- request = request;
DEBUG("rlm_stg: stg_preacct()");
return RLM_MODULE_OK;
/*
* Write accounting information to this modules database.
*/
-static int stg_accounting(void *instance, REQUEST *request)
+static int stg_accounting(void *, REQUEST * request)
{
/* quiet the compiler */
VALUE_PAIR * sttype;
VALUE_PAIR * svc;
VALUE_PAIR * sessid;
svc = pairfind(request->packet->vps, PW_SERVICE_TYPE);
- instance = instance;
- request = request;
+
DEBUG("rlm_stg: stg_accounting()");
sessid = pairfind(request->packet->vps, PW_ACCT_SESSION_ID);
* max. number of logins, do a second pass and validate all
* logins by querying the terminal server (using eg. SNMP).
*/
-static int stg_checksimul(void *instance, REQUEST *request)
+static int stg_checksimul(void *, REQUEST *request)
{
- instance = instance;
DEBUG("rlm_stg: stg_checksimul()");
request->simul_count=0;
return RLM_MODULE_OK;
}
-static int stg_postauth(void *instance, REQUEST *request)
+static int stg_postauth(void *, REQUEST *request)
{
- instance = instance;
VALUE_PAIR *fia;
VALUE_PAIR *svc;
struct in_addr fip;
static int stg_detach(void *instance)
{
DEBUG("rlm_stg: stg_detach()");
- cli->Stop();
delete cli;
free(((struct rlm_stg_t *)instance)->server);
free(((struct rlm_stg_t *)instance)->password);