siputils.h

00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of SIP-router, a free SIP server.
00007  *
00008  * SIP-router is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * SIP-router is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00023 
00024 #ifndef _SIPUTILS_H_
00025 #define _SIPUTILS_H_
00026 
00027 typedef int (*siputils_has_totag_t)(struct sip_msg*, char*, char*);
00028 typedef int (*siputils_is_uri_user_e164_t)(str*);
00029 
00031 typedef struct siputils_api {
00032         int_str rpid_avp;      
00033         int     rpid_avp_type; 
00034         siputils_has_totag_t has_totag;
00035         siputils_is_uri_user_e164_t is_uri_user_e164;
00036 } siputils_api_t;
00037 
00038 typedef int (*bind_siputils_t)(siputils_api_t* api);
00039 
00045 int bind_siputils(siputils_api_t* api);
00046 
00047 inline static int siputils_load_api(siputils_api_t *pxb)
00048 {
00049         bind_siputils_t bind_siputils_exports;
00050         if (!(bind_siputils_exports = (bind_siputils_t)find_export("bind_siputils", 1, 0)))
00051         {
00052                 LM_ERR("Failed to import bind_siputils\n");
00053                 return -1;
00054         }
00055         return bind_siputils_exports(pxb);
00056 }
00057 
00058 #endif