00001 /* 00002 * $Id: errinfo.h 5003 2008-09-26 11:01:51Z henningw $ 00003 * 00004 * Copyright (C) 2006 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 /*! 00024 * \file errinfo.h 00025 * \brief Error handling 00026 */ 00027 00028 00029 #ifndef _errinfo_h_ 00030 #define _errinfo_h_ 00031 00032 #include "str.h" 00033 00034 /*! \name ErrorClasses error clases */ 00035 #define OSER_EC_PARSER 1 /*!< parse error */ 00036 #define OSER_EC_PMEMORY 2 /*!< private memory error */ 00037 #define OSER_EC_SMEMORY 3 /*!< share memory error */ 00038 00039 #define OSER_EL_CRITIC 1 00040 #define OSER_EL_HIGH 2 00041 #define OSER_EL_MEDIUM 3 /*!< severity level normal - used by parsing errors */ 00042 #define OSER_EL_NORMAL 4 00043 #define OSER_EL_LOW 5 00044 00045 typedef struct err_info_ 00046 { 00047 int eclass; /*!< error class */ 00048 int level; /*!< severity level (lower is higher) */ 00049 str info; /*!< error details */ 00050 int rcode; /*!< recommended reply code */ 00051 str rreason; /*!< recommended reply reason phrase */ 00052 } err_info_t; 00053 00054 void init_err_info(void); 00055 void set_err_info(int ec, int el, char *info); 00056 void set_err_reply(int rc, char *rr); 00057 err_info_t* get_err_info(void); 00058 00059 #endif
1.5.6