diff options
author | venaas <venaas> | 2008-09-17 12:57:49 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-09-17 12:57:49 +0000 |
commit | 977aeaa206964b7590c18dce1088d6f89745165b (patch) | |
tree | 951279ebe8af7e810e1d2446f1bb948ef8b4a1ec /radsecproxy.c | |
parent | 04e007ddc3e3669458f094436989237d488942d2 (diff) |
logging of replymsg, patch from Arne Schwabe
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@389 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 924434c..f2d8346 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -6,6 +6,11 @@ * copyright notice and this permission notice appear in all copies. */ +/* Code contributions from: + * + * Arne Schwabe <schwabe at uni-paderborn.de> + */ + /* For UDP there is one server instance consisting of udpserverrd and udpserverth * rd is responsible for init and launching wr * For TLS there is a server instance that launches tlsserverrd for each TLS peer @@ -1992,7 +1997,7 @@ int replyh(struct server *server, unsigned char *buf) { int i, len, sublen; unsigned char *messageauth, *subattrs, *attrs, *attr, *username; struct sockaddr_storage fromsa; - char tmp[760], stationid[760]; + char tmp[760], stationid[760], replymsg[760]; server->connectionok = 1; server->lostrqs = 0; @@ -2108,10 +2113,23 @@ int replyh(struct server *server, unsigned char *buf) { attr = attrget(rq->buf + 20, RADLEN(rq->buf) - 20, RAD_Attr_Calling_Station_Id); if (attr) { radattr2ascii(stationid, sizeof(stationid), attr); - debug(DBG_INFO, "%s for user %s stationid %s from %s", - radmsgtype2string(*buf), tmp, stationid, server->conf->host); - } else - debug(DBG_INFO, "%s for user %s from %s", radmsgtype2string(*buf), tmp, server->conf->host); + attr = attrget(buf + 20, RADLEN(buf) - 20, RAD_Attr_Reply_Message); + if (attr) { + radattr2ascii(replymsg, sizeof(replymsg), attr); + debug(DBG_INFO, "%s for user %s stationid %s from %s (%s)", + radmsgtype2string(*buf), tmp, stationid, server->conf->host, replymsg); + } else + debug(DBG_INFO, "%s for user %s stationid %s from %s", + radmsgtype2string(*buf), tmp, stationid, server->conf->host); + } else { + attr = attrget(buf + 20, RADLEN(buf) - 20, RAD_Attr_Reply_Message); + if (attr) { + radattr2ascii(replymsg, sizeof(replymsg), attr); + debug(DBG_INFO, "%s for user %s from %s (%s)", + radmsgtype2string(*buf), tmp, server->conf->host, replymsg); + } else + debug(DBG_INFO, "%s for user %s from %s", radmsgtype2string(*buf), tmp, server->conf->host); + } } } |