1 /* Copyright (c) 2006-2009, Stig Venaas, UNINETT AS.
2 * Copyright (c) 2010, UNINETT AS, NORDUnet A/S.
3 * Copyright (c) 2010-2013, NORDUnet A/S. */
4 /* See LICENSE for licensing information. */
13 int listconfig(struct gconffile **cf, char *block, int compact) {
14 char *opt = NULL, *val = NULL;
20 if (!getconfigline(cf, block, &opt, &val, &conftype))
23 return 0; /* Success. */
25 if (conftype == CONF_STR && !strcasecmp(opt, "include")) {
26 if (!pushgconfpaths(cf, val))
27 debugx(1, DBG_ERR, "failed to include config file %s", val);
34 printf(compact ? "%s=%s;" : "\t%s=%s\n", opt, val);
36 printf("%s=%s\n", opt, val);
39 printf("%s %s {%s", opt, val, compact ? "" : "\n");
40 if (listconfig(cf, val, compact))
45 printf("Unsupported config type\n");
50 return 0; /* Success. */
53 int main(int argc, char **argv) {
55 struct gconffile *cfs;
57 debug_init("radsecproxy-conf");
58 debug_set_level(DBG_WARN);
60 while ((c = getopt(argc, argv, "c")) != -1) {
69 if (argc - optind != 1)
72 cfs = openconfigfile(argv[optind]);
73 return listconfig(&cfs, NULL, compact);
76 debug(DBG_ERR, "Usage:\n%s [ -c ] configfile", argv[0]);
80 /* Local Variables: */
81 /* c-file-style: "stroustrup" */