~ubuntu-branches/ubuntu/precise/netatalk/precise

« back to all changes in this revision

Viewing changes to include/atalk/uam.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Rittau
  • Date: 2004-01-19 12:43:49 UTC
  • Revision ID: james.westby@ubuntu.com-20040119124349-es563jbp0hk0ae51
Tags: upstream-1.6.4
ImportĀ upstreamĀ versionĀ 1.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
 
2
 * All Rights Reserved.  See COPYRIGHT.
 
3
 */
 
4
 
 
5
#ifndef UAM_H
 
6
#define UAM_H 1
 
7
 
 
8
#include <sys/cdefs.h>
 
9
#include <pwd.h>
 
10
#include <stdarg.h>
 
11
 
 
12
#ifdef TRU64
 
13
#include <sia.h>
 
14
#include <siad.h>
 
15
#endif /* TRU64 */
 
16
 
 
17
/* just a label for exported bits */
 
18
#define UAM_MODULE_EXPORT
 
19
 
 
20
/* type of uam */
 
21
#define UAM_MODULE_SERVER        1
 
22
#define UAM_MODULE_CLIENT        2
 
23
 
 
24
/* in case something drastic has to change */
 
25
#define UAM_MODULE_VERSION       1
 
26
 
 
27
/* things for which we can have uams */
 
28
#define UAM_SERVER_LOGIN         (1 << 0)
 
29
#define UAM_SERVER_CHANGEPW      (1 << 1)
 
30
#define UAM_SERVER_PRINTAUTH     (1 << 2) 
 
31
 
 
32
/* options */
 
33
#define UAM_OPTION_USERNAME     (1 << 0) /* get space for username */
 
34
#define UAM_OPTION_GUEST        (1 << 1) /* get guest user */
 
35
#define UAM_OPTION_PASSWDOPT    (1 << 2) /* get the password file */
 
36
#define UAM_OPTION_SIGNATURE    (1 << 3) /* get server signature */
 
37
#define UAM_OPTION_RANDNUM      (1 << 4) /* request a random number */
 
38
#define UAM_OPTION_HOSTNAME     (1 << 5) /* get host name */
 
39
#define UAM_OPTION_COOKIE       (1 << 6) /* cookie handle */
 
40
#define UAM_OPTION_PROTOCOL     (1 << 7) /* DSI or ASP */
 
41
#define UAM_OPTION_CLIENTNAME   (1 << 8) /* get client IP address */
 
42
#define UAM_OPTION_KRB5SERVICE  (1 << 9) /* service name for krb5 principal */
 
43
 
 
44
/* some password options. you pass these in the length parameter and
 
45
 * get back the corresponding option. not all of these are implemented. */
 
46
#define UAM_PASSWD_FILENAME     (1 << 0)
 
47
#define UAM_PASSWD_MINLENGTH    (1 << 1)
 
48
#define UAM_PASSWD_MAXFAIL      (1 << 2) /* not implemented yet. */
 
49
#define UAM_PASSWD_EXPIRETIME   (1 << 3) /* not implemented yet. */
 
50
 
 
51
/* i'm doing things this way because os x server's dynamic linker
 
52
 * support is braindead. it also allows me to do a little versioning. */
 
53
struct uam_export {
 
54
  int uam_type, uam_version;
 
55
  int (*uam_setup)(const char *);
 
56
  void (*uam_cleanup)(void);
 
57
};
 
58
 
 
59
/* register and unregister uams with these functions */
 
60
extern int uam_register __P((const int, const char *, const char *, ...));
 
61
extern void uam_unregister __P((const int, const char *));
 
62
 
 
63
/* helper functions */
 
64
extern struct passwd *uam_getname __P((char *, const int));
 
65
extern int uam_checkuser __P((const struct passwd *));
 
66
 
 
67
/* afp helper functions */
 
68
extern int uam_afp_read __P((void *, char *, int *,
 
69
                             int (*)(void *, void *, const int)));
 
70
extern int uam_afpserver_option __P((void *, const int, void *, int *));
 
71
#ifdef TRU64
 
72
extern void uam_afp_getcmdline __P((int *, char ***));
 
73
extern int uam_sia_validate_user __P((sia_collect_func_t *, int, char **,
 
74
                                     char *, char *, char *, int, char *,
 
75
                                     char *));
 
76
#endif /* TRU64 */
 
77
 
 
78
/* switch.c */
 
79
#define UAM_AFPSERVER_PREAUTH  (0)
 
80
#define UAM_AFPSERVER_POSTAUTH (1 << 0)
 
81
 
 
82
extern int uam_afpserver_action __P((const int /*id*/, const int /*switch*/, 
 
83
                                     int (**)(), int (**)()));
 
84
 
 
85
#endif