/* * Write accounting information to this modules database. */ static rlm_rcode_t perl_accounting(void *instance, REQUEST *request) { VALUE_PAIR *pair; int acctstatustype=0; if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE, 0, TAG_ANY)) != NULL) { acctstatustype = pair->vp_integer; } else { radlog(L_ERR, "Invalid Accounting Packet"); return RLM_MODULE_INVALID; } switch (acctstatustype) { case PW_STATUS_START: if (((PERL_INST *)instance)->func_start_accounting) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_start_accounting); } else { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } break; case PW_STATUS_STOP: if (((PERL_INST *)instance)->func_stop_accounting) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_stop_accounting); } else { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } break; default: return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } }
/* * Send CoA request */ static rlm_rcode_t perl_send_coa(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_send_coa); }
/* * Pre-Auth request */ static rlm_rcode_t perl_post_auth(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_post_auth); }
/* * Check for simultaneouse-use */ static rlm_rcode_t perl_checksimul(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_checksimul); }
/* * Authenticate the user with the given password. */ static rlm_rcode_t perl_authenticate(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_authenticate); }
/* * Post-Proxy request */ static int perl_post_proxy(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_post_proxy); }
/* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int perl_authorize(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_authorize); }
/* * Recv CoA request */ static int perl_recv_coa(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_recv_coa); }