CPL_tree.h

Go to the documentation of this file.
00001 /*
00002  * $Id: CPL_tree.h 4518 2008-07-28 15:39:28Z henningw $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00023 #ifndef _CPL_TREE_DEFINITION_H
00024 #define _CPL_TREE_DEFINITION_H
00025 
00026 
00027 
00028 #define              CPL_NODE   1
00029 #define         INCOMING_NODE   2
00030 #define         OUTGOING_NODE   3
00031 #define        ANCILLARY_NODE   4
00032 #define        SUBACTION_NODE   5
00033 #define   ADDRESS_SWITCH_NODE   6
00034 #define          ADDRESS_NODE   7
00035 #define             BUSY_NODE   8
00036 #define          DEFAULT_NODE   9
00037 #define          FAILURE_NODE  10
00038 #define              LOG_NODE  11
00039 #define           LOOKUP_NODE  12
00040 #define         LOCATION_NODE  13
00041 #define         LANGUAGE_NODE  14
00042 #define  LANGUAGE_SWITCH_NODE  15
00043 #define             MAIL_NODE  16
00044 #define         NOTFOUND_NODE  17
00045 #define         NOANSWER_NODE  18
00046 #define            PROXY_NODE  19
00047 #define         PRIORITY_NODE  20
00048 #define  PRIORITY_SWITCH_NODE  21
00049 #define           REJECT_NODE  22
00050 #define         REDIRECT_NODE  23
00051 #define      REDIRECTION_NODE  24
00052 #define  REMOVE_LOCATION_NODE  25
00053 #define              SUB_NODE  26
00054 #define          SUCCESS_NODE  27
00055 #define           STRING_NODE  28
00056 #define    STRING_SWITCH_NODE  29
00057 #define             TIME_NODE  30
00058 #define      TIME_SWITCH_NODE  31
00059 #define        OTHERWISE_NODE  32
00060 #define      NOT_PRESENT_NODE  33
00061 
00062 
00063 
00064 /* attributes and values fro ADDRESS-SWITCH node */
00065 #define  FIELD_ATTR                  0       /*shared with STRING_SWITCH*/
00066 #define  SUBFIELD_ATTR               1
00067 #define  ORIGIN_VAL                  0
00068 #define  DESTINATION_VAL             1
00069 #define  ORIGINAL_DESTINATION_VAL    2
00070 #define  ADDRESS_TYPE_VAL            0
00071 #define  USER_VAL                    1
00072 #define  HOST_VAL                    2
00073 #define  PORT_VAL                    3
00074 #define  TEL_VAL                     4
00075 #define  DISPLAY_VAL                 5    /*shared with STRING*/
00076 
00077 /* attributes and values for ADDRESS node */
00078 #define  IS_ATTR                     0    /*shared with STRING*/
00079 #define  CONTAINS_ATTR               1    /*shared with STRING*/
00080 #define  SUBDOMAIN_OF_ATTR           2
00081 
00082 /* attributes and values for STRING-SWITCH node */
00083 #define  SUBJECT_VAL                 0
00084 #define  ORGANIZATION_VAL            1
00085 #define  USER_AGENT_VAL              2
00086 
00087 /* attributes and values for LANGUAGE node */
00088 #define  MATCHES_TAG_ATTR            0
00089 #define  MATCHES_SUBTAG_ATTR         1
00090 
00091 /* attributes and values for TIME-SWITCH node */
00092 #define  TZID_ATTR                   0
00093 #define  TZURL_ATTR                  1
00094 
00095 /* attributes and values for TIME node */
00096 #define  DTSTART_ATTR                0
00097 #define  DTEND_ATTR                  1
00098 #define  DURATION_ATTR               2
00099 #define  FREQ_ATTR                   3
00100 #define  INTERVAL_ATTR               4
00101 #define  UNTIL_ATTR                  5
00102 #define  COUNT_ATTR                  6
00103 #define  BYSECOND_ATTR               7
00104 #define  BYMINUTE_ATTR               8
00105 #define  BYHOUR_ATTR                 9
00106 #define  BYDAY_ATTR                 10
00107 #define  BYMONTHDAY_ATTR            11
00108 #define  BYYEARDAY_ATTR             12
00109 #define  BYWEEKNO_ATTR              13
00110 #define  BYMONTH_ATTR               14
00111 #define  WKST_ATTR                  15
00112 #define  BYSETPOS_ATTR              16
00113 
00114 /* attributes and values for PRIORITY node */
00115 #define  LESS_ATTR                   0
00116 #define  GREATER_ATTR                1
00117 #define  EQUAL_ATTR                  2
00118 #define  PRIOSTR_ATTR                3
00119 #define  EMERGENCY_VAL               0
00120 #define  EMERGENCY_STR               "emergency"
00121 #define  EMERGENCY_STR_LEN           (sizeof(EMERGENCY_STR)-1)
00122 #define  URGENT_VAL                  1
00123 #define  URGENT_STR                  "urgent"
00124 #define  URGENT_STR_LEN              (sizeof(URGENT_STR)-1)
00125 #define  NORMAL_VAL                  2
00126 #define  NORMAL_STR                  "normal"
00127 #define  NORMAL_STR_LEN              (sizeof(NORMAL_STR)-1)
00128 #define  NON_URGENT_VAL              3
00129 #define  NON_URGENT_STR              "non-urgent"
00130 #define  NON_URGENT_STR_LEN          (sizeof(NON_URGENT_STR)-1)
00131 #define  UNKNOWN_PRIO_VAL            4
00132 
00133 /* attributes and values for LOCATION node */
00134 #define  URL_ATTR                    0
00135 #define  PRIORITY_ATTR               1
00136 #define  CLEAR_ATTR                  2    /*shared with LOOKUP node*/
00137 #define  NO_VAL                      0    /*shared with LOOKUP node*/
00138 #define  YES_VAL                     1    /*shared with LOOKUP node*/
00139 
00140 /* attributes and values for LOOKUP node */
00141 #define  SOURCE_ATTR                 0
00142 #define  TIMEOUT_ATTR                1    /*shared with PROXY node*/
00143 #define  SOURCE_REG_STR              "registration"
00144 #define  SOURCE_REG_STR_LEN          (sizeof("registration")-1)
00145 
00146 /* attributes and values for REMOVE_LOCATION node */
00147 #define  LOCATION_ATTR               0
00148 #define  PARAM_ATTR                  1
00149 #define  VALUE_ATTR                  2
00150 
00151 /* attributes and values for PROXY node */
00152 #define  RECURSE_ATTR                2
00153 #define  ORDERING_ATTR               3
00154 #define  PARALLEL_VAL                0
00155 #define  SEQUENTIAL_VAL              1
00156 #define  FIRSTONLY_VAL               2
00157 
00158 /* attributes and values for REDIRECT node */
00159 #define  PERMANENT_ATTR              0
00160 
00161 /* attributes and values for REJECT node */
00162 #define  STATUS_ATTR                 0
00163 #define  REASON_ATTR                 1
00164 #define  BUSY_VAL                    486
00165 #define  BUSY_STR                    "busy"
00166 #define  BUSY_STR_LEN                (sizeof(BUSY_STR)-1)
00167 #define  NOTFOUND_VAL                404
00168 #define  NOTFOUND_STR                "notfound"
00169 #define  NOTFOUND_STR_LEN            (sizeof(NOTFOUND_STR)-1)
00170 #define  REJECT_VAL                  603
00171 #define  REJECT_STR                  "reject"
00172 #define  REJECT_STR_LEN              (sizeof(REJECT_STR)-1)
00173 #define  ERROR_VAL                   500
00174 #define  ERROR_STR                   "error"
00175 #define  ERROR_STR_LEN               (sizeof(ERROR_STR)-1)
00176 
00177 /* attributes and values for LOG node */
00178 #define  NAME_ATTR                   0
00179 #define  MAX_NAME_SIZE               32
00180 #define  COMMENT_ATTR                1
00181 #define  MAX_COMMENT_SIZE            128
00182 
00183 /* attributes and values for EMAIL node */
00184 #define  TO_ATTR                     0
00185 #define  SUBJECT_ATTR                1
00186 #define  SUBJECT_EMAILHDR_STR        "subject"
00187 #define  SUBJECT_EMAILHDR_LEN        (sizeof(SUBJECT_EMAILHDR_STR)-1)
00188 #define  BODY_ATTR                   2
00189 #define  BODY_EMAILHDR_STR           "body"
00190 #define  BODY_EMAILHDR_LEN           (sizeof(BODY_EMAILHDR_STR)-1)
00191 #define  URL_MAILTO_STR              "mailto:"
00192 #define  URL_MAILTO_LEN              (sizeof(URL_MAILTO_STR)-1)
00193 
00194 /* attributes and values for SUB node */
00195 #define  REF_ATTR                    0
00196 
00197 
00198 
00199 /* node = | type(1) | nr_kids(1) | nr_attrs(1) | unused(1) |
00200  *        | x*kids_offset(2) | y*attrs(2*n) |
00201  */
00202 
00203 #define      NODE_TYPE(_p)            ( *((unsigned char*)(_p)) )
00204 #define      NR_OF_KIDS(_p)           ( *((unsigned char* )((_p)+1)) )
00205 #define      NR_OF_ATTR(_p)           ( *((unsigned char* )((_p)+1+1)) )
00206 #define      KID_OFFSET_PTR(_p,_n)    ( (unsigned short*)((_p)+4+2*(_n)) )
00207 #define      ATTR_PTR(_p)             ( (_p)+4+2*NR_OF_KIDS(_p) )
00208 #define      SIMPLE_NODE_SIZE(_p)     ( 4+2*NR_OF_KIDS(_p) )
00209 #define      GET_NODE_SIZE(_n)        ( 4+2*(_n) )
00210 #define      BASIC_ATTR_SIZE          4
00211 
00212 #define      SET_KID_OFFSET(_p,_n,_o) *KID_OFFSET_PTR(_p,_n)=htons(_o)
00213 #define      KID_OFFSET(_p,_n)        ntohs(*KID_OFFSET_PTR(_p,_n))
00214 
00215 
00216 
00217 
00218 #endif
00219 

Generated on Thu May 17 10:00:25 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6