case_reas.h

Go to the documentation of this file.
00001 /* 
00002  * $Id$
00003  * 
00004  * Copyright (C) 2010 iptelorg GmbH
00005  *
00006  * Permission to use, copy, modify, and distribute this software for any
00007  * purpose with or without fee is hereby granted, provided that the above
00008  * copyright notice and this permission notice appear in all copies.
00009  *
00010  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00011  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00012  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00013  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00014  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00015  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00016  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00017  */
00018 /*
00019  * parser/case_reas.h
00020  */
00021 /*
00022  * History:
00023  * --------
00024  *  2010-02-18  initial version (andrei)
00025 */
00026 
00032 #ifndef __case_reas_h
00033 #define __case_reas_h
00034 
00035 
00036 #define ON_CASE                                                 \
00037         switch(LOWER_DWORD(val)) {                      \
00038                 case _on1_:                                             \
00039                         hdr->type = HDR_REASON_T;       \
00040                         hdr->name.len = 6;                      \
00041                         return (p + 3);                         \
00042                 case _on2_:                                             \
00043                         hdr->type = HDR_REASON_T;       \
00044                         hdr->name.len = 7;                      \
00045                         return (p + 4);                         \
00046                 case _on3_:                                             \
00047                         hdr->type = HDR_REASON_T;       \
00048                         p+=4;                                           \
00049                         goto dc_end;                            \
00050         }                                                                       \
00051         if ((LOWER_DWORD(val)&0x00ffffff) ==\
00052                                 (_on1_&0x00ffffff)){    \
00053                         hdr->type = HDR_REASON_T;       \
00054                         hdr->name.len = 6;                      \
00055                         return (p+3);                           \
00056         }
00057 
00058 
00059 
00060 #define reas_CASE               \
00061         p += 4;                         \
00062         val = READ(p);          \
00063         ON_CASE;                        \
00064         goto other;
00065 
00066 
00067 
00068 
00069 #endif /*__case_reas_h*/
00070 
00071 /* vi: set ts=4 sw=4 tw=79:ai:cindent: */