d2578f4d030880308f2ce1deb6634239d7918cc9
[sip-router] / parser / case_prox.h
1 /*
2  * $Id$
3  *
4  * Proxy-Authorization and Proxy-Require header field parser macros
5  */
6
7 #ifndef CASE_PROX_H
8 #define CASE_PROX_H
9
10
11 #define ION_CASE                           \
12         switch(val) {                      \
13         case _ion1_:                       \
14                 hdr->type = HDR_PROXYAUTH; \
15                 hdr->name.len = 19;        \
16                 *(p + 3) = '\0';           \
17                 return (p + 4);            \
18                                            \
19         case _ion2_:                       \
20                 hdr->type = HDR_PROXYAUTH; \
21                 p += 4;                    \
22                 goto dc_end;               \
23         }
24
25
26 #define IZAT_CASE                 \
27         switch(val) {             \
28         case _izat_:              \
29                 p += 4;           \
30                 val = READ(p);    \
31                 ION_CASE;         \
32                                   \
33                 val = unify(val); \
34                 ION_CASE;         \
35                 goto other;       \
36         }
37
38
39 #define THOR_CASE                 \
40         switch(val) {             \
41         case _thor_:              \
42                 p += 4;           \
43                 val = READ(p);    \
44                 IZAT_CASE;        \
45                                   \
46                 val = unify(val); \
47                 IZAT_CASE;        \
48                 goto other;       \
49         }
50
51
52 #define QUIR_CASE                                     \
53         switch(val) {                                 \
54         case _quir_:                                  \
55                 p += 4;                               \
56                 switch(*p) {                          \
57                 case 'e':                             \
58                 case 'E':                             \
59                         hdr->type = HDR_PROXYREQUIRE; \
60                         p++;                          \
61                         goto dc_end;                  \
62                 }                                     \
63                 goto other;                           \
64         }
65
66
67 #define PROX2_CASE                \
68         switch(val) {             \
69         case _y_Au_:              \
70                 p += 4;           \
71                 val = READ(p);    \
72                 THOR_CASE;        \
73                                   \
74                 val = unify(val); \
75                 THOR_CASE;        \
76                 goto other;       \
77                                   \
78         case _y_Re_:              \
79                 p += 4;           \
80                 val = READ(p);    \
81                 QUIR_CASE;        \
82                                   \
83                 val = unify(val); \
84                 QUIR_CASE;        \
85                 goto other;       \
86         }
87
88
89 #define Prox_CASE         \
90         p += 4;           \
91         val = READ(p);    \
92         PROX2_CASE;       \
93                           \
94         val = unify(val); \
95         PROX2_CASE;       \
96         goto other;
97
98
99 #endif /* CASE_PROX_H */