#else
#ifdef HAVE_OPENSSL_SSL_H
#ifndef WITH_TLS
+#ifndef NO_OPENSSL
#define WITH_TLS (1)
#endif
#endif
#endif
+#endif
/*
* WITH_VMPS is handled by src/include/autoconf.h
#define request_stats_init(_x)
#define request_stats_final(_x)
-#define FR_STATS_INC(_x)
+#define FR_STATS_INC(_x, _y)
#define FR_STATS_TYPE_INC(_x)
#endif
#ifndef FR_TLS_H
#define FR_TLS_H
-#ifndef NO_OPENSSL
+#ifdef WITH_TLS
/*
* @file tls.h
}
#endif
-#endif /* NO_OPENSSL */
+#endif /* WITH_TLS */
#endif /* FR_TLS_H */
#include <freeradius-devel/autoconf.h>
#include <freeradius-devel/radiusd.h>
-#ifndef NO_OPENSSL
+#ifdef WITH_TLS
void cbtls_info(const SSL *s, int where, int ret)
{
return(strlen((char *)userdata));
}
-#endif /* !defined(NO_OPENSSL) */
+#endif
};
-int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p)
-{
- const char *vp_name = name;
- REQUEST *myrequest = request;
- DICT_ATTR *da;
- VALUE_PAIR *vps = NULL;
-
- *vp_p = NULL;
-
- /*
- * Allow for tunneled sessions.
- */
- if (strncmp(vp_name, "outer.", 6) == 0) {
- if (!myrequest->parent) return TRUE;
- vp_name += 6;
- myrequest = myrequest->parent;
- }
-
- if (strncmp(vp_name, "request:", 8) == 0) {
- vp_name += 8;
- vps = myrequest->packet->vps;
-
- } else if (strncmp(vp_name, "reply:", 6) == 0) {
- vp_name += 6;
- vps = myrequest->reply->vps;
-
-#ifdef WITH_PROXY
- } else if (strncmp(vp_name, "proxy-request:", 14) == 0) {
- vp_name += 14;
- if (request->proxy) vps = myrequest->proxy->vps;
-
- } else if (strncmp(vp_name, "proxy-reply:", 12) == 0) {
- vp_name += 12;
- if (request->proxy_reply) vps = myrequest->proxy_reply->vps;
-#endif
-
- } else if (strncmp(vp_name, "config:", 7) == 0) {
- vp_name += 7;
- vps = myrequest->config_items;
-
- } else if (strncmp(vp_name, "control:", 8) == 0) {
- vp_name += 8;
- vps = myrequest->config_items;
-
-#ifdef WITH_COA
- } else if (strncmp(vp_name, "coa:", 4) == 0) {
- vp_name += 4;
-
- if (myrequest->coa &&
- (myrequest->coa->proxy->code == PW_COA_REQUEST)) {
- vps = myrequest->coa->proxy->vps;
- }
-
- } else if (strncmp(vp_name, "coa-reply:", 10) == 0) {
- vp_name += 10;
-
- if (myrequest->coa && /* match reply with request */
- (myrequest->coa->proxy->code == PW_COA_REQUEST) &&
- (myrequest->coa->proxy_reply)) {
- vps = myrequest->coa->proxy_reply->vps;
- }
-
- } else if (strncmp(vp_name, "disconnect:", 11) == 0) {
- vp_name += 11;
-
- if (myrequest->coa &&
- (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST)) {
- vps = myrequest->coa->proxy->vps;
- }
-
- } else if (strncmp(vp_name, "disconnect-reply:", 17) == 0) {
- vp_name += 17;
-
- if (myrequest->coa && /* match reply with request */
- (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST) &&
- (myrequest->coa->proxy_reply)) {
- vps = myrequest->coa->proxy_reply->vps;
- }
-#endif
-
- } else {
- vps = myrequest->packet->vps;
- }
-
- da = dict_attrbyname(vp_name);
- if (!da) return FALSE; /* not a dictionary name */
-
- /*
- * May not may not be found, but it *is* a known name.
- */
- *vp_p = pairfind(vps, da->attr, da->vendor);
- return TRUE;
-}
-
-
/*
* *presult is "did comparison match or not"
*/
} modcall_stack;
+#ifdef WITH_UNLANG
static void pairfree_wrapper(void *data)
{
VALUE_PAIR **vp = (VALUE_PAIR **) data;
pairfree(vp);
}
+#endif
/**
* @brief Call a module, iteratively, with a local stack, rather than
child->name ? child->name : "",
fr_int2str(rcode_table, myresult, "??"));
+#ifdef WITH_UNLANG
if (0) {
handle_result:
if (child->type != MOD_BREAK) {
fr_int2str(rcode_table, myresult, "??"));
}
}
+#else
+ handle_result:
+#endif
/*
* This is a bit of a hack...
}
}
+#ifdef WITH_UNLANG
if (strcmp(modrefname, "break") == 0) {
return do_compile_modbreak(parent, component);
}
+#endif
/*
* Not a virtual module. It must be a real module.
if (request->packet->vps == NULL) {
rcode = request->listener->decode(request->listener, request);
+#ifdef WITH_UNLANG
if (debug_condition) {
int result = FALSE;
const char *my_debug = debug_condition;
request->radlog = radlog_request;
}
}
+#endif
DEBUG_PACKET(request, request->packet, 0);
} else {
}
fflush(fr_log_fp);
}
+
+
+int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p)
+{
+ const char *vp_name = name;
+ REQUEST *myrequest = request;
+ DICT_ATTR *da;
+ VALUE_PAIR *vps = NULL;
+
+ *vp_p = NULL;
+
+ /*
+ * Allow for tunneled sessions.
+ */
+ if (strncmp(vp_name, "outer.", 6) == 0) {
+ if (!myrequest->parent) return TRUE;
+ vp_name += 6;
+ myrequest = myrequest->parent;
+ }
+
+ if (strncmp(vp_name, "request:", 8) == 0) {
+ vp_name += 8;
+ vps = myrequest->packet->vps;
+
+ } else if (strncmp(vp_name, "reply:", 6) == 0) {
+ vp_name += 6;
+ vps = myrequest->reply->vps;
+
+#ifdef WITH_PROXY
+ } else if (strncmp(vp_name, "proxy-request:", 14) == 0) {
+ vp_name += 14;
+ if (request->proxy) vps = myrequest->proxy->vps;
+
+ } else if (strncmp(vp_name, "proxy-reply:", 12) == 0) {
+ vp_name += 12;
+ if (request->proxy_reply) vps = myrequest->proxy_reply->vps;
+#endif
+
+ } else if (strncmp(vp_name, "config:", 7) == 0) {
+ vp_name += 7;
+ vps = myrequest->config_items;
+
+ } else if (strncmp(vp_name, "control:", 8) == 0) {
+ vp_name += 8;
+ vps = myrequest->config_items;
+
+#ifdef WITH_COA
+ } else if (strncmp(vp_name, "coa:", 4) == 0) {
+ vp_name += 4;
+
+ if (myrequest->coa &&
+ (myrequest->coa->proxy->code == PW_COA_REQUEST)) {
+ vps = myrequest->coa->proxy->vps;
+ }
+
+ } else if (strncmp(vp_name, "coa-reply:", 10) == 0) {
+ vp_name += 10;
+
+ if (myrequest->coa && /* match reply with request */
+ (myrequest->coa->proxy->code == PW_COA_REQUEST) &&
+ (myrequest->coa->proxy_reply)) {
+ vps = myrequest->coa->proxy_reply->vps;
+ }
+
+ } else if (strncmp(vp_name, "disconnect:", 11) == 0) {
+ vp_name += 11;
+
+ if (myrequest->coa &&
+ (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST)) {
+ vps = myrequest->coa->proxy->vps;
+ }
+
+ } else if (strncmp(vp_name, "disconnect-reply:", 17) == 0) {
+ vp_name += 17;
+
+ if (myrequest->coa && /* match reply with request */
+ (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST) &&
+ (myrequest->coa->proxy_reply)) {
+ vps = myrequest->coa->proxy_reply->vps;
+ }
+#endif
+
+ } else {
+ vps = myrequest->packet->vps;
+ }
+
+ da = dict_attrbyname(vp_name);
+ if (!da) return FALSE; /* not a dictionary name */
+
+ /*
+ * May not may not be found, but it *is* a known name.
+ */
+ *vp_p = pairfind(vps, da->attr, da->vendor);
+ return TRUE;
+}
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
+#ifdef WITH_DYNAMIC_CLIENTS
/*
* Find the client definition.
*/
return RLM_MODULE_OK;
}
+#else
+static int dynamic_client_authorize(UNUSED void *instance, REQUEST *request)
+{
+ RDEBUG("Dynamic clients are unsupported in this build.");
+ return RLM_MODULE_FAIL;
+}
+#endif
/*
* The module name should be the only globally exported symbol.
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
-
+#ifdef WITH_PROXY
static void cleanup(RADIUS_PACKET *packet)
{
if (!packet) return;
cleanup(packet);
return rcode;
}
+#else
+static int replicate_packet(void *instance, REQUEST *request)
+{
+ RDEBUG("Replication is unsupported in this build.");
+ return RLM_MODULE_FAIL;
+}
+#endif
/*
* The module name should be the only globally exported symbol.