.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "libinnauth 3" .TH libinnauth 3 2024-04-01 "INN 2.7.2" "InterNetNews Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME libinnauth \- Routines for writing nnrpd resolvers and authenticators .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #include "libinnauth.h" \& \& struct res_info { \& struct sockaddr *client; \& struct sockaddr *local; \& char *clienthostname; \& }; \& \& struct auth_info { \& char *username; \& char *password; \& }; \& \& struct auth_info *get_auth_info(FILE *); \& struct res_info *get_res_info (FILE *); \& \& void free_auth_info(struct auth_info*); \& void free_res_info (struct res_info*); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" These functions provide a convenient C frontend to the nnrpd external authentication interface documented in \fIdoc/external\-auth\fR. Use of this library is \fBnot\fR required; in particular, external resolvers and authenticators written in languages other than C will need to implement the necessary functionality themselves. .PP The get_auth_info() and get_res_info() functions allocate sufficient memory for a \fBstruct auth_info\fR or \fBstruct res_info\fR and any necessary fields, and return a pointer to the struct with the fields filled in from information supplied by nnrpd (the \fBFILE*\fR parameter generally should be \f(CW\*(C`stdin\*(C'\fR). Both functions return NULL on error. The caller is responsible for deallocating the memory by using the functions below. .PP The string fields of both structs are straightforward. The \fBclient\fR and \fBlocal\fR fields of \fBstruct res_info\fR actually point to instances of \&\fBstruct sockaddr_in\fR (or \fBstruct sockaddr_in6\fR if IPv6 support is compiled in). .PP The free_auth_info() and free_res_info() functions free the struct passed in as argument and all necessary fields. .SH BUGS .IX Header "BUGS" In many cases, nnrpd provides more information than is normally useful (for example, even when calling an authenticator, the resolver information is often provided.) On the other hand, in certain cases it provides less information than might be expected (for example, if nnrpd is reading from stdin rather than a socket). The implementation is capable of handling at least the first of these issues, but that functionality is not exposed in the interface. .PP At present, \fIlibinnauth.h\fR and its implementation are located in \&\fIauthprogs/\fR; perhaps they should be moved to \fIinclude/\fR and \fIlib/\fR, respectively? .SH HISTORY .IX Header "HISTORY" Written by Jeffrey M.\ Vinocur for InterNetNews. .SH "SEE ALSO" .IX Header "SEE ALSO" nnrpd(8), readers.conf(5), \fIdoc/external\-auth\fR