From 03f712e58327e5b15856082074062b22fccb30bd Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 3 Nov 2018 00:49:22 +0100 Subject: Implemented session id management and session logs in database --- src/mysql.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mysql.h') diff --git a/src/mysql.h b/src/mysql.h index 46e607e..8c6040f 100644 --- a/src/mysql.h +++ b/src/mysql.h @@ -10,9 +10,13 @@ struct db_host_info { char db_init(void); void db_clean(void); -char * db_get_username_from_pubkey(ssh_key pubkey); -struct db_host_info * db_get_host_info(const char * hostname); -void db_free_host_info(struct db_host_info * info); +char * // returns NULL if no user found, this char * is to be freed from the calling code +db_get_username_from_pubkey(ssh_key pubkey); +struct db_host_info * // returns NULL if no key found, this char * is to be freed from the calling code +db_get_host_info(const char * hostname); void db_set_host_publickey_hash(const char * hostname, const char * hash); +unsigned long long // returns 0 on error, or the session_id +db_init_session_and_get_id(const char * hostname, const char * username); +void db_free_host_info(struct db_host_info * info); #endif -- cgit v1.2.3