File: CPL_tree.h

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (220 lines) | stat: -rw-r--r-- 8,162 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
 * $Id: CPL_tree.h,v 1.1.1.1 2005/06/13 16:47:35 bogdan_iancu Exp $
 *
 * Copyright (C) 2001-2003 FhG Fokus
 *
 * This file is part of openser, a free SIP server.
 *
 * openser is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version
 *
 * openser is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef _CPL_TREE_DEFINITION_H
#define _CPL_TREE_DEFINITION_H



#define              CPL_NODE   1
#define         INCOMING_NODE   2
#define         OUTGOING_NODE   3
#define        ANCILLARY_NODE   4
#define        SUBACTION_NODE   5
#define   ADDRESS_SWITCH_NODE   6
#define          ADDRESS_NODE   7
#define             BUSY_NODE   8
#define          DEFAULT_NODE   9
#define          FAILURE_NODE  10
#define              LOG_NODE  11
#define           LOOKUP_NODE  12
#define         LOCATION_NODE  13
#define         LANGUAGE_NODE  14
#define  LANGUAGE_SWITCH_NODE  15
#define             MAIL_NODE  16
#define         NOTFOUND_NODE  17
#define         NOANSWER_NODE  18
#define            PROXY_NODE  19
#define         PRIORITY_NODE  20
#define  PRIORITY_SWITCH_NODE  21
#define           REJECT_NODE  22
#define         REDIRECT_NODE  23
#define      REDIRECTION_NODE  24
#define  REMOVE_LOCATION_NODE  25
#define              SUB_NODE  26
#define          SUCCESS_NODE  27
#define           STRING_NODE  28
#define    STRING_SWITCH_NODE  29
#define             TIME_NODE  30
#define      TIME_SWITCH_NODE  31
#define        OTHERWISE_NODE  32
#define      NOT_PRESENT_NODE  33



/* attributes and values fro ADDRESS-SWITCH node */
#define  FIELD_ATTR                  0       /*shared with STRING_SWITCH*/
#define  SUBFIELD_ATTR               1
#define  ORIGIN_VAL                  0
#define  DESTINATION_VAL             1
#define  ORIGINAL_DESTINATION_VAL    2
#define  ADDRESS_TYPE_VAL            0
#define  USER_VAL                    1
#define  HOST_VAL                    2
#define  PORT_VAL                    3
#define  TEL_VAL                     4
#define  DISPLAY_VAL                 5

/* attributes and values for ADDRESS node */
#define  IS_ATTR                     0    /*shared with STRING*/
#define  CONTAINS_ATTR               1    /*shared with STRING*/
#define  SUBDOMAIN_OF_ATTR           2

/* attributes and values for STRING-SWITCH node */
#define  SUBJECT_VAL                 0
#define  ORGANIZATION_VAL            1
#define  USER_AGENT_VAL              2
#define  DISPALY_VAL                 3

/* attributes and values for LANGUAGE node */
#define  MATCHES_TAG_ATTR            0
#define  MATCHES_SUBTAG_ATTR         1

/* attributes and values for TIME-SWITCH node */
#define  TZID_ATTR                   0
#define  TZURL_ATTR                  1

/* attributes and values for TIME node */
#define  DTSTART_ATTR                0
#define  DTEND_ATTR                  1
#define  DURATION_ATTR               2
#define  FREQ_ATTR                   3
#define  INTERVAL_ATTR               4
#define  UNTIL_ATTR                  5
#define  COUNT_ATTR                  6
#define  BYSECOND_ATTR               7
#define  BYMINUTE_ATTR               8
#define  BYHOUR_ATTR                 9
#define  BYDAY_ATTR                 10
#define  BYMONTHDAY_ATTR            11
#define  BYYEARDAY_ATTR             12
#define  BYWEEKNO_ATTR              13
#define  BYMONTH_ATTR               14
#define  WKST_ATTR                  15
#define  BYSETPOS_ATTR              16

/* attributes and values for PRIORITY node */
#define  LESS_ATTR                   0
#define  GREATER_ATTR                1
#define  EQUAL_ATTR                  2
#define  PRIOSTR_ATTR                3
#define  EMERGENCY_VAL               0
#define  EMERGENCY_STR               "emergency"
#define  EMERGENCY_STR_LEN           (sizeof(EMERGENCY_STR)-1)
#define  URGENT_VAL                  1
#define  URGENT_STR                  "urgent"
#define  URGENT_STR_LEN              (sizeof(URGENT_STR)-1)
#define  NORMAL_VAL                  2
#define  NORMAL_STR                  "normal"
#define  NORMAL_STR_LEN              (sizeof(NORMAL_STR)-1)
#define  NON_URGENT_VAL              3
#define  NON_URGENT_STR              "non-urgent"
#define  NON_URGENT_STR_LEN          (sizeof(NON_URGENT_STR)-1)
#define  UNKNOWN_PRIO_VAL            4

/* attributes and values for LOCATION node */
#define  URL_ATTR                    0
#define  PRIORITY_ATTR               1
#define  CLEAR_ATTR                  2    /*shared with LOOKUP node*/
#define  NO_VAL                      0    /*shared with LOOKUP node*/
#define  YES_VAL                     1    /*shared with LOOKUP node*/

/* attributes and values for LOOKUP node */
#define  SOURCE_ATTR                 0
#define  TIMEOUT_ATTR                1    /*shared with PROXY node*/
#define  SOURCE_REG_STR              "registration"
#define  SOURCE_REG_STR_LEN          (sizeof("registration")-1)

/* attributes and values for REMOVE_LOCATION node */
#define  LOCATION_ATTR               0
#define  PARAM_ATTR                  1
#define  VALUE_ATTR                  2

/* attributes and values for PROXY node */
#define  RECURSE_ATTR                2
#define  ORDERING_ATTR               3
#define  PARALLEL_VAL                0
#define  SEQUENTIAL_VAL              1
#define  FIRSTONLY_VAL               2

/* attributes and values for REDIRECT node */
#define  PERMANENT_ATTR              0

/* attributes and values for REJECT node */
#define  STATUS_ATTR                 0
#define  REASON_ATTR                 1
#define  BUSY_VAL                    486
#define  BUSY_STR                    "busy"
#define  BUSY_STR_LEN                (sizeof(BUSY_STR)-1)
#define  NOTFOUND_VAL                404
#define  NOTFOUND_STR                "notfound"
#define  NOTFOUND_STR_LEN            (sizeof(NOTFOUND_STR)-1)
#define  REJECT_VAL                  603
#define  REJECT_STR                  "reject"
#define  REJECT_STR_LEN              (sizeof(REJECT_STR)-1)
#define  ERROR_VAL                   500
#define  ERROR_STR                   "error"
#define  ERROR_STR_LEN               (sizeof(ERROR_STR)-1)

/* attributes and values for LOG node */
#define  NAME_ATTR                   0
#define  MAX_NAME_SIZE               32
#define  COMMENT_ATTR                1
#define  MAX_COMMENT_SIZE            128

/* attributes and values for EMAIL node */
#define  TO_ATTR                     0
#define  SUBJECT_ATTR                1
#define  SUBJECT_EMAILHDR_STR        "subject"
#define  SUBJECT_EMAILHDR_LEN        (sizeof(SUBJECT_EMAILHDR_STR)-1)
#define  BODY_ATTR                   2
#define  BODY_EMAILHDR_STR           "body"
#define  BODY_EMAILHDR_LEN           (sizeof(BODY_EMAILHDR_STR)-1)
#define  URL_MAILTO_STR              "mailto:"
#define  URL_MAILTO_LEN              (sizeof(URL_MAILTO_STR)-1)

/* attributes and values for SUB node */
#define  REF_ATTR                    0



/* node = | type(1) | nr_kids(1) | nr_attrs(1) | unused(1) |
 *        | x*kids_offset(2) | y*attrs(2*n) |
 */

#define      NODE_TYPE(_p)            ( *((unsigned char*)(_p)) )
#define      NR_OF_KIDS(_p)           ( *((unsigned char* )((_p)+1)) )
#define      NR_OF_ATTR(_p)           ( *((unsigned char* )((_p)+1+1)) )
#define      KID_OFFSET_PTR(_p,_n)    ( (unsigned short*)((_p)+4+2*(_n)) )
#define      ATTR_PTR(_p)             ( (_p)+4+2*NR_OF_KIDS(_p) )
#define      SIMPLE_NODE_SIZE(_p)     ( 4+2*NR_OF_KIDS(_p) )
#define      GET_NODE_SIZE(_n)        ( 4+2*(_n) )
#define      BASIC_ATTR_SIZE          4

#define      SET_KID_OFFSET(_p,_n,_o) *KID_OFFSET_PTR(_p,_n)=htons(_o)
#define      KID_OFFSET(_p,_n)        ntohs(*KID_OFFSET_PTR(_p,_n))




#endif