2 * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
3 * Copyright (c) 1990,1993 Regents of The University of Michigan.
4 * All Rights Reserved. See COPYRIGHT.
6 * modified from main.c. this handles afp options.
11 #endif /* HAVE_CONFIG_H */
18 #include <sys/param.h>
19 #include <sys/socket.h>
20 #include <atalk/logger.h>
22 #include <netinet/in.h>
23 #include <arpa/inet.h>
27 #endif /* HAVE_NETDB_H */
31 #include <sys/types.h>
32 #endif /* ADMIN_GRP */
34 #include <atalk/paths.h>
35 #include <atalk/util.h>
36 #include <atalk/compat.h>
37 #include <atalk/globals.h>
38 #include <atalk/fce_api.h>
39 #include <atalk/errchk.h>
48 * Show version information about afpd.
51 static void show_version( void )
55 printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION );
57 puts( "This program is free software; you can redistribute it and/or modify it under" );
58 puts( "the terms of the GNU General Public License as published by the Free Software" );
59 puts( "Foundation; either version 2 of the License, or (at your option) any later" );
60 puts( "version. Please see the file COPYING for further information and details.\n" );
62 puts( "afpd has been compiled with support for these features:\n" );
64 num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ] );
65 printf( " AFP versions:\t" );
66 for ( i = 0; i < num; i++ ) {
67 printf( "%d.%d ", afp_versions[ i ].av_number/10, afp_versions[ i ].av_number%10);
71 printf( " CNID backends:\t" );
72 #ifdef CNID_BACKEND_CDB
75 #ifdef CNID_BACKEND_DB3
78 #ifdef CNID_BACKEND_DBD
79 #ifdef CNID_BACKEND_DBD_TXN
85 #ifdef CNID_BACKEND_HASH
88 #ifdef CNID_BACKEND_LAST
91 #ifdef CNID_BACKEND_MTAB
94 #ifdef CNID_BACKEND_TDB
97 #ifdef CNID_BACKEND_MYSQL
104 * Show extended version information about afpd and Netatalk.
107 static void show_version_extended(void )
111 printf( " Zeroconf support:\t" );
112 #if defined (HAVE_MDNS)
113 puts( "mDNSResponder" );
114 #elif defined (HAVE_AVAHI)
120 printf( " TCP wrappers support:\t" );
127 printf( " Quota support:\t" );
128 #ifndef NO_QUOTA_SUPPORT
134 printf( " Admin group support:\t" );
141 printf( " Valid shell checks:\t" );
142 #ifndef DISABLE_SHELLCHECK
148 printf( " cracklib support:\t" );
155 printf( " EA support:\t" );
158 printf( " ACL support:\t" );
165 printf( " LDAP support:\t" );
172 printf( " D-Bus support:\t" );
173 #ifdef HAVE_DBUS_GLIB
179 printf( " Spotlight support:\t" );
186 printf( " DTrace probes:\t" );
195 * Display compiled-in default paths
197 static void show_paths( void )
199 printf( " afp.conf:\t%s\n", _PATH_CONFDIR "afp.conf");
200 printf( " extmap.conf:\t%s\n", _PATH_CONFDIR "extmap.conf");
201 printf( " state directory:\t%s\n", _PATH_STATEDIR);
202 printf( " afp_signature.conf:\t%s\n", _PATH_STATEDIR "afp_signature.conf");
203 printf( " afp_voluuid.conf:\t%s\n", _PATH_STATEDIR "afp_voluuid.conf");
204 printf( " UAM search path:\t%s\n", _PATH_AFPDUAMPATH );
205 printf( " Server messages path:\t%s\n", SERVERTEXT);
209 * Display usage information about afpd.
211 static void show_usage(void)
213 fprintf( stderr, "Usage:\tafpd [-d] [-F configfile]\n");
214 fprintf( stderr, "\tafpd -h|-v|-V\n");
217 void afp_options_parse_cmdline(AFPObj *obj, int ac, char **av)
221 while (EOF != ( c = getopt( ac, av, "dF:vVh" )) ) {
224 obj->cmdlineflags |= OPTION_DEBUG;
227 obj->cmdlineconfigfile = strdup(optarg);
229 case 'v': /* version */
230 show_version( ); puts( "" );
231 show_paths( ); puts( "" );
234 case 'V': /* extended version */
235 show_version_extended( ); puts( "" );
236 show_paths( ); puts( "" );
239 case 'h': /* usage */
247 if ( err || optind != ac ) {