allow debug of raw RADIUS data
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Mar 2012 20:47:27 +0000 (21:47 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 13 Mar 2012 15:27:17 +0000 (16:27 +0100)
src/libradius/radius_client.c
src/libradius/radius_socket.c

index 57bd743..acdac78 100644 (file)
@@ -84,6 +84,7 @@ METHOD(radius_client_t, request, radius_message_t*,
        char virtual[] = {0x00,0x00,0x00,0x05};
        radius_socket_t *socket;
        radius_message_t *res;
+       chunk_t data;
 
        /* we add the "Virtual" NAS-Port-Type, as we SHOULD include one */
        req->add(req, RAT_NAS_PORT_TYPE, chunk_create(virtual, sizeof(virtual)));
@@ -98,12 +99,16 @@ METHOD(radius_client_t, request, radius_message_t*,
        socket = this->config->get_socket(this->config);
        DBG1(DBG_CFG, "sending RADIUS %N to server '%s'", radius_message_code_names,
                 req->get_code(req), this->config->get_name(this->config));
+
        res = socket->request(socket, req);
        if (res)
        {
                DBG1(DBG_CFG, "received RADIUS %N from server '%s'",
                         radius_message_code_names, res->get_code(res),
                         this->config->get_name(this->config));
+               data = res->get_encoding(res);
+               DBG3(DBG_CFG, "%B", &data);
+
                save_state(this, res);
                if (res->get_code(res) == RMC_ACCESS_ACCEPT)
                {
index 875bd61..f848569 100644 (file)
@@ -165,6 +165,8 @@ METHOD(radius_socket_t, request, radius_message_t*,
        }
 
        data = request->get_encoding(request);
+       DBG3(DBG_CFG, "%B", &data);
+
        /* timeout after 2, 3, 4, 5 seconds */
        for (i = 2; i <= 5; i++)
        {