1 /* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
2 * All Rights Reserved. See COPYRIGHT.
12 /* just a label for exported bits */
13 #define UAM_MODULE_EXPORT
16 #define UAM_MODULE_SERVER 1
17 #define UAM_MODULE_CLIENT 2
19 /* in case something drastic has to change */
20 #define UAM_MODULE_VERSION 1
22 /* things for which we can have uams */
23 #define UAM_SERVER_LOGIN (1 << 0)
24 #define UAM_SERVER_CHANGEPW (1 << 1)
25 #define UAM_SERVER_PRINTAUTH (1 << 2)
28 #define UAM_OPTION_USERNAME (1 << 0) /* get space for username */
29 #define UAM_OPTION_GUEST (1 << 1) /* get guest user */
30 #define UAM_OPTION_PASSWDOPT (1 << 2) /* get the password file */
31 #define UAM_OPTION_SIGNATURE (1 << 3) /* get server signature */
32 #define UAM_OPTION_RANDNUM (1 << 4) /* request a random number */
33 #define UAM_OPTION_HOSTNAME (1 << 5) /* get host name */
34 #define UAM_OPTION_COOKIE (1 << 6) /* cookie handle */
36 /* some password options. you pass these in the length parameter and
37 * get back the corresponding option. not all of these are implemented. */
38 #define UAM_PASSWD_FILENAME (1 << 0)
39 #define UAM_PASSWD_MINLENGTH (1 << 1)
40 #define UAM_PASSWD_MAXFAIL (1 << 2) /* not implemented yet. */
41 #define UAM_PASSWD_EXPIRETIME (1 << 3) /* not implemented yet. */
43 /* i'm doing things this way because os x server's dynamic linker
44 * support is braindead. it also allows me to do a little versioning. */
46 int uam_type, uam_version;
47 int (*uam_setup)(const char *);
48 void (*uam_cleanup)(void);
51 /* register and unregister uams with these functions */
52 extern int uam_register __P((const int, const char *, const char *, ...));
53 extern void uam_unregister __P((const int, const char *));
55 /* helper functions */
56 extern struct passwd *uam_getname __P((char *, const int));
57 extern int uam_checkuser __P((const struct passwd *));
59 /* afp helper functions */
60 extern int uam_afp_read __P((void *, char *, int *,
61 int (*)(void *, void *, const int)));
62 extern int uam_afpserver_option __P((void *, const int, void *, int *));
65 #define UAM_AFPSERVER_PREAUTH (0)
66 #define UAM_AFPSERVER_POSTAUTH (1 << 0)
68 extern int uam_afpserver_action __P((const int /*id*/, const int /*switch*/,
69 int (**)(), int (**)()));