]> arthur.barton.de Git - netatalk.git/commitdiff
afpd -v: show AFP versions
authorHAT <hat@fa2.so-net.ne.jp>
Tue, 23 Aug 2011 12:38:38 +0000 (21:38 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Tue, 23 Aug 2011 12:38:38 +0000 (21:38 +0900)
etc/afpd/afp_options.c
etc/afpd/auth.c
etc/afpd/auth.h

index b40f61debbeb58ca7a9e6917a8de300291728b85..aa4014096bbe85a3dc68806e2e0ea9244bcede15 100644 (file)
@@ -518,6 +518,8 @@ int afp_options_parseline(char *buf, struct afp_options *options)
  */
 static void show_version( void )
 {
+       int num, i;
+
        printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION );
 
        puts( "This program is free software; you can redistribute it and/or modify it under" );
@@ -527,9 +529,12 @@ static void show_version( void )
 
        puts( "afpd has been compiled with support for these features:\n" );
 
-       printf( "        AFP3.x support:\tYes\n" );
-        printf( "        TCP/IP Support:\t" );
-        puts( "Yes" );
+       num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ] );
+       printf( "          AFP versions:\t" );
+       for ( i = 0; i < num; i++ ) {
+               printf( "%d.%d ", afp_versions[ i ].av_number/10, afp_versions[ i ].av_number%10);
+       }
+       puts( "" );
 
        printf( "DDP(AppleTalk) Support:\t" );
 #ifdef NO_DDP
index b7f5aa5d37b62cfcc2f35cde4d663d2938168e60..9d8fbf78aeb7b0fbb2c13b9336dcc8ef126687f9 100644 (file)
@@ -69,22 +69,6 @@ gid_t   *groups;
 
 int ngroups;
 
-/*
- * These numbers are scattered throughout the code.
- */
-static struct afp_versions  afp_versions[] = {
-#ifndef NO_DDP
-    { "AFPVersion 1.1", 11 },
-    { "AFPVersion 2.0", 20 },
-    { "AFPVersion 2.1", 21 },
-#endif /* ! NO_DDP */
-    { "AFP2.2", 22 },
-    { "AFPX03", 30 },
-    { "AFP3.1", 31 },
-    { "AFP3.2", 32 },
-    { "AFP3.3", 33 }
-};
-
 static struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules};
 static struct uam_obj uam_login = {"", "", 0, {{NULL, NULL, NULL, NULL }}, &uam_login,
                                    &uam_login};
index d26354f38d972a58400d41bbcb2d78d47ab3e09d..beda0d02ffdcb9d2c92d818560e84423017c93ae 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: auth.h,v 1.9 2009-10-15 10:43:13 didg Exp $
- *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
@@ -23,6 +21,19 @@ struct afp_versions {
     int                av_number;
 };
 
+static const struct afp_versions  afp_versions[] = {
+#ifndef NO_DDP
+    { "AFPVersion 1.1", 11 },
+    { "AFPVersion 2.0", 20 },
+    { "AFPVersion 2.1", 21 },
+#endif /* ! NO_DDP */
+    { "AFP2.2", 22 },
+    { "AFPX03", 30 },
+    { "AFP3.1", 31 },
+    { "AFP3.2", 32 },
+    { "AFP3.3", 33 }
+};
+
 /* for GetUserInfo */
 #define USERIBIT_USER  (1 << 0)
 #define USERIBIT_GROUP (1 << 1)