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;"
16 .B " IDENT_USERID = ...,"
17 .B " IDENT_ERROR = ...,"
22 .B " unsigned short sport, dport;"
25 .B " struct { char *os, *user; } userid;"
30 .BI "void ident_abort(ident_request *" rq );
31 .ta \w'\fBvoid ident('u
32 .BI "void ident(ident_request *" rq ", sel_state *" s ,
33 .BI " const struct sockaddr_in *" local ,
34 .BI " const struct sockaddr_in *" remote ,
35 .BI " void (*" func ")(ident_reply *" i ", void *" p ),
37 .ta \w'\fBvoid ident_socket('u
38 .BI "void ident_socket(ident_request *" rq ", sel_state *" s ", int " sk ,
39 .BI " void (*" func ")(ident_reply *" i ", void *" p ),
45 header defines some types and functions which implement an ident client
46 (as specified by RFC931).
48 The state of an ident request in progress is represented in an object of
51 a structure type whose layout is unspecified. Storage for these objects
52 is provided by the caller.
54 The primary interface for starting an ident request is the
56 function. It takes a number of arguments:
58 .BI "ident_request *" rq
59 Pointer to the client request block which is to maintain the state of
60 the request as it progresses. This must not be discarded while the
61 request is in progress, for obvious reasons.
64 Pointer to an I/O multiplexor. See
66 for more information about the I/O multiplexing system.
68 .BI "struct sockaddr_in *" local ", *" remote
69 The local and remote socket addresses describing the connection to be
70 enquired about. The local address is not optional. If you don't have
75 .BI "void (*" func ")(ident_reply *" i ", void *" p )
76 The handler function to be called with the result of the ident request.
79 structure is described in detail below.
82 A pointer argument to be supplied to the handler function.
86 function provides an alternative interface to setting up an ident
87 request. Instead of the local and remote socket addresses, the function
88 works out the local and remote addresses from a socket file descriptor
89 provided as an argument.
91 The handler function is provided the results in a structure of type
93 The pointer may be null if there was a problem connecting to the server;
94 in this case, the global
96 variable describes the problem in its usual inimitable way.
98 The reply structure contains the following members:
100 .B "unsigned short sport, dport"
101 The source and destination ports, as seen from the point of view of the
102 server. These should match up with the ports in the request structure.
105 The type of response received from the server. There are three possible
108 indicates that the server specified a userid and operating system name;
110 indicates that the server reported an error message; and
112 indicates that the server's response was invalid.
114 .B "char *u.userid.os"
115 The name of the remote operating system; only valid if
120 .B "char *u.userid.user"
121 The name of the remote user; only valid if
127 The error message reported by the server; only valid if
132 An ident request in progress can be aborted by calling
134 on the request block. In this case, no notification is made to the
140 Mark Wooding, <mdw@distorted.org.uk>