db.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG FOKUS
  5. * Copyright (C) 2006-2007 iptelorg GmbH
  6. *
  7. * This file is part of ser, a free SIP server.
  8. *
  9. * ser is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version
  13. *
  14. * For a license to use the ser software under conditions
  15. * other than those described here, or to purchase support for this
  16. * software, please contact iptel.org by e-mail at the following addresses:
  17. * [email protected]
  18. *
  19. * ser is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  27. */
  28. #ifndef _DB_H
  29. #define _DB_H 1
  30. /**
  31. * \defgroup DB_API Database Abstraction Layer
  32. *
  33. * @{
  34. */
  35. #include "db_gen.h"
  36. #include "db_ctx.h"
  37. #include "db_uri.h"
  38. #include "db_cmd.h"
  39. #include "db_res.h"
  40. #include "db_rec.h"
  41. #include "db_fld.h"
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif /* __cplusplus */
  45. /*
  46. * Various database flags shared by modules
  47. */
  48. #define SRDB_LOAD_SER (1 << 0) /* The row should be loaded by SER */
  49. #define SRDB_DISABLED (1 << 1) /* The row is disabled */
  50. #define SRDB_CANON (1 << 2) /* Canonical entry (domain or uri) */
  51. #define SRDB_IS_TO (1 << 3) /* The URI can be used in To */
  52. #define SRDB_IS_FROM (1 << 4) /* The URI can be used in From */
  53. #define SRDB_FOR_SERWEB (1 << 5) /* Credentials instance can be used by serweb */
  54. #define SRDB_PENDING (1 << 6)
  55. #define SRDB_DELETED (1 << 7)
  56. #define SRDB_CALLER_DELETED (1 << 8) /* Accounting table */
  57. #define SRDB_CALLEE_DELETED (1 << 9) /* Accounting table */
  58. #define SRDB_MULTIVALUE (1 << 10) /* Attr_types table */
  59. #define SRDB_FILL_ON_REG (1 << 11) /* Attr_types table */
  60. #define SRDB_REQUIRED (1 << 12) /* Attr_types table */
  61. #define SRDB_DIR (1 << 13) /* Domain_settings table */
  62. #define RESERVED_1 (1 << 28) /* Reserved for private use */
  63. #define RESERVED_2 (1 << 29) /* Reserved for private use */
  64. #define RESERVED_3 (1 << 30) /* Reserved for private use */
  65. #define RESERVED_4 (1 << 31) /* Reserved for private use */
  66. struct db_gen;
  67. DBLIST_HEAD(_db_root);
  68. /** \brief The root of all DB API structures
  69. *
  70. * This is the root linked list of all database
  71. * structures allocated in SER
  72. */
  73. extern struct _db_root db_root;
  74. #ifdef __cplusplus
  75. }
  76. #endif /* __cplusplus */
  77. /** @} */
  78. #endif /* _DB_H */