return output;
}
+static const char *parse_spaces = " ";
+
/*
* Parses an item (not a CONF_ITEM) into the specified format,
radlog(L_ERR, "Bad value \"%s\" for boolean variable %s", value, name);
return -1;
}
- cf_log_info(cs, "\t%s = %s", name, value);
+ cf_log_info(cs, "%.*s\t%s = %s",
+ cs->depth, parse_spaces, name, value);
break;
case PW_TYPE_INTEGER:
*(int *)data = strtol(value, 0, 0);
- cf_log_info(cs, "\t%s = %d", name, *(int *)data);
+ cf_log_info(cs, "%.*s\t%s = %d",
+ cs->depth, parse_spaces, name, *(int *)data);
break;
case PW_TYPE_STRING_PTR:
}
}
- cf_log_info(cs, "\t%s = \"%s\"", name, value ? value : "(null)");
+ cf_log_info(cs, "%.*s\t%s = \"%s\"",
+ cs->depth, parse_spaces, name, value ? value : "(null)");
*q = value ? strdup(value) : NULL;
break;
if (!value) return -1;
}
- cf_log_info(cs, "\t%s = \"%s\"", name, value ? value : "(null)");
+ cf_log_info(cs, "%.*s\t%s = \"%s\"",
+ cs->depth, parse_spaces, name, value ? value : "(null)");
*q = value ? strdup(value) : NULL;
/*
*/
if (strcmp(value, "*") == 0) {
*(uint32_t *) data = htonl(INADDR_ANY);
- cf_log_info(cs, "\t%s = *", name);
+ cf_log_info(cs, "%.*s\t%s = *",
+ cs->depth, parse_spaces, name);
break;
}
if (ip_hton(value, AF_INET, &ipaddr) < 0) {
}
if (strspn(value, "0123456789.") == strlen(value)) {
- cf_log_info(cs, "\t%s = %s", name, value);
+ cf_log_info(cs, "%.*s\t%s = %s",
+ cs->depth, parse_spaces, name, value);
} else {
- cf_log_info(cs, "\t%s = %s IP address [%s]", name, value,
+ cf_log_info(cs, "%.*s\t%s = %s IP address [%s]",
+ cs->depth, parse_spaces, name, value,
ip_ntoh(&ipaddr, ipbuf, sizeof(ipbuf)));
}
*(uint32_t *) data = ipaddr.ipaddr.ip4addr.s_addr;
radlog(L_ERR, "Can't find IPv6 address for host %s", value);
return -1;
}
- cf_log_info(cs, "\t%s = %s IPv6 address [%s]", name, value,
- ip_ntoh(&ipaddr, ipbuf, sizeof(ipbuf)));
+ cf_log_info(cs, "%.*s\t%s = %s IPv6 address [%s]",
+ cs->depth, parse_spaces, name, value,
+ ip_ntoh(&ipaddr, ipbuf, sizeof(ipbuf)));
memcpy(data, &ipaddr.ipaddr.ip6addr,
sizeof(ipaddr.ipaddr.ip6addr));
break;
return rcode;
}
-static const char *parse_spaces = " ";
/*
* A copy of cf_section_parse that initializes pointers before