spl->critical section conversion.
[dragonfly.git] / contrib / libpam / libpamc / libpamc.h
1 /*
2  * $Id: libpamc.h,v 1.2 2000/11/19 23:54:03 agmorgan Exp $
3  *
4  * Copyright (c) Andrew G. Morgan <morgan@ftp.kernel.org>
5  *
6  */
7
8 #ifndef LIBPAMC_H
9 #define LIBPAMC_H
10
11 #include <security/pam_client.h>
12 #include <security/_pam_macros.h>
13
14 #include <sys/stat.h>
15 #include <unistd.h>
16 #include <sys/types.h>
17 #include <dirent.h>
18 #include <sys/wait.h>
19 #include <stdlib.h>
20 #include <errno.h>
21 #include <ctype.h>
22
23 #define _PAMC_DEFAULT_TOP_FD  10
24
25 struct pamc_handle_s {
26     struct pamc_agent_s *current;
27     struct pamc_agent_s *chain;
28     struct pamc_blocked_s *blocked_agents;
29     int max_path;
30     char **agent_paths;
31     int combined_status;
32     int highest_fd_to_close;
33 };
34
35 typedef struct pamc_blocked_s {
36     char *id;                       /* <NUL> terminated */
37     struct pamc_blocked_s *next;
38 } pamc_blocked_t;
39
40 typedef struct pamc_agent_s {
41     char *id;
42     int id_length;
43     struct pamc_agent_s *next;
44     int writer;   /* write to agent */
45     int reader;   /* read from agent */
46     pid_t pid;    /* agent process id */
47 } pamc_agent_t;
48
49 /* used to build a tree of unique, sorted agent ids */
50
51 typedef struct pamc_id_node {
52     struct pamc_id_node *left, *right;
53     int child_count;
54     char *agent_id;
55 } pamc_id_node_t;
56
57 /* internal function */
58 int __pamc_valid_agent_id(int id_length, const char *id);
59
60 #define PAMC_SYSTEM_AGENT_PATH        "/lib/pamc:/usr/lib/pamc"
61 #define PAMC_SYSTEM_AGENT_SEPARATOR   ':'
62
63 #endif /* LIBPAMC_H */