parse_allow.h

Go to the documentation of this file.
00001 /*
00002  * $Id: parse_allow.h 4720 2008-08-23 10:56:15Z henningw $
00003  *
00004  * Copyright (c) 2004 Juha Heinanen
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  * History:
00023  * -------
00024  * 2006-03-02  parse_allow() parses and cumulates all ALLOW headers (bogdan)
00025  */
00026 
00027 #ifndef PARSE_ALLOW_H
00028 #define PARSE_ALLOW_H
00029 
00030 #include "../mem/mem.h"
00031 #include "msg_parser.h"
00032 
00033 
00034 /*!
00035  * casting macro for accessing Allow body 
00036  */
00037 #define get_allow_methods(p_msg) \
00038    (((struct allow_body*)(p_msg)->allow->parsed)->allow_all)
00039 
00040 
00041 struct allow_body {
00042    unsigned int allow;            /* allow mask for the current hdr */
00043    unsigned int allow_all;        /* allow mask for the all allow hdr - it's
00044                                    * set only for the first hdr in sibling
00045                                    * list*/
00046 };
00047 
00048 /*!
00049  * Parse all Allow HFs
00050  */
00051 int parse_allow( struct sip_msg *msg);
00052 
00053 
00054 static inline void free_allow(struct allow_body **ab)
00055 {
00056    if (ab && *ab) {
00057       pkg_free(*ab);
00058       *ab = 0;
00059    }
00060 }
00061 
00062 #endif /* PARSE_ALLOW_H */

Generated on Thu May 24 00:00:28 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6