case_acce.h

Go to the documentation of this file.
00001 /*
00002  * $Id: case_acce.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 Accept and Accept-Language Header Field Name Parsing Macros
00026  * \ingroup parser
00027  */
00028 
00029 #ifndef CASE_ACCE_H
00030 #define CASE_ACCE_H
00031 
00032 
00033 #define age_CASE                                \
00034         switch(LOWER_DWORD(val)) {              \
00035         case _age1_:                            \
00036            hdr->type = HDR_ACCEPTLANGUAGE_T; \
00037            hdr->name.len = 15;             \
00038            return (p + 4);                 \
00039                                                 \
00040         case _age2_:                            \
00041                 hdr->type = HDR_ACCEPTLANGUAGE_T; \
00042                 p += 4;                         \
00043            goto dc_end;                    \
00044         }
00045 
00046 
00047 #define angu_CASE                  \
00048         switch(LOWER_DWORD(val)) { \
00049         case _angu_:               \
00050       p += 4;            \
00051       val = READ(p);     \
00052       age_CASE;          \
00053       goto other;        \
00054    }
00055 
00056 
00057 #define on_CASE                                            \
00058         if (LOWER_BYTE(*p) == 'o') {                       \
00059                 p++;                                       \
00060                 if (LOWER_BYTE(*p) == 'n') {               \
00061                         hdr->type = HDR_ACCEPTDISPOSITION_T; \
00062                         p++;                               \
00063                         goto dc_end;                       \
00064                 }                                          \
00065         }
00066 
00067 
00068 #define siti_CASE                  \
00069         switch(LOWER_DWORD(val)) { \
00070         case _siti_:               \
00071                 p += 4;            \
00072                 val = READ(p);     \
00073                 on_CASE;           \
00074                 goto other;        \
00075         }
00076 
00077 
00078 #define ispo_CASE                  \
00079         switch(LOWER_DWORD(val)) { \
00080         case _ispo_:               \
00081                 p += 4;            \
00082                 val = READ(p);     \
00083                 siti_CASE;         \
00084                 goto other;        \
00085         }
00086 
00087 
00088 #define ptld_CASE                  \
00089         switch(LOWER_DWORD(val)) { \
00090         case _pt_l_:               \
00091       p += 4;            \
00092       val = READ(p);     \
00093       angu_CASE;         \
00094       goto other;        \
00095                                    \
00096         case _pt_d_:               \
00097                 p += 4;            \
00098                 val = READ(p);     \
00099                 ispo_CASE;         \
00100                 goto other;        \
00101    }
00102 
00103 
00104 #define acce_CASE                           \
00105     p += 4;                                 \
00106     val = READ(p);                          \
00107     ptld_CASE;                              \
00108                                             \
00109     if (LOWER_BYTE(*p) == 'p') {            \
00110             p++;                            \
00111             if (LOWER_BYTE(*p) == 't') {    \
00112                     hdr->type = HDR_ACCEPT_T; \
00113                     p++;                    \
00114                     goto dc_end;            \
00115             }                               \
00116     }                                       \
00117     goto other;
00118 
00119 
00120 #endif /* CASE_ACCE_H */

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