00001 00054 #ifndef __TRANSACTION_H_ 00055 #define __TRANSACTION_H_ 00056 00057 #include <time.h> 00058 #include "utils.h" 00059 #include "diameter.h" 00060 #include "diameter_api.h" 00061 00063 typedef struct _cdp_trans_t{ 00064 AAAMsgIdentifier endtoendid; 00065 AAAMsgIdentifier hopbyhopid; 00066 AAATransactionCallback_f *cb; 00067 void **ptr; 00068 AAAMessage *ans; 00069 time_t expires; 00070 int auto_drop; 00071 struct _cdp_trans_t *next; 00072 struct _cdp_trans_t *prev; 00073 } cdp_trans_t; 00074 00076 typedef struct { 00077 gen_lock_t *lock; 00078 cdp_trans_t *head,*tail; 00079 } cdp_trans_list_t; 00080 00081 int trans_init(); 00082 00083 inline cdp_trans_t* add_trans(AAAMessage *msg,AAATransactionCallback_f *cb, void *ptr,int timeout,int auto_drop); 00084 void del_trans(AAAMessage *msg); 00085 inline cdp_trans_t* take_trans(AAAMessage *msg); 00086 inline void free_trans(cdp_trans_t *x); 00087 00088 void trans_timer(time_t now, void* ptr); 00089 00090 00091 00092 #endif /*TRANSACTION_H_*/
1.5.2