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 #ifndef _SANITY_API_H_
00032 #define _SANITY_API_H_
00033
00034 #include "../../parser/msg_parser.h"
00035
00036 typedef int (*sanity_check_f)(struct sip_msg* msg, int msg_checks,
00037 int uri_checks);
00038 typedef int (*sanity_check_defaults_f)(struct sip_msg* msg);
00039
00040 typedef struct sanity_api {
00041 sanity_check_f check;
00042 sanity_check_defaults_f check_defaults;
00043 } sanity_api_t;
00044
00045 typedef int (*bind_sanity_f)(sanity_api_t* api);
00046
00050 static inline int sanity_load_api(sanity_api_t *api)
00051 {
00052 bind_sanity_f bindsanity;
00053
00054 bindsanity = (bind_sanity_f)find_export("bind_sanity", 0, 0);
00055 if(bindsanity == 0) {
00056 LM_ERR("cannot find bind_sanity\n");
00057 return -1;
00058 }
00059 if(bindsanity(api)<0)
00060 {
00061 LM_ERR("cannot bind sanity api\n");
00062 return -1;
00063 }
00064 return 0;
00065 }
00066
00067
00068 #endif