case_prox.h

Go to the documentation of this file.
00001 /*
00002  * $Id: case_prox.h 4720 2008-08-23 10:56:15Z 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 Proxy-Require, Proxy-Authorization Header Field Name Parsing Macros
00026  * \ingroup parser
00027  */
00028 
00029 #ifndef CASE_PROX_H
00030 #define CASE_PROX_H
00031 
00032 
00033 #define ION_CASE                           \
00034         switch(LOWER_DWORD(val)) {         \
00035         case _ion1_:                       \
00036            hdr->type = HDR_PROXYAUTH_T; \
00037            hdr->name.len = 19;        \
00038            return (p + 4);            \
00039                                            \
00040         case _ion2_:                       \
00041                 hdr->type = HDR_PROXYAUTH_T; \
00042                 p += 4;                    \
00043            goto dc_end;               \
00044         }
00045 
00046 
00047 #define IZAT_CASE                  \
00048         switch(LOWER_DWORD(val)) { \
00049         case _izat_:               \
00050                 p += 4;            \
00051                 val = READ(p);     \
00052                 ION_CASE;          \
00053                 goto other;        \
00054         }
00055 
00056 
00057 #define THOR_CASE                  \
00058         switch(LOWER_DWORD(val)) { \
00059         case _thor_:               \
00060                 p += 4;            \
00061                 val = READ(p);     \
00062                 IZAT_CASE;         \
00063                 goto other;        \
00064         }
00065 
00066 
00067 #define QUIR_CASE                                     \
00068         switch(LOWER_DWORD(val)) {                    \
00069         case _quir_:                                  \
00070            p += 4;                               \
00071                 switch(LOWER_BYTE(*p)) {              \
00072                 case 'e':                             \
00073                         hdr->type = HDR_PROXYREQUIRE_T; \
00074                    p++;                          \
00075                         goto dc_end;                  \
00076                 }                                     \
00077                 goto other;                           \
00078         }
00079 
00080 
00081 #define PROX2_CASE                 \
00082         switch(LOWER_DWORD(val)) { \
00083         case _y_au_:               \
00084                 p += 4;            \
00085                 val = READ(p);     \
00086                 THOR_CASE;         \
00087                 goto other;        \
00088                                    \
00089         case _y_re_:               \
00090                 p += 4;            \
00091                 val = READ(p);     \
00092                 QUIR_CASE;         \
00093                 goto other;        \
00094         }
00095 
00096 
00097 #define prox_CASE         \
00098         p += 4;           \
00099         val = READ(p);    \
00100         PROX2_CASE;       \
00101          goto other;
00102 
00103 
00104 #endif /* CASE_PROX_H */

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