cctools
auth.h
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2022 The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef AUTH_H
9 #define AUTH_H
10 
11 #include "link.h"
12 
13 struct auth_state;
14 
15 #define AUTH_SUBJECT_MAX 1024
16 #define AUTH_TYPE_MAX 1024
17 #define AUTH_LINE_MAX (AUTH_SUBJECT_MAX+AUTH_TYPE_MAX)
18 
19 typedef int (*auth_assert_t) (struct link * l, time_t stoptime);
20 typedef int (*auth_accept_t) (struct link * l, char **subject, time_t stoptime);
21 
22 int auth_assert(struct link *l, char **type, char **subject, time_t stoptime);
23 int auth_accept(struct link *l, char **type, char **subject, time_t stoptime);
24 
25 int auth_barrier(struct link *l, const char *response, time_t stoptime);
26 int auth_register(char *type, auth_assert_t assert, auth_accept_t accept);
27 
28 void auth_clear(void);
29 
30 struct auth_state *auth_clone(void);
31 void auth_replace(struct auth_state *);
32 void auth_free(struct auth_state *);
33 
34 #endif