summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorvenaas <venaas>2008-08-12 15:11:36 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-08-12 15:11:36 +0000
commitd229a3b7b4223872ddab4d75a10feccedaabb36f (patch)
treef7535de176c4f737ad71356dc6985df05c643c80 /radsecproxy.c
parent0265871bcd9ea246dc5d03d3aaaf5e8f8c31ea5e (diff)
started on dtls support
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@333 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 9136c18..d0e65ea 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -140,6 +140,20 @@ static const struct protodefs protodefs[] = {
tcpclientrd, /* clientreader */
clientradputtcp /* clientradput */
},
+ { "dtls", /* DTLS, assuming RAD_DTLS defined as 3 */
+ NULL, /* secretdefault */
+ SOCK_DGRAM, /* socktype */
+ "1812", /* portdefault */
+ REQUEST_RETRY_COUNT, /* retrycountdefault */
+ 10, /* retrycountmax */
+ REQUEST_RETRY_INTERVAL, /* retryintervaldefault */
+ 60, /* retryintervalmax */
+ udpserverrd, /* listener */
+ &options.sourceudp, /* srcaddrport */
+ NULL, /* connecter */
+ udpclientrd, /* clientreader */
+ clientradputudp /* clientradput */
+ },
{ NULL
}
};
@@ -615,6 +629,7 @@ void freeserver(struct server *server, uint8_t destroymutex) {
int addserver(struct clsrvconf *conf) {
struct clsrvconf *res;
+ uint8_t type;
if (conf->servers) {
debug(DBG_ERR, "addserver: currently works with just one server per conf");
@@ -628,14 +643,18 @@ int addserver(struct clsrvconf *conf) {
memset(conf->servers, 0, sizeof(struct server));
conf->servers->conf = conf;
- if (!srcprotores[conf->type]) {
- res = resolve_hostport(conf->type, *conf->pdef->srcaddrport, NULL);
- srcprotores[conf->type] = res->addrinfo;
+ type = conf->type;
+ if (type == RAD_DTLS)
+ type = RAD_UDP;
+
+ if (!srcprotores[type]) {
+ res = resolve_hostport(type, *conf->pdef->srcaddrport, NULL);
+ srcprotores[type] = res->addrinfo;
res->addrinfo = NULL;
freeclsrvres(res);
}
- if (conf->type == RAD_UDP) {
+ if (type == RAD_UDP) {
switch (conf->addrinfo->ai_family) {
case AF_INET:
if (udp_client4_sock < 0) {