uid_auth_db_mod.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * $Id$
  3. *
  4. * Digest Authentication - Database support
  5. *
  6. * Copyright (C) 2001-2003 FhG Fokus
  7. *
  8. * This file is part of ser, a free SIP server.
  9. *
  10. * ser is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version
  14. *
  15. * For a license to use the ser software under conditions
  16. * other than those described here, or to purchase support for this
  17. * software, please contact iptel.org by e-mail at the following addresses:
  18. * [email protected]
  19. *
  20. * ser is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, write to the Free Software
  27. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #ifndef UID_AUTH_DB_MOD_H
  30. #define UID_AUTH_DB_MOD_H
  31. #include "../../str.h"
  32. #include "../../lib/srdb2/db.h"
  33. #include "../../modules/auth/api.h"
  34. #include "../../parser/msg_parser.h"
  35. /*
  36. * Module parameters variables
  37. */
  38. extern str username_column; /* 'username' column name */
  39. extern str did_column; /* 'did' column name */
  40. extern str realm_column; /* 'realm' column name */
  41. extern str pass_column; /* 'password' column name */
  42. extern str pass_column_2; /* Column containing HA1 string constructed
  43. * of user@domain username
  44. */
  45. extern str flags_column; /* Flags column in credentials table */
  46. extern int calc_ha1; /* if set to 1, ha1 is calculated by the server */
  47. extern int use_did; /* Whether query should also use did in query */
  48. extern int check_all; /* if set to 1, multiple db entries are checked */
  49. extern db_ctx_t* auth_db_handle; /* database connection handle */
  50. extern auth_api_s_t auth_api;
  51. extern str* credentials;
  52. extern int credentials_n;
  53. /* structure holding information for a table (holds
  54. * only pregenerated DB queries now) */
  55. typedef struct _authdb_table_info_t {
  56. str table; /* s is zero terminated */
  57. db_cmd_t *query_pass; /* queries HA1 */
  58. db_cmd_t *query_pass2; /* queries HA1B */
  59. db_cmd_t *query_password; /* queries plain password */
  60. struct _authdb_table_info_t *next;
  61. char buf[1]; /* used to hold 'table' data */
  62. } authdb_table_info_t;
  63. #endif /* AUTHDB_MOD_H */