aboutsummaryrefslogtreecommitdiff
path: root/src/mysql.h
diff options
context:
space:
mode:
authorJulien Dessaux2018-11-03 00:49:22 +0100
committerJulien Dessaux2018-11-07 14:37:50 +0100
commit03f712e58327e5b15856082074062b22fccb30bd (patch)
tree9671dcf756338dff4fe19daec2309b042977ba00 /src/mysql.h
parentBegan implementing configuration fetching from an sshportal mysql database (diff)
downloadbastion-03f712e58327e5b15856082074062b22fccb30bd.tar.gz
bastion-03f712e58327e5b15856082074062b22fccb30bd.tar.bz2
bastion-03f712e58327e5b15856082074062b22fccb30bd.zip
Implemented session id management and session logs in database
Diffstat (limited to '')
-rw-r--r--src/mysql.h10
1 files changed, 7 insertions, 3 deletions
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