Authentication Functions char *mail_auth (char *mechanism,authresponse_t resp,int argc,char *argv[]); mechanism authentication mechanism name resp callback function for providing responses argc main() function argc value argv main() function argv value This server function searches the list of authenticators that was established by auth_link() for an authenticator with the given name. If an authenticator is found, authentication is initialized. The function pointed to by resp is called as the authenticator requires responses. AUTHENTICATOR *mail_lookup_auth (unsigned int i); i position in authenticator list This function returns the nth authenticator in the list, where n is the value of it. unsigned int mail_lookup_auth_name (char *mechanism); mechanism authentication mechanism name This function searches the list of authenticators for an authenticator with the given name, and returns its position in the authenticator list. The functions below are provided by c-client client drivers or by servers to support the protocol-dependent parts of authentication. typedef void *(*authchallenge_t) (void *stream,unsigned long *len); stream stream to read challenge len pointer to returned length in octets This driver function is called by an authenticator to read a challenge from the given protocol stream in a protocol-dependent way. It returns that challenge in binary and its length in octets to the authenticator. typedef long (*authrespond_t) (void *stream,char *s,unsigned long size); stream stream to send response s response string size length of response string in octets This driver function is called by an authenticator to send a challenge response to the given stream in a protocol-dependent way. It returns T if successful, NIL if failure. typedef char *(*authresponse_t) (void *challenge,unsigned long clen, unsigned long *rlen); challenge challenge string clen length of challenge string in octets rlen pointer to returned length of response string This server function is called with a challenge string of clen octets. It sends, according to whatever protocol (IMAP, POP, etc.) it uses, and returns the received response and response length in octets. typedef long (*authclient_t) (authchallenge_t challenger, authrespond_t responder,NETMBX *mb,void *s, unsigned long trial); challenger pointer to protocol-dependent challenge reader function responder pointer to protocol-dependent response sender function mb NETMBX struct of the mailbox desired to open s stream for protocol-dependent routines to use trial number of authentication attempts remaining This client authenticator function negotiates reading challenges and sending responses for a particular authenticator (Kerberos, etc.) over the protocol, and returns T if authenticated or NIL if failed. typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv[]); responder pointer to protocol-dependent responder function argc main() function argc value argv main() function argv value This server authenticator function negotiates sending challenges and reading responses for a particular authenticator (Kerberos, etc.), and returns either the authenticated user name or NIL if authentication failed.