Add some basic indenting
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 18 May 2014 16:49:00 +0000 (17:49 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 18 May 2014 21:59:03 +0000 (22:59 +0100)
src/main/modcall.c
src/main/process.c
src/modules/rlm_chap/rlm_chap.c
src/modules/rlm_eap/eap.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c
src/modules/rlm_mschap/opendir.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_preprocess/rlm_preprocess.c

index 9b5d6d5..db49022 100644 (file)
@@ -289,7 +289,8 @@ static rlm_rcode_t CC_HINT(nonnull) call_modsingle(rlm_components_t component, m
        blocked = (request->master_state == REQUEST_STOP_PROCESSING);
        if (blocked) return RLM_MODULE_NOOP;
 
-       RDEBUG3("  modsingle[%s]: calling %s (%s) for request %d",
+       RINDENT();
+       RDEBUG3("modsingle[%s]: calling %s (%s) for request %d",
               comp2str[component], sp->modinst->name,
               sp->modinst->entry->name, request->number);
 
@@ -319,7 +320,8 @@ static rlm_rcode_t CC_HINT(nonnull) call_modsingle(rlm_components_t component, m
        }
 
  fail:
-       RDEBUG3("  modsingle[%s]: returned from %s (%s) for request %d",
+       REXDENT();
+       RDEBUG3("modsingle[%s]: returned from %s (%s) for request %d",
               comp2str[component], sp->modinst->name,
               sp->modinst->entry->name, request->number);
 
index bd5a8be..7c43ae3 100644 (file)
@@ -2057,7 +2057,7 @@ static int insert_into_proxy_hash(REQUEST *request)
 
        PTHREAD_MUTEX_UNLOCK(&proxy_mutex);
 
-       RDEBUG3(" proxy: allocating destination %s port %d - Id %d",
+       RDEBUG3("proxy: allocating destination %s port %d - Id %d",
               inet_ntop(request->proxy->dst_ipaddr.af,
                         &request->proxy->dst_ipaddr.ipaddr, buf, sizeof(buf)),
               request->proxy->dst_port,
@@ -2103,18 +2103,18 @@ static int process_proxy_reply(REQUEST *request)
        if (vp) {
                post_proxy_type = vp->vp_integer;
 
-               RDEBUG2("  Found Post-Proxy-Type %s",
-                       dict_valnamebyattr(PW_POST_PROXY_TYPE, 0,
-                                          post_proxy_type));
+               RDEBUG2("Found Post-Proxy-Type %s", dict_valnamebyattr(PW_POST_PROXY_TYPE, 0, post_proxy_type));
        }
 
        if (request->home_pool && request->home_pool->virtual_server) {
                char const *old_server = request->server;
 
                request->server = request->home_pool->virtual_server;
-               RDEBUG2(" server %s {", request->server);
+               RDEBUG2("server %s {", request->server);
+               RINDENT();
                rcode = process_post_proxy(post_proxy_type, request);
-               RDEBUG2(" }");
+               REXDENT();
+               RDEBUG2("}");
                request->server = old_server;
        } else {
                rcode = process_post_proxy(post_proxy_type, request);
@@ -2566,7 +2566,7 @@ static int request_will_proxy(REQUEST *request)
                DICT_VALUE const *dval = dict_valbyattr(vp->da->attr, vp->da->vendor, vp->vp_integer);
                /* Must be a validation issue */
                rad_assert(dval);
-               RDEBUG2("  Found Pre-Proxy-Type %s", dval->name);
+               RDEBUG2("Found Pre-Proxy-Type %s", dval->name);
                pre_proxy_type = vp->vp_integer;
        }
 
@@ -2576,10 +2576,14 @@ static int request_will_proxy(REQUEST *request)
                char const *old_server = request->server;
 
                request->server = request->home_pool->virtual_server;
-               RDEBUG2(" server %s {", request->server);
+
+               RDEBUG2("server %s {", request->server);
+               RINDENT();
                rcode = process_pre_proxy(pre_proxy_type, request);
-               RDEBUG2(" }");
-                       request->server = old_server;
+               REXDENT();
+               RDEBUG2("}");
+
+               request->server = old_server;
        } else {
                rcode = process_pre_proxy(pre_proxy_type, request);
        }
@@ -3530,7 +3534,7 @@ static void request_coa_originate(REQUEST *request)
                DICT_VALUE const *dval = dict_valbyattr(vp->da->attr, vp->da->vendor, vp->vp_integer);
                /* Must be a validation issue */
                rad_assert(dval);
-               RDEBUG2("  Found Pre-Proxy-Type %s", dval->name);
+               RDEBUG2("Found Pre-Proxy-Type %s", dval->name);
                pre_proxy_type = vp->vp_integer;
        }
 
@@ -3538,9 +3542,11 @@ static void request_coa_originate(REQUEST *request)
                char const *old_server = coa->server;
 
                coa->server = coa->home_pool->virtual_server;
-               RDEBUG2(" server %s {", coa->server);
+               RDEBUG2("server %s {", coa->server);
+               RINDENT();
                rcode = process_pre_proxy(pre_proxy_type, coa);
-               RDEBUG2(" }");
+               REXDENT();
+               RDEBUG2("}");
                coa->server = old_server;
        } else {
                rcode = process_pre_proxy(pre_proxy_type, coa);
index e678a51..efb0956 100644 (file)
@@ -120,13 +120,15 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(UNUSED void *instance,
                }
 
                fr_bin2hex(buffer, p, length);
-               RDEBUG3("    chap challenge  %s", buffer);
+               RINDENT();
+               RDEBUG3("CHAP challenge :  %s", buffer);
 
                fr_bin2hex(buffer, chap->vp_octets + 1, CHAP_VALUE_LENGTH);
-               RDEBUG3("    client sent     %s", buffer);
+               RDEBUG3("Client sent    : %s", buffer);
 
                fr_bin2hex(buffer, pass_str + 1, CHAP_VALUE_LENGTH);
-               RDEBUG3("    we calculated   %s", buffer);
+               RDEBUG3("We calculated  : %s", buffer);
+               REXDENT();
        } else {
                RDEBUG2("Comparing with \"known good\" Cleartext-Password");
        }
index 8641b42..bbeb43a 100644 (file)
@@ -814,7 +814,7 @@ int eap_start(rlm_eap_t *inst, REQUEST *request)
            ((eap_msg->vp_octets[4] == 0) ||
             (eap_msg->vp_octets[4] >= PW_EAP_MAX_TYPES) ||
             (!inst->methods[eap_msg->vp_octets[4]]))) {
-               RDEBUG2(" Ignoring Unknown EAP type");
+               RDEBUG2("Ignoring Unknown EAP type");
                return EAP_NOOP;
        }
 
index 036ee47..3e9a706 100644 (file)
@@ -323,7 +323,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
         *      If we're doing horrible tunneling work, remember it.
         */
        if ((request->log.lvl & RAD_REQUEST_OPTION_PROXY_EAP) != 0) {
-               RDEBUG2("  Not-EAP proxy set.  Not composing EAP");
+               RDEBUG2("No EAP proxy set.  Not composing EAP");
                /*
                 *      Add the handle to the proxied list, so that we
                 *      can retrieve it in the post-proxy stage, and
@@ -380,7 +380,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, REQUEST *re
                 */
                pairdelete(&request->proxy->vps, PW_FREERADIUS_PROXIED_TO, VENDORPEC_FREERADIUS, TAG_ANY);
 
-               RDEBUG2("  Tunneled session will be proxied.  Not doing EAP");
+               RDEBUG2("Tunneled session will be proxied.  Not doing EAP");
                return RLM_MODULE_HANDLED;
        }
 #endif
index 4c08695..009b305 100644 (file)
@@ -885,11 +885,14 @@ rlm_rcode_t eappeap_process(eap_handler_t *handler, tls_session_t *tls_session)
         *      packets after we told them to f*ck off.
         */
        case PEAP_STATUS_SENT_TLV_FAILURE:
-               RDEBUG(" The users session was previously rejected: returning reject (again.)");
-               RDEBUG(" *** This means you need to read the PREVIOUS messages in the debug output");
-               RDEBUG(" *** to find out the reason why the user was rejected");
-               RDEBUG(" *** Look for \"reject\" or \"fail\".  Those earlier messages will tell you");
-               RDEBUG(" *** what went wrong, and how to fix the problem");
+               RINDENT();
+               RDEBUG("The users session was previously rejected: returning reject (again.)");
+               RDEBUG("*** This means you need to read the PREVIOUS messages in the debug output");
+               RDEBUG("*** to find out the reason why the user was rejected");
+               RDEBUG("*** Look for \"reject\" or \"fail\".  Those earlier messages will tell you");
+               RDEBUG("*** what went wrong, and how to fix the problem");
+               REXDENT();
+
                return RLM_MODULE_REJECT;
 
                case PEAP_STATUS_PHASE2_INIT:
index f6ca24c..30a0dd3 100644 (file)
@@ -53,7 +53,7 @@ static int diameter_verify(REQUEST *request, uint8_t const *data, unsigned int d
                hdr_len = 12;
 
                if (remaining < hdr_len) {
-                 RDEBUG2(" Diameter attribute is too small (%u) to contain a Diameter header", remaining);
+                 RDEBUG2("Diameter attribute is too small (%u) to contain a Diameter header", remaining);
                        return 0;
                }
 
@@ -64,7 +64,7 @@ static int diameter_verify(REQUEST *request, uint8_t const *data, unsigned int d
 
                if ((data[4] & 0x80) != 0) {
                        if (remaining < 16) {
-                               RDEBUG2(" Diameter attribute is too small to contain a Diameter header with Vendor-Id");
+                               RDEBUG2("Diameter attribute is too small to contain a Diameter header with Vendor-Id");
                                return 0;
                        }
 
index a783de4..dca699b 100644 (file)
@@ -313,7 +313,8 @@ rlm_rcode_t od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR *
        memcpy(&(tDataBuff->fBufferData[uiCurr]), shortUserName, uiLen);
        uiCurr += uiLen;
 #ifndef NDEBUG
-       RDEBUG2("       stepbuf server challenge:\t");
+       RINDENT();
+       RDEBUG2("Stepbuf server challenge : ");
        for (t = 0; t < challenge->length; t++) {
                fprintf(stderr, "%02x", challenge->vp_strvalue[t]);
        }
@@ -329,7 +330,7 @@ rlm_rcode_t od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR *
        uiCurr += uiLen;
 
 #ifndef NDEBUG
-       RDEBUG2("       stepbuf peer challenge:\t\t");
+       RDEBUG2("Stepbuf peer challenge   : ");
        for (t = 2; t < 18; t++) {
                fprintf(stderr, "%02x", response->vp_strvalue[t]);
        }
@@ -345,7 +346,8 @@ rlm_rcode_t od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR *
        uiCurr += uiLen;
 
 #ifndef NDEBUG
-       RDEBUG2("       stepbuf p24:\t\t");
+       RDEBUG2("Stepbuf p24              : ");
+       REXDENT();
        for (t = 26; t < 50; t++) {
                fprintf(stderr, "%02x", response->vp_strvalue[t]);
        }
index a2bfd39..59b4eb4 100644 (file)
@@ -192,8 +192,7 @@ static ssize_t mschap_xlat(void *instance, REQUEST *request,
                 *      for MS-CHAPv1
                 */
                if (chap_challenge->length == 8) {
-                       RDEBUG2(" mschap1: %02x",
-                              chap_challenge->vp_octets[0]);
+                       RDEBUG2("mschap1: %02x", chap_challenge->vp_octets[0]);
                        data = chap_challenge->vp_octets;
                        data_len = 8;
 
index b38c91a..093b73f 100644 (file)
@@ -410,7 +410,7 @@ static int hints_setup(PAIR_LIST *hints, REQUEST *request)
                 */
                if (((strcmp(i->name, "DEFAULT") == 0) || (strcmp(i->name, name) == 0)) &&
                    (paircompare(request, request_pairs, i->check, NULL) == 0)) {
-                       RDEBUG2("  hints: Matched %s at %d", i->name, i->lineno);
+                       RDEBUG2("hints: Matched %s at %d", i->name, i->lineno);
                        /*
                         *      Now add all attributes to the request list,
                         *      except PW_STRIP_USER_NAME and PW_FALL_THROUGH