File: libauth.h

package info (click to toggle)
inn2 2.4.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,912 kB
  • ctags: 7,860
  • sloc: ansic: 85,104; perl: 11,427; sh: 9,863; makefile: 2,498; yacc: 1,563; python: 298; lex: 252; tcl: 7
file content (39 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
**
**  Common headers for authenticators and resolvers.
**
*/

#include "config.h"
#include "portable/socket.h"

/* Holds the resolver information from nnrpd. */
struct res_info {
    struct sockaddr *client;
    struct sockaddr *local;
    char *clienthostname;
};

/* Holds the authentication information from nnrpd. */
struct auth_info {
    char *username;
    char *password;
};

/*
 * Reads connection information from a file descriptor (normally stdin, when
 * talking to nnrpd) and returns a new res_info or auth_info struct, or
 * returns NULL on failure.  Note that the fields will never be NULL; if the
 * corresponding information is missing, it is an error (which will be
 * logged and NULL will be returned).  The client is responsible for freeing
 * the struct and its fields; this can be done by calling the appropriate
 * destruction function below.
 */

extern struct auth_info *get_auth_info(FILE *);
extern struct res_info  *get_res_info (FILE *);

extern void free_auth_info(struct auth_info*);
extern void free_res_info (struct res_info*);