codec/base64.3: Supply missing Oxford comma.
[mLib] / sel / ident.3
CommitLineData
83856dde 1.\" -*-nroff-*-
fbf20b5b 2.TH ident 3 "2 October 1999" "Straylight/Edgeware" "mLib utilities library"
83856dde 3.SH "NAME"
4ident \- identd (RFC931) client
5.\" @ident_abort
6.\" @ident
7.\" @ident_socket
8.SH "SYNOPSIS"
9.nf
10.B "#include <mLib/ident>"
11
12.BI "void ident_abort(ident_request *" rq );
2b1924c2
MW
13.ds mT \fBvoid ident(
14.BI "\*(mTident_request *" rq ", sel_state *" s ,
15.BI "\h'\w'\*(mT'u'const struct sockaddr_in *" local ,
16.BI "\h'\w'\*(mT'u'const struct sockaddr_in *" remote ,
17.BI "\h'\w'\*(mT'u'void (*" func ")(ident_reply *" i ", void *" p ),
18.BI "\h'\w'\*(mT'u'void *" p );
19.ds mT \fBvoid ident_socket(
20.BI "\*(mTident_request *" rq ", sel_state *" s ", int " sk ,
21.BI "\h'\w'\*(mT'u'void (*" func ")(ident_reply *" i ", void *" p ),
22.BI "\h'\w'\*(mT'u'void *" p );
83856dde 23.fi
24.SH "DESCRIPTION"
25The
26.B ident.h
27header defines some types and functions which implement an ident client
28(as specified by RFC931).
29.PP
30The state of an ident request in progress is represented in an object of
31type
32.BR ident_request ,
33a structure type whose layout is unspecified. Storage for these objects
34is provided by the caller.
35.PP
36The primary interface for starting an ident request is the
37.B ident
38function. It takes a number of arguments:
39.TP
40.BI "ident_request *" rq
41Pointer to the client request block which is to maintain the state of
42the request as it progresses. This must not be discarded while the
43request is in progress, for obvious reasons.
44.TP
45.BI "sel_state *" s
46Pointer to an I/O multiplexor. See
47.BR sel (3)
48for more information about the I/O multiplexing system.
49.TP
50.BI "struct sockaddr_in *" local ", *" remote
51The local and remote socket addresses describing the connection to be
52enquired about. The local address is not optional. If you don't have
53it handy, you can use
54.B ident_socket
55described below.
56.TP
57.BI "void (*" func ")(ident_reply *" i ", void *" p )
58The handler function to be called with the result of the ident request.
59The
60.B ident_reply
61structure is described in detail below.
62.TP
63.BI "void *" p
64A pointer argument to be supplied to the handler function.
65.PP
66The
67.B ident_socket
68function provides an alternative interface to setting up an ident
69request. Instead of the local and remote socket addresses, the function
70works out the local and remote addresses from a socket file descriptor
71provided as an argument.
72.PP
73The handler function is provided the results in a structure of type
74.BR ident_reply .
75The pointer may be null if there was a problem connecting to the server;
76in this case, the global
77.B errno
78variable describes the problem in its usual inimitable way.
79.PP
80The reply structure contains the following members:
81.TP
82.B "unsigned short sport, dport"
83The source and destination ports, as seen from the point of view of the
84server. These should match up with the ports in the request structure.
85.TP
86.B "unsigned type"
87The type of response received from the server. There are three possible
88values:
89.B IDENT_USERID
90indicates that the server specified a userid and operating system name;
91.B IDENT_ERROR
92indicates that the server reported an error message; and
93.B IDENT_BAD
94indicates that the server's response was invalid.
95.TP
96.B "char *u.userid.os"
97The name of the remote operating system; only valid if
98.B type
99has the value
100.BR IDENT_USERID .
101.TP
102.B "char *u.userid.user"
103The name of the remote user; only valid if
104.B type
105has the value
106.BR IDENT_USERID .
107.TP
108.B "char *u.error"
109The error message reported by the server; only valid if
110.B type
111has the value
112.BR IDENT_ERROR .
113.PP
114An ident request in progress can be aborted by calling
115.B ident_abort
116on the request block. In this case, no notification is made to the
117handler function.
118.SH "SEE ALSO"
119.BR sel (3),
120.BR mLib (3).
121.SH "AUTHOR"
9b5ac6ff 122Mark Wooding, <mdw@distorted.org.uk>