sl_api.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 _SL_API_H_
00031 #define _SL_API_H_
00032
00033 #include "../../sr_module.h"
00034 #include "../../dprint.h"
00035
00036 typedef int (*get_reply_totag_f)(struct sip_msg *msg, str *tag);
00037 typedef int (*send_reply_f)(struct sip_msg *msg, int code, str *reason);
00038 typedef int (*sl_get_reply_totag_f)(struct sip_msg *msg, str *tag);
00039 typedef int (*sl_send_reply_f)(struct sip_msg *msg, int code, str *reason);
00040 typedef int (*sl_send_reply_dlg_f)(struct sip_msg *msg, int code, str *reason,
00041 str *tag);
00042
00043
00044 struct sl_binds {
00045 sl_send_reply_f reply;
00046 sl_send_reply_dlg_f reply_dlg;
00047 sl_get_reply_totag_f sl_get_reply_totag;
00048 send_reply_f send_reply;
00049 get_reply_totag_f get_reply_totag;
00050 };
00051
00052 typedef int(*load_sl_f)(struct sl_binds *slb);
00053
00054 int load_sl(struct sl_binds *slb);
00055
00056
00057
00058
00059 static inline int load_sl_api( struct sl_binds *slb )
00060 {
00061 load_sl_f load_sl;
00062
00063
00064 if ( !(load_sl=(load_sl_f)find_export("load_sl", 0, 0))) {
00065 LM_ERR("can't import load_sl\n");
00066 return -1;
00067 }
00068
00069 if (load_sl( slb )==-1)
00070 return -1;
00071
00072 return 0;
00073 }
00074
00075
00076 #endif