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
101 * Show extended version information about afpd and Netatalk.
104 static void show_version_extended(void )
108 printf( " Zeroconf support:\t" );
109 #if defined (HAVE_MDNS)
110 puts( "mDNSResponder" );
111 #elif defined (HAVE_AVAHI)
117 printf( " TCP wrappers support:\t" );
124 printf( " Quota support:\t" );
125 #ifndef NO_QUOTA_SUPPORT
131 printf( " Admin group support:\t" );
138 printf( " Valid shell checks:\t" );
139 #ifndef DISABLE_SHELLCHECK
145 printf( " cracklib support:\t" );
152 printf( " EA support:\t" );
155 printf( " ACL support:\t" );
162 printf( " LDAP support:\t" );
171 * Display compiled-in default paths
173 static void show_paths( void )
175 printf( " afp.conf:\t%s\n", _PATH_CONFDIR "afp.conf");
176 printf( " extmap.conf:\t%s\n", _PATH_CONFDIR "extmap.conf");
177 printf( " state directory:\t%s\n", _PATH_STATEDIR);
178 printf( " afp_signature.conf:\t%s\n", _PATH_STATEDIR "afp_signature.conf");
179 printf( " afp_voluuid.conf:\t%s\n", _PATH_STATEDIR "afp_voluuid.conf");
180 printf( " UAM search path:\t%s\n", _PATH_AFPDUAMPATH );
181 printf( " Server messages path:\t%s\n", SERVERTEXT);
185 * Display usage information about afpd.
187 static void show_usage(void)
189 fprintf( stderr, "Usage:\tafpd [-d] [-F configfile]\n");
190 fprintf( stderr, "\tafpd -h|-v|-V\n");
193 void afp_options_parse_cmdline(AFPObj *obj, int ac, char **av)
197 while (EOF != ( c = getopt( ac, av, "dF:vVh" )) ) {
200 obj->cmdlineflags |= OPTION_DEBUG;
203 obj->cmdlineconfigfile = strdup(optarg);
205 case 'v': /* version */
206 show_version( ); puts( "" );
207 show_paths( ); puts( "" );
210 case 'V': /* extended version */
211 show_version_extended( ); puts( "" );
212 show_paths( ); puts( "" );
215 case 'h': /* usage */
223 if ( err || optind != ac ) {