case_acce.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Accept, Accept-Language, Accept-Contact, Accept-Disposition Header Field Name Parsing Macros
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  *
00008  * This file is part of SIP-router, a free SIP server.
00009  *
00010  * SIP-router is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * SIP-router is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  */
00024 
00031 #ifndef CASE_ACCE_H
00032 #define CASE_ACCE_H
00033 
00034 
00035 #define age_CASE                                \
00036         switch(LOWER_DWORD(val)) {              \
00037         case _age1_:                            \
00038                 hdr->type = HDR_ACCEPTLANGUAGE_T; \
00039                 hdr->name.len = 15;             \
00040                 return (p + 4);                 \
00041                                                 \
00042         case _age2_:                            \
00043                 hdr->type = HDR_ACCEPTLANGUAGE_T; \
00044                 p += 4;                         \
00045                 goto dc_end;                    \
00046         }
00047 
00048 
00049 #define angu_CASE                  \
00050         switch(LOWER_DWORD(val)) { \
00051         case _angu_:               \
00052                 p += 4;            \
00053                 val = READ(p);     \
00054                 age_CASE;          \
00055                 goto other;        \
00056         }
00057 
00058 
00059 #define accept_contact_ct_CASE                             \
00060         if (LOWER_BYTE(*p) == 'c') {                       \
00061                 p++;                                       \
00062                 if (LOWER_BYTE(*p) == 't') {               \
00063                         hdr->type = HDR_ACCEPTCONTACT_T;   \
00064                         p++;                               \
00065                         goto dc_end;                       \
00066                 }                                          \
00067         }
00068 
00069 #define accept_c_onta_CASE         \
00070         switch(LOWER_DWORD(val)) { \
00071         case _onta_:               \
00072                 p += 4;            \
00073                 val = READ(p);     \
00074                 accept_contact_ct_CASE;  \
00075                 goto other;        \
00076         }
00077 
00078 
00079 #define ptldc_CASE                 \
00080         switch(LOWER_DWORD(val)) { \
00081         case _pt_l_:               \
00082                 p += 4;            \
00083                 val = READ(p);     \
00084                 angu_CASE;         \
00085                 goto other;        \
00086                                    \
00087         case _pt_c_:               \
00088                 p += 4;            \
00089                 val = READ(p);     \
00090                 accept_c_onta_CASE;\
00091                 goto other;        \
00092         }
00093 
00094 
00095 #define acce_CASE                           \
00096     p += 4;                                 \
00097     val = READ(p);                          \
00098     ptldc_CASE;                             \
00099                                             \
00100     if (LOWER_BYTE(*p) == 'p') {            \
00101             p++;                            \
00102             if (LOWER_BYTE(*p) == 't') {    \
00103                     hdr->type = HDR_ACCEPT_T; \
00104                     p++;                    \
00105                     goto dc_end;            \
00106             }                               \
00107     }                                       \
00108     goto other;
00109 
00110 
00111 #endif /* CASE_ACCE_H */