avpops_db.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _AVP_OPS_DB_H_
00031 #define _AVP_OPS_DB_H_
00032
00033 #include "../../db/db.h"
00034 #include "../../parser/msg_parser.h"
00035 #include "../../str.h"
00036 #include "../../sr_module.h"
00037 #include "../../pvar.h"
00038
00039
00040
00041 struct db_scheme
00042 {
00043 str name;
00044 str uuid_col;
00045 str username_col;
00046 str domain_col;
00047 str value_col;
00048 str table;
00049 int db_flags;
00050 struct db_scheme *next;
00051 };
00052
00053
00054 int avpops_db_bind(const str* db_url);
00055
00056 int avpops_db_init(const str* db_url, const str* db_table, str **db_columns);
00057
00058 db_res_t *db_load_avp( str *uuid, str *username, str *domain,
00059 char *attr, const str *table, struct db_scheme *scheme);
00060
00061 void db_close_query( db_res_t *res );
00062
00063 int db_store_avp( db_key_t *keys, db_val_t *vals, int n, const str *table);
00064
00065 int db_delete_avp( str *uuid, str *username, str *domain,
00066 char *attr, const str *table);
00067
00068 int db_query_avp(struct sip_msg* msg, char *query, pvname_list_t* dest);
00069
00070 int avp_add_db_scheme( modparam_t type, void* val);
00071
00072 struct db_scheme *avp_get_db_scheme( str *name );
00073
00074 #endif