case_cont.h

Go to the documentation of this file.
00001 /*
00002  * $Id: case_cont.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  * Contact, Content-Type, Content-Length, Content-Disposition Header Field Name Parsing Macros
00026  * \ingroup parser
00027  */
00028 
00029 #ifndef CASE_CONT_H
00030 #define CASE_CONT_H
00031 
00032 
00033 #define TH_CASE                                        \
00034         switch(LOWER_DWORD(val)) {                     \
00035         case _th12_:                                   \
00036                 hdr->type = HDR_CONTENTLENGTH_T;         \
00037                 hdr->name.len = 14;                    \
00038                 return (p + 4);                        \
00039         }                                              \
00040                                                        \
00041         if (LOWER_BYTE(*p) == 't') {                   \
00042                 p++;                                   \
00043                 if (LOWER_BYTE(*p) == 'h') {           \
00044                         hdr->type = HDR_CONTENTLENGTH_T; \
00045                         p++;                           \
00046                         goto dc_end;                   \
00047                 }                                      \
00048         }
00049 
00050 
00051 #define ion_CASE                                    \
00052         switch(LOWER_DWORD(val)) {                  \
00053         case _ion1_:                                \
00054            hdr->type = HDR_CONTENTDISPOSITION_T; \
00055            hdr->name.len = 19;                 \
00056            return (p + 4);                     \
00057                                                     \
00058         case _ion2_:                                \
00059                 hdr->type = HDR_CONTENTDISPOSITION_T; \
00060                 p += 4;                             \
00061            goto dc_end;                        \
00062         }
00063 
00064 
00065 #define DISPOSITION_CASE           \
00066         switch(LOWER_DWORD(val)) { \
00067         case _osit_:               \
00068       p += 4;            \
00069       val = READ(p);     \
00070       ion_CASE;          \
00071       goto other;        \
00072    }
00073 
00074 
00075 #define CONTENT_CASE                         \
00076         switch(LOWER_DWORD(val)) {           \
00077         case _leng_:                         \
00078                 p += 4;                      \
00079                 val = READ(p);               \
00080                 TH_CASE;                     \
00081                 goto other;                  \
00082                                              \
00083         case _type_:                         \
00084                 hdr->type = HDR_CONTENTTYPE_T; \
00085                 p += 4;                      \
00086                 goto dc_end;                 \
00087                                              \
00088         case _disp_:                         \
00089                 p += 4;                      \
00090       val = READ(p);               \
00091       DISPOSITION_CASE;            \
00092                 goto other;                  \
00093         }
00094 
00095 
00096 #define ACT_ENT_CASE                     \
00097         switch(LOWER_DWORD(val)) {       \
00098         case _act1_:                     \
00099            hdr->type = HDR_CONTACT_T; \
00100            hdr->name.len = 7;       \
00101            return (p + 4);          \
00102                                     \
00103         case _act2_:                     \
00104            hdr->type = HDR_CONTACT_T; \
00105            p += 4;                  \
00106            goto dc_end;             \
00107                                          \
00108         case _ent__:                     \
00109                 p += 4;                  \
00110                 val = READ(p);           \
00111                 CONTENT_CASE;            \
00112                 goto other;              \
00113         }                         
00114 
00115 #define cont_CASE      \
00116      p += 4;           \
00117      val = READ(p);    \
00118      ACT_ENT_CASE;     \
00119      goto other;
00120 
00121 
00122 #endif /* CASE_CONT_H */

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