datagram_fnc.h

Go to the documentation of this file.
00001 /*
00002  * $Id: datagram_fnc.h 1133 2007-04-02 17:31:13Z ancuta_onofrei $
00003  *
00004  * Copyright (C) 2007 Voice Sistem SRL
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio 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  * Kamailio 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  * History:
00024  * ---------
00025  *  2007-06-25  first version (ancuta)
00026  */
00027 
00028 #ifndef _DATAGRAM_FNC_H
00029 #define _DATAGRAM_FNC_H
00030 
00031 #include <stdio.h>
00032 #include <stdarg.h>
00033 #include <errno.h>
00034 #include "../../ip_addr.h"
00035 #include "../../str.h"
00036 #include "../../dprint.h"
00037 #include "../../ut.h"
00038 #include "../../mi/mi.h"
00039 #include "../../mem/mem.h"
00040 #include "../../mem/shm_mem.h"
00041 
00042 #include "mi_datagram.h"
00043 
00044 #define MI_COMMAND_FAILED              "500 command failed\n"
00045 #define MI_COMMAND_FAILED_LEN          (sizeof(MI_COMMAND_FAILED)-1)
00046 #define MI_COMMAND_NOT_AVAILABLE       "500 command not available\n"
00047 #define MI_COMMAND_AVAILABLE_LEN       (sizeof(MI_COMMAND_NOT_AVAILABLE)-1)
00048 #define MI_PARSE_ERROR              "400 parse error in command\n"
00049 #define MI_PARSE_ERROR_LEN             (sizeof(MI_PARSE_ERROR)-1)
00050 #define MI_INTERNAL_ERROR           "500 Internal server error\n"
00051 #define MI_INTERNAL_ERROR_LEN       (sizeof(MI_INTERNAL_ERROR)-1)
00052 
00053 
00054 
00055 typedef struct datagram_str{
00056    char * start, * current; 
00057    int len;
00058 }datagram_stream;
00059 
00060 typedef struct rx_tx{
00061    int rx_sock, tx_sock;
00062 }rx_tx_sockets;
00063 
00064 
00065 int  mi_init_datagram_server(sockaddr_dtgram * address, unsigned int domain,
00066                         rx_tx_sockets * socks,int mode, 
00067                         int uid, int gid );
00068 int mi_init_datagram_buffer(void);
00069 void mi_datagram_server(int rx_sock, int tx_sock);
00070 #endif /*_DATAGRAM_FNC_H*/

Generated on Mon May 21 18:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6