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