auth-client-connection.h revision 419baa2c17c63ae516b2df6cc5695f15aaccbff8
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch#ifndef AUTH_CLIENT_CONNECTION_H
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen#define AUTH_CLIENT_CONNECTION_H
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen#include "master-interface.h"
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenstruct auth_client_connection {
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen struct auth *auth;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen int refcount;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen int fd;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen struct io *io;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen struct istream *input;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen struct ostream *output;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen unsigned int pid;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen unsigned int connect_uid;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen uint8_t cookie[MASTER_AUTH_COOKIE_SIZE];
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen struct auth_request_handler *request_handler;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen unsigned int version_received:1;
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen};
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenstruct auth_client_connection *
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenauth_client_connection_create(struct auth *auth, int fd);
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenvoid auth_client_connection_destroy(struct auth_client_connection **conn);
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenstruct auth_client_connection *
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenauth_client_connection_lookup(unsigned int pid);
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainenvoid auth_client_connections_init(void);
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainenvoid auth_client_connections_deinit(void);
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen#endif
6b2738c39a868ff9291867138c55029fc40cf105Timo Sirainen