presence/event_list.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
00031
00032
00033
00034
00035 #ifndef _PRES_EV_LST_H
00036 #define _PRES_EV_LST_H
00037
00038 #include "../../parser/msg_parser.h"
00039 #include "../../parser/parse_event.h"
00040 #include "../../str.h"
00041 #include "subscribe.h"
00042
00043 #define WINFO_TYPE 1<< 0
00044 #define PUBL_TYPE 1<< 1
00045
00046 struct subscription;
00047
00048 typedef int (apply_auth_t)(str* , struct subscription*, str** );
00049
00050 typedef int (publ_handling_t)(struct sip_msg*);
00051
00052 typedef int (subs_handling_t)(struct sip_msg*);
00053
00054 typedef str* (agg_nbody_t)(str* pres_user, str* pres_domain, str** body_array, int n, int off_index);
00055
00056
00057
00058
00059
00060
00061 typedef str* (aux_body_processing_t)(struct subscription *subs, str* body);
00062
00063
00064
00065
00066
00067
00068
00069
00070 typedef int (is_allowed_t)(struct subscription* subs);
00071 typedef int (get_rules_doc_t)(str* user, str* domain, str** rules_doc);
00072
00073
00074
00075
00076
00077
00078
00079 typedef void(free_body_t)(char* body);
00080
00081 struct pres_ev
00082 {
00083 str name;
00084 event_t* evp;
00085 str content_type;
00086 int default_expires;
00087 int type;
00088 int etag_not_new;
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 int req_auth;
00100 get_rules_doc_t* get_rules_doc;
00101 apply_auth_t* apply_auth_nbody;
00102 is_allowed_t* get_auth_status;
00103
00104
00105
00106
00107
00108
00109 agg_nbody_t* agg_nbody;
00110 publ_handling_t * evs_publ_handl;
00111 subs_handling_t * evs_subs_handl;
00112 free_body_t* free_body;
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 aux_body_processing_t* aux_body_processing;
00124 free_body_t* aux_free_body;
00125 struct pres_ev* wipeer;
00126 struct pres_ev* next;
00127
00128 };
00129 typedef struct pres_ev pres_ev_t;
00130
00131 typedef struct evlist
00132 {
00133 int ev_count;
00134 pres_ev_t* events;
00135 }evlist_t;
00136
00137 evlist_t* init_evlist(void);
00138
00139 int add_event(pres_ev_t* event);
00140
00141 typedef int (*add_event_t)(pres_ev_t* event);
00142
00143 void free_event_params(param_t* params, int mem_type);
00144
00145 pres_ev_t* contains_event(str* name, event_t* parsed_event);
00146
00147 typedef pres_ev_t* (*contains_event_t)(str* name, event_t* parsed_event);
00148
00149 int get_event_list(str** ev_list);
00150
00151 typedef int (*get_event_list_t) (str** ev_list);
00152
00153 void destroy_evlist(void);
00154
00155 extern evlist_t* EvList;
00156
00157 pres_ev_t* search_event(event_t* event);
00158 typedef pres_ev_t* (*search_event_t)(event_t* event);
00159
00160 event_t* shm_copy_event(event_t* e);
00161
00162 void shm_free_event(event_t* ev);
00163
00164 void free_pres_event(pres_ev_t* ev);
00165
00166
00167 #endif