netatalk  4.4.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uam.h
Go to the documentation of this file.
1/* Copyright (c) 1999 Adrian Sun ([email protected])
2 * All Rights Reserved. See COPYRIGHT.
3 */
4
5#ifndef UAM_H
6#define UAM_H 1
7
8#include <pwd.h>
9#include <stdarg.h>
10
11/* just a label for exported bits */
12#ifndef UAM_MODULE_EXPORT
13#define UAM_MODULE_EXPORT
14#endif
15
16/* type of uam */
17#define UAM_MODULE_SERVER 1
18#define UAM_MODULE_CLIENT 2
19
20/* in case something drastic has to change */
21#define UAM_MODULE_VERSION 1
22
23/* define if minimum version of libgcrypt is required */
24#define UAM_NEED_LIBGCRYPT_VERSION NULL
25
26/* things for which we can have uams */
27#define UAM_SERVER_LOGIN (1 << 0)
28#define UAM_SERVER_CHANGEPW (1 << 1)
29#define UAM_SERVER_PRINTAUTH (1 << 2)
30#define UAM_SERVER_LOGIN_EXT (1 << 3)
31
32/* options */
33#define UAM_OPTION_USERNAME (1 << 0)
34#define UAM_OPTION_GUEST (1 << 1)
35#define UAM_OPTION_PASSWDOPT (1 << 2)
36#define UAM_OPTION_SIGNATURE (1 << 3)
37#define UAM_OPTION_RANDNUM (1 << 4)
38#define UAM_OPTION_HOSTNAME (1 << 5)
39#define UAM_OPTION_COOKIE (1 << 6)
40#define UAM_OPTION_PROTOCOL (1 << 7)
41#define UAM_OPTION_CLIENTNAME (1 << 8)
42#define UAM_OPTION_KRB5SERVICE (1 << 9)
43#define UAM_OPTION_MACCHARSET (1 << 10)
44#define UAM_OPTION_UNIXCHARSET (1 << 11)
45#define UAM_OPTION_SESSIONINFO (1 << 12)
46#define UAM_OPTION_KRB5REALM (1 << 13)
47#define UAM_OPTION_FQDN (1 << 14)
48
49/* some password options. you pass these in the length parameter and
50 * get back the corresponding option. not all of these are implemented. */
51#define UAM_PASSWD_FILENAME (1 << 0)
52#define UAM_PASSWD_MINLENGTH (1 << 1)
53#define UAM_PASSWD_EXPIRETIME (1 << 3)
54
55/* max lenght of username */
56#define UAM_USERNAMELEN 255
57
58/* i'm doing things this way because os x server's dynamic linker
59 * support is braindead. it also allows me to do a little versioning. */
60struct uam_export {
62 int (*uam_setup)(void *, const char *);
63 void (*uam_cleanup)(void);
64};
65
66#define SESSIONKEY_LEN 64
67#define SESSIONTOKEN_LEN 8
68
79
80/* register and unregister uams with these functions */
81extern UAM_MODULE_EXPORT int uam_register(const int, const char *, const char *,
82 ...);
83extern UAM_MODULE_EXPORT void uam_unregister(const int, const char *);
84
85/* helper functions */
86extern UAM_MODULE_EXPORT struct passwd *uam_getname(void *, char *, const int);
87extern UAM_MODULE_EXPORT int uam_checkuser(void *, const struct passwd *);
88
89/* afp helper functions */
90extern UAM_MODULE_EXPORT int uam_afp_read(void *, char *, size_t *,
91 int (*)(void *, void *, const int));
92extern UAM_MODULE_EXPORT int uam_afpserver_option(void *, const int, void *,
93 size_t *);
94
95#endif
#define UAM_MODULE_EXPORT
Definition logger.h:14
Definition uam.h:69
size_t sessionkey_len
Definition uam.h:71
size_t sessiontoken_len
Definition uam.h:75
size_t clientid_len
Definition uam.h:77
void * clientid
Definition uam.h:76
void * sessiontoken
Definition uam.h:74
void * cryptedkey
Definition uam.h:72
void * sessionkey
Definition uam.h:70
size_t cryptedkey_len
Definition uam.h:73
Definition uam.h:60
int(* uam_setup)(void *, const char *)
Definition uam.h:62
void(* uam_cleanup)(void)
Definition uam.h:63
int uam_version
Definition uam.h:61
int uam_type
Definition uam.h:61
UAM_MODULE_EXPORT int uam_afp_read(void *, char *, size_t *, int(*)(void *, void *, const int))
UAM_MODULE_EXPORT int uam_checkuser(void *, const struct passwd *)
Definition afpd/uam.c:315
UAM_MODULE_EXPORT int uam_afpserver_option(void *, const int, void *, size_t *)
Definition afpd/uam.c:388
UAM_MODULE_EXPORT int uam_register(const int, const char *, const char *,...)
Definition afpd/uam.c:113
UAM_MODULE_EXPORT struct passwd * uam_getname(void *, char *, const int)
helper functions for plugin uams
Definition afpd/uam.c:218
UAM_MODULE_EXPORT void uam_unregister(const int, const char *)
Definition afpd/uam.c:193