xref: /netbsd-src/external/ibm-public/postfix/dist/src/postconf/postconf_other.c (revision 413d532bcc3f62d122e56d92e13ac64825a40baf)
1 /*	$NetBSD: postconf_other.c,v 1.1.1.1 2013/01/02 18:59:03 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	postconf_other 3
6 /* SUMMARY
7 /*	support for miscellaneous information categories
8 /* SYNOPSIS
9 /*	#include <postconf.h>
10 /*
11 /*	void	show_maps()
12 /*
13 /*	void	show_locks()
14 /*
15 /*	void	show_sasl(mode)
16 /*	int	mode;
17 /* DESCRIPTION
18 /*	show_maps() lists the available map (lookup table) types.
19 /*
20 /*	show_locks() lists the available mailbox lock types.
21 /*
22 /*	show_sasl() shows the available SASL authentication
23 /*	plugin types.
24 /*
25 /*	Arguments:
26 /* .IP mode
27 /*	Show server information if the SHOW_SASL_SERV flag is set,
28 /*	otherwise show client information.
29 /* DIAGNOSTICS
30 /*	Problems are reported to the standard error stream.
31 /* LICENSE
32 /* .ad
33 /* .fi
34 /*	The Secure Mailer license must be distributed with this software.
35 /* AUTHOR(S)
36 /*	Wietse Venema
37 /*	IBM T.J. Watson Research
38 /*	P.O. Box 704
39 /*	Yorktown Heights, NY 10598, USA
40 /*--*/
41 
42 /* System library. */
43 
44 #include <sys_defs.h>
45 
46 /* Utility library. */
47 
48 #include <vstream.h>
49 #include <argv.h>
50 #include <dict.h>
51 
52 /* Global library. */
53 
54 #include <mbox_conf.h>
55 
56 /* XSASL library. */
57 
58 #include <xsasl.h>
59 
60 /* Application-specific. */
61 
62 #include <postconf.h>
63 
64 /* show_maps - show available maps */
65 
66 void    show_maps(void)
67 {
68     ARGV   *maps_argv;
69     int     i;
70 
71     maps_argv = dict_mapnames();
72     for (i = 0; i < maps_argv->argc; i++)
73 	vstream_printf("%s\n", maps_argv->argv[i]);
74     argv_free(maps_argv);
75 }
76 
77 /* show_locks - show available mailbox locking methods */
78 
79 void    show_locks(void)
80 {
81     ARGV   *locks_argv;
82     int     i;
83 
84     locks_argv = mbox_lock_names();
85     for (i = 0; i < locks_argv->argc; i++)
86 	vstream_printf("%s\n", locks_argv->argv[i]);
87     argv_free(locks_argv);
88 }
89 
90 /* show_sasl - show SASL plug-in types */
91 
92 void    show_sasl(int what)
93 {
94     ARGV   *sasl_argv;
95     int     i;
96 
97     sasl_argv = (what & SHOW_SASL_SERV) ? xsasl_server_types() :
98 	xsasl_client_types();
99     for (i = 0; i < sasl_argv->argc; i++)
100 	vstream_printf("%s\n", sasl_argv->argv[i]);
101     argv_free(sasl_argv);
102 }
103