auth/common.h

Go to the documentation of this file.
00001 /*
00002  * $Id: common.h 5211 2008-11-17 20:05:27Z henningw $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
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
00025  * \brief Digest Authentication Module
00026  * \ingroup auth
00027  * - Module: \ref auth
00028  */
00029 
00030 #ifndef COMMON_H
00031 #define COMMON_H
00032 
00033 #include "../../parser/msg_parser.h"
00034 
00035 #define MESSAGE_400 "Bad Request"
00036 #define MESSAGE_500 "Server Internal Error"
00037 
00038 
00039 /*!
00040  * \brief Return parsed To or From, host part of the parsed uri is realm
00041  * \param _m SIP message
00042  * \param _hftype header field type
00043  * \param _u SIP URI
00044  * \return 0 on success, negative on failure
00045  */
00046 int get_realm(struct sip_msg* _m, hdr_types_t _hftype, struct sip_uri** _u);
00047 
00048 
00049 /*!
00050  * \brief Create a response with given code and reason phrase
00051  *
00052  * Create a response with given code and reason phrase
00053  * Optionally add new headers specified in _hdr
00054  * \param _m SIP message
00055  * \param _code response code
00056  * \param _reason reason string
00057  * \param _hdr header to add
00058  * \param _hdr_len header length
00059  * \return 1 if reply could be sended, -1 on failure
00060  */
00061 int send_resp(struct sip_msg* _m, int _code, str* _reason,
00062    char* _hdr, int _hdr_len);
00063 
00064 #endif

Generated on Thu May 17 12:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6