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

« back to all changes in this revision

Viewing changes to etc/papd/uam_auth.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
/*
 
2
 * $Id: uam_auth.h,v 1.3 2001/06/25 20:13:45 rufustfirefly Exp $
 
3
 *
 
4
 * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
 
5
 * All Rights Reserved.  See COPYRIGHT.
 
6
 *
 
7
 * interface between uam.c and auth.c
 
8
 */
 
9
 
 
10
#ifndef PAPD_UAM_AUTH_H
 
11
#define PAPD_UAM_AUTH_H 1
 
12
 
 
13
#include <sys/cdefs.h>
 
14
#include <pwd.h>
 
15
 
 
16
#include <atalk/uam.h>
 
17
 
 
18
#include "file.h"
 
19
 
 
20
struct uam_mod {
 
21
  void *uam_module;
 
22
  struct uam_export *uam_fcn;
 
23
  struct uam_mod *uam_prev, *uam_next;
 
24
};
 
25
 
 
26
struct uam_obj {
 
27
  const char *uam_name; /* authentication method */
 
28
  char *uam_path; /* where it's located */
 
29
  int uam_count;
 
30
  union {
 
31
    struct {
 
32
      int (*login) __P((void *, struct passwd **, 
 
33
                        char *, int, char *, int *));
 
34
      int (*logincont) __P((void *, struct passwd **, char *,
 
35
                            int, char *, int *));
 
36
      void (*logout) __P((void));
 
37
    } uam_login;
 
38
    int (*uam_changepw) __P((void *, char *, struct passwd *, char *,
 
39
                             int, char *, int *));
 
40
    int (*uam_printer) __P((char *, char *, char *, struct papfile *));
 
41
  } u;
 
42
  struct uam_obj *uam_prev, *uam_next;
 
43
};
 
44
 
 
45
#define uam_attach(a, b) do { \
 
46
    (a)->uam_prev->uam_next = (b); \
 
47
    (b)->uam_prev = (a)->uam_prev; \
 
48
    (b)->uam_next = (a); \
 
49
    (a)->uam_prev = (b); \
 
50
} while (0)                                  
 
51
 
 
52
#define uam_detach(a) do { \
 
53
    (a)->uam_prev->uam_next = (a)->uam_next; \
 
54
    (a)->uam_next->uam_prev = (a)->uam_prev; \
 
55
} while (0)
 
56
 
 
57
#define UAM_LIST(type) (((type) == UAM_SERVER_LOGIN) ? &uam_login : \
 
58
                (((type) == UAM_SERVER_CHANGEPW) ? &uam_changepw : \
 
59
                (((type) == UAM_SERVER_PRINTAUTH) ? &uam_printer : NULL)))
 
60
 
 
61
 
 
62
extern struct uam_mod *uam_load __P((const char *, const char *));
 
63
extern void uam_unload __P((struct uam_mod *));
 
64
 
 
65
/* auth.c */
 
66
int auth_load __P((const char *, const char *));
 
67
int auth_register __P((const int, struct uam_obj *));
 
68
#define auth_unregister(a) uam_detach(a)
 
69
struct uam_obj *auth_uamfind __P((const int, const char *, const int));
 
70
void auth_unload __P((void));
 
71
int getuamnames __P((const int, char *));
 
72
 
 
73
#endif /* uam_auth.h */