netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
papd/uam_auth.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999 Adrian Sun ([email protected])
3 * All Rights Reserved. See COPYRIGHT.
4 *
5 * interface between uam.c and auth.c
6 */
7
8#ifndef PAPD_UAM_AUTH_H
9#define PAPD_UAM_AUTH_H 1
10
11#include <sys/types.h>
12#include <pwd.h>
13
14#include <atalk/uam.h>
15
16#include "file.h"
17
18struct uam_mod {
19 void *uam_module;
20 struct uam_export *uam_fcn;
21 struct uam_mod *uam_prev, *uam_next;
22};
23
24struct uam_obj {
25 const char *uam_name; /* authentication method */
26 char *uam_path; /* where it's located */
27 int uam_count;
28 union {
29 struct {
30 int (*login)(void *, struct passwd **,
31 char *, int, char *, int *);
32 int (*logincont)(void *, struct passwd **, char *,
33 int, char *, int *);
34 void (*logout)(void);
36 int (*uam_changepw)(void *, char *, struct passwd *, char *,
37 int, char *, int *);
38 int (*uam_printer)(char *, char *, char *, struct papfile *);
39 } u;
40 struct uam_obj *uam_prev, *uam_next;
41};
42
43#define uam_attach(a, b) do { \
44 (a)->uam_prev->uam_next = (b); \
45 (b)->uam_prev = (a)->uam_prev; \
46 (b)->uam_next = (a); \
47 (a)->uam_prev = (b); \
48} while (0)
49
50#define uam_detach(a) do { \
51 (a)->uam_prev->uam_next = (a)->uam_next; \
52 (a)->uam_next->uam_prev = (a)->uam_prev; \
53} while (0)
54
55#define UAM_LIST(type) (((type) == UAM_SERVER_LOGIN) ? &uam_login : \
56 (((type) == UAM_SERVER_CHANGEPW) ? &uam_changepw : \
57 (((type) == UAM_SERVER_PRINTAUTH) ? &uam_printer : NULL)))
58
59
60extern struct uam_mod *uam_load(const char *, const char *);
61extern void uam_unload(struct uam_mod *);
62
63/* auth.c */
64int auth_load(const char *, const char *);
65int auth_register(const int, struct uam_obj *);
66#define auth_unregister(a) uam_detach(a)
67struct uam_obj *auth_uamfind(const int, const char *, const int);
68void auth_unload(void);
69int getuamnames(const int, char *);
70
71#endif /* uam_auth.h */
static struct uam_obj uam_changepw
Definition afpd/auth.c:56
static struct uam_obj uam_login
Definition afpd/auth.c:53
void uam_unload(struct uam_mod *)
Definition afpd/uam.c:101
int auth_register(const int, struct uam_obj *)
Definition afpd/auth.c:1156
void auth_unload(void)
Definition afpd/auth.c:1220
int getuamnames(const int, char *)
Definition papd/auth.c:43
struct uam_mod * uam_load(const char *, const char *)
Definition papd/uam.c:31
int auth_load(const char *, const char *)
Definition papd/auth.c:101
struct uam_obj * auth_uamfind(const int, const char *, const int)
Definition afpd/auth.c:1137
Definition papd/file.h:11
Definition afpd/uam_auth.h:16
void * uam_module
Definition afpd/uam_auth.h:17
struct uam_mod * uam_next
Definition afpd/uam_auth.h:19
struct uam_mod * uam_prev
Definition afpd/uam_auth.h:19
struct uam_export * uam_fcn
Definition afpd/uam_auth.h:18
Definition afpd/uam_auth.h:22
int(* logincont)(void *, struct passwd **, char *, int, char *, size_t *)
Definition afpd/uam_auth.h:30
void(* logout)(void)
Definition afpd/uam_auth.h:32
union uam_obj::@267363230117161357145247102227344201111336235326 u
int(* uam_printer)(char *, char *, char *, struct papfile *)
Definition papd/uam_auth.h:38
const char * uam_name
Definition afpd/uam_auth.h:23
int(* login)(void *, struct passwd **, char *, int, char *, size_t *)
Definition afpd/uam_auth.h:28
struct uam_obj * uam_prev
Definition afpd/uam_auth.h:39
int uam_count
Definition afpd/uam_auth.h:25
struct uam_obj * uam_next
Definition afpd/uam_auth.h:39
char * uam_path
Definition afpd/uam_auth.h:24