2 .TH ident 3 "2 October 1999" "Straylight/Edgeware" "mLib utilities library"
4 ident \- identd (RFC931) client
10 .B "#include <mLib/ident>"
12 .B "typedef struct { ...\& } ident_request;"
15 .B "\h'4n'IDENT_USERID = ...,"
16 .B "\h'4n'IDENT_ERROR = ...,"
17 .B "\h'4n'IDENT_BAD = ..."
21 .B "\h'4n'unsigned short sport, dport;"
22 .B "\h'4n'unsigned type;"
24 .B "\h'8n'struct { char *os, *user; } userid;"
25 .B "\h'8n'char *error;"
29 .BI "void ident_abort(ident_request *" rq );
31 .BI "\*(mTident_request *" rq ", sel_state *" s ,
32 .BI "\h'\w'\*(mT'u'const struct sockaddr_in *" local ,
33 .BI "\h'\w'\*(mT'u'const struct sockaddr_in *" remote ,
34 .BI "\h'\w'\*(mT'u'void (*" func ")(ident_reply *" i ", void *" p ),
35 .BI "\h'\w'\*(mT'u'void *" p );
36 .ds mT \fBvoid ident_socket(
37 .BI "\*(mTident_request *" rq ", sel_state *" s ", int " sk ,
38 .BI "\h'\w'\*(mT'u'void (*" func ")(ident_reply *" i ", void *" p ),
39 .BI "\h'\w'\*(mT'u'void *" p );
44 header defines some types and functions which implement an ident client
45 (as specified by RFC931).
47 The state of an ident request in progress is represented in an object of
50 a structure type whose layout is unspecified. Storage for these objects
51 is provided by the caller.
53 The primary interface for starting an ident request is the
55 function. It takes a number of arguments:
57 .BI "ident_request *" rq
58 Pointer to the client request block which is to maintain the state of
59 the request as it progresses. This must not be discarded while the
60 request is in progress, for obvious reasons.
63 Pointer to an I/O multiplexor. See
65 for more information about the I/O multiplexing system.
67 .BI "struct sockaddr_in *" local ", *" remote
68 The local and remote socket addresses describing the connection to be
69 enquired about. The local address is not optional. If you don't have
74 .BI "void (*" func ")(ident_reply *" i ", void *" p )
75 The handler function to be called with the result of the ident request.
78 structure is described in detail below.
81 A pointer argument to be supplied to the handler function.
85 function provides an alternative interface to setting up an ident
86 request. Instead of the local and remote socket addresses, the function
87 works out the local and remote addresses from a socket file descriptor
88 provided as an argument.
90 The handler function is provided the results in a structure of type
92 The pointer may be null if there was a problem connecting to the server;
93 in this case, the global
95 variable describes the problem in its usual inimitable way.
97 The reply structure contains the following members:
99 .B "unsigned short sport, dport"
100 The source and destination ports, as seen from the point of view of the
101 server. These should match up with the ports in the request structure.
104 The type of response received from the server. There are three possible
107 indicates that the server specified a userid and operating system name;
109 indicates that the server reported an error message; and
111 indicates that the server's response was invalid.
113 .B "char *u.userid.os"
114 The name of the remote operating system; only valid if
119 .B "char *u.userid.user"
120 The name of the remote user; only valid if
126 The error message reported by the server; only valid if
131 An ident request in progress can be aborted by calling
133 on the request block. In this case, no notification is made to the
139 Mark Wooding, <mdw@distorted.org.uk>