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
00031
00032
00033
00034
00035 #ifndef URECORD_H
00036 #define URECORD_H
00037
00038
00039 #include <stdio.h>
00040 #include <time.h>
00041 #include "hslot.h"
00042 #include "../../str.h"
00043 #include "../../qvalue.h"
00044 #include "ucontact.h"
00045 #include "notify.h"
00046
00047
00048 struct hslot;
00049
00050
00051
00052
00053
00054 typedef struct urecord {
00055 str* domain;
00056 str uid;
00057 ucontact_t* contacts;
00058
00059 struct hslot* slot;
00060 struct {
00061 struct urecord* prev;
00062 struct urecord* next;
00063 } d_ll;
00064 struct {
00065 struct urecord* prev;
00066 struct urecord* next;
00067 } s_ll;
00068
00069 struct notify_cb* watchers;
00070 } urecord_t;
00071
00072
00073
00074 int new_urecord(str* _dom, str* _uid, urecord_t** _r);
00075
00076
00077
00078 void free_urecord(urecord_t* _r);
00079
00080
00081
00082
00083
00084 void print_urecord(FILE* _f, urecord_t* _r);
00085
00086
00087
00088
00089
00090 int mem_insert_ucontact(urecord_t* _r, str* aor, str* _c, time_t _e, qvalue_t _q, str* _cid, int _cs,
00091 unsigned int _flags, struct ucontact** _con, str *_ua, str* _recv,
00092 struct socket_info* sock, str* _inst, int sid);
00093
00094
00095
00096
00097
00098
00099 void mem_remove_ucontact(urecord_t* _r, ucontact_t* _c);
00100
00101
00102
00103
00104
00105 void mem_delete_ucontact(urecord_t* _r, ucontact_t* _c);
00106
00107
00108
00109
00110
00111 int timer_urecord(urecord_t* _r);
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 typedef void (*release_urecord_t)(urecord_t* _r);
00122 void release_urecord(urecord_t* _r);
00123
00124
00125
00126
00127
00128
00129 typedef int (*insert_ucontact_t)(urecord_t* _r, str* aor, str* _c, time_t _e, qvalue_t _q, str* _cid, int _cs,
00130 unsigned int _flags, struct ucontact** _con, str *_ua, str* _recv,
00131 struct socket_info* sock, str* _inst, int sid);
00132 int insert_ucontact(urecord_t* _r, str* aor, str* _c, time_t _e, qvalue_t _q, str* _cid, int _cs,
00133 unsigned int _flags, struct ucontact** _con, str *_ua, str* _recv,
00134 struct socket_info* sock, str* _inst, int sid);
00135
00136
00137
00138
00139 typedef int (*delete_ucontact_t)(urecord_t* _r, struct ucontact* _c);
00140 int delete_ucontact(urecord_t* _r, struct ucontact* _c);
00141
00142
00143
00144
00145
00146 typedef int (*get_ucontact_t)(urecord_t* _r, str* _c, struct ucontact** _co);
00147 int get_ucontact(urecord_t* _r, str* _c, struct ucontact** _co);
00148
00149 typedef int (*get_ucontact_by_inst_t)(urecord_t* _r, str* _c, str* _i, struct ucontact** _co);
00150 int get_ucontact_by_instance(urecord_t* _r, str* _c, str* _i, struct ucontact** _co);
00151 #endif