modules/ims_qos: added patch for flow-description bug when request originates from...
[sip-router] / parser / case_min.h
1 /*
2  * Min-SE Header Field Name Parsing Macros
3  *
4  * Copyright (C) 2001-2003 FhG Fokus
5  *
6  * This file is part of Kamailio, a free SIP server.
7  *
8  * Kamailio is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version
12  *
13  * Kamailio is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 /*! \file 
24  * \brief Parser :: Min-SE Header Field Name Parsing Macros
25  *
26  * \ingroup parser
27  */
28
29
30 #ifndef CASE_MIN_H
31 #define CASE_MIN_H
32
33
34 #define RES_CASE                            \
35         switch(LOWER_DWORD(val)) {              \
36                 case _res1_:    /* "res:" */        \
37                         hdr->type = HDR_MIN_EXPIRES_T;  \
38                         hdr->name.len = 11;             \
39                         return (p + 4);                 \
40                 case _res2_:    /* "res " */        \
41                         hdr->type = HDR_MIN_EXPIRES_T;  \
42                         p+=4;                           \
43                         goto dc_end;                    \
44         }
45
46 #define MIN2_CASE                           \
47         if (LOWER_BYTE(*p) == 's') {            \
48                 p++;                                \
49                 if (LOWER_BYTE(*p) == 'e') {        \
50                         hdr->type = HDR_MIN_SE_T;       \
51                         p++;                            \
52                         goto dc_end;                    \
53                 }                                   \
54         } else if (LOWER_DWORD(val) == _expi_) { \
55                 p += 4;                             \
56                 val = READ(p);                      \
57                 RES_CASE;                           \
58         }
59
60 #define min_CASE                            \
61         p += 4;                                 \
62         val = READ(p);                          \
63         MIN2_CASE;                              \
64         goto other;
65
66
67 #endif /* CASE_MIN_H */