chiark / gitweb /
wip compile
[inn-innduct.git] / authprogs / libauth.h
1 /*
2 **
3 **  Common headers for authenticators and resolvers.
4 **
5 */
6
7 #include "config.h"
8 #include "portable/socket.h"
9
10 /* Holds the resolver information from nnrpd. */
11 struct res_info {
12     struct sockaddr *client;
13     struct sockaddr *local;
14     char *clienthostname;
15 };
16
17 /* Holds the authentication information from nnrpd. */
18 struct auth_info {
19     char *username;
20     char *password;
21 };
22
23 /*
24  * Reads connection information from a file descriptor (normally stdin, when
25  * talking to nnrpd) and returns a new res_info or auth_info struct, or
26  * returns NULL on failure.  Note that the fields will never be NULL; if the
27  * corresponding information is missing, it is an error (which will be
28  * logged and NULL will be returned).  The client is responsible for freeing
29  * the struct and its fields; this can be done by calling the appropriate
30  * destruction function below.
31  */
32
33 extern struct auth_info *get_auth_info(FILE *);
34 extern struct res_info  *get_res_info (FILE *);
35
36 extern void free_auth_info(struct auth_info*);
37 extern void free_res_info (struct res_info*);
38
39