GPLization banner introduced to *.[hc] files
[sip-router] / parser / case_prox.h
1 /*
2  * $Id$
3  *
4  * Proxy-Authorization and Proxy-Require header field parser macros
5  *
6  * Copyright (C) 2001-2003 Fhg Fokus
7  *
8  * This file is part of ser, a free SIP server.
9  *
10  * ser is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version
14  *
15  * For a license to use the ser software under conditions
16  * other than those described here, or to purchase support for this
17  * software, please contact iptel.org by e-mail at the following addresses:
18  *    info@iptel.org
19  *
20  * ser is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License 
26  * along with this program; if not, write to the Free Software 
27  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28  */
29
30
31 #ifndef CASE_PROX_H
32 #define CASE_PROX_H
33
34
35 #define ION_CASE                           \
36         switch(val) {                      \
37         case _ion1_:                       \
38                 hdr->type = HDR_PROXYAUTH; \
39                 hdr->name.len = 19;        \
40                 *(p + 3) = '\0';           \
41                 return (p + 4);            \
42                                            \
43         case _ion2_:                       \
44                 hdr->type = HDR_PROXYAUTH; \
45                 p += 4;                    \
46                 goto dc_end;               \
47         }
48
49
50 #define IZAT_CASE                 \
51         switch(val) {             \
52         case _izat_:              \
53                 p += 4;           \
54                 val = READ(p);    \
55                 ION_CASE;         \
56                                   \
57                 val = unify(val); \
58                 ION_CASE;         \
59                 goto other;       \
60         }
61
62
63 #define THOR_CASE                 \
64         switch(val) {             \
65         case _thor_:              \
66                 p += 4;           \
67                 val = READ(p);    \
68                 IZAT_CASE;        \
69                                   \
70                 val = unify(val); \
71                 IZAT_CASE;        \
72                 goto other;       \
73         }
74
75
76 #define QUIR_CASE                                     \
77         switch(val) {                                 \
78         case _quir_:                                  \
79                 p += 4;                               \
80                 switch(*p) {                          \
81                 case 'e':                             \
82                 case 'E':                             \
83                         hdr->type = HDR_PROXYREQUIRE; \
84                         p++;                          \
85                         goto dc_end;                  \
86                 }                                     \
87                 goto other;                           \
88         }
89
90
91 #define PROX2_CASE                \
92         switch(val) {             \
93         case _y_Au_:              \
94                 p += 4;           \
95                 val = READ(p);    \
96                 THOR_CASE;        \
97                                   \
98                 val = unify(val); \
99                 THOR_CASE;        \
100                 goto other;       \
101                                   \
102         case _y_Re_:              \
103                 p += 4;           \
104                 val = READ(p);    \
105                 QUIR_CASE;        \
106                                   \
107                 val = unify(val); \
108                 QUIR_CASE;        \
109                 goto other;       \
110         }
111
112
113 #define Prox_CASE         \
114         p += 4;           \
115         val = READ(p);    \
116         PROX2_CASE;       \
117                           \
118         val = unify(val); \
119         PROX2_CASE;       \
120         goto other;
121
122
123 #endif /* CASE_PROX_H */