1 /* Copyright (c) 2006-2010, UNINETT AS.
2 * Copyright (c) 2010-2013, NORDUnet A/S. */
3 /* See LICENSE for licensing information. */
12 int listconfig(struct gconffile **cf, char *block, int compact) {
13 char *opt = NULL, *val = NULL;
19 if (!getconfigline(cf, block, &opt, &val, &conftype))
22 return 0; /* Success. */
24 if (conftype == CONF_STR && !strcasecmp(opt, "include")) {
25 if (!pushgconfpaths(cf, val))
26 debugx(1, DBG_ERR, "failed to include config file %s", val);
33 printf(compact ? "%s=%s;" : "\t%s=%s\n", opt, val);
35 printf("%s=%s\n", opt, val);
38 printf("%s %s {%s", opt, val, compact ? "" : "\n");
39 if (listconfig(cf, val, compact))
44 printf("Unsupported config type\n");
49 return 0; /* Success. */
52 int main(int argc, char **argv) {
54 struct gconffile *cfs;
56 debug_init("radsecproxy-conf");
57 debug_set_level(DBG_WARN);
59 while ((c = getopt(argc, argv, "c")) != -1) {
68 if (argc - optind != 1)
71 cfs = openconfigfile(argv[optind]);
72 return listconfig(&cfs, NULL, compact);
75 debug(DBG_ERR, "Usage:\n%s [ -c ] configfile", argv[0]);
79 /* Local Variables: */
80 /* c-file-style: "stroustrup" */