From 70638056ae44d5976b8557fbbdce40575d794324 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 16 Jan 2015 16:27:05 +0100 Subject: Add more overview to develdoc and correct a factual error. --- develdoc.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/develdoc.txt b/develdoc.txt index 4380412..5cfc0b2 100644 --- a/develdoc.txt +++ b/develdoc.txt @@ -21,8 +21,8 @@ This is all that happens in the main thread. The threads created above need to take care of the rest. Client writers are generally responsible for sending messages to -clients, and if necessary creating and maintaining connections to -the client. Client writers create threads for handling replies from +servers, and if necessary creating and maintaining connections to +the server. Client writers create threads for handling replies from servers. If connections are used, one thread is created for reading from each connection. clientwr() will use connecter() and clientconnreader() definitions for the transport. @@ -36,6 +36,18 @@ xxxserverrd, where xxx is the transport name. The server reader is responsible for creating a server writer thread that takes care of sending RADIUS replies to a client. + (listener) > server reader <-- requests from clients + client writer --> requests to a server + (client writer) > client reader <-- responses from a server + (server reader) > server writer --> responses to a client + +TODO: they are all their own threads? + +Legend: + > creates + --> sends message + <-- receives message + 2. RADIUS message processing ============================ -- cgit v1.1 From 45f4e0ab36930bdc116b8cb6794e8088481b9cc0 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 16 Jan 2015 16:27:37 +0100 Subject: Add comments on functions. --- radsecproxy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radsecproxy.c b/radsecproxy.c index a074ec2..e098a9a 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1434,6 +1434,8 @@ void rmclientrq(struct request *rq, uint8_t id) { } } +/* Called from server readers, handling incoming requests from + * clients. */ /* returns 0 if validation/authentication fails, else 1 */ int radsrv(struct request *rq) { struct radmsg *msg = NULL; @@ -1602,6 +1604,7 @@ exit: return 1; } +/* Called from client readers, handling replies from servers. */ void replyh(struct server *server, unsigned char *buf) { struct client *from; struct rqout *rqout; -- cgit v1.1 From 0369f3420defa244e157aa94153e10eb65338057 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 22 Jan 2015 12:32:08 +0100 Subject: Revamp the documentation of a request+response being proxied. --- develdoc.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/develdoc.txt b/develdoc.txt index 5cfc0b2..fb43cd0 100644 --- a/develdoc.txt +++ b/develdoc.txt @@ -36,17 +36,15 @@ xxxserverrd, where xxx is the transport name. The server reader is responsible for creating a server writer thread that takes care of sending RADIUS replies to a client. - (listener) > server reader <-- requests from clients - client writer --> requests to a server - (client writer) > client reader <-- responses from a server - (server reader) > server writer --> responses to a client +Summary of request and response proxied between client and server: -TODO: they are all their own threads? + request from client -> (listener ->) server reader + request queue + client writer -> request to server -Legend: - > creates - --> sends message - <-- receives message + response from server -> client reader + reply queue + server writer -> response to client 2. RADIUS message processing -- cgit v1.1