/* eurephiadb_driver.h -- API provided by the database driver * * GPLv2 - Copyright (C) 2008 David Sommerseth * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifndef EUREPHIADB_DRIVER_H_ #define EUREPHIADB_DRIVER_H_ #define attempt_IPADDR 1 #define attempt_CERTIFICATE 2 #define attempt_USERNAME 3 #define ATTEMPT_RESET 0x0A #define ATTEMPT_REGISTER 0x0B #ifndef EUREPHIADB_DRIVER /* Functions needed by all drivers */ const char *(*eDB_DriverVersion) (void); int (*eDB_DriverAPIVersion) (void); /* * functions which needs to exists in the eurephiaDB (eDB) module - API Version 1 */ int (*eDBconnect) (eurephiaCTX *ctx, const int argc, const char **argv); void (*eDBdisconnect) (eurephiaCTX *ctx); int (*eDBauth_TLS) (eurephiaCTX *ctx, const char *org, const char *cname, const char *email, const char *digest, const char *depth); int (*eDBauth_user) (eurephiaCTX *ctx, const int certid, const char *username, const char *passwd); int (*eDBget_uid) (eurephiaCTX *ctx, const int certid, const char *username); int (*eDBblacklist_check) (eurephiaCTX *ctx, const int type, const char *val); void (*eDBregister_attempt) (eurephiaCTX *ctx, int type, int mode, const char *value); int (*eDBregister_login) (eurephiaCTX *ctx, eurephiaSESSION *skey, const int certid, const int uid, const char *proto, const char *remipaddr, const char *remport, const char *vpnipaddr, const char *vpnipmask) ; int (*eDBregister_vpnmacaddr) (eurephiaCTX *ctx, eurephiaSESSION *skey, const char *macaddr); int (*eDBregister_logout) (eurephiaCTX *ctx, eurephiaSESSION *skey, const char *bytes_sent, const char *bytes_received, const char *duration); /* firewall functions */ char *(*eDBget_firewall_profile) (eurephiaCTX *ctx, eurephiaSESSION *session); /* The following functions is also declared in eurephia_session_values.c - for local internal usage. */ char *(*eDBget_sessionkey_seed) (eurephiaCTX *ctx, const char *sessionseed); char *(*eDBget_sessionkey_macaddr) (eurephiaCTX *ctx, const char *macaddr); int (*eDBcheck_sessionkey_uniqueness) (eurephiaCTX *ctx, const char *seskey); int (*eDBregister_sessionkey) (eurephiaCTX *ctx, const char *seed, const char *seskey); eurephiaVALUES *(*eDBload_sessiondata) (eurephiaCTX *ctx, const char *sesskey); int (*eDBdestroy_session) (eurephiaCTX *ctx, eurephiaSESSION *session); int (*eDBstore_session_value) (eurephiaCTX *ctx, eurephiaSESSION *skey, int mode, const char *key, const char *val); #endif /* !EUREPHIADB_DRIVER */ #endif /* !EUREPHIADB_DRIVER_H_ */