1libauth(3)                InterNetNews Documentation                libauth(3)
2
3
4

NAME

6       libauth - routines for writing nnrpd resolvers and authenticators
7

SYNOPSIS

9           #include "libauth.h"
10
11           struct res_info {
12               struct sockaddr *client;
13               struct sockaddr *local;
14               char *clienthostname;
15           };
16
17           struct auth_info {
18               char *username;
19               char *password;
20           };
21
22           struct auth_info *get_auth_info(FILE *);
23           struct res_info  *get_res_info (FILE *);
24
25           void free_auth_info(struct auth_info*);
26           void free_res_info (struct res_info*);
27

DESCRIPTION

29       These functions provide a convenient C frontend to the nnrpd external
30       authentication interface documented in doc/external-auth.  Use of this
31       library is not required; in particular, external resolvers and authen‐
32       ticators written in languages other than C will need to implement the
33       necessary functionality themselves.
34
35       The get_auth_info() and get_res_info() functions allocate sufficient
36       memory for a struct auth_info or struct res_info and any necessary
37       fields, and return a pointer to the struct with the fields filled in
38       from information supplied by nnrpd (the FILE* parameter generally
39       should be "stdin").  Both functions return NULL on error.  The caller
40       is responsible for deallocating the memory by using the functions
41       below.
42
43       The string fields of both structs are straightforward.  The client and
44       local fields of struct res_info actually point to instances of struct
45       sockaddr_in (or struct sockaddr_in6 if IPv6 support is compiled in).
46
47       The free_auth_info() and free_res_info() functions free the struct
48       passed in as argument and all necessary fields.
49

BUGS

51       In many cases, nnrpd provides more information than is normally useful
52       (for example, even when calling an authenticator, the resolver informa‐
53       tion is often provided.)  On the other hand, in certain cases it pro‐
54       vides less information than might be expected (for example, if nnrpd is
55       reading from stdin rather than a socket).  The implementation is capa‐
56       ble of handling at least the first of these issues, but that function‐
57       ality is not exposed in the interface.
58
59       At present, libauth.h and its implementation are located in authprogs/;
60       perhaps they should be moved to include/ and lib/, respectively?
61

HISTORY

63       Written by Jeffrey M. Vinocur <jeff@litech.org> for InterNetNews.
64
65       $Id: libauth.3 5989 2002-12-12 23:07:49Z vinocur $
66

SEE ALSO

68       nnrpd(8), readers.conf(5), doc/external-auth
69
70
71
72INN 2.4.0                         2002-12-12                        libauth(3)
Impressum