int log_auth_goodpass;
int allow_core_dumps;
int debug_level;
+#ifdef WITH_PROXY
int proxy_requests;
+#endif
int reject_delay;
int status_server;
int max_request_time;
* and it should re-send it.
* If configured, encode, sign, and send.
*/
- if ((request->reply->code != 0) ||
- (request->listener->type == RAD_LISTEN_DETAIL)) {
+ if ((request->reply->code != 0)
+#ifdef WITH_DETAIL
+ || (request->listener->type == RAD_LISTEN_DETAIL)
+#endif
+ ) {
DEBUG_PACKET(request, request->reply, 1);
request->listener->send(request->listener, request);
}
/*
* We may want to quench the new request.
*/
- if ((listener->type != RAD_LISTEN_DETAIL) &&
+ if (
+#ifdef WITH_DETAIL
+ (listener->type != RAD_LISTEN_DETAIL) &&
+#endif
!can_handle_new_request(packet, client, root)) {
return 0;
}
*/
if (this->status == RAD_LISTEN_STATUS_CLOSED) {
int count = this->count;
+
+#ifdef WITH_DETAIL
rad_assert(this->type != RAD_LISTEN_DETAIL);
+#endif
#ifdef WITH_PROXY
/*
xel = xel;
- if ((listener->type != RAD_LISTEN_DETAIL) &&
+ if (
+#ifdef WITH_DETAIL
+ (listener->type != RAD_LISTEN_DETAIL) &&
+#endif
(listener->fd < 0)) {
char buffer[256];
thread_pool_addrequest(request, fun);
}
-
+#ifdef WITH_DETAIL
/*
* This function is called periodically to see if this detail
* file is available for reading.
exit(1);
}
}
-
+#endif
static void event_status(struct timeval *wake)
{
for (this = mainconfig.listen; this != NULL; this = this->next) {
listen_socket_t *sock;
- if ((this->type != RAD_LISTEN_AUTH) &&
- (this->type != RAD_LISTEN_ACCT)) continue;
+ if ((this->type != RAD_LISTEN_AUTH)
+#ifdef WITH_ACCOUNTING
+ && (this->type != RAD_LISTEN_ACCT)
+#endif
+ ) continue;
sock = this->data;
* FIXME: For TCP, ignore the *secondary*
* listeners associated with the main socket.
*/
- if ((this->type != RAD_LISTEN_AUTH) &&
- (this->type != RAD_LISTEN_ACCT)) continue;
+ if ((this->type != RAD_LISTEN_AUTH)
+#ifdef WITH_ACCOUNTING
+ && (this->type != RAD_LISTEN_ACCT)
+#endif
+ ) continue;
sock = this->data;
continue;
}
+#ifdef WITHOUT_ACCOUNTING
+ if (comp == RLM_COMPONENT_ACCT) continue;
+#endif
+
+#ifdef WITHOUT_SESSION_MGMT
+ if (comp == RLM_COMPONENT_SESS) continue;
+#endif
+
if (load_component_section(subcs, components, comp) < 0) {
goto error;
}
if (request->master_state == REQUEST_COUNTED) return;
if ((request->listener->type != RAD_LISTEN_NONE) &&
- (request->listener->type != RAD_LISTEN_AUTH) &&
- (request->listener->type != RAD_LISTEN_ACCT)) return;
+#ifdef WITH_ACCOUNTING
+ (request->listener->type != RAD_LISTEN_ACCT) &&
+#endif
+ (request->listener->type != RAD_LISTEN_AUTH)) return;
#undef INC_AUTH
#define INC_AUTH(_x) radius_auth_stats._x++;request->listener->stats._x++;if (request->client && request->client->auth) request->client->auth->_x++;
#undef INC_ACCT
+#ifdef WITH_ACCOUNTING
#define INC_ACCT(_x) radius_acct_stats._x++;request->listener->stats._x++;if (request->client && request->client->acct) request->client->acct->_x++
+#else
+#define INC_ACCT(_x)
+#endif
/*
* Update the statistics.
thread_pool_queue_stats(array);
+#ifdef WITH_DETAIL
for (i = 0; i <= RAD_LISTEN_DETAIL; i++) {
vp = radius_paircreate(request, &request->reply->vps,
162 + i, VENDORPEC_FREERADIUS,
vp->vp_integer = array[i];
}
#endif
+#endif
}
/*
return ((struct rlm_always_t *)instance)->rcode;
}
+#ifdef WITH_SESSION_MGMT
/*
* checksimul fakes some other variables besides the rcode...
*/
return inst->rcode;
}
+#endif
static int always_detach(void *instance)
{
always_return, /* authorization */
always_return, /* preaccounting */
always_return, /* accounting */
+#ifdef WITH_SESSION_MGMT
always_checksimul, /* checksimul */
+#else
+ NULL,
+#endif
always_return, /* pre-proxy */
always_return, /* post-proxy */
always_return /* post-auth */
*/
static int detail_accounting(void *instance, REQUEST *request)
{
+#ifdef WITH_DETAIL
if (request->listener->type == RAD_LISTEN_DETAIL &&
strcmp(((struct detail_instance *)instance)->detailfile,
((listen_detail_t *)request->listener->data)->filename) == 0) {
RDEBUG("Suppressing writes to detail file as the request was just read from a detail file.");
return RLM_MODULE_NOOP;
}
+#endif
return do_detail(instance,request,request->packet, TRUE);
}
}
+#ifdef WITH_ACCOUNTING
/*
* Store logins in the RADIUS utmp file.
*/
return RLM_MODULE_OK;
}
+#endif
+#ifdef WITH_SESSION_MGMT
/*
* See if a user is already logged in. Sets request->simul_count to the
* current session count for this user and sets request->simul_mpp to 2
return RLM_MODULE_OK;
}
+#endif
/* globally exported name */
module_t rlm_radutmp = {
NULL, /* authentication */
NULL, /* authorization */
NULL, /* preaccounting */
+#ifdef WITH_ACCOUNTING
radutmp_accounting, /* accounting */
+#else
+ NULL,
+#endif
+#ifdef WITH_SESSION_MGMT
radutmp_checksimul, /* checksimul */
+#else
+ NULL,
+#endif
NULL, /* pre-proxy */
NULL, /* post-proxy */
NULL /* post-auth */
offsetof(SQL_CONFIG,authorize_group_check_query), NULL, ""},
{"authorize_group_reply_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,authorize_group_reply_query), NULL, ""},
+#ifdef WITH_ACCOUNTING
{"accounting_onoff_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,accounting_onoff_query), NULL, ""},
{"accounting_update_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,accounting_stop_query), NULL, ""},
{"accounting_stop_query_alt", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,accounting_stop_query_alt), NULL, ""},
+#endif
{"group_membership_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,groupmemb_query), NULL, NULL},
{"connect_failure_retry_delay", PW_TYPE_INTEGER,
offsetof(SQL_CONFIG,connect_failure_retry_delay), NULL, "60"},
+#ifdef WITH_SESSION_MGMT
{"simul_count_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,simul_count_query), NULL, ""},
{"simul_verify_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,simul_verify_query), NULL, ""},
+#endif
{"postauth_query", PW_TYPE_STRING_PTR,
offsetof(SQL_CONFIG,postauth_query), NULL, ""},
{"safe-characters", PW_TYPE_STRING_PTR,
}
}
+#ifdef WITH_ACCOUNTING
/*
* Accounting: save the account data to our sql table
*/
return ret;
}
+#endif
+#ifdef WITH_SESSION_MGMT
/*
* See if a user is already logged in. Sets request->simul_count to the
* current session count for this user.
*/
return RLM_MODULE_OK;
}
+#endif
/*
* Execute postauth_query after authentication
NULL, /* authentication */
rlm_sql_authorize, /* authorization */
NULL, /* preaccounting */
+#ifdef WITH_ACCOUNTING
rlm_sql_accounting, /* accounting */
+#else
+ NULL,
+#endif
+#ifdef WITH_SESSION_MGMT
rlm_sql_checksimul, /* checksimul */
+#else
+ NULL,
+#endif
NULL, /* pre-proxy */
NULL, /* post-proxy */
rlm_sql_postauth /* post-auth */