lib/srdb2/db.h

00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2001-2003 FhG FOKUS
00005  * Copyright (C) 2006-2007 iptelorg GmbH
00006  *
00007  * This file is part of ser, a free SIP server.
00008  *
00009  * ser is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version
00013  *
00014  * For a license to use the ser software under conditions
00015  * other than those described here, or to purchase support for this
00016  * software, please contact iptel.org by e-mail at the following addresses:
00017  *    info@iptel.org
00018  *
00019  * ser is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU General Public License 
00025  * along with this program; if not, write to the Free Software 
00026  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  */
00028 
00029 #ifndef _DB_H
00030 #define _DB_H  1
00031 
00039 #include "db_gen.h"
00040 #include "db_ctx.h"
00041 #include "db_uri.h"
00042 #include "db_cmd.h"
00043 #include "db_res.h"
00044 #include "db_rec.h"
00045 #include "db_fld.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif /* __cplusplus */
00050 
00051 
00052 /*
00053  * Various database flags shared by modules 
00054  */
00055 #define SRDB_LOAD_SER   (1 << 0)  /* The row should be loaded by SER */
00056 #define SRDB_DISABLED   (1 << 1)  /* The row is disabled */
00057 #define SRDB_CANON      (1 << 2)  /* Canonical entry (domain or uri) */
00058 #define SRDB_IS_TO      (1 << 3)  /* The URI can be used in To */
00059 #define SRDB_IS_FROM    (1 << 4)  /* The URI can be used in From */
00060 #define SRDB_FOR_SERWEB (1 << 5)  /* Credentials instance can be used by serweb */
00061 #define SRDB_PENDING    (1 << 6)
00062 #define SRDB_DELETED    (1 << 7)
00063 #define SRDB_CALLER_DELETED (1 << 8) /* Accounting table */
00064 #define SRDB_CALLEE_DELETED (1 << 9) /* Accounting table */
00065 #define SRDB_MULTIVALUE     (1 << 10) /* Attr_types table */
00066 #define SRDB_FILL_ON_REG    (1 << 11) /* Attr_types table */
00067 #define SRDB_REQUIRED       (1 << 12) /* Attr_types table */
00068 #define SRDB_DIR            (1 << 13) /* Domain_settings table */
00069 
00070 #define RESERVED_1      (1 << 28) /* Reserved for private use */
00071 #define RESERVED_2      (1 << 29) /* Reserved for private use */
00072 #define RESERVED_3      (1 << 30) /* Reserved for private use */
00073 #define RESERVED_4      (1 << 31) /* Reserved for private use */
00074 
00075 struct db_gen;
00076 
00077 
00078 DBLIST_HEAD(_db_root);
00079 
00085 extern struct _db_root db_root;
00086 
00087 #ifdef __cplusplus
00088 }
00089 #endif /* __cplusplus */
00090 
00093 #endif /* _DB_H */