2 * Copyright (C) 2008 Stig Venaas <venaas@uninett.no>
3 * Copyright (C) 2010,2011,2012 NORDUnet A/S
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
17 int listconfig(struct gconffile **cf, char *block, int compact) {
18 char *opt = NULL, *val = NULL;
24 if (!getconfigline(cf, block, &opt, &val, &conftype))
27 return 0; /* Success. */
29 if (conftype == CONF_STR && !strcasecmp(opt, "include")) {
30 if (!pushgconfpaths(cf, val))
31 debugx(1, DBG_ERR, "failed to include config file %s", val);
38 printf(compact ? "%s=%s;" : "\t%s=%s\n", opt, val);
40 printf("%s=%s\n", opt, val);
43 printf("%s %s {%s", opt, val, compact ? "" : "\n");
44 if (listconfig(cf, val, compact))
49 printf("Unsupported config type\n");
54 return 0; /* Success. */
57 int main(int argc, char **argv) {
59 struct gconffile *cfs;
61 debug_init("radsecproxy-conf");
62 debug_set_level(DBG_WARN);
64 while ((c = getopt(argc, argv, "c")) != -1) {
73 if (argc - optind != 1)
76 cfs = openconfigfile(argv[optind]);
77 return listconfig(&cfs, NULL, compact);
80 debug(DBG_ERR, "Usage:\n%s [ -c ] configfile", argv[0]);
84 /* Local Variables: */
85 /* c-file-style: "stroustrup" */