Added version to server
[tunnel6.git] / server / src / db.h
blob7e06d15355ec36964a203d12d338e9314750da81
1 /*
2 * tunnel6
3 * Copyright (C) 2010 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _DB_H
21 #define _DB_H
23 #include <sys/time.h>
24 #include "ipv6.h"
26 /* Client structure */
27 typedef struct client_context {
28 struct client_context *next, *prev;
30 ipv6_addr_t ip; /* IPv6 */
31 ipv6_addr_t prefix; /* routed prefix */
32 char *name; /* name */
33 char *pwd; /* password */
34 struct sockaddr_in *info; /* socket info */
35 struct timeval tnow; /* time of the last heartbeat */
36 } client_t;
38 extern int db_disconnect_all ();
39 extern client_t *db_check (ipv6_addr_t ip);
40 extern client_t *db_find (struct sockaddr_in *info);
41 extern client_t *db_verify (char *name, char *pwd);
42 extern int db_flush (client_t *c);
43 extern int db_reload ();
44 extern int db_init ();
46 #endif