FR_RADIUSV11_ALLOW,
FR_RADIUSV11_REQUIRE,
} fr_radiusv11_t;
+
+extern const FR_NAME_NUMBER radiusv11_types[];
#endif
/*
return out;
}
+
+#ifdef WITH_RADIUSV11
+const FR_NAME_NUMBER radiusv11_types[] = {
+ { "forbid", FR_RADIUSV11_FORBID },
+ { "allow", FR_RADIUSV11_ALLOW },
+ { "require", FR_RADIUSV11_REQUIRE },
+ { NULL, 0 }
+
+};
+#endif
cl_srcipaddr = NULL;
}
+#ifdef WITH_RADIUSV11
+ if (c->tls_required && (cf_pair_find(cs, "radiusv11") != NULL)) {
+ int rcode;
+ char const *name = NULL;
+
+ rcode = cf_item_parse(cs, "radiusv11", FR_ITEM_POINTER(PW_TYPE_STRING, &name), "forbid");
+ if (rcode < 0) goto error;
+
+ rcode = fr_str2int(radiusv11_types, name, -1);
+ if (rcode < 0) {
+ cf_log_err_cs(cs, "Invalid value for 'radiusv11'");
+ goto error;
+ }
+
+ c->radiusv11 = rcode;
+ }
+#endif
+
/*
* A response_window of zero is OK, and means that it's
* ignored by the rest of the server timers.
close(newfd);
return 0;
}
+
+#ifdef WITH_RADIUSV11
+ switch (listener->radiusv11) {
+ case FR_RADIUSV11_FORBID:
+ if (client->radiusv11 == FR_RADIUSV11_REQUIRE) {
+ INFO("Ignoring new connection as client is marked as 'radiusv11 = require', and this socket has 'radiusv11 = forbid'");
+ close(newfd);
+ return 0;
+ }
+ break;
+
+ case FR_RADIUSV11_ALLOW:
+ /*
+ * We negotiate it as per the client recommendations (forbid, allow, require)
+ */
+ break;
+
+ case FR_RADIUSV11_REQUIRE:
+ if (client->radiusv11 == FR_RADIUSV11_FORBID) {
+ INFO("Ignoring new connection as client is marked as 'radiusv11 = forbid', and this socket has 'radiusv11 = require'");
+ close(newfd);
+ return 0;
+ }
+ break;
+ }
+#endif
+
#endif
/*
rcode = cf_item_parse(cs, "check_client_connections", FR_ITEM_POINTER(PW_TYPE_BOOLEAN, &this->check_client_connections), "no");
if (rcode < 0) return -1;
+
+#ifdef WITH_RADIUSV11
+ if (cf_pair_find(cs, "radiusv11")) {
+ char const *name = NULL;
+
+ rcode = cf_item_parse(cs, "radiusv11", FR_ITEM_POINTER(PW_TYPE_STRING, &name), "forbid");
+ if (rcode < 0) return -1;
+
+ rcode = fr_str2int(radiusv11_types, name, -1);
+ if (rcode < 0) {
+ cf_log_err_cs(cs, "Invalid value for 'radiusv11'");
+ return -1;
+ }
+
+ this->radiusv11 = rcode;
+ }
+#endif
}
#else /* WITH_TLS */
/*
home->listeners = rbtree_create(home, listener_cmp, NULL, RBTREE_FLAG_LOCK);
if (!home->listeners) goto error;
+
+#ifdef WITH_RADIUSV11
+ if (cf_pair_find(tls, "radiusv11")) {
+ char const *name = NULL;
+
+ rcode = cf_item_parse(cs, "radiusv11", FR_ITEM_POINTER(PW_TYPE_STRING, &name), "forbid");
+ if (rcode < 0) goto error;
+
+ rcode = fr_str2int(radiusv11_types, name, -1);
+ if (rcode < 0) {
+ cf_log_err_cs(cs, "Invalid value for 'radiusv11'");
+ goto error;
+ }
+
+ home->radiusv11 = rcode;
+ }
+#endif
+
}
#endif
} /* end of parse home server */