diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-11-07 00:47:39 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2010-11-07 00:47:39 +0200 |
commit | 25593b5e6fea76ed7c08db586924032c0810c27e (patch) | |
tree | b632534eb96978ad620fee1e5a9a5d280e0b191e /authdb.h | |
parent | e0450bd60a30ca944c16f84ee195463fd4aab653 (diff) | |
download | squark-25593b5e6fea76ed7c08db586924032c0810c27e.tar.bz2 squark-25593b5e6fea76ed7c08db586924032c0810c27e.tar.xz |
squark: reorganize sources to src directory
Diffstat (limited to 'authdb.h')
-rw-r--r-- | authdb.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/authdb.h b/authdb.h deleted file mode 100644 index 7bfa2f4..0000000 --- a/authdb.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef AUTHDB_H -#define AUTHDB_H - -#include <stddef.h> -#include <stdint.h> -#include "blob.h" -#include "addr.h" - -#define AUTHDB_IP_HASH_SIZE 64 - -struct sqdb; -struct authdb_map_entry; - -struct authdb_config { - struct sqdb *db; - time_t last_check; - time_t last_change; - uint64_t block_categories; - uint64_t hard_block_categories; - blob_t redirect_url_base; -}; - -struct authdb { - struct authdb_map_entry *hash_bucket[AUTHDB_IP_HASH_SIZE]; -}; - -struct authdb_entry { - struct { - char login_name[44]; - char mac_address[6]; - uint16_t switch_port; - sockaddr_any switch_ip; - uint64_t block_categories; - uint64_t hard_block_categories; - uint32_t login_time; - } p; - uint32_t last_activity_time; - uint32_t override_time; - uint32_t checksum; -}; - -struct authdb_map_entry { - struct authdb_map_entry *next; - sockaddr_any baseaddr; - struct authdb_entry * entries; -}; - -int authdb_open(struct authdb *adb, struct authdb_config *adbc, struct sqdb *db); -void authdb_close(struct authdb *adb); - -void *authdb_get(struct authdb *adb, sockaddr_any *addr, struct authdb_entry *entry, int create); - -void authdb_clear_entry(struct authdb_entry *entry); -int authdb_set(void *token, struct authdb_entry *entry); -int authdb_check_login(void *token, struct authdb_entry *e, blob_t username, time_t now); -void authdb_commit_login(void *token, struct authdb_entry *e, time_t now, struct authdb_config *cfg); -void authdb_commit_logout(void *token); -void authdb_commit_override(void *token, struct authdb_entry *entry, time_t now); - -int adbc_refresh(struct authdb_config *cfg, time_t now); - -#endif |