Mercurial > hg > freeDiameter
annotate libfdcore/dict_base_proto.c @ 705:f0cb8f465763
Added standard Result-Code values in header.
Added Error-Cause attribute conversion in app_radgw.
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 31 Jan 2011 17:22:21 +0900 |
parents | 026802543f57 |
children | 4a9f08d6b6ba |
rev | line source |
---|---|
0 | 1 /********************************************************************************************************* |
2 * Software License Agreement (BSD License) * | |
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> * | |
4 * * | |
662
2e94ef0515d7
Updated copyright information
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
658
diff
changeset
|
5 * Copyright (c) 2011, WIDE Project and NICT * |
0 | 6 * All rights reserved. * |
7 * * | |
8 * Redistribution and use of this software in source and binary forms, with or without modification, are * | |
9 * permitted provided that the following conditions are met: * | |
10 * * | |
11 * * Redistributions of source code must retain the above * | |
12 * copyright notice, this list of conditions and the * | |
13 * following disclaimer. * | |
14 * * | |
15 * * Redistributions in binary form must reproduce the above * | |
16 * copyright notice, this list of conditions and the * | |
17 * following disclaimer in the documentation and/or other * | |
18 * materials provided with the distribution. * | |
19 * * | |
20 * * Neither the name of the WIDE Project or NICT nor the * | |
21 * names of its contributors may be used to endorse or * | |
22 * promote products derived from this software without * | |
23 * specific prior written permission of WIDE Project and * | |
24 * NICT. * | |
25 * * | |
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * | |
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * | |
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * | |
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * | |
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * | |
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * | |
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * | |
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * | |
34 *********************************************************************************************************/ | |
35 | |
36 /* Diameter Base protocol definitions. | |
37 */ | |
38 | |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
336
diff
changeset
|
39 #include "fdcore-internal.h" |
0 | 40 |
41 #include <netinet/in.h> | |
42 #include <sys/socket.h> | |
43 | |
44 /* The pointer for the global dictionary (initialized from main) */ | |
45 struct dictionary * fd_g_dict = NULL; | |
46 | |
47 /* The functions to encode and interpret the derived types defined in the base protocol */ | |
48 | |
49 /* Address AVP <-> struct sockaddr_storage */ | |
50 static int Address_encode(void * data, union avp_value * avp_value) | |
51 { | |
52 sSS * ss = (sSS *) data; | |
53 uint16_t AddressType = 0; | |
54 size_t size = 0; | |
55 unsigned char * buf = NULL; | |
56 | |
57 TRACE_ENTRY("%p %p", data, avp_value); | |
58 CHECK_PARAMS( data && avp_value ); | |
59 | |
60 switch (ss->ss_family) { | |
61 case AF_INET: | |
62 { | |
63 /* We are encoding an IP address */ | |
64 sSA4 * sin = (sSA4 *)ss; | |
65 | |
66 AddressType = 1;/* see http://www.iana.org/assignments/address-family-numbers/ */ | |
67 size = 6; /* 2 for AddressType + 4 for data */ | |
68 | |
69 CHECK_MALLOC( buf = malloc(size) ); | |
70 | |
71 /* may not work because of alignment: *(uint32_t *)(buf+2) = htonl(sin->sin_addr.s_addr); */ | |
72 memcpy(buf + 2, &sin->sin_addr.s_addr, 4); | |
73 } | |
74 break; | |
75 | |
76 case AF_INET6: | |
77 { | |
78 /* We are encoding an IPv6 address */ | |
79 sSA6 * sin6 = (sSA6 *)ss; | |
80 | |
81 AddressType = 2;/* see http://www.iana.org/assignments/address-family-numbers/ */ | |
82 size = 18; /* 2 for AddressType + 16 for data */ | |
83 | |
84 CHECK_MALLOC( buf = malloc(size) ); | |
85 | |
86 /* The order is already good here */ | |
87 memcpy(buf + 2, &sin6->sin6_addr.s6_addr, 16); | |
88 } | |
89 break; | |
90 | |
91 default: | |
92 CHECK_PARAMS( AddressType = 0 ); | |
93 } | |
94 | |
95 *(uint16_t *)buf = htons(AddressType); | |
96 | |
97 avp_value->os.len = size; | |
98 avp_value->os.data = buf; | |
99 | |
100 return 0; | |
101 } | |
102 | |
103 static int Address_interpret(union avp_value * avp_value, void * interpreted) | |
104 { | |
105 uint16_t AddressType = 0; | |
106 unsigned char * buf; | |
107 | |
108 TRACE_ENTRY("%p %p", avp_value, interpreted); | |
109 | |
110 CHECK_PARAMS( avp_value && interpreted && (avp_value->os.len >= 2) ); | |
111 | |
112 AddressType = ntohs(*(uint16_t *)avp_value->os.data); | |
113 buf = &avp_value->os.data[2]; | |
114 | |
115 switch (AddressType) { | |
116 case 1 /* IP */: | |
117 { | |
118 sSA4 * sin = (sSA4 *)interpreted; | |
119 | |
120 CHECK_PARAMS( avp_value->os.len == 6 ); | |
121 | |
122 sin->sin_family = AF_INET; | |
123 /* sin->sin_addr.s_addr = ntohl( * (uint32_t *) buf); -- may not work because of bad alignment */ | |
124 memcpy(&sin->sin_addr.s_addr, buf, 4); | |
125 } | |
126 break; | |
127 | |
128 case 2 /* IP6 */: | |
129 { | |
130 sSA6 * sin6 = (sSA6 *)interpreted; | |
131 | |
132 CHECK_PARAMS( avp_value->os.len == 18 ); | |
133 | |
134 sin6->sin6_family = AF_INET6; | |
135 memcpy(&sin6->sin6_addr.s6_addr, buf, 16); | |
136 } | |
137 break; | |
138 | |
139 default: | |
140 CHECK_PARAMS( AddressType = 0 ); | |
141 } | |
142 | |
143 return 0; | |
144 } | |
145 | |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
146 /* Dump the content of an Address AVP */ |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
147 static void Address_dump(union avp_value * avp_value, FILE * fstr) |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
148 { |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
149 union { |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
150 sSA sa; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
151 sSS ss; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
152 sSA4 sin; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
153 sSA6 sin6; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
154 } s; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
155 uint16_t fam; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
156 |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
157 memset(&s, 0, sizeof(s)); |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
158 |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
159 /* The first two octets represent the address family, http://www.iana.org/assignments/address-family-numbers/ */ |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
160 if (avp_value->os.len < 2) { |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
161 fd_log_debug_fstr(fstr, "[invalid length: %d]", avp_value->os.len); |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
162 return; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
163 } |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
164 |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
165 /* Following octets are the address in network byte order already */ |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
166 fam = avp_value->os.data[0] << 8 | avp_value->os.data[1]; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
167 switch (fam) { |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
168 case 1: |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
169 /* IP */ |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
170 s.sa.sa_family = AF_INET; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
171 if (avp_value->os.len != 6) { |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
172 fd_log_debug_fstr(fstr, "[invalid IP length: %d]", avp_value->os.len); |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
173 return; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
174 } |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
175 memcpy(&s.sin.sin_addr.s_addr, avp_value->os.data + 2, 4); |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
176 break; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
177 case 2: |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
178 /* IP6 */ |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
179 s.sa.sa_family = AF_INET6; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
180 if (avp_value->os.len != 18) { |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
181 fd_log_debug_fstr(fstr, "[invalid IP6 length: %d]", avp_value->os.len); |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
182 return; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
183 } |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
184 memcpy(&s.sin6.sin6_addr.s6_addr, avp_value->os.data + 2, 16); |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
185 break; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
186 default: |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
187 fd_log_debug_fstr(fstr, "[unsupported family: 0x%hx]", fam); |
190
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
188 return; |
02857b1cd872
Added address value dumps in messages
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
156
diff
changeset
|
189 } |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
190 |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
191 { |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
192 char addrbuf[INET6_ADDRSTRLEN]; |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
193 int rc = getnameinfo(&s.sa, sSAlen(&s.sa), addrbuf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
194 if (rc) |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
195 fd_log_debug_fstr(fstr, "%s", (char *)gai_strerror(rc)); |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
196 else |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
197 fd_log_debug_fstr(fstr, "%s", addrbuf); |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
198 |
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
199 } |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
200 } |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
201 |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
202 static void UTF8String_dump(union avp_value * avp_value, FILE * fstr) |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
203 { |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
204 size_t len = avp_value->os.len; |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
205 if (len > 42) |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
206 len = 42; /* avoid very long strings */ |
687
026802543f57
Prepare for new message log facility
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
662
diff
changeset
|
207 fd_log_debug_fstr(fstr, "%.*s", len, avp_value->os.data); |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
208 } |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
209 |
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
210 |
0 | 211 |
212 | |
213 #define CHECK_dict_new( _type, _data, _parent, _ref ) \ | |
214 CHECK_FCT( fd_dict_new( dict, (_type), (_data), (_parent), (_ref)) ); | |
215 | |
216 #define CHECK_dict_search( _type, _criteria, _what, _result ) \ | |
217 CHECK_FCT( fd_dict_search( dict, (_type), (_criteria), (_what), (_result), ENOENT) ); | |
218 | |
219 struct local_rules_definition { | |
220 char *avp_name; | |
221 enum rule_position position; | |
222 int min; | |
223 int max; | |
224 }; | |
225 | |
226 #define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) | |
227 | |
228 #define PARSE_loc_rules( _rulearray, _parent) { \ | |
229 int __ar; \ | |
230 for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ | |
231 struct dict_rule_data __data = { NULL, \ | |
232 (_rulearray)[__ar].position, \ | |
233 0, \ | |
234 (_rulearray)[__ar].min, \ | |
235 (_rulearray)[__ar].max}; \ | |
236 __data.rule_order = RULE_ORDER(__data.rule_position); \ | |
237 CHECK_FCT( fd_dict_search( \ | |
238 dict, \ | |
239 DICT_AVP, \ | |
240 AVP_BY_NAME, \ | |
241 (_rulearray)[__ar].avp_name, \ | |
242 &__data.rule_avp, 0 ) ); \ | |
243 if ( !__data.rule_avp ) { \ | |
244 TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ | |
245 return ENOENT; \ | |
246 } \ | |
247 CHECK_FCT_DO( fd_dict_new( dict, DICT_RULE, &__data, _parent, NULL), \ | |
248 { \ | |
249 TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ | |
250 (_rulearray)[__ar].avp_name ); \ | |
251 return EINVAL; \ | |
252 } ); \ | |
253 } \ | |
254 } | |
255 | |
256 int fd_dict_base_protocol(struct dictionary * dict) | |
257 { | |
258 TRACE_ENTRY("%p", dict); | |
259 CHECK_PARAMS(dict); | |
260 | |
261 /* Vendors section */ | |
262 { | |
263 /* The base RFC has no vendor information */ | |
264 ; | |
265 } | |
266 | |
267 /* Applications section */ | |
268 { | |
269 /* base accounting application */ | |
270 { | |
271 struct dict_application_data data = { 3, "Diameter Base Accounting" }; | |
272 CHECK_dict_new( DICT_APPLICATION, &data, NULL, NULL); | |
273 } | |
274 | |
275 /* relay application */ | |
276 { | |
277 struct dict_application_data data = { 0xffffffff, "Relay" }; | |
43
2db15632a63d
Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
278 #if AI_RELAY != 0xffffffff |
2db15632a63d
Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
279 #error "AI_RELAY definition mismatch" |
2db15632a63d
Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
280 #endif |
0 | 281 CHECK_dict_new( DICT_APPLICATION, &data , NULL, NULL); |
282 } | |
283 } | |
284 | |
285 /* Derived AVP types section */ | |
286 { | |
287 /* Address */ | |
288 { | |
289 /* | |
290 The Address format is derived from the OctetString AVP Base | |
291 Format. It is a discriminated union, representing, for example a | |
292 32-bit (IPv4) [RFC791] or 128-bit (IPv6) [RFC4291] address, most | |
293 significant octet first. The first two octets of the Address AVP | |
294 represents the AddressType, which contains an Address Family | |
295 defined in [IANAADFAM]. The AddressType is used to discriminate | |
296 the content and format of the remaining octets. | |
297 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
298 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "Address" , Address_interpret , Address_encode, Address_dump }; |
0 | 299 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
300 } | |
301 | |
302 /* Time */ | |
303 { | |
304 /* | |
305 The Time format is derived from the OctetString AVP Base Format. | |
306 The string MUST contain four octets, in the same format as the | |
307 first four bytes are in the NTP timestamp format. The NTP | |
308 Timestamp format is defined in chapter 3 of [RFC4330]. | |
309 | |
310 This represents the number of seconds since 0h on 1 January 1900 | |
311 with respect to the Coordinated Universal Time (UTC). | |
312 | |
313 On 6h 28m 16s UTC, 7 February 2036 the time value will overflow. | |
314 SNTP [RFC4330] describes a procedure to extend the time to 2104. | |
315 This procedure MUST be supported by all DIAMETER nodes. | |
316 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
317 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "Time" , NULL , NULL , NULL }; |
0 | 318 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
319 } | |
320 | |
321 /* UTF8String */ | |
322 { | |
323 /* | |
324 The UTF8String format is derived from the OctetString AVP Base | |
325 Format. This is a human readable string represented using the | |
326 ISO/IEC IS 10646-1 character set, encoded as an OctetString using | |
327 the UTF-8 [RFC3629] transformation format described in RFC 3629. | |
328 | |
329 Since additional code points are added by amendments to the 10646 | |
330 standard from time to time, implementations MUST be prepared to | |
331 encounter any code point from 0x00000001 to 0x7fffffff. Byte | |
332 sequences that do not correspond to the valid encoding of a code | |
333 point into UTF-8 charset or are outside this range are prohibited. | |
334 | |
335 The use of control codes SHOULD be avoided. When it is necessary | |
336 to represent a new line, the control code sequence CR LF SHOULD be | |
337 used. | |
338 | |
339 The use of leading or trailing white space SHOULD be avoided. | |
340 | |
341 For code points not directly supported by user interface hardware | |
342 or software, an alternative means of entry and display, such as | |
343 hexadecimal, MAY be provided. | |
344 | |
345 For information encoded in 7-bit US-ASCII, the UTF-8 charset is | |
346 identical to the US-ASCII charset. | |
347 | |
348 UTF-8 may require multiple bytes to represent a single character / | |
349 code point; thus the length of an UTF8String in octets may be | |
350 different from the number of characters encoded. | |
351 | |
352 Note that the AVP Length field of an UTF8String is measured in | |
353 octets, not characters. | |
354 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
355 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "UTF8String" , NULL , NULL , UTF8String_dump }; |
0 | 356 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
357 } | |
358 | |
359 /* DiameterIdentity */ | |
360 { | |
361 /* | |
362 The DiameterIdentity format is derived from the OctetString AVP | |
363 Base Format. | |
364 | |
365 DiameterIdentity = FQDN | |
366 | |
367 | |
368 DiameterIdentity value is used to uniquely identify a Diameter | |
369 node for purposes of duplicate connection and routing loop | |
370 detection. | |
371 | |
372 The contents of the string MUST be the FQDN of the Diameter node. | |
373 If multiple Diameter nodes run on the same host, each Diameter | |
374 node MUST be assigned a unique DiameterIdentity. If a Diameter | |
375 | |
376 node can be identified by several FQDNs, a single FQDN should be | |
377 picked at startup, and used as the only DiameterIdentity for that | |
378 node, whatever the connection it is sent on. Note that in this | |
379 document, DiameterIdentity is in ASCII form in order to be | |
380 compatible with existing DNS infrastructure. See Appendix D for | |
381 interactions between the Diameter protocol and Internationalized | |
382 Domain Name (IDNs). | |
383 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
384 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "DiameterIdentity" , NULL , NULL , UTF8String_dump }; |
0 | 385 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
386 } | |
387 | |
388 /* DiameterURI */ | |
389 { | |
390 /* | |
391 The DiameterURI MUST follow the Uniform Resource Identifiers (URI) | |
392 syntax [RFC3986] rules specified below: | |
393 | |
394 "aaa://" FQDN [ port ] [ transport ] [ protocol ] | |
395 | |
396 ; No transport security | |
397 | |
398 "aaas://" FQDN [ port ] [ transport ] [ protocol ] | |
399 | |
400 ; Transport security used | |
401 | |
402 FQDN = Fully Qualified Host Name | |
403 | |
404 port = ":" 1*DIGIT | |
405 | |
406 ; One of the ports used to listen for | |
407 ; incoming connections. | |
408 ; If absent, | |
409 ; the default Diameter port (3868) is | |
410 ; assumed. | |
411 | |
412 transport = ";transport=" transport-protocol | |
413 | |
414 ; One of the transports used to listen | |
415 ; for incoming connections. If absent, | |
416 ; the default SCTP [RFC2960] protocol is | |
417 ; assumed. UDP MUST NOT be used when | |
418 ; the aaa-protocol field is set to | |
419 ; diameter. | |
420 | |
421 transport-protocol = ( "tcp" / "sctp" / "udp" ) | |
422 | |
423 protocol = ";protocol=" aaa-protocol | |
424 | |
425 ; If absent, the default AAA protocol | |
426 ; is diameter. | |
427 | |
428 aaa-protocol = ( "diameter" / "radius" / "tacacs+" ) | |
429 | |
430 The following are examples of valid Diameter host identities: | |
431 | |
432 aaa://host.example.com;transport=tcp | |
433 aaa://host.example.com:6666;transport=tcp | |
434 aaa://host.example.com;protocol=diameter | |
435 aaa://host.example.com:6666;protocol=diameter | |
436 aaa://host.example.com:6666;transport=tcp;protocol=diameter | |
437 aaa://host.example.com:1813;transport=udp;protocol=radius | |
438 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
439 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "DiameterURI" , NULL , NULL , UTF8String_dump }; |
0 | 440 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
441 } | |
442 | |
443 /* Enumerated */ | |
444 { | |
445 /* | |
446 Enumerated is derived from the Integer32 AVP Base Format. The | |
447 definition contains a list of valid values and their | |
448 interpretation and is described in the Diameter application | |
449 introducing the AVP. | |
450 */ | |
451 | |
336
5d1a22bb1cfe
Removed some references to waaad
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
258
diff
changeset
|
452 /* We don't use a generic "Enumerated" type in freeDiameter. Instead, we define |
0 | 453 * types of the form "Enumerated(<avpname>)" where <avpname> is replaced |
454 * by the name of the AVP to which the type applies. | |
455 * Example: Enumerated(Disconnect-Cause) | |
456 */ | |
457 ; | |
458 } | |
459 | |
460 /* IPFilterRule */ | |
461 { | |
462 /* | |
463 The IPFilterRule format is derived from the OctetString AVP Base | |
464 Format and uses the ASCII charset. The rule syntax is a modified | |
465 subset of ipfw(8) from FreeBSD. Packets may be filtered based on | |
466 the following information that is associated with it: | |
467 | |
468 Direction (in or out) | |
469 Source and destination IP address (possibly masked) | |
470 Protocol | |
471 Source and destination port (lists or ranges) | |
472 TCP flags | |
473 IP fragment flag | |
474 IP options | |
475 ICMP types | |
476 | |
477 Rules for the appropriate direction are evaluated in order, with | |
478 the first matched rule terminating the evaluation. Each packet is | |
479 evaluated once. If no rule matches, the packet is dropped if the | |
480 last rule evaluated was a permit, and passed if the last rule was | |
481 a deny. | |
482 | |
483 IPFilterRule filters MUST follow the format: | |
484 | |
485 action dir proto from src to dst [options] | |
486 | |
487 (...skipped loooong explanation...) | |
488 | |
489 There is one kind of packet that the access device MUST always | |
490 discard, that is an IP fragment with a fragment offset of one. | |
491 This is a valid packet, but it only has one use, to try to | |
492 circumvent firewalls. | |
493 | |
494 An access device that is unable to interpret or apply a deny rule | |
495 MUST terminate the session. An access device that is unable to | |
496 interpret or apply a permit rule MAY apply a more restrictive | |
497 rule. An access device MAY apply deny rules of its own before the | |
498 supplied rules, for example to protect the access device owner's | |
499 infrastructure. | |
500 */ | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
501 struct dict_type_data data = { AVP_TYPE_OCTETSTRING, "IPFilterRule" , NULL , NULL , UTF8String_dump }; |
0 | 502 CHECK_dict_new( DICT_TYPE, &data , NULL, NULL); |
503 } | |
504 } | |
505 | |
506 /* AVP section */ | |
507 { | |
508 struct dict_object * Address_type; | |
509 struct dict_object * UTF8String_type; | |
510 struct dict_object * DiameterIdentity_type; | |
511 struct dict_object * DiameterURI_type; | |
512 struct dict_object * Time_type; | |
513 | |
514 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); | |
515 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type); | |
516 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type); | |
517 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type); | |
518 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); | |
519 | |
520 /* Vendor-Id */ | |
521 { | |
522 /* | |
523 The Vendor-Id AVP (AVP Code 266) is of type Unsigned32 and contains | |
524 the IANA "SMI Network Management Private Enterprise Codes" [RFC3232] | |
525 value assigned to the vendor of the Diameter device. It is | |
526 envisioned that the combination of the Vendor-Id, Product-Name | |
527 (Section 5.3.7) and the Firmware-Revision (Section 5.3.4) AVPs may | |
528 provide useful debugging information. | |
529 | |
530 A Vendor-Id value of zero in the CER or CEA messages is reserved and | |
531 indicates that this field is ignored. | |
532 */ | |
533 struct dict_avp_data data = { | |
534 266, /* Code */ | |
535 #if AC_VENDOR_ID != 266 | |
536 #error "AC_VENDOR_ID definition mismatch" | |
537 #endif | |
538 0, /* Vendor */ | |
539 "Vendor-Id", /* Name */ | |
540 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
541 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
542 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
543 }; | |
544 CHECK_dict_new( DICT_AVP, &data, NULL, NULL); | |
545 } | |
546 | |
547 /* Firmware-Revision */ | |
548 { | |
549 /* | |
550 The Firmware-Revision AVP (AVP Code 267) is of type Unsigned32 and is | |
551 used to inform a Diameter peer of the firmware revision of the | |
552 issuing device. | |
553 | |
554 For devices that do not have a firmware revision (general purpose | |
555 computers running Diameter software modules, for instance), the | |
556 revision of the Diameter software module may be reported instead. | |
557 */ | |
558 struct dict_avp_data data = { | |
559 267, /* Code */ | |
560 #if AC_FIRMWARE_REVISION != 267 | |
561 #error "AC_FIRMWARE_REVISION definition mismatch" | |
562 #endif | |
563 0, /* Vendor */ | |
564 "Firmware-Revision", /* Name */ | |
565 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
566 0, /* Fixed flag values */ | |
567 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
568 }; | |
569 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
570 } | |
571 | |
572 /* Host-IP-Address */ | |
573 { | |
574 /* | |
575 The Host-IP-Address AVP (AVP Code 257) is of type Address and is used | |
576 to inform a Diameter peer of the sender's IP address. All source | |
577 addresses that a Diameter node expects to use with SCTP [RFC2960] | |
578 MUST be advertised in the CER and CEA messages by including a | |
579 Host-IP- Address AVP for each address. This AVP MUST ONLY be used in | |
580 the CER and CEA messages. | |
581 */ | |
582 struct dict_avp_data data = { | |
583 257, /* Code */ | |
584 #if AC_HOST_IP_ADDRESS != 257 | |
585 #error "AC_HOST_IP_ADDRESS definition mismatch" | |
586 #endif | |
587 0, /* Vendor */ | |
588 "Host-IP-Address", /* Name */ | |
589 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
590 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
591 AVP_TYPE_OCTETSTRING /* base type of data */ | |
592 }; | |
593 CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); | |
594 } | |
595 | |
596 /* Supported-Vendor-Id */ | |
597 { | |
598 /* | |
599 The Supported-Vendor-Id AVP (AVP Code 265) is of type Unsigned32 and | |
600 contains the IANA "SMI Network Management Private Enterprise Codes" | |
601 [RFC3232] value assigned to a vendor other than the device vendor but | |
602 including the application vendor. This is used in the CER and CEA | |
603 messages in order to inform the peer that the sender supports (a | |
604 subset of) the vendor-specific AVPs defined by the vendor identified | |
605 in this AVP. The value of this AVP SHOULD NOT be set to zero. | |
606 Multiple instances of this AVP containing the same value SHOULD NOT | |
607 be sent. | |
608 */ | |
609 struct dict_avp_data data = { | |
610 265, /* Code */ | |
611 #if AC_SUPPORTED_VENDOR_ID != 265 | |
612 #error "AC_SUPPORTED_VENDOR_ID definition mismatch" | |
613 #endif | |
614 0, /* Vendor */ | |
615 "Supported-Vendor-Id", /* Name */ | |
616 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
617 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
618 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
619 }; | |
620 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
621 } | |
622 | |
623 /* Product-Name */ | |
624 { | |
625 /* | |
626 The Product-Name AVP (AVP Code 269) is of type UTF8String, and | |
627 contains the vendor assigned name for the product. The Product-Name | |
628 AVP SHOULD remain constant across firmware revisions for the same | |
629 product. | |
630 */ | |
631 struct dict_avp_data data = { | |
632 269, /* Code */ | |
633 #if AC_PRODUCT_NAME != 269 | |
634 #error "AC_PRODUCT_NAME definition mismatch" | |
635 #endif | |
636 0, /* Vendor */ | |
637 "Product-Name", /* Name */ | |
638 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
639 0, /* Fixed flag values */ | |
640 AVP_TYPE_OCTETSTRING /* base type of data */ | |
641 }; | |
642 CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); | |
643 } | |
644 | |
645 /* Disconnect-Cause */ | |
646 { | |
647 /* | |
648 The Disconnect-Cause AVP (AVP Code 273) is of type Enumerated. A | |
649 Diameter node MUST include this AVP in the Disconnect-Peer-Request | |
650 message to inform the peer of the reason for its intention to | |
651 shutdown the transport connection. The following values are | |
652 supported: | |
653 | |
654 REBOOTING 0 | |
655 A scheduled reboot is imminent. Receiver of DPR with above result | |
656 code MAY attempt reconnection. | |
657 | |
658 BUSY 1 | |
659 The peer's internal resources are constrained, and it has | |
660 determined that the transport connection needs to be closed. | |
661 Receiver of DPR with above result code SHOULD NOT attempt | |
662 reconnection. | |
663 | |
664 DO_NOT_WANT_TO_TALK_TO_YOU 2 | |
665 The peer has determined that it does not see a need for the | |
666 transport connection to exist, since it does not expect any | |
667 messages to be exchanged in the near future. Receiver of DPR | |
668 with above result code SHOULD NOT attempt reconnection. | |
669 */ | |
670 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
671 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Disconnect-Cause)" , NULL, NULL, NULL }; |
0 | 672 struct dict_enumval_data t_0 = { "REBOOTING", { .i32 = 0 }}; |
673 struct dict_enumval_data t_1 = { "BUSY", { .i32 = 1 }}; | |
674 struct dict_enumval_data t_2 = { "DO_NOT_WANT_TO_TALK_TO_YOU", { .i32 = 2 }}; | |
675 struct dict_avp_data data = { | |
676 273, /* Code */ | |
677 #if AC_DISCONNECT_CAUSE != 273 | |
678 #error "AC_DISCONNECT_CAUSE definition mismatch" | |
679 #endif | |
680 0, /* Vendor */ | |
681 "Disconnect-Cause", /* Name */ | |
682 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
683 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
684 AVP_TYPE_INTEGER32 /* base type of data */ | |
685 }; | |
686 /* Create the Enumerated type, and then the AVP */ | |
687 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
688 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
689 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
690 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
691 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
692 } | |
693 | |
694 /* Origin-Host */ | |
695 { | |
696 /* | |
697 The Origin-Host AVP (AVP Code 264) is of type DiameterIdentity, and | |
698 MUST be present in all Diameter messages. This AVP identifies the | |
699 endpoint that originated the Diameter message. Relay agents MUST NOT | |
700 modify this AVP. | |
701 | |
702 The value of the Origin-Host AVP is guaranteed to be unique within a | |
703 single host. | |
704 | |
705 Note that the Origin-Host AVP may resolve to more than one address as | |
706 the Diameter peer may support more than one address. | |
707 | |
708 This AVP SHOULD be placed as close to the Diameter header as | |
709 possible. | |
710 */ | |
711 struct dict_avp_data data = { | |
712 264, /* Code */ | |
713 #if AC_ORIGIN_HOST != 264 | |
714 #error "AC_ORIGIN_HOST definition mismatch" | |
715 #endif | |
716 0, /* Vendor */ | |
717 "Origin-Host", /* Name */ | |
718 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
719 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
720 AVP_TYPE_OCTETSTRING /* base type of data */ | |
721 }; | |
722 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
723 } | |
724 | |
725 /* Origin-Realm */ | |
726 { | |
727 /* | |
728 The Origin-Realm AVP (AVP Code 296) is of type DiameterIdentity. | |
729 This AVP contains the Realm of the originator of any Diameter message | |
730 and MUST be present in all messages. | |
731 | |
732 This AVP SHOULD be placed as close to the Diameter header as | |
733 possible. | |
734 */ | |
735 struct dict_avp_data data = { | |
736 296, /* Code */ | |
737 #if AC_ORIGIN_REALM != 296 | |
738 #error "AC_ORIGIN_REALM definition mismatch" | |
739 #endif | |
740 0, /* Vendor */ | |
741 "Origin-Realm", /* Name */ | |
742 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
743 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
744 AVP_TYPE_OCTETSTRING /* base type of data */ | |
745 }; | |
746 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
747 } | |
748 | |
749 /* Destination-Host */ | |
750 { | |
751 /* | |
752 The Destination-Host AVP (AVP Code 293) is of type DiameterIdentity. | |
753 This AVP MUST be present in all unsolicited agent initiated messages, | |
754 MAY be present in request messages, and MUST NOT be present in Answer | |
755 messages. | |
756 | |
757 The absence of the Destination-Host AVP will cause a message to be | |
758 sent to any Diameter server supporting the application within the | |
759 realm specified in Destination-Realm AVP. | |
760 | |
761 This AVP SHOULD be placed as close to the Diameter header as | |
762 possible. | |
763 */ | |
764 struct dict_avp_data data = { | |
765 293, /* Code */ | |
766 #if AC_DESTINATION_HOST != 293 | |
767 #error "AC_DESTINATION_HOST definition mismatch" | |
768 #endif | |
769 0, /* Vendor */ | |
770 "Destination-Host", /* Name */ | |
771 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
772 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
773 AVP_TYPE_OCTETSTRING /* base type of data */ | |
774 }; | |
775 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
776 } | |
777 | |
778 /* Destination-Realm */ | |
779 { | |
780 /* | |
781 The Destination-Realm AVP (AVP Code 283) is of type DiameterIdentity, | |
782 and contains the realm the message is to be routed to. The | |
783 Destination-Realm AVP MUST NOT be present in Answer messages. | |
784 Diameter Clients insert the realm portion of the User-Name AVP. | |
785 Diameter servers initiating a request message use the value of the | |
786 Origin-Realm AVP from a previous message received from the intended | |
787 target host (unless it is known a priori). When present, the | |
788 Destination-Realm AVP is used to perform message routing decisions. | |
789 | |
790 Request messages whose ABNF does not list the Destination-Realm AVP | |
791 as a mandatory AVP are inherently non-routable messages. | |
792 | |
793 This AVP SHOULD be placed as close to the Diameter header as | |
794 possible. | |
795 */ | |
796 struct dict_avp_data data = { | |
797 283, /* Code */ | |
798 #if AC_DESTINATION_REALM != 283 | |
799 #error "AC_DESTINATION_REALM definition mismatch" | |
800 #endif | |
801 0, /* Vendor */ | |
802 "Destination-Realm", /* Name */ | |
803 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
804 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
805 AVP_TYPE_OCTETSTRING /* base type of data */ | |
806 }; | |
807 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
808 } | |
809 | |
810 /* Route-Record */ | |
811 { | |
812 /* | |
813 The Route-Record AVP (AVP Code 282) is of type DiameterIdentity. The | |
814 identity added in this AVP MUST be the same as the one received in | |
815 the Origin-Host of the Capabilities Exchange message. | |
816 */ | |
817 struct dict_avp_data data = { | |
818 282, /* Code */ | |
819 #if AC_ROUTE_RECORD != 282 | |
820 #error "AC_ROUTE_RECORD definition mismatch" | |
821 #endif | |
822 0, /* Vendor */ | |
823 "Route-Record", /* Name */ | |
824 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
825 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
826 AVP_TYPE_OCTETSTRING /* base type of data */ | |
827 }; | |
828 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
829 } | |
830 | |
831 /* Proxy-Host */ | |
832 { | |
833 /* | |
834 The Proxy-Host AVP (AVP Code 280) is of type DiameterIdentity. This | |
835 AVP contains the identity of the host that added the Proxy-Info AVP. | |
836 */ | |
837 struct dict_avp_data adata = { | |
838 280, /* Code */ | |
839 #if AC_PROXY_HOST != 280 | |
840 #error "AC_PROXY_HOST definition mismatch" | |
841 #endif | |
842 0, /* Vendor */ | |
843 "Proxy-Host", /* Name */ | |
844 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
845 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
846 AVP_TYPE_OCTETSTRING /* base type of data */ | |
847 }; | |
848 CHECK_dict_new( DICT_AVP, &adata , DiameterIdentity_type, NULL); | |
849 } | |
850 | |
851 /* Proxy-State */ | |
852 { | |
853 /* | |
854 The Proxy-State AVP (AVP Code 33) is of type OctetString, and | |
855 contains state local information, and MUST be treated as opaque data. | |
856 */ | |
857 struct dict_avp_data adata = { | |
858 33, /* Code */ | |
859 #if AC_PROXY_STATE != 33 | |
860 #error "AC_PROXY_STATE definition mismatch" | |
861 #endif | |
862 0, /* Vendor */ | |
863 "Proxy-State", /* Name */ | |
864 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
865 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
866 AVP_TYPE_OCTETSTRING /* base type of data */ | |
867 }; | |
868 CHECK_dict_new( DICT_AVP, &adata , NULL, NULL); | |
869 } | |
870 | |
871 /* Proxy-Info */ | |
872 { | |
873 /* | |
874 The Proxy-Info AVP (AVP Code 284) is of type Grouped. The Grouped | |
875 Data field has the following ABNF grammar: | |
876 | |
877 Proxy-Info ::= < AVP Header: 284 > | |
878 { Proxy-Host } | |
879 { Proxy-State } | |
880 * [ AVP ] | |
881 */ | |
882 struct dict_object * avp; | |
883 struct dict_avp_data data = { | |
884 284, /* Code */ | |
885 #if AC_PROXY_INFO != 284 | |
886 #error "AC_PROXY_INFO definition mismatch" | |
887 #endif | |
888 0, /* Vendor */ | |
889 "Proxy-Info", /* Name */ | |
890 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
891 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
892 AVP_TYPE_GROUPED /* base type of data */ | |
893 }; | |
894 struct local_rules_definition rules[] = | |
895 { { "Proxy-Host", RULE_REQUIRED, -1, 1 } | |
896 ,{ "Proxy-State", RULE_REQUIRED, -1, 1 } | |
897 }; | |
898 | |
899 CHECK_dict_new( DICT_AVP, &data , NULL, &avp); | |
900 PARSE_loc_rules( rules, avp ); | |
901 } | |
902 | |
903 /* Auth-Application-Id */ | |
904 { | |
905 /* | |
906 The Auth-Application-Id AVP (AVP Code 258) is of type Unsigned32 and | |
907 is used in order to advertise support of the Authentication and | |
908 Authorization portion of an application (see Section 2.4). If | |
909 present in a message other than CER and CEA, the value of the Auth- | |
910 Application-Id AVP MUST match the Application Id present in the | |
911 Diameter message header. | |
912 */ | |
913 struct dict_avp_data data = { | |
914 258, /* Code */ | |
915 #if AC_AUTH_APPLICATION_ID != 258 | |
916 #error "AC_AUTH_APPLICATION_ID definition mismatch" | |
917 #endif | |
918 0, /* Vendor */ | |
919 "Auth-Application-Id", /* Name */ | |
920 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
921 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
922 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
923 }; | |
924 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
925 } | |
926 | |
927 /* Acct-Application-Id */ | |
928 { | |
929 /* | |
930 The Acct-Application-Id AVP (AVP Code 259) is of type Unsigned32 and | |
931 is used in order to advertise support of the Accounting portion of an | |
932 application (see Section 2.4). If present in a message other than | |
933 CER and CEA, the value of the Acct-Application-Id AVP MUST match the | |
934 Application Id present in the Diameter message header. | |
935 */ | |
936 struct dict_avp_data data = { | |
937 259, /* Code */ | |
938 #if AC_ACCT_APPLICATION_ID != 259 | |
939 #error "AC_ACCT_APPLICATION_ID definition mismatch" | |
940 #endif | |
941 0, /* Vendor */ | |
942 "Acct-Application-Id", /* Name */ | |
943 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
944 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
945 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
946 }; | |
947 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
948 } | |
949 | |
950 /* Inband-Security-Id */ | |
951 { | |
952 /* | |
953 The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and | |
954 is used in order to advertise support of the Security portion of the | |
955 application. | |
956 | |
957 Currently, the following values are supported, but there is ample | |
958 room to add new security Ids. | |
959 | |
960 | |
961 NO_INBAND_SECURITY 0 | |
962 | |
963 This peer does not support TLS. This is the default value, if the | |
964 AVP is omitted. | |
965 | |
966 TLS 1 | |
967 | |
968 This node supports TLS security, as defined by [RFC4346]. | |
969 */ | |
970 | |
971 /* Although the RFC does not specify an "Enumerated" type here, we go forward and create one. | |
972 * This is the reason for the "*" in the type name | |
973 */ | |
974 | |
975 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
976 struct dict_type_data tdata = { AVP_TYPE_UNSIGNED32, "Enumerated*(Inband-Security-Id)" , NULL, NULL, NULL }; |
43
2db15632a63d
Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
977 struct dict_enumval_data t_0 = { "NO_INBAND_SECURITY", { .u32 = ACV_ISI_NO_INBAND_SECURITY }}; |
2db15632a63d
Added a large part of connection establishment logic, to test
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
978 struct dict_enumval_data t_1 = { "TLS", { .u32 = ACV_ISI_TLS }}; |
0 | 979 struct dict_avp_data data = { |
980 299, /* Code */ | |
981 #if AC_INBAND_SECURITY_ID != 299 | |
982 #error "AC_INBAND_SECURITY_ID definition mismatch" | |
983 #endif | |
984 0, /* Vendor */ | |
985 "Inband-Security-Id", /* Name */ | |
986 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
987 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
988 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
989 }; | |
990 /* Create the Enumerated type, and then the AVP */ | |
991 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
992 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
993 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
994 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
995 } | |
996 | |
997 /* Vendor-Specific-Application-Id */ | |
998 { | |
999 /* | |
1000 The Vendor-Specific-Application-Id AVP (AVP Code 260) is of type | |
1001 Grouped and is used to advertise support of a vendor-specific | |
1002 Diameter Application. Exactly one instance of either Auth- | |
1003 Application-Id or Acct-Application-Id AVP MUST be present. The | |
1004 Application Id carried by either Auth-Application-Id or Acct- | |
1005 Application-Id AVP MUST comply with vendor specific Application Id | |
1006 assignment described in Sec 11.3. It MUST also match the Application | |
1007 Id present in the diameter header except when used in a CER or CEA | |
1008 messages. | |
1009 | |
1010 The Vendor-Id AVP is an informational AVP pertaining to the vendor | |
1011 who may have authorship of the vendor-specific Diameter application. | |
1012 It MUST NOT be used as a means of defining a completely separate | |
1013 vendor-specific Application Id space. | |
1014 | |
1015 This AVP MUST also be present as the first AVP in all experimental | |
1016 commands defined in the vendor-specific application. | |
1017 | |
1018 This AVP SHOULD be placed as close to the Diameter header as | |
1019 possible. | |
1020 | |
1021 AVP Format | |
1022 | |
1023 <Vendor-Specific-Application-Id> ::= < AVP Header: 260 > | |
1024 { Vendor-Id } | |
1025 [ Auth-Application-Id ] | |
1026 [ Acct-Application-Id ] | |
1027 | |
1028 A Vendor-Specific-Application-Id AVP MUST contain exactly one of | |
1029 either Auth-Application-Id or Acct-Application-Id. If a Vendor- | |
1030 Specific-Application-Id is received without any of these two AVPs, | |
1031 then the recipient SHOULD issue an answer with a Result-Code set to | |
1032 DIAMETER_MISSING_AVP. The answer SHOULD also include a Failed-AVP | |
1033 which MUST contain an example of an Auth-Application-Id AVP and an | |
1034 Acct-Application-Id AVP. | |
1035 | |
1036 If a Vendor-Specific-Application-Id is received that contains both | |
1037 Auth-Application-Id and Acct-Application-Id, then the recipient | |
1038 SHOULD issue an answer with Result-Code set to | |
1039 DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. The answer SHOULD also include a | |
1040 Failed-AVP which MUST contain the received Auth-Application-Id AVP | |
1041 and Acct-Application-Id AVP. | |
1042 */ | |
1043 struct dict_object * avp; | |
1044 struct dict_avp_data data = { | |
1045 260, /* Code */ | |
1046 #if AC_VENDOR_SPECIFIC_APPLICATION_ID != 260 | |
1047 #error "AC_VENDOR_SPECIFIC_APPLICATION_ID definition mismatch" | |
1048 #endif | |
1049 0, /* Vendor */ | |
1050 "Vendor-Specific-Application-Id", /* Name */ | |
1051 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1052 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1053 AVP_TYPE_GROUPED /* base type of data */ | |
1054 }; | |
1055 | |
1056 struct local_rules_definition rules[] = | |
1057 { { "Vendor-Id", RULE_REQUIRED, -1, 1 } | |
1058 ,{ "Auth-Application-Id", RULE_OPTIONAL, -1, 1 } | |
1059 ,{ "Acct-Application-Id", RULE_OPTIONAL, -1, 1 } | |
1060 }; | |
1061 | |
1062 /* Create the grouped AVP */ | |
1063 CHECK_dict_new( DICT_AVP, &data , NULL, &avp); | |
1064 PARSE_loc_rules( rules, avp ); | |
1065 | |
1066 } | |
1067 | |
1068 /* Redirect-Host */ | |
1069 { | |
1070 /* | |
1071 One or more of instances of this AVP MUST be present if the answer | |
1072 message's 'E' bit is set and the Result-Code AVP is set to | |
1073 DIAMETER_REDIRECT_INDICATION. | |
1074 | |
1075 Upon receiving the above, the receiving Diameter node SHOULD forward | |
1076 the request directly to one of the hosts identified in these AVPs. | |
1077 The server contained in the selected Redirect-Host AVP SHOULD be used | |
1078 for all messages pertaining to this session. | |
1079 */ | |
1080 struct dict_avp_data data = { | |
1081 292, /* Code */ | |
1082 #if AC_REDIRECT_HOST != 292 | |
1083 #error "AC_REDIRECT_HOST definition mismatch" | |
1084 #endif | |
1085 0, /* Vendor */ | |
1086 "Redirect-Host", /* Name */ | |
1087 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1088 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1089 AVP_TYPE_OCTETSTRING /* base type of data */ | |
1090 }; | |
1091 CHECK_dict_new( DICT_AVP, &data , DiameterURI_type, NULL); | |
1092 } | |
1093 | |
1094 /* Redirect-Host-Usage */ | |
1095 { | |
1096 /* | |
1097 The Redirect-Host-Usage AVP (AVP Code 261) is of type Enumerated. | |
1098 This AVP MAY be present in answer messages whose 'E' bit is set and | |
1099 the Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION. | |
1100 | |
1101 When present, this AVP dictates how the routing entry resulting from | |
1102 the Redirect-Host is to be used. The following values are supported: | |
1103 | |
1104 | |
1105 DONT_CACHE 0 | |
1106 | |
1107 The host specified in the Redirect-Host AVP should not be cached. | |
1108 This is the default value. | |
1109 | |
1110 | |
1111 ALL_SESSION 1 | |
1112 | |
1113 All messages within the same session, as defined by the same value | |
1114 of the Session-ID AVP MAY be sent to the host specified in the | |
1115 Redirect-Host AVP. | |
1116 | |
1117 | |
1118 ALL_REALM 2 | |
1119 | |
1120 All messages destined for the realm requested MAY be sent to the | |
1121 host specified in the Redirect-Host AVP. | |
1122 | |
1123 | |
1124 REALM_AND_APPLICATION 3 | |
1125 | |
1126 All messages for the application requested to the realm specified | |
1127 MAY be sent to the host specified in the Redirect-Host AVP. | |
1128 | |
1129 ALL_APPLICATION 4 | |
1130 | |
1131 All messages for the application requested MAY be sent to the host | |
1132 specified in the Redirect-Host AVP. | |
1133 | |
1134 | |
1135 ALL_HOST 5 | |
1136 | |
1137 All messages that would be sent to the host that generated the | |
1138 Redirect-Host MAY be sent to the host specified in the Redirect- | |
1139 Host AVP. | |
1140 | |
1141 | |
1142 ALL_USER 6 | |
1143 | |
1144 All messages for the user requested MAY be sent to the host | |
1145 specified in the Redirect-Host AVP. | |
1146 | |
1147 | |
1148 When multiple cached routes are created by redirect indications and | |
1149 they differ only in redirect usage and peers to forward requests to | |
1150 (see Section 6.1.8), a precedence rule MUST be applied to the | |
1151 redirect usage values of the cached routes during normal routing to | |
1152 resolve contentions that may occur. The precedence rule is the order | |
1153 that dictate which redirect usage should be considered before any | |
1154 other as they appear. The order is as follows: | |
1155 | |
1156 | |
1157 1. ALL_SESSION | |
1158 | |
1159 2. ALL_USER | |
1160 | |
1161 3. REALM_AND_APPLICATION | |
1162 | |
1163 4. ALL_REALM | |
1164 | |
1165 5. ALL_APPLICATION | |
1166 | |
1167 6. ALL_HOST | |
1168 */ | |
1169 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
1170 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Redirect-Host-Usage)" , NULL, NULL, NULL }; |
0 | 1171 struct dict_enumval_data t_0 = { "DONT_CACHE", { .i32 = 0 }}; |
1172 struct dict_enumval_data t_1 = { "ALL_SESSION", { .i32 = 1 }}; | |
1173 struct dict_enumval_data t_2 = { "ALL_REALM", { .i32 = 2 }}; | |
1174 struct dict_enumval_data t_3 = { "REALM_AND_APPLICATION", { .i32 = 3 }}; | |
1175 struct dict_enumval_data t_4 = { "ALL_APPLICATION", { .i32 = 4 }}; | |
1176 struct dict_enumval_data t_5 = { "ALL_HOST", { .i32 = 5 }}; | |
1177 struct dict_enumval_data t_6 = { "ALL_USER", { .i32 = 6 }}; | |
1178 struct dict_avp_data data = { | |
1179 261, /* Code */ | |
1180 #if AC_REDIRECT_HOST_USAGE != 261 | |
1181 #error "AC_REDIRECT_HOST_USAGE definition mismatch" | |
1182 #endif | |
1183 0, /* Vendor */ | |
1184 "Redirect-Host-Usage", /* Name */ | |
1185 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1186 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1187 AVP_TYPE_INTEGER32 /* base type of data */ | |
1188 }; | |
1189 /* Create the Enumerated type, and then the AVP */ | |
1190 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
1191 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
1192 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
1193 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
1194 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
1195 CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); | |
1196 CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); | |
1197 CHECK_dict_new( DICT_ENUMVAL, &t_6 , type, NULL); | |
1198 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
1199 } | |
1200 | |
1201 /* Redirect-Max-Cache-Time */ | |
1202 { | |
1203 /* | |
1204 The Redirect-Max-Cache-Time AVP (AVP Code 262) is of type Unsigned32. | |
1205 This AVP MUST be present in answer messages whose 'E' bit is set, the | |
1206 Result-Code AVP is set to DIAMETER_REDIRECT_INDICATION and the | |
1207 Redirect-Host-Usage AVP set to a non-zero value. | |
1208 | |
1209 This AVP contains the maximum number of seconds the peer and route | |
1210 table entries, created as a result of the Redirect-Host, will be | |
1211 cached. Note that once a host created due to a redirect indication | |
1212 is no longer reachable, any associated peer and routing table entries | |
1213 MUST be deleted. | |
1214 */ | |
1215 struct dict_avp_data data = { | |
1216 262, /* Code */ | |
1217 #if AC_REDIRECT_MAX_CACHE_TIME != 262 | |
1218 #error "AC_REDIRECT_MAX_CACHE_TIME definition mismatch" | |
1219 #endif | |
1220 0, /* Vendor */ | |
1221 "Redirect-Max-Cache-Time", /* Name */ | |
1222 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1223 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1224 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
1225 }; | |
1226 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
1227 } | |
1228 | |
1229 /* Result-Code */ | |
1230 { | |
1231 /* | |
1232 The Result-Code AVP (AVP Code 268) is of type Unsigned32 and | |
1233 indicates whether a particular request was completed successfully or | |
1234 whether an error occurred. All Diameter answer messages defined in | |
1235 IETF applications MUST include one Result-Code AVP. A non-successful | |
1236 Result-Code AVP (one containing a non 2xxx value other than | |
1237 DIAMETER_REDIRECT_INDICATION) MUST include the Error-Reporting-Host | |
1238 AVP if the host setting the Result-Code AVP is different from the | |
1239 identity encoded in the Origin-Host AVP. | |
1240 | |
1241 The Result-Code data field contains an IANA-managed 32-bit address | |
1242 space representing errors (see Section 11.4). Diameter provides the | |
1243 following classes of errors, all identified by the thousands digit in | |
1244 the decimal notation: | |
1245 | |
1246 o 1xxx (Informational) | |
1247 | |
1248 o 2xxx (Success) | |
1249 | |
1250 o 3xxx (Protocol Errors) | |
1251 | |
1252 o 4xxx (Transient Failures) | |
1253 | |
1254 o 5xxx (Permanent Failure) | |
1255 | |
1256 A non-recognized class (one whose first digit is not defined in this | |
1257 section) MUST be handled as a permanent failure. | |
1258 */ | |
1259 | |
1260 /* Although the RFC does not specify an "Enumerated" type here, we go forward and create one. | |
1261 * This is the reason for the "*" in the type name | |
1262 */ | |
1263 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
1264 struct dict_type_data tdata = { AVP_TYPE_UNSIGNED32, "Enumerated*(Result-Code)" , NULL, NULL, NULL }; |
0 | 1265 struct dict_avp_data data = { |
1266 268, /* Code */ | |
1267 #if AC_RESULT_CODE != 268 | |
1268 #error "AC_RESULT_CODE definition mismatch" | |
1269 #endif | |
1270 0, /* Vendor */ | |
1271 "Result-Code", /* Name */ | |
1272 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1273 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1274 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
1275 }; | |
1276 /* Create the Enumerated type, and then the AVP */ | |
1277 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
1278 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
1279 | |
1280 /* Informational */ | |
1281 { | |
1282 /* 1001 */ | |
1283 { | |
1284 /* | |
1285 This informational error is returned by a Diameter server to | |
1286 inform the access device that the authentication mechanism being | |
1287 used requires multiple round trips, and a subsequent request needs | |
1288 to be issued in order for access to be granted. | |
1289 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1290 struct dict_enumval_data error_code = { "DIAMETER_MULTI_ROUND_AUTH", { .u32 = ER_DIAMETER_MULTI_ROUND_AUTH }}; |
0 | 1291 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1292 } | |
1293 } | |
1294 /* Success */ | |
1295 { | |
1296 /* 2001 */ | |
1297 { | |
1298 /* | |
1299 The Request was successfully completed. | |
1300 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1301 struct dict_enumval_data error_code = { "DIAMETER_SUCCESS", { .u32 = ER_DIAMETER_SUCCESS }}; |
0 | 1302 #if ER_DIAMETER_SUCCESS != 2001 |
1303 #error "ER_DIAMETER_SUCCESS definition mismatch" | |
1304 #endif | |
1305 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); | |
1306 } | |
1307 /* 2002 */ | |
1308 { | |
1309 /* | |
1310 When returned, the request was successfully completed, but | |
1311 additional processing is required by the application in order to | |
1312 provide service to the user. | |
1313 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1314 struct dict_enumval_data error_code = { "DIAMETER_LIMITED_SUCCESS", { .u32 = ER_DIAMETER_LIMITED_SUCCESS }}; |
0 | 1315 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1316 } | |
1317 } | |
1318 /* Protocol Errors */ | |
1319 { | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1320 /* 3001 -- might be changed to 5xxx soon */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1321 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1322 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1323 The Request contained a Command-Code that the receiver did not |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1324 recognize or support. This MUST be used when a Diameter node |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1325 receives an experimental command that it does not understand. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1326 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1327 struct dict_enumval_data error_code = { "DIAMETER_COMMAND_UNSUPPORTED", { .u32 = ER_DIAMETER_COMMAND_UNSUPPORTED }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1328 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1329 } |
0 | 1330 /* 3002 */ |
1331 { | |
1332 /* | |
1333 This error is given when Diameter can not deliver the message to | |
1334 the destination, either because no host within the realm | |
1335 supporting the required application was available to process the | |
1336 request, or because Destination-Host AVP was given without the | |
1337 associated Destination-Realm AVP. | |
1338 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1339 struct dict_enumval_data error_code = { "DIAMETER_UNABLE_TO_DELIVER", { .u32 = ER_DIAMETER_UNABLE_TO_DELIVER }}; |
0 | 1340 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1341 } | |
1342 /* 3003 */ | |
1343 { | |
1344 /* | |
1345 The intended realm of the request is not recognized. | |
1346 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1347 struct dict_enumval_data error_code = { "DIAMETER_REALM_NOT_SERVED", { .u32 = ER_DIAMETER_REALM_NOT_SERVED }}; |
0 | 1348 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1349 } | |
1350 /* 3004 */ | |
1351 { | |
1352 /* | |
1353 When returned, a Diameter node SHOULD attempt to send the message | |
1354 to an alternate peer. This error MUST only be used when a | |
1355 specific server is requested, and it cannot provide the requested | |
1356 service. | |
1357 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1358 struct dict_enumval_data error_code = { "DIAMETER_TOO_BUSY", { .u32 = ER_DIAMETER_TOO_BUSY }}; |
0 | 1359 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1360 } | |
1361 /* 3005 */ | |
1362 { | |
1363 /* | |
1364 An agent detected a loop while trying to get the message to the | |
1365 intended recipient. The message MAY be sent to an alternate peer, | |
1366 if one is available, but the peer reporting the error has | |
1367 identified a configuration problem. | |
1368 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1369 struct dict_enumval_data error_code = { "DIAMETER_LOOP_DETECTED", { .u32 = ER_DIAMETER_LOOP_DETECTED }}; |
0 | 1370 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1371 } | |
1372 /* 3006 */ | |
1373 { | |
1374 /* | |
1375 A redirect agent has determined that the request could not be | |
1376 satisfied locally and the initiator of the request should direct | |
1377 the request directly to the server, whose contact information has | |
1378 been added to the response. When set, the Redirect-Host AVP MUST | |
1379 be present. | |
1380 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1381 struct dict_enumval_data error_code = { "DIAMETER_REDIRECT_INDICATION", { .u32 = ER_DIAMETER_REDIRECT_INDICATION }}; |
0 | 1382 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1383 } | |
1384 /* 3007 */ | |
1385 { | |
1386 /* | |
1387 A request was sent for an application that is not supported. | |
1388 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1389 struct dict_enumval_data error_code = { "DIAMETER_APPLICATION_UNSUPPORTED", { .u32 = ER_DIAMETER_APPLICATION_UNSUPPORTED }}; |
0 | 1390 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1391 } | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1392 /* 3008 -- will change to 5xxx soon */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1393 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1394 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1395 A request was received whose bits in the Diameter header were |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1396 either set to an invalid combination, or to a value that is |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1397 inconsistent with the command code's definition. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1398 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1399 struct dict_enumval_data error_code = { "DIAMETER_INVALID_HDR_BITS", { .u32 = ER_DIAMETER_INVALID_HDR_BITS }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1400 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1401 } |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1402 /* 3009 -- will change to 5xxx soon */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1403 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1404 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1405 A request was received that included an AVP whose flag bits are |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1406 set to an unrecognized value, or that is inconsistent with the |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1407 AVP's definition. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1408 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1409 struct dict_enumval_data error_code = { "DIAMETER_INVALID_AVP_BITS", { .u32 = ER_DIAMETER_INVALID_AVP_BITS }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1410 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1411 } |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1412 /* 3010 -- will change to 5xxx soon */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1413 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1414 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1415 A CER was received from an unknown peer. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1416 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1417 struct dict_enumval_data error_code = { "DIAMETER_UNKNOWN_PEER", { .u32 = ER_DIAMETER_UNKNOWN_PEER }}; |
0 | 1418 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1419 } | |
1420 } | |
1421 /* Transient Failures */ | |
1422 { | |
1423 /* 4001 */ | |
1424 { | |
1425 /* | |
1426 The authentication process for the user failed, most likely due to | |
1427 an invalid password used by the user. Further attempts MUST only | |
1428 be tried after prompting the user for a new password. | |
1429 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1430 struct dict_enumval_data error_code = { "DIAMETER_AUTHENTICATION_REJECTED", { .u32 = ER_DIAMETER_AUTHENTICATION_REJECTED }}; |
0 | 1431 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1432 } | |
1433 /* 4002 */ | |
1434 { | |
1435 /* | |
1436 A Diameter node received the accounting request but was unable to | |
1437 commit it to stable storage due to a temporary lack of space. | |
1438 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1439 struct dict_enumval_data error_code = { "DIAMETER_OUT_OF_SPACE", { .u32 = ER_DIAMETER_OUT_OF_SPACE }}; |
0 | 1440 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1441 } | |
1442 /* 4003 */ | |
1443 { | |
1444 /* | |
1445 The peer has determined that it has lost the election process and | |
1446 has therefore disconnected the transport connection. | |
1447 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1448 struct dict_enumval_data error_code = { "ELECTION_LOST", { .u32 = ER_ELECTION_LOST }}; |
0 | 1449 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1450 } | |
1451 } | |
1452 /* Permanent Failures */ | |
1453 { | |
1454 /* 5001 */ | |
1455 { | |
1456 /* | |
1457 The peer received a message that contained an AVP that is not | |
1458 recognized or supported and was marked with the Mandatory bit. A | |
1459 Diameter message with this error MUST contain one or more Failed- | |
1460 AVP AVP containing the AVPs that caused the failure. | |
1461 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1462 struct dict_enumval_data error_code = { "DIAMETER_AVP_UNSUPPORTED", { .u32 = ER_DIAMETER_AVP_UNSUPPORTED }}; |
0 | 1463 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1464 } | |
1465 /* 5002 */ | |
1466 { | |
1467 /* | |
1468 The request contained an unknown Session-Id. | |
1469 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1470 struct dict_enumval_data error_code = { "DIAMETER_UNKNOWN_SESSION_ID", { .u32 = ER_DIAMETER_UNKNOWN_SESSION_ID }}; |
0 | 1471 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1472 } | |
1473 /* 5003 */ | |
1474 { | |
1475 /* | |
1476 A request was received for which the user could not be authorized. | |
1477 This error could occur if the service requested is not permitted | |
1478 to the user. | |
1479 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1480 struct dict_enumval_data error_code = { "DIAMETER_AUTHORIZATION_REJECTED",{ .u32 = ER_DIAMETER_AUTHORIZATION_REJECTED }}; |
0 | 1481 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1482 } | |
1483 /* 5004 */ | |
1484 { | |
1485 /* | |
1486 The request contained an AVP with an invalid value in its data | |
1487 portion. A Diameter message indicating this error MUST include | |
1488 the offending AVPs within a Failed-AVP AVP. | |
1489 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1490 struct dict_enumval_data error_code = { "DIAMETER_INVALID_AVP_VALUE", { .u32 = ER_DIAMETER_INVALID_AVP_VALUE }}; |
0 | 1491 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1492 } | |
1493 /* 5005 */ | |
1494 { | |
1495 /* | |
1496 The request did not contain an AVP that is required by the Command | |
1497 Code definition. If this value is sent in the Result-Code AVP, a | |
1498 Failed-AVP AVP SHOULD be included in the message. The Failed-AVP | |
1499 AVP MUST contain an example of the missing AVP complete with the | |
1500 Vendor-Id if applicable. The value field of the missing AVP | |
1501 should be of correct minimum length and contain zeroes. | |
1502 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1503 struct dict_enumval_data error_code = { "DIAMETER_MISSING_AVP", { .u32 = ER_DIAMETER_MISSING_AVP }}; |
0 | 1504 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1505 } | |
1506 /* 5006 */ | |
1507 { | |
1508 /* | |
1509 A request was received that cannot be authorized because the user | |
1510 has already expended allowed resources. An example of this error | |
1511 condition is a user that is restricted to one dial-up PPP port, | |
1512 attempts to establish a second PPP connection. | |
1513 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1514 struct dict_enumval_data error_code = { "DIAMETER_RESOURCES_EXCEEDED", { .u32 = ER_DIAMETER_RESOURCES_EXCEEDED }}; |
0 | 1515 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1516 } | |
1517 /* 5007 */ | |
1518 { | |
1519 /* | |
1520 The Home Diameter server has detected AVPs in the request that | |
1521 contradicted each other, and is not willing to provide service to | |
1522 the user. The Failed-AVP AVPs MUST be present which contains the | |
1523 AVPs that contradicted each other. | |
1524 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1525 struct dict_enumval_data error_code = { "DIAMETER_CONTRADICTING_AVPS", { .u32 = ER_DIAMETER_CONTRADICTING_AVPS }}; |
0 | 1526 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1527 } | |
1528 /* 5008 */ | |
1529 { | |
1530 /* | |
1531 A message was received with an AVP that MUST NOT be present. The | |
1532 Failed-AVP AVP MUST be included and contain a copy of the | |
1533 offending AVP. | |
1534 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1535 struct dict_enumval_data error_code = { "DIAMETER_AVP_NOT_ALLOWED", { .u32 = ER_DIAMETER_AVP_NOT_ALLOWED }}; |
0 | 1536 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1537 } | |
1538 /* 5009 */ | |
1539 { | |
1540 /* | |
1541 A message was received that included an AVP that appeared more | |
1542 often than permitted in the message definition. The Failed-AVP | |
1543 AVP MUST be included and contain a copy of the first instance of | |
1544 the offending AVP that exceeded the maximum number of occurrences | |
1545 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1546 struct dict_enumval_data error_code = { "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES",{ .u32 = ER_DIAMETER_AVP_OCCURS_TOO_MANY_TIMES }}; |
0 | 1547 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1548 } | |
1549 /* 5010 */ | |
1550 { | |
1551 /* | |
1552 This error is returned by a Diameter node that is not acting as a | |
1553 relay when it receives a CER which advertises a set of | |
1554 applications that it does not support. | |
1555 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1556 struct dict_enumval_data error_code = { "DIAMETER_NO_COMMON_APPLICATION",{ .u32 = ER_DIAMETER_NO_COMMON_APPLICATION }}; |
0 | 1557 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1558 } | |
1559 /* 5011 */ | |
1560 { | |
1561 /* | |
1562 This error is returned when a request was received, whose version | |
1563 number is unsupported. | |
1564 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1565 struct dict_enumval_data error_code = { "DIAMETER_UNSUPPORTED_VERSION", { .u32 = ER_DIAMETER_UNSUPPORTED_VERSION }}; |
0 | 1566 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1567 } | |
1568 /* 5012 */ | |
1569 { | |
1570 /* | |
1571 This error is returned when a request is rejected for unspecified | |
1572 reasons. | |
1573 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1574 struct dict_enumval_data error_code = { "DIAMETER_UNABLE_TO_COMPLY", { .u32 = ER_DIAMETER_UNABLE_TO_COMPLY }}; |
0 | 1575 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1576 } | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1577 /* 5013 -- will change to 3xxx */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1578 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1579 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1580 This error is returned when an unrecognized bit in the Diameter |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1581 header is set to one (1). |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1582 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1583 struct dict_enumval_data error_code = { "DIAMETER_INVALID_BIT_IN_HEADER", { .u32 = ER_DIAMETER_INVALID_BIT_IN_HEADER }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1584 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1585 } |
0 | 1586 /* 5014 */ |
1587 { | |
1588 /* | |
1589 The request contained an AVP with an invalid length. A Diameter | |
1590 message indicating this error MUST include the offending AVPs | |
1591 within a Failed-AVP AVP. In cases where the erroneous avp length | |
1592 value exceeds the message length or is less than the minimum AVP | |
1593 header length, it is sufficient to include the offending AVP | |
1594 header and a zero filled payload of the minimum required length | |
1595 for the payloads data type. If the AVP is a grouped AVP, the | |
1596 grouped AVP header with an empty payload would be sufficient to | |
1597 indicate the offending AVP. In the case where the offending AVP | |
1598 header cannot be fully decoded when avp length is less than the | |
1599 minimum AVP header length, it is sufficient to include an | |
1600 offending AVP header that is formulated by padding the incomplete | |
1601 AVP header with zero up to the minimum AVP header length. | |
1602 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1603 struct dict_enumval_data error_code = { "DIAMETER_INVALID_AVP_LENGTH", { .u32 = ER_DIAMETER_INVALID_AVP_LENGTH }}; |
0 | 1604 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1605 } | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1606 /* 5015 -- will change to 3xxx */ |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1607 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1608 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1609 This error is returned when a request is received with an invalid |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1610 message length. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1611 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1612 struct dict_enumval_data error_code = { "DIAMETER_INVALID_MESSAGE_LENGTH", { .u32 = ER_DIAMETER_INVALID_MESSAGE_LENGTH }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1613 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1614 } |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1615 /* 5016 */ |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1616 { |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1617 /* |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1618 The request contained an AVP with which is not allowed to have the |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1619 given value in the AVP Flags field. A Diameter message indicating |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1620 this error MUST include the offending AVPs within a Failed-AVP |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1621 AVP. |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1622 */ |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1623 struct dict_enumval_data error_code = { "DIAMETER_INVALID_AVP_BIT_COMBO", { .u32 = ER_DIAMETER_INVALID_AVP_BIT_COMBO }}; |
119
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1624 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
5b3faa0b5c25
Added Result-Code values that disappeard between rfc3588 and 3588bis
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
43
diff
changeset
|
1625 } |
0 | 1626 /* 5017 */ |
1627 { | |
1628 /* | |
1629 This error is returned when a CER message is received, and there | |
1630 are no common security mechanisms supported between the peers. A | |
1631 Capabilities-Exchange-Answer (CEA) MUST be returned with the | |
1632 Result-Code AVP set to DIAMETER_NO_COMMON_SECURITY. | |
1633 */ | |
705
f0cb8f465763
Added standard Result-Code values in header.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
687
diff
changeset
|
1634 struct dict_enumval_data error_code = { "DIAMETER_NO_COMMON_SECURITY", { .u32 = ER_DIAMETER_NO_COMMON_SECURITY }}; |
0 | 1635 CHECK_dict_new( DICT_ENUMVAL, &error_code , type, NULL); |
1636 } | |
1637 } | |
1638 } | |
1639 | |
1640 /* Error-Message */ | |
1641 { | |
1642 /* | |
1643 The Error-Message AVP (AVP Code 281) is of type UTF8String. It MAY | |
1644 accompany a Result-Code AVP as a human readable error message. The | |
1645 Error-Message AVP is not intended to be useful in real-time, and | |
1646 SHOULD NOT be expected to be parsed by network entities. | |
1647 */ | |
1648 struct dict_avp_data data = { | |
1649 281, /* Code */ | |
1650 #if AC_ERROR_MESSAGE != 281 | |
1651 #error "AC_ERROR_MESSAGE definition mismatch" | |
1652 #endif | |
1653 0, /* Vendor */ | |
1654 "Error-Message", /* Name */ | |
1655 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1656 0, /* Fixed flag values */ | |
1657 AVP_TYPE_OCTETSTRING /* base type of data */ | |
1658 }; | |
1659 CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); | |
1660 } | |
1661 | |
1662 /* Error-Reporting-Host */ | |
1663 { | |
1664 /* | |
1665 The Error-Reporting-Host AVP (AVP Code 294) is of type | |
1666 DiameterIdentity. This AVP contains the identity of the Diameter | |
1667 host that sent the Result-Code AVP to a value other than 2001 | |
1668 (Success), only if the host setting the Result-Code is different from | |
1669 the one encoded in the Origin-Host AVP. This AVP is intended to be | |
1670 used for troubleshooting purposes, and MUST be set when the Result- | |
1671 Code AVP indicates a failure. | |
1672 */ | |
1673 struct dict_avp_data data = { | |
1674 294, /* Code */ | |
1675 #if AC_ERROR_REPORTING_HOST != 294 | |
1676 #error "AC_ERROR_REPORTING_HOST definition mismatch" | |
1677 #endif | |
1678 0, /* Vendor */ | |
1679 "Error-Reporting-Host", /* Name */ | |
1680 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1681 0, /* Fixed flag values */ | |
1682 AVP_TYPE_OCTETSTRING /* base type of data */ | |
1683 }; | |
1684 CHECK_dict_new( DICT_AVP, &data , DiameterIdentity_type, NULL); | |
1685 } | |
1686 | |
1687 /* Failed-AVP */ | |
1688 { | |
1689 /* | |
1690 The Failed-AVP AVP (AVP Code 279) is of type Grouped and provides | |
1691 debugging information in cases where a request is rejected or not | |
1692 fully processed due to erroneous information in a specific AVP. The | |
1693 value of the Result-Code AVP will provide information on the reason | |
1694 for the Failed-AVP AVP. A Diameter message SHOULD contain only one | |
1695 Failed-AVP that corresponds to the error indicated by the Result-Code | |
1696 AVP. For practical purposes, this Failed-AVP would typically refer | |
1697 to the first AVP processing error that a Diameter node encounters. | |
1698 | |
1699 The possible reasons for this AVP are the presence of an improperly | |
1700 constructed AVP, an unsupported or unrecognized AVP, an invalid AVP | |
1701 value, the omission of a required AVP, the presence of an explicitly | |
1702 excluded AVP (see tables in Section 10), or the presence of two or | |
1703 more occurrences of an AVP which is restricted to 0, 1, or 0-1 | |
1704 occurrences. | |
1705 | |
1706 A Diameter message SHOULD contain one Failed-AVP AVP, containing the | |
1707 entire AVP that could not be processed successfully. If the failure | |
1708 reason is omission of a required AVP, an AVP with the missing AVP | |
1709 code, the missing vendor id, and a zero filled payload of the minimum | |
1710 required length for the omitted AVP will be added. If the failure | |
1711 reason is an invalid AVP length where the reported length is less | |
1712 than the minimum AVP header length or greater than the reported | |
1713 message length, a copy of the offending AVP header and a zero filled | |
1714 payload of the minimum required length SHOULD be added. | |
1715 | |
1716 In the case where the offending AVP is embedded within a grouped AVP, | |
1717 the Failed-AVP MAY contain the grouped AVP which in turn contains the | |
1718 single offending AVP. The same method MAY be employed if the grouped | |
1719 AVP itself is embedded in yet another grouped AVP and so on. In this | |
1720 case, the Failed-AVP MAY contain the grouped AVP heirarchy up to the | |
1721 single offending AVP. This enables the recipient to detect the | |
1722 location of the offending AVP when embedded in a group. | |
1723 | |
1724 AVP Format | |
1725 | |
1726 <Failed-AVP> ::= < AVP Header: 279 > | |
1727 1* {AVP} | |
1728 */ | |
1729 struct dict_avp_data data = { | |
1730 279, /* Code */ | |
1731 #if AC_FAILED_AVP != 279 | |
1732 #error "AC_FAILED_AVP definition mismatch" | |
1733 #endif | |
1734 0, /* Vendor */ | |
1735 "Failed-AVP", /* Name */ | |
1736 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1737 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1738 AVP_TYPE_GROUPED /* base type of data */ | |
1739 }; | |
1740 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
1741 } | |
1742 | |
1743 /* Experimental-Result */ | |
1744 { | |
1745 /* | |
1746 The Experimental-Result AVP (AVP Code 297) is of type Grouped, and | |
1747 indicates whether a particular vendor-specific request was completed | |
1748 successfully or whether an error occurred. Its Data field has the | |
1749 following ABNF grammar: | |
1750 | |
1751 AVP Format | |
1752 | |
1753 Experimental-Result ::= < AVP Header: 297 > | |
1754 { Vendor-Id } | |
1755 { Experimental-Result-Code } | |
1756 | |
1757 The Vendor-Id AVP (see Section 5.3.3) in this grouped AVP identifies | |
1758 the vendor responsible for the assignment of the result code which | |
1759 follows. All Diameter answer messages defined in vendor-specific | |
1760 applications MUST include either one Result-Code AVP or one | |
1761 Experimental-Result AVP. | |
1762 */ | |
1763 struct dict_avp_data data = { | |
1764 297, /* Code */ | |
1765 0, /* Vendor */ | |
1766 "Experimental-Result", /* Name */ | |
1767 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1768 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1769 AVP_TYPE_GROUPED /* base type of data */ | |
1770 }; | |
1771 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
1772 } | |
1773 | |
1774 /* Experimental-Result-Code */ | |
1775 { | |
1776 /* | |
1777 The Experimental-Result-Code AVP (AVP Code 298) is of type Unsigned32 | |
1778 and contains a vendor-assigned value representing the result of | |
1779 processing the request. | |
1780 | |
1781 It is recommended that vendor-specific result codes follow the same | |
1782 conventions given for the Result-Code AVP regarding the different | |
1783 types of result codes and the handling of errors (for non 2xxx | |
1784 values). | |
1785 */ | |
1786 /* Although the RFC does not specify an "Enumerated" type here, we go forward and create one. | |
1787 * This is the reason for the "*" in the type name. Vendors will have to define their values. | |
1788 */ | |
1789 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
1790 struct dict_type_data tdata = { AVP_TYPE_UNSIGNED32, "Enumerated*(Experimental-Result-Code)" , NULL, NULL, NULL }; |
0 | 1791 struct dict_avp_data data = { |
1792 298, /* Code */ | |
1793 0, /* Vendor */ | |
1794 "Experimental-Result-Code", /* Name */ | |
1795 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1796 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1797 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
1798 }; | |
1799 | |
1800 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
1801 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
1802 } | |
1803 | |
1804 /* Auth-Request-Type */ | |
1805 { | |
1806 /* | |
1807 The Auth-Request-Type AVP (AVP Code 274) is of type Enumerated and is | |
1808 included in application-specific auth requests to inform the peers | |
1809 whether a user is to be authenticated only, authorized only or both. | |
1810 Note any value other than both MAY cause RADIUS interoperability | |
1811 issues. The following values are defined: | |
1812 | |
1813 | |
1814 AUTHENTICATE_ONLY 1 | |
1815 | |
1816 The request being sent is for authentication only, and MUST | |
1817 contain the relevant application specific authentication AVPs that | |
1818 are needed by the Diameter server to authenticate the user. | |
1819 | |
1820 | |
1821 AUTHORIZE_ONLY 2 | |
1822 | |
1823 The request being sent is for authorization only, and MUST contain | |
1824 the application specific authorization AVPs that are necessary to | |
1825 identify the service being requested/offered. | |
1826 | |
1827 | |
1828 AUTHORIZE_AUTHENTICATE 3 | |
1829 | |
1830 The request contains a request for both authentication and | |
1831 authorization. The request MUST include both the relevant | |
1832 application specific authentication information, and authorization | |
1833 information necessary to identify the service being requested/ | |
1834 offered. | |
1835 */ | |
1836 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
1837 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Auth-Request-Type)" , NULL, NULL, NULL }; |
0 | 1838 struct dict_enumval_data t_1 = { "AUTHENTICATE_ONLY", { .i32 = 1 }}; |
1839 struct dict_enumval_data t_2 = { "AUTHORIZE_ONLY", { .i32 = 2 }}; | |
1840 struct dict_enumval_data t_3 = { "AUTHORIZE_AUTHENTICATE", { .i32 = 3 }}; | |
1841 struct dict_avp_data data = { | |
1842 274, /* Code */ | |
1843 0, /* Vendor */ | |
1844 "Auth-Request-Type", /* Name */ | |
1845 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1846 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1847 AVP_TYPE_INTEGER32 /* base type of data */ | |
1848 }; | |
1849 /* Create the Enumerated type, and then the AVP */ | |
1850 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
1851 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
1852 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
1853 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
1854 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
1855 } | |
1856 | |
1857 /* Session-Id */ | |
1858 { | |
1859 /* | |
1860 The Session-Id AVP (AVP Code 263) is of type UTF8String and is used | |
1861 to identify a specific session (see Section 8). All messages | |
1862 pertaining to a specific session MUST include only one Session-Id AVP | |
1863 and the same value MUST be used throughout the life of a session. | |
1864 When present, the Session-Id SHOULD appear immediately following the | |
1865 Diameter Header (see Section 3). | |
1866 | |
1867 The Session-Id MUST be globally and eternally unique, as it is meant | |
1868 to uniquely identify a user session without reference to any other | |
1869 information, and may be needed to correlate historical authentication | |
1870 information with accounting information. The Session-Id includes a | |
1871 mandatory portion and an implementation-defined portion; a | |
1872 recommended format for the implementation-defined portion is outlined | |
1873 below. | |
1874 | |
1875 (skipped, see RFC for detail) | |
1876 */ | |
1877 struct dict_avp_data data = { | |
1878 263, /* Code */ | |
1879 #if AC_SESSION_ID != 263 | |
1880 #error "AC_SESSION_ID definition mismatch" | |
1881 #endif | |
1882 0, /* Vendor */ | |
1883 "Session-Id", /* Name */ | |
1884 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1885 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1886 AVP_TYPE_OCTETSTRING /* base type of data */ | |
1887 }; | |
1888 CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); | |
1889 } | |
1890 | |
1891 /* Authorization-Lifetime */ | |
1892 { | |
1893 /* | |
1894 The Authorization-Lifetime AVP (AVP Code 291) is of type Unsigned32 | |
1895 and contains the maximum number of seconds of service to be provided | |
1896 to the user before the user is to be re-authenticated and/or re- | |
1897 authorized. Great care should be taken when the Authorization- | |
1898 Lifetime value is determined, since a low, non-zero, value could | |
1899 create significant Diameter traffic, which could congest both the | |
1900 network and the agents. | |
1901 | |
1902 A value of zero (0) means that immediate re-auth is necessary by the | |
1903 access device. This is typically used in cases where multiple | |
1904 authentication methods are used, and a successful auth response with | |
1905 this AVP set to zero is used to signal that the next authentication | |
1906 method is to be immediately initiated. The absence of this AVP, or a | |
1907 value of all ones (meaning all bits in the 32 bit field are set to | |
1908 one) means no re-auth is expected. | |
1909 | |
1910 If both this AVP and the Session-Timeout AVP are present in a | |
1911 message, the value of the latter MUST NOT be smaller than the | |
1912 Authorization-Lifetime AVP. | |
1913 | |
1914 An Authorization-Lifetime AVP MAY be present in re-authorization | |
1915 messages, and contains the number of seconds the user is authorized | |
1916 to receive service from the time the re-auth answer message is | |
1917 received by the access device. | |
1918 | |
1919 This AVP MAY be provided by the client as a hint of the maximum | |
1920 lifetime that it is willing to accept. However, the server MAY | |
1921 return a value that is equal to, or smaller, than the one provided by | |
1922 the client. | |
1923 */ | |
1924 struct dict_avp_data data = { | |
1925 291, /* Code */ | |
1926 0, /* Vendor */ | |
1927 "Authorization-Lifetime", /* Name */ | |
1928 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1929 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1930 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
1931 }; | |
1932 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
1933 } | |
1934 | |
1935 /* Auth-Grace-Period */ | |
1936 { | |
1937 /* | |
1938 The Auth-Grace-Period AVP (AVP Code 276) is of type Unsigned32 and | |
1939 contains the number of seconds the Diameter server will wait | |
1940 following the expiration of the Authorization-Lifetime AVP before | |
1941 cleaning up resources for the session. | |
1942 */ | |
1943 struct dict_avp_data data = { | |
1944 276, /* Code */ | |
1945 0, /* Vendor */ | |
1946 "Auth-Grace-Period", /* Name */ | |
1947 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1948 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1949 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
1950 }; | |
1951 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
1952 } | |
1953 | |
1954 /* Auth-Session-State */ | |
1955 { | |
1956 /* | |
1957 The Auth-Session-State AVP (AVP Code 277) is of type Enumerated and | |
1958 specifies whether state is maintained for a particular session. The | |
1959 client MAY include this AVP in requests as a hint to the server, but | |
1960 the value in the server's answer message is binding. The following | |
1961 values are supported: | |
1962 | |
1963 | |
1964 STATE_MAINTAINED 0 | |
1965 | |
1966 This value is used to specify that session state is being | |
1967 maintained, and the access device MUST issue a session termination | |
1968 message when service to the user is terminated. This is the | |
1969 default value. | |
1970 | |
1971 | |
1972 NO_STATE_MAINTAINED 1 | |
1973 | |
1974 This value is used to specify that no session termination messages | |
1975 will be sent by the access device upon expiration of the | |
1976 Authorization-Lifetime. | |
1977 */ | |
1978 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
1979 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Auth-Session-State)" , NULL, NULL, NULL }; |
0 | 1980 struct dict_enumval_data t_0 = { "STATE_MAINTAINED", { .i32 = 0 }}; |
1981 struct dict_enumval_data t_1 = { "NO_STATE_MAINTAINED", { .i32 = 1 }}; | |
1982 struct dict_avp_data data = { | |
1983 277, /* Code */ | |
1984 0, /* Vendor */ | |
1985 "Auth-Session-State", /* Name */ | |
1986 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
1987 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
1988 AVP_TYPE_INTEGER32 /* base type of data */ | |
1989 }; | |
1990 /* Create the Enumerated type, and then the AVP */ | |
1991 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
1992 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
1993 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
1994 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
1995 } | |
1996 | |
1997 /* Re-Auth-Request-Type */ | |
1998 { | |
1999 /* | |
2000 The Re-Auth-Request-Type AVP (AVP Code 285) is of type Enumerated and | |
2001 is included in application-specific auth answers to inform the client | |
2002 of the action expected upon expiration of the Authorization-Lifetime. | |
2003 If the answer message contains an Authorization-Lifetime AVP with a | |
2004 positive value, the Re-Auth-Request-Type AVP MUST be present in an | |
2005 answer message. The following values are defined: | |
2006 | |
2007 | |
2008 AUTHORIZE_ONLY 0 | |
2009 | |
2010 An authorization only re-auth is expected upon expiration of the | |
2011 Authorization-Lifetime. This is the default value if the AVP is | |
2012 not present in answer messages that include the Authorization- | |
2013 Lifetime. | |
2014 | |
2015 | |
2016 AUTHORIZE_AUTHENTICATE 1 | |
2017 | |
2018 An authentication and authorization re-auth is expected upon | |
2019 expiration of the Authorization-Lifetime. | |
2020 */ | |
2021 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2022 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Re-Auth-Request-Type)" , NULL, NULL, NULL }; |
0 | 2023 struct dict_enumval_data t_0 = { "AUTHORIZE_ONLY", { .i32 = 0 }}; |
2024 struct dict_enumval_data t_1 = { "AUTHORIZE_AUTHENTICATE", { .i32 = 1 }}; | |
2025 struct dict_avp_data data = { | |
2026 285, /* Code */ | |
2027 0, /* Vendor */ | |
2028 "Re-Auth-Request-Type", /* Name */ | |
2029 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2030 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2031 AVP_TYPE_INTEGER32 /* base type of data */ | |
2032 }; | |
2033 /* Create the Enumerated type, and then the AVP */ | |
2034 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2035 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
2036 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2037 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2038 } | |
2039 | |
2040 /* Session-Timeout */ | |
2041 { | |
2042 /* | |
2043 The Session-Timeout AVP (AVP Code 27) [RFC2865] is of type Unsigned32 | |
2044 and contains the maximum number of seconds of service to be provided | |
2045 to the user before termination of the session. When both the | |
2046 Session-Timeout and the Authorization-Lifetime AVPs are present in an | |
2047 answer message, the former MUST be equal to or greater than the value | |
2048 of the latter. | |
2049 | |
2050 A session that terminates on an access device due to the expiration | |
2051 of the Session-Timeout MUST cause an STR to be issued, unless both | |
2052 the access device and the home server had previously agreed that no | |
2053 session termination messages would be sent (see Section 8.11). | |
2054 | |
2055 A Session-Timeout AVP MAY be present in a re-authorization answer | |
2056 message, and contains the remaining number of seconds from the | |
2057 beginning of the re-auth. | |
2058 | |
2059 A value of zero, or the absence of this AVP, means that this session | |
2060 has an unlimited number of seconds before termination. | |
2061 | |
2062 This AVP MAY be provided by the client as a hint of the maximum | |
2063 timeout that it is willing to accept. However, the server MAY return | |
2064 a value that is equal to, or smaller, than the one provided by the | |
2065 client. | |
2066 */ | |
2067 struct dict_avp_data data = { | |
2068 27, /* Code */ | |
2069 0, /* Vendor */ | |
2070 "Session-Timeout", /* Name */ | |
2071 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2072 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2073 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2074 }; | |
2075 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2076 } | |
2077 | |
2078 /* User-Name */ | |
2079 { | |
2080 /* | |
2081 The User-Name AVP (AVP Code 1) [RFC2865] is of type UTF8String, which | |
2082 contains the User-Name, in a format consistent with the NAI | |
2083 specification [RFC4282]. | |
2084 */ | |
2085 struct dict_avp_data data = { | |
2086 1, /* Code */ | |
2087 0, /* Vendor */ | |
2088 "User-Name", /* Name */ | |
2089 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2090 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2091 AVP_TYPE_OCTETSTRING /* base type of data */ | |
2092 }; | |
2093 CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); | |
2094 } | |
2095 | |
2096 /* Termination-Cause */ | |
2097 { | |
2098 /* | |
2099 The Termination-Cause AVP (AVP Code 295) is of type Enumerated, and | |
2100 is used to indicate the reason why a session was terminated on the | |
2101 access device. The following values are defined: | |
2102 | |
2103 | |
2104 DIAMETER_LOGOUT 1 | |
2105 | |
2106 The user initiated a disconnect | |
2107 | |
2108 | |
2109 DIAMETER_SERVICE_NOT_PROVIDED 2 | |
2110 | |
2111 This value is used when the user disconnected prior to the receipt | |
2112 of the authorization answer message. | |
2113 | |
2114 | |
2115 DIAMETER_BAD_ANSWER 3 | |
2116 | |
2117 This value indicates that the authorization answer received by the | |
2118 access device was not processed successfully. | |
2119 | |
2120 | |
2121 DIAMETER_ADMINISTRATIVE 4 | |
2122 | |
2123 The user was not granted access, or was disconnected, due to | |
2124 administrative reasons, such as the receipt of a Abort-Session- | |
2125 Request message. | |
2126 | |
2127 | |
2128 DIAMETER_LINK_BROKEN 5 | |
2129 | |
2130 The communication to the user was abruptly disconnected. | |
2131 | |
2132 | |
2133 DIAMETER_AUTH_EXPIRED 6 | |
2134 | |
2135 The user's access was terminated since its authorized session time | |
2136 has expired. | |
2137 | |
2138 | |
2139 DIAMETER_USER_MOVED 7 | |
2140 | |
2141 The user is receiving services from another access device. | |
2142 | |
2143 | |
2144 DIAMETER_SESSION_TIMEOUT 8 | |
2145 | |
2146 The user's session has timed out, and service has been terminated. | |
2147 */ | |
2148 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2149 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Termination-Cause)" , NULL, NULL, NULL }; |
0 | 2150 struct dict_enumval_data t_1 = { "DIAMETER_LOGOUT", { .i32 = 1 }}; |
2151 struct dict_enumval_data t_2 = { "DIAMETER_SERVICE_NOT_PROVIDED", { .i32 = 2 }}; | |
2152 struct dict_enumval_data t_3 = { "DIAMETER_BAD_ANSWER", { .i32 = 3 }}; | |
2153 struct dict_enumval_data t_4 = { "DIAMETER_ADMINISTRATIVE", { .i32 = 4 }}; | |
2154 struct dict_enumval_data t_5 = { "DIAMETER_LINK_BROKEN", { .i32 = 5 }}; | |
2155 struct dict_enumval_data t_6 = { "DIAMETER_AUTH_EXPIRED", { .i32 = 6 }}; | |
2156 struct dict_enumval_data t_7 = { "DIAMETER_USER_MOVED", { .i32 = 7 }}; | |
2157 struct dict_enumval_data t_8 = { "DIAMETER_SESSION_TIMEOUT", { .i32 = 8 }}; | |
2158 struct dict_avp_data data = { | |
2159 295, /* Code */ | |
2160 0, /* Vendor */ | |
2161 "Termination-Cause", /* Name */ | |
2162 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2163 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2164 AVP_TYPE_INTEGER32 /* base type of data */ | |
2165 }; | |
2166 /* Create the Enumerated type, and then the AVP */ | |
2167 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2168 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2169 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
2170 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
2171 CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); | |
2172 CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); | |
2173 CHECK_dict_new( DICT_ENUMVAL, &t_6 , type, NULL); | |
2174 CHECK_dict_new( DICT_ENUMVAL, &t_7 , type, NULL); | |
2175 CHECK_dict_new( DICT_ENUMVAL, &t_8 , type, NULL); | |
2176 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2177 } | |
2178 | |
2179 /* Origin-State-Id */ | |
2180 { | |
2181 /* | |
2182 The Origin-State-Id AVP (AVP Code 278), of type Unsigned32, is a | |
2183 monotonically increasing value that is advanced whenever a Diameter | |
2184 entity restarts with loss of previous state, for example upon reboot. | |
2185 Origin-State-Id MAY be included in any Diameter message, including | |
2186 CER. | |
2187 | |
2188 A Diameter entity issuing this AVP MUST create a higher value for | |
2189 this AVP each time its state is reset. A Diameter entity MAY set | |
2190 Origin-State-Id to the time of startup, or it MAY use an incrementing | |
2191 counter retained in non-volatile memory across restarts. | |
2192 | |
2193 The Origin-State-Id, if present, MUST reflect the state of the entity | |
2194 indicated by Origin-Host. If a proxy modifies Origin-Host, it MUST | |
2195 either remove Origin-State-Id or modify it appropriately as well. | |
2196 Typically, Origin-State-Id is used by an access device that always | |
2197 starts up with no active sessions; that is, any session active prior | |
2198 to restart will have been lost. By including Origin-State-Id in a | |
2199 message, it allows other Diameter entities to infer that sessions | |
2200 associated with a lower Origin-State-Id are no longer active. If an | |
2201 access device does not intend for such inferences to be made, it MUST | |
2202 either not include Origin-State-Id in any message, or set its value | |
2203 to 0. | |
2204 */ | |
2205 struct dict_avp_data data = { | |
2206 278, /* Code */ | |
2207 0, /* Vendor */ | |
2208 "Origin-State-Id", /* Name */ | |
2209 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2210 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2211 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2212 }; | |
2213 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2214 } | |
2215 | |
2216 /* Session-Binding */ | |
2217 { | |
2218 /* | |
2219 The Session-Binding AVP (AVP Code 270) is of type Unsigned32, and MAY | |
2220 be present in application-specific authorization answer messages. If | |
2221 present, this AVP MAY inform the Diameter client that all future | |
2222 application-specific re-auth messages for this session MUST be sent | |
2223 to the same authorization server. This AVP MAY also specify that a | |
2224 Session-Termination-Request message for this session MUST be sent to | |
2225 the same authorizing server. | |
2226 | |
2227 This field is a bit mask, and the following bits have been defined: | |
2228 | |
2229 | |
2230 RE_AUTH 1 | |
2231 | |
2232 When set, future re-auth messages for this session MUST NOT | |
2233 include the Destination-Host AVP. When cleared, the default | |
2234 value, the Destination-Host AVP MUST be present in all re-auth | |
2235 messages for this session. | |
2236 | |
2237 | |
2238 STR 2 | |
2239 | |
2240 When set, the STR message for this session MUST NOT include the | |
2241 Destination-Host AVP. When cleared, the default value, the | |
2242 Destination-Host AVP MUST be present in the STR message for this | |
2243 session. | |
2244 | |
2245 | |
2246 ACCOUNTING 4 | |
2247 | |
2248 When set, all accounting messages for this session MUST NOT | |
2249 include the Destination-Host AVP. When cleared, the default | |
2250 value, the Destination-Host AVP, if known, MUST be present in all | |
2251 accounting messages for this session. | |
2252 */ | |
2253 | |
2254 /* Although the RFC does not specify an "Enumerated" type here, we go forward and create one. | |
2255 * This is the reason for the "*" in the type name | |
2256 * The actual values of the AVP will not always be defined here, but at least it can be used in some cases. | |
2257 * ... maybe the code will be changed later to support bitfields AVP ... | |
2258 */ | |
2259 | |
2260 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2261 struct dict_type_data tdata = { AVP_TYPE_UNSIGNED32, "Enumerated*(Session-Binding)" , NULL, NULL, NULL }; |
0 | 2262 struct dict_enumval_data t_1 = { "RE_AUTH", { .u32 = 1 }}; |
2263 struct dict_enumval_data t_2 = { "STR", { .u32 = 2 }}; | |
2264 struct dict_enumval_data t_4 = { "ACCOUNTING", { .u32 = 4 }}; | |
2265 struct dict_avp_data data = { | |
2266 270, /* Code */ | |
2267 0, /* Vendor */ | |
2268 "Session-Binding", /* Name */ | |
2269 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2270 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2271 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2272 }; | |
2273 /* Create the Enumerated type, and then the AVP */ | |
2274 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2275 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2276 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
2277 CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); | |
2278 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2279 } | |
2280 | |
2281 /* Session-Server-Failover */ | |
2282 { | |
2283 /* | |
2284 The Session-Server-Failover AVP (AVP Code 271) is of type Enumerated, | |
2285 and MAY be present in application-specific authorization answer | |
2286 messages that either do not include the Session-Binding AVP or | |
2287 include the Session-Binding AVP with any of the bits set to a zero | |
2288 value. If present, this AVP MAY inform the Diameter client that if a | |
2289 re-auth or STR message fails due to a delivery problem, the Diameter | |
2290 client SHOULD issue a subsequent message without the Destination-Host | |
2291 AVP. When absent, the default value is REFUSE_SERVICE. | |
2292 | |
2293 The following values are supported: | |
2294 | |
2295 | |
2296 REFUSE_SERVICE 0 | |
2297 | |
2298 If either the re-auth or the STR message delivery fails, terminate | |
2299 service with the user, and do not attempt any subsequent attempts. | |
2300 | |
2301 | |
2302 TRY_AGAIN 1 | |
2303 | |
2304 If either the re-auth or the STR message delivery fails, resend | |
2305 the failed message without the Destination-Host AVP present. | |
2306 | |
2307 | |
2308 ALLOW_SERVICE 2 | |
2309 | |
2310 If re-auth message delivery fails, assume that re-authorization | |
2311 succeeded. If STR message delivery fails, terminate the session. | |
2312 | |
2313 | |
2314 TRY_AGAIN_ALLOW_SERVICE 3 | |
2315 | |
2316 If either the re-auth or the STR message delivery fails, resend | |
2317 the failed message without the Destination-Host AVP present. If | |
2318 the second delivery fails for re-auth, assume re-authorization | |
2319 succeeded. If the second delivery fails for STR, terminate the | |
2320 session. | |
2321 */ | |
2322 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2323 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Session-Server-Failover)" , NULL, NULL, NULL }; |
0 | 2324 struct dict_enumval_data t_0 = { "REFUSE_SERVICE", { .i32 = 0 }}; |
2325 struct dict_enumval_data t_1 = { "TRY_AGAIN", { .i32 = 1 }}; | |
2326 struct dict_enumval_data t_2 = { "ALLOW_SERVICE", { .i32 = 2 }}; | |
2327 struct dict_enumval_data t_3 = { "TRY_AGAIN_ALLOW_SERVICE", { .i32 = 3 }}; | |
2328 struct dict_avp_data data = { | |
2329 271, /* Code */ | |
2330 0, /* Vendor */ | |
2331 "Session-Server-Failover", /* Name */ | |
2332 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2333 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2334 AVP_TYPE_INTEGER32 /* base type of data */ | |
2335 }; | |
2336 /* Create the Enumerated type, and then the AVP */ | |
2337 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2338 CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); | |
2339 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2340 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
2341 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
2342 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2343 } | |
2344 | |
2345 /* Multi-Round-Time-Out */ | |
2346 { | |
2347 /* | |
2348 The Multi-Round-Time-Out AVP (AVP Code 272) is of type Unsigned32, | |
2349 and SHOULD be present in application-specific authorization answer | |
2350 messages whose Result-Code AVP is set to DIAMETER_MULTI_ROUND_AUTH. | |
2351 This AVP contains the maximum number of seconds that the access | |
2352 device MUST provide the user in responding to an authentication | |
2353 request. | |
2354 */ | |
2355 struct dict_avp_data data = { | |
2356 272, /* Code */ | |
2357 0, /* Vendor */ | |
2358 "Multi-Round-Time-Out", /* Name */ | |
2359 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2360 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2361 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2362 }; | |
2363 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2364 } | |
2365 | |
2366 /* Class */ | |
2367 { | |
2368 /* | |
2369 The Class AVP (AVP Code 25) is of type OctetString and is used to by | |
2370 Diameter servers to return state information to the access device. | |
2371 When one or more Class AVPs are present in application-specific | |
2372 authorization answer messages, they MUST be present in subsequent re- | |
2373 authorization, session termination and accounting messages. Class | |
2374 AVPs found in a re-authorization answer message override the ones | |
2375 found in any previous authorization answer message. Diameter server | |
2376 implementations SHOULD NOT return Class AVPs that require more than | |
2377 4096 bytes of storage on the Diameter client. A Diameter client that | |
2378 receives Class AVPs whose size exceeds local available storage MUST | |
2379 terminate the session. | |
2380 */ | |
2381 struct dict_avp_data data = { | |
2382 25, /* Code */ | |
2383 0, /* Vendor */ | |
2384 "Class", /* Name */ | |
2385 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2386 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2387 AVP_TYPE_OCTETSTRING /* base type of data */ | |
2388 }; | |
2389 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2390 } | |
2391 | |
2392 /* Event-Timestamp */ | |
2393 { | |
2394 /* | |
2395 The Event-Timestamp (AVP Code 55) is of type Time, and MAY be | |
2396 included in an Accounting-Request and Accounting-Answer messages to | |
2397 record the time that the reported event occurred, in seconds since | |
2398 January 1, 1900 00:00 UTC. | |
2399 */ | |
2400 struct dict_avp_data data = { | |
2401 55, /* Code */ | |
2402 0, /* Vendor */ | |
2403 "Event-Timestamp", /* Name */ | |
2404 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2405 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2406 AVP_TYPE_OCTETSTRING /* base type of data */ | |
2407 }; | |
2408 CHECK_dict_new( DICT_AVP, &data , Time_type, NULL); | |
2409 } | |
2410 | |
2411 | |
2412 /* Accounting-Record-Type */ | |
2413 { | |
2414 /* | |
2415 The Accounting-Record-Type AVP (AVP Code 480) is of type Enumerated | |
2416 and contains the type of accounting record being sent. The following | |
2417 values are currently defined for the Accounting-Record-Type AVP: | |
2418 | |
2419 | |
2420 EVENT_RECORD 1 | |
2421 | |
2422 An Accounting Event Record is used to indicate that a one-time | |
2423 event has occurred (meaning that the start and end of the event | |
2424 are simultaneous). This record contains all information relevant | |
2425 to the service, and is the only record of the service. | |
2426 | |
2427 | |
2428 START_RECORD 2 | |
2429 | |
2430 An Accounting Start, Interim, and Stop Records are used to | |
2431 indicate that a service of a measurable length has been given. An | |
2432 Accounting Start Record is used to initiate an accounting session, | |
2433 and contains accounting information that is relevant to the | |
2434 initiation of the session. | |
2435 | |
2436 | |
2437 INTERIM_RECORD 3 | |
2438 | |
2439 An Interim Accounting Record contains cumulative accounting | |
2440 information for an existing accounting session. Interim | |
2441 Accounting Records SHOULD be sent every time a re-authentication | |
2442 or re-authorization occurs. Further, additional interim record | |
2443 triggers MAY be defined by application-specific Diameter | |
2444 applications. The selection of whether to use INTERIM_RECORD | |
2445 records is done by the Acct-Interim-Interval AVP. | |
2446 | |
2447 | |
2448 STOP_RECORD 4 | |
2449 | |
2450 An Accounting Stop Record is sent to terminate an accounting | |
2451 session and contains cumulative accounting information relevant to | |
2452 the existing session. | |
2453 */ | |
2454 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2455 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Accounting-Record-Type)" , NULL, NULL, NULL }; |
0 | 2456 struct dict_enumval_data t_1 = { "EVENT_RECORD", { .i32 = 1 }}; |
2457 struct dict_enumval_data t_2 = { "START_RECORD", { .i32 = 2 }}; | |
2458 struct dict_enumval_data t_3 = { "INTERIM_RECORD", { .i32 = 3 }}; | |
2459 struct dict_enumval_data t_4 = { "STOP_RECORD", { .i32 = 4 }}; | |
2460 struct dict_avp_data data = { | |
2461 480, /* Code */ | |
2462 0, /* Vendor */ | |
2463 "Accounting-Record-Type", /* Name */ | |
2464 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2465 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2466 AVP_TYPE_INTEGER32 /* base type of data */ | |
2467 }; | |
2468 /* Create the Enumerated type, and then the AVP */ | |
2469 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2470 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2471 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
2472 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
2473 CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); | |
2474 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2475 } | |
2476 | |
2477 /* Acct-Interim-Interval */ | |
2478 { | |
2479 /* | |
2480 The Acct-Interim-Interval AVP (AVP Code 85) is of type Unsigned32 and | |
2481 is sent from the Diameter home authorization server to the Diameter | |
2482 client. The client uses information in this AVP to decide how and | |
2483 when to produce accounting records. With different values in this | |
2484 AVP, service sessions can result in one, two, or two+N accounting | |
2485 records, based on the needs of the home-organization. The following | |
2486 accounting record production behavior is directed by the inclusion of | |
2487 this AVP: | |
2488 | |
2489 | |
2490 1. The omission of the Acct-Interim-Interval AVP or its inclusion | |
2491 with Value field set to 0 means that EVENT_RECORD, START_RECORD, | |
2492 and STOP_RECORD are produced, as appropriate for the service. | |
2493 | |
2494 | |
2495 2. The inclusion of the AVP with Value field set to a non-zero value | |
2496 means that INTERIM_RECORD records MUST be produced between the | |
2497 START_RECORD and STOP_RECORD records. The Value field of this | |
2498 AVP is the nominal interval between these records in seconds. | |
2499 | |
2500 The Diameter node that originates the accounting information, | |
2501 known as the client, MUST produce the first INTERIM_RECORD record | |
2502 roughly at the time when this nominal interval has elapsed from | |
2503 the START_RECORD, the next one again as the interval has elapsed | |
2504 once more, and so on until the session ends and a STOP_RECORD | |
2505 record is produced. | |
2506 | |
2507 The client MUST ensure that the interim record production times | |
2508 are randomized so that large accounting message storms are not | |
2509 created either among records or around a common service start | |
2510 time. | |
2511 */ | |
2512 struct dict_avp_data data = { | |
2513 85, /* Code */ | |
2514 0, /* Vendor */ | |
2515 "Acct-Interim-Interval", /* Name */ | |
2516 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2517 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2518 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2519 }; | |
2520 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2521 } | |
2522 | |
2523 /* Accounting-Record-Number */ | |
2524 { | |
2525 /* | |
2526 The Accounting-Record-Number AVP (AVP Code 485) is of type Unsigned32 | |
2527 and identifies this record within one session. As Session-Id AVPs | |
2528 are globally unique, the combination of Session-Id and Accounting- | |
2529 Record-Number AVPs is also globally unique, and can be used in | |
2530 matching accounting records with confirmations. An easy way to | |
2531 produce unique numbers is to set the value to 0 for records of type | |
2532 EVENT_RECORD and START_RECORD, and set the value to 1 for the first | |
2533 INTERIM_RECORD, 2 for the second, and so on until the value for | |
2534 STOP_RECORD is one more than for the last INTERIM_RECORD. | |
2535 */ | |
2536 struct dict_avp_data data = { | |
2537 485, /* Code */ | |
2538 0, /* Vendor */ | |
2539 "Accounting-Record-Number", /* Name */ | |
2540 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2541 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2542 AVP_TYPE_UNSIGNED32 /* base type of data */ | |
2543 }; | |
2544 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2545 } | |
2546 | |
2547 /* Acct-Session-Id */ | |
2548 { | |
2549 /* | |
2550 The Acct-Session-Id AVP (AVP Code 44) is of type OctetString is only | |
2551 used when RADIUS/Diameter translation occurs. This AVP contains the | |
2552 contents of the RADIUS Acct-Session-Id attribute. | |
2553 */ | |
2554 struct dict_avp_data data = { | |
2555 44, /* Code */ | |
2556 0, /* Vendor */ | |
2557 "Acct-Session-Id", /* Name */ | |
2558 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2559 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2560 AVP_TYPE_OCTETSTRING /* base type of data */ | |
2561 }; | |
2562 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2563 } | |
2564 | |
2565 /* Acct-Multi-Session-Id */ | |
2566 { | |
2567 /* | |
2568 The Acct-Multi-Session-Id AVP (AVP Code 50) is of type UTF8String, | |
2569 following the format specified in Section 8.8. The Acct-Multi- | |
2570 Session-Id AVP is used to link together multiple related accounting | |
2571 sessions, where each session would have a unique Session-Id, but the | |
2572 same Acct-Multi-Session-Id AVP. This AVP MAY be returned by the | |
2573 Diameter server in an authorization answer, and MUST be used in all | |
2574 accounting messages for the given session. | |
2575 */ | |
2576 struct dict_avp_data data = { | |
2577 50, /* Code */ | |
2578 0, /* Vendor */ | |
2579 "Acct-Multi-Session-Id", /* Name */ | |
2580 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2581 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2582 AVP_TYPE_OCTETSTRING /* base type of data */ | |
2583 }; | |
2584 CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); | |
2585 } | |
2586 | |
2587 /* Accounting-Sub-Session-Id */ | |
2588 { | |
2589 /* | |
2590 The Accounting-Sub-Session-Id AVP (AVP Code 287) is of type | |
2591 Unsigned64 and contains the accounting sub-session identifier. The | |
2592 combination of the Session-Id and this AVP MUST be unique per sub- | |
2593 session, and the value of this AVP MUST be monotonically increased by | |
2594 one for all new sub-sessions. The absence of this AVP implies no | |
2595 sub-sessions are in use, with the exception of an Accounting-Request | |
2596 whose Accounting-Record-Type is set to STOP_RECORD. A STOP_RECORD | |
2597 message with no Accounting-Sub-Session-Id AVP present will signal the | |
2598 termination of all sub-sessions for a given Session-Id. | |
2599 */ | |
2600 struct dict_avp_data data = { | |
2601 287, /* Code */ | |
2602 0, /* Vendor */ | |
2603 "Accounting-Sub-Session-Id", /* Name */ | |
2604 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2605 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2606 AVP_TYPE_UNSIGNED64 /* base type of data */ | |
2607 }; | |
2608 CHECK_dict_new( DICT_AVP, &data , NULL, NULL); | |
2609 } | |
2610 | |
2611 /* Accounting-Realtime-Required */ | |
2612 { | |
2613 /* | |
2614 The Accounting-Realtime-Required AVP (AVP Code 483) is of type | |
2615 Enumerated and is sent from the Diameter home authorization server to | |
2616 the Diameter client or in the Accounting-Answer from the accounting | |
2617 server. The client uses information in this AVP to decide what to do | |
2618 if the sending of accounting records to the accounting server has | |
2619 been temporarily prevented due to, for instance, a network problem. | |
2620 | |
2621 | |
2622 DELIVER_AND_GRANT 1 | |
2623 | |
2624 The AVP with Value field set to DELIVER_AND_GRANT means that the | |
2625 service MUST only be granted as long as there is a connection to | |
2626 an accounting server. Note that the set of alternative accounting | |
2627 servers are treated as one server in this sense. Having to move | |
2628 the accounting record stream to a backup server is not a reason to | |
2629 discontinue the service to the user. | |
2630 | |
2631 | |
2632 GRANT_AND_STORE 2 | |
2633 | |
2634 The AVP with Value field set to GRANT_AND_STORE means that service | |
2635 SHOULD be granted if there is a connection, or as long as records | |
2636 can still be stored as described in Section 9.4. | |
2637 | |
2638 This is the default behavior if the AVP isn't included in the | |
2639 reply from the authorization server. | |
2640 | |
2641 | |
2642 GRANT_AND_LOSE 3 | |
2643 | |
2644 The AVP with Value field set to GRANT_AND_LOSE means that service | |
2645 SHOULD be granted even if the records can not be delivered or | |
2646 stored. | |
2647 */ | |
2648 struct dict_object * type; | |
156
e2dc300819b3
Fix overwriten thread location
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
119
diff
changeset
|
2649 struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Accounting-Realtime-Required)" , NULL, NULL, NULL }; |
0 | 2650 struct dict_enumval_data t_1 = { "DELIVER_AND_GRANT", { .i32 = 1 }}; |
2651 struct dict_enumval_data t_2 = { "GRANT_AND_STORE", { .i32 = 2 }}; | |
2652 struct dict_enumval_data t_3 = { "GRANT_AND_LOSE", { .i32 = 3 }}; | |
2653 struct dict_avp_data data = { | |
2654 483, /* Code */ | |
2655 0, /* Vendor */ | |
2656 "Accounting-Realtime-Required", /* Name */ | |
2657 AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ | |
2658 AVP_FLAG_MANDATORY, /* Fixed flag values */ | |
2659 AVP_TYPE_INTEGER32 /* base type of data */ | |
2660 }; | |
2661 /* Create the Enumerated type, and then the AVP */ | |
2662 CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); | |
2663 CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); | |
2664 CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); | |
2665 CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); | |
2666 CHECK_dict_new( DICT_AVP, &data , type, NULL); | |
2667 } | |
2668 | |
2669 } | |
2670 | |
2671 /* Commands section */ | |
2672 { | |
2673 /* To avoid defining global variables for all the AVP that we use here, we do search the dictionary in each sub-block. | |
2674 * This is far from optimal, but the code is clearer like this, and the time it requires at execution is not noticeable. | |
2675 */ | |
2676 | |
2677 /* Generic message syntax when the 'E' bit is set */ | |
2678 { | |
2679 /* | |
2680 The 'E' (Error Bit) in the Diameter header is set when the request | |
2681 caused a protocol-related error (see Section 7.1.3). A message with | |
2682 the 'E' bit MUST NOT be sent as a response to an answer message. | |
2683 Note that a message with the 'E' bit set is still subjected to the | |
2684 processing rules defined in Section 6.2. When set, the answer | |
2685 message will not conform to the ABNF specification for the command, | |
2686 and will instead conform to the following ABNF: | |
2687 | |
2688 Message Format | |
2689 | |
2690 <answer-message> ::= < Diameter Header: code, ERR [PXY] > | |
2691 0*1< Session-Id > | |
2692 { Origin-Host } | |
2693 { Origin-Realm } | |
2694 { Result-Code } | |
2695 [ Origin-State-Id ] | |
2696 [ Error-Message ] | |
2697 [ Error-Reporting-Host ] | |
2698 [ Failed-AVP ] | |
2699 * [ Proxy-Info ] | |
2700 * [ AVP ] | |
2701 | |
2702 Note that the code used in the header is the same than the one found | |
2703 in the request message, but with the 'R' bit cleared and the 'E' bit | |
2704 set. The 'P' bit in the header is set to the same value as the one | |
2705 found in the request message. | |
2706 */ | |
2707 struct dict_object * cmd_error; | |
2708 struct local_rules_definition rules[] = | |
2709 { { "Session-Id", RULE_FIXED_HEAD,0, 1 } | |
2710 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2711 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2712 ,{ "Result-Code", RULE_REQUIRED, -1, 1 } | |
2713 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
2714 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
2715 ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } | |
2716 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
2717 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
2718 }; | |
2719 CHECK_FCT( fd_dict_get_error_cmd(dict, &cmd_error) ); | |
2720 PARSE_loc_rules( rules, cmd_error ); | |
2721 } | |
2722 | |
2723 /* Capabilities-Exchange-Request */ | |
2724 { | |
2725 /* | |
2726 The Capabilities-Exchange-Request (CER), indicated by the Command- | |
2727 Code set to 257 and the Command Flags' 'R' bit set, is sent to | |
2728 exchange local capabilities. Upon detection of a transport failure, | |
2729 this message MUST NOT be sent to an alternate peer. | |
2730 | |
2731 When Diameter is run over SCTP [RFC2960], which allows for | |
2732 connections to span multiple interfaces and multiple IP addresses, | |
2733 the Capabilities-Exchange-Request message MUST contain one Host-IP- | |
2734 Address AVP for each potential IP address that MAY be locally used | |
2735 when transmitting Diameter messages. | |
2736 | |
2737 Message Format | |
2738 | |
2739 <CER> ::= < Diameter Header: 257, REQ > | |
2740 { Origin-Host } | |
2741 { Origin-Realm } | |
2742 1* { Host-IP-Address } | |
2743 { Vendor-Id } | |
2744 { Product-Name } | |
2745 [ Origin-State-Id ] | |
2746 * [ Supported-Vendor-Id ] | |
2747 * [ Auth-Application-Id ] | |
2748 * [ Inband-Security-Id ] | |
2749 * [ Acct-Application-Id ] | |
2750 * [ Vendor-Specific-Application-Id ] | |
2751 [ Firmware-Revision ] | |
2752 * [ AVP ] | |
2753 */ | |
2754 struct dict_object * cmd; | |
2755 struct dict_cmd_data data = { | |
2756 257, /* Code */ | |
2757 #if CC_CAPABILITIES_EXCHANGE != 257 | |
2758 #error "CC_CAPABILITIES_EXCHANGE definition mismatch" | |
2759 #endif | |
2760 "Capabilities-Exchange-Request", /* Name */ | |
2761 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT | CMD_FLAG_ERROR, /* Fixed flags */ | |
2762 CMD_FLAG_REQUEST /* Fixed flag values */ | |
2763 }; | |
2764 struct local_rules_definition rules[] = | |
2765 { { "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2766 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2767 ,{ "Host-IP-Address", RULE_REQUIRED, -1,-1 } | |
2768 ,{ "Vendor-Id", RULE_REQUIRED, -1, 1 } | |
2769 ,{ "Product-Name", RULE_REQUIRED, -1, 1 } | |
2770 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
2771 ,{ "Supported-Vendor-Id", RULE_OPTIONAL, -1,-1 } | |
2772 ,{ "Auth-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2773 ,{ "Inband-Security-Id", RULE_OPTIONAL, -1,-1 } | |
2774 ,{ "Acct-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2775 ,{ "Vendor-Specific-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2776 ,{ "Firmware-Revision", RULE_OPTIONAL, -1, 1 } | |
2777 }; | |
2778 | |
2779 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2780 PARSE_loc_rules( rules, cmd ); | |
2781 } | |
2782 | |
2783 /* Capabilities-Exchange-Answer */ | |
2784 { | |
2785 /* | |
2786 The Capabilities-Exchange-Answer (CEA), indicated by the Command-Code | |
2787 set to 257 and the Command Flags' 'R' bit cleared, is sent in | |
2788 response to a CER message. | |
2789 | |
2790 When Diameter is run over SCTP [RFC2960], which allows connections to | |
2791 span multiple interfaces, hence, multiple IP addresses, the | |
2792 Capabilities-Exchange-Answer message MUST contain one Host-IP-Address | |
2793 AVP for each potential IP address that MAY be locally used when | |
2794 transmitting Diameter messages. | |
2795 | |
2796 Message Format | |
2797 | |
2798 <CEA> ::= < Diameter Header: 257 > | |
2799 { Result-Code } | |
2800 { Origin-Host } | |
2801 { Origin-Realm } | |
2802 1* { Host-IP-Address } | |
2803 { Vendor-Id } | |
2804 { Product-Name } | |
2805 [ Origin-State-Id ] | |
2806 [ Error-Message ] | |
2807 [ Failed-AVP ] | |
2808 * [ Supported-Vendor-Id ] | |
2809 * [ Auth-Application-Id ] | |
2810 * [ Inband-Security-Id ] | |
2811 * [ Acct-Application-Id ] | |
2812 * [ Vendor-Specific-Application-Id ] | |
2813 [ Firmware-Revision ] | |
2814 * [ AVP ] | |
2815 */ | |
2816 struct dict_object * cmd; | |
2817 struct dict_cmd_data data = { | |
2818 257, /* Code */ | |
2819 #if CC_CAPABILITIES_EXCHANGE != 257 | |
2820 #error "CC_CAPABILITIES_EXCHANGE definition mismatch" | |
2821 #endif | |
2822 "Capabilities-Exchange-Answer", /* Name */ | |
2823 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT, /* Fixed flags */ | |
2824 0 /* Fixed flag values */ | |
2825 }; | |
2826 struct local_rules_definition rules[] = | |
2827 { { "Result-Code", RULE_REQUIRED, -1, 1 } | |
2828 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2829 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2830 ,{ "Host-IP-Address", RULE_REQUIRED, -1,-1 } | |
2831 ,{ "Vendor-Id", RULE_REQUIRED, -1, 1 } | |
2832 ,{ "Product-Name", RULE_REQUIRED, -1, 1 } | |
2833 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
2834 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
2835 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
2836 ,{ "Supported-Vendor-Id", RULE_OPTIONAL, -1,-1 } | |
2837 ,{ "Auth-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2838 ,{ "Inband-Security-Id", RULE_OPTIONAL, -1,-1 } | |
2839 ,{ "Acct-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2840 ,{ "Vendor-Specific-Application-Id", RULE_OPTIONAL, -1,-1 } | |
2841 ,{ "Firmware-Revision", RULE_OPTIONAL, -1, 1 } | |
2842 }; | |
2843 | |
2844 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2845 PARSE_loc_rules( rules, cmd ); | |
2846 } | |
2847 | |
2848 /* Disconnect-Peer-Request */ | |
2849 { | |
2850 /* | |
2851 The Disconnect-Peer-Request (DPR), indicated by the Command-Code set | |
2852 to 282 and the Command Flags' 'R' bit set, is sent to a peer to | |
2853 inform its intentions to shutdown the transport connection. Upon | |
2854 detection of a transport failure, this message MUST NOT be sent to an | |
2855 alternate peer. | |
2856 | |
2857 Message Format | |
2858 | |
2859 <DPR> ::= < Diameter Header: 282, REQ > | |
2860 { Origin-Host } | |
2861 { Origin-Realm } | |
2862 { Disconnect-Cause } | |
2863 */ | |
2864 struct dict_object * cmd; | |
2865 struct dict_cmd_data data = { | |
2866 282, /* Code */ | |
2867 #if CC_DISCONNECT_PEER != 282 | |
2868 #error "CC_DISCONNECT_PEER definition mismatch" | |
2869 #endif | |
2870 "Disconnect-Peer-Request", /* Name */ | |
2871 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT | CMD_FLAG_ERROR, /* Fixed flags */ | |
2872 CMD_FLAG_REQUEST /* Fixed flag values */ | |
2873 }; | |
2874 struct local_rules_definition rules[] = | |
2875 { { "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2876 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2877 ,{ "Disconnect-Cause", RULE_REQUIRED, -1, 1 } | |
2878 }; | |
2879 | |
2880 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2881 PARSE_loc_rules( rules, cmd ); | |
2882 } | |
2883 | |
2884 /* Disconnect-Peer-Answer */ | |
2885 { | |
2886 /* | |
2887 The Disconnect-Peer-Answer (DPA), indicated by the Command-Code set | |
2888 to 282 and the Command Flags' 'R' bit cleared, is sent as a response | |
2889 to the Disconnect-Peer-Request message. Upon receipt of this | |
2890 message, the transport connection is shutdown. | |
2891 | |
2892 Message Format | |
2893 | |
2894 <DPA> ::= < Diameter Header: 282 > | |
2895 { Result-Code } | |
2896 { Origin-Host } | |
2897 { Origin-Realm } | |
2898 [ Error-Message ] | |
2899 [ Failed-AVP ] | |
2900 */ | |
2901 struct dict_object * cmd; | |
2902 struct dict_cmd_data data = { | |
2903 282, /* Code */ | |
2904 #if CC_DISCONNECT_PEER != 282 | |
2905 #error "CC_DISCONNECT_PEER definition mismatch" | |
2906 #endif | |
2907 "Disconnect-Peer-Answer", /* Name */ | |
2908 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT, /* Fixed flags */ | |
2909 0 /* Fixed flag values */ | |
2910 }; | |
2911 struct local_rules_definition rules[] = | |
2912 { { "Result-Code", RULE_REQUIRED, -1, 1 } | |
2913 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2914 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2915 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
2916 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
2917 }; | |
2918 | |
2919 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2920 PARSE_loc_rules( rules, cmd ); | |
2921 } | |
2922 | |
2923 /* Device-Watchdog-Request */ | |
2924 { | |
2925 /* | |
2926 The Device-Watchdog-Request (DWR), indicated by the Command-Code set | |
2927 to 280 and the Command Flags' 'R' bit set, is sent to a peer when no | |
2928 traffic has been exchanged between two peers (see Section 5.5.3). | |
2929 Upon detection of a transport failure, this message MUST NOT be sent | |
2930 to an alternate peer. | |
2931 | |
2932 Message Format | |
2933 | |
2934 <DWR> ::= < Diameter Header: 280, REQ > | |
2935 { Origin-Host } | |
2936 { Origin-Realm } | |
2937 [ Origin-State-Id ] | |
2938 */ | |
2939 struct dict_object * cmd; | |
2940 struct dict_cmd_data data = { | |
2941 280, /* Code */ | |
2942 #if CC_DEVICE_WATCHDOG != 280 | |
2943 #error "CC_DEVICE_WATCHDOG definition mismatch" | |
2944 #endif | |
2945 "Device-Watchdog-Request", /* Name */ | |
2946 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT | CMD_FLAG_ERROR, /* Fixed flags */ | |
2947 CMD_FLAG_REQUEST /* Fixed flag values */ | |
2948 }; | |
2949 struct local_rules_definition rules[] = | |
2950 { { "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2951 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2952 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
2953 }; | |
2954 | |
2955 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2956 PARSE_loc_rules( rules, cmd ); | |
2957 } | |
2958 | |
2959 /* Device-Watchdog-Answer */ | |
2960 { | |
2961 /* | |
2962 The Device-Watchdog-Answer (DWA), indicated by the Command-Code set | |
2963 to 280 and the Command Flags' 'R' bit cleared, is sent as a response | |
2964 to the Device-Watchdog-Request message. | |
2965 | |
2966 Message Format | |
2967 | |
2968 <DWA> ::= < Diameter Header: 280 > | |
2969 { Result-Code } | |
2970 { Origin-Host } | |
2971 { Origin-Realm } | |
2972 [ Error-Message ] | |
2973 [ Failed-AVP ] | |
2974 [ Origin-State-Id ] | |
2975 */ | |
2976 struct dict_object * cmd; | |
2977 struct dict_cmd_data data = { | |
2978 280, /* Code */ | |
2979 #if CC_DEVICE_WATCHDOG != 280 | |
2980 #error "CC_DEVICE_WATCHDOG definition mismatch" | |
2981 #endif | |
2982 "Device-Watchdog-Answer", /* Name */ | |
2983 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_RETRANSMIT, /* Fixed flags */ | |
2984 0 /* Fixed flag values */ | |
2985 }; | |
2986 struct local_rules_definition rules[] = | |
2987 { { "Result-Code", RULE_REQUIRED, -1, 1 } | |
2988 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
2989 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
2990 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
2991 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
2992 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
2993 }; | |
2994 | |
2995 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
2996 PARSE_loc_rules( rules, cmd ); | |
2997 } | |
2998 | |
2999 /* Re-Auth-Request */ | |
3000 { | |
3001 /* | |
3002 The Re-Auth-Request (RAR), indicated by the Command-Code set to 258 | |
3003 and the message flags' 'R' bit set, may be sent by any server to the | |
3004 access device that is providing session service, to request that the | |
3005 user be re-authenticated and/or re-authorized. | |
3006 | |
3007 | |
3008 Message Format | |
3009 | |
3010 <RAR> ::= < Diameter Header: 258, REQ, PXY > | |
3011 < Session-Id > | |
3012 { Origin-Host } | |
3013 { Origin-Realm } | |
3014 { Destination-Realm } | |
3015 { Destination-Host } | |
3016 { Auth-Application-Id } | |
3017 { Re-Auth-Request-Type } | |
3018 [ User-Name ] | |
3019 [ Origin-State-Id ] | |
3020 * [ Proxy-Info ] | |
3021 * [ Route-Record ] | |
3022 * [ AVP ] | |
3023 */ | |
3024 struct dict_object * cmd; | |
3025 struct dict_cmd_data data = { | |
3026 258, /* Code */ | |
3027 #if CC_RE_AUTH != 258 | |
3028 #error "CC_RE_AUTH definition mismatch" | |
3029 #endif | |
3030 "Re-Auth-Request", /* Name */ | |
3031 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ | |
3032 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3033 }; | |
3034 struct local_rules_definition rules[] = | |
3035 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3036 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3037 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3038 ,{ "Destination-Realm", RULE_REQUIRED, -1, 1 } | |
3039 ,{ "Destination-Host", RULE_REQUIRED, -1, 1 } | |
3040 ,{ "Auth-Application-Id", RULE_REQUIRED, -1, 1 } | |
3041 ,{ "Re-Auth-Request-Type", RULE_REQUIRED, -1, 1 } | |
3042 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3043 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3044 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3045 ,{ "Route-Record", RULE_OPTIONAL, -1,-1 } | |
3046 }; | |
3047 | |
3048 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3049 PARSE_loc_rules( rules, cmd ); | |
3050 } | |
3051 | |
3052 /* Re-Auth-Answer */ | |
3053 { | |
3054 /* | |
3055 The Re-Auth-Answer (RAA), indicated by the Command-Code set to 258 | |
3056 and the message flags' 'R' bit clear, is sent in response to the RAR. | |
3057 The Result-Code AVP MUST be present, and indicates the disposition of | |
3058 the request. | |
3059 | |
3060 A successful RAA message MUST be followed by an application-specific | |
3061 authentication and/or authorization message. | |
3062 | |
3063 | |
3064 Message Format | |
3065 | |
3066 <RAA> ::= < Diameter Header: 258, PXY > | |
3067 < Session-Id > | |
3068 { Result-Code } | |
3069 { Origin-Host } | |
3070 { Origin-Realm } | |
3071 [ User-Name ] | |
3072 [ Origin-State-Id ] | |
3073 [ Error-Message ] | |
3074 [ Error-Reporting-Host ] | |
3075 [ Failed-AVP ] | |
3076 * [ Redirect-Host ] | |
3077 [ Redirect-Host-Usage ] | |
3078 [ Redirect-Max-Cache-Time ] | |
3079 * [ Proxy-Info ] | |
3080 * [ AVP ] | |
3081 */ | |
3082 struct dict_object * cmd; | |
3083 struct dict_cmd_data data = { | |
3084 258, /* Code */ | |
3085 #if CC_RE_AUTH != 258 | |
3086 #error "CC_RE_AUTH definition mismatch" | |
3087 #endif | |
3088 "Re-Auth-Answer", /* Name */ | |
3089 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flags */ | |
3090 CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3091 }; | |
3092 struct local_rules_definition rules[] = | |
3093 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3094 ,{ "Result-Code", RULE_REQUIRED, -1, 1 } | |
3095 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3096 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3097 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3098 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3099 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
3100 ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } | |
3101 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
3102 ,{ "Redirect-Host", RULE_OPTIONAL, -1,-1 } | |
3103 ,{ "Redirect-Host-Usage", RULE_OPTIONAL, -1, 1 } | |
3104 ,{ "Redirect-Max-Cache-Time", RULE_OPTIONAL, -1, 1 } | |
3105 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3106 }; | |
3107 | |
3108 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3109 PARSE_loc_rules( rules, cmd ); | |
3110 } | |
3111 | |
3112 /* Session-Termination-Request */ | |
3113 { | |
3114 /* | |
3115 The Session-Termination-Request (STR), indicated by the Command-Code | |
3116 set to 275 and the Command Flags' 'R' bit set, is sent by the access | |
3117 device to inform the Diameter Server that an authenticated and/or | |
3118 authorized session is being terminated. | |
3119 | |
3120 | |
3121 Message Format | |
3122 | |
3123 <STR> ::= < Diameter Header: 275, REQ, PXY > | |
3124 < Session-Id > | |
3125 { Origin-Host } | |
3126 { Origin-Realm } | |
3127 { Destination-Realm } | |
3128 { Auth-Application-Id } | |
3129 { Termination-Cause } | |
3130 [ User-Name ] | |
3131 [ Destination-Host ] | |
3132 * [ Class ] | |
3133 [ Origin-State-Id ] | |
3134 * [ Proxy-Info ] | |
3135 * [ Route-Record ] | |
3136 * [ AVP ] | |
3137 */ | |
3138 struct dict_object * cmd; | |
3139 struct dict_cmd_data data = { | |
3140 275, /* Code */ | |
3141 #if CC_SESSION_TERMINATION != 275 | |
3142 #error "CC_SESSION_TERMINATION definition mismatch" | |
3143 #endif | |
3144 "Session-Termination-Request", /* Name */ | |
3145 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ | |
3146 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3147 }; | |
3148 struct local_rules_definition rules[] = | |
3149 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3150 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3151 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3152 ,{ "Destination-Realm", RULE_REQUIRED, -1, 1 } | |
3153 ,{ "Auth-Application-Id", RULE_REQUIRED, -1, 1 } | |
3154 ,{ "Termination-Cause", RULE_REQUIRED, -1, 1 } | |
3155 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3156 ,{ "Destination-Host", RULE_OPTIONAL, -1, 1 } | |
3157 ,{ "Class", RULE_OPTIONAL, -1,-1 } | |
3158 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3159 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3160 ,{ "Route-Record", RULE_OPTIONAL, -1,-1 } | |
3161 }; | |
3162 | |
3163 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3164 PARSE_loc_rules( rules, cmd ); | |
3165 } | |
3166 | |
3167 /* Session-Termination-Answer */ | |
3168 { | |
3169 /* | |
3170 The Session-Termination-Answer (STA), indicated by the Command-Code | |
3171 set to 275 and the message flags' 'R' bit clear, is sent by the | |
3172 Diameter Server to acknowledge the notification that the session has | |
3173 been terminated. The Result-Code AVP MUST be present, and MAY | |
3174 contain an indication that an error occurred while servicing the STR. | |
3175 | |
3176 Upon sending or receipt of the STA, the Diameter Server MUST release | |
3177 all resources for the session indicated by the Session-Id AVP. Any | |
3178 intermediate server in the Proxy-Chain MAY also release any | |
3179 resources, if necessary. | |
3180 | |
3181 Message Format | |
3182 | |
3183 <STA> ::= < Diameter Header: 275, PXY > | |
3184 < Session-Id > | |
3185 { Result-Code } | |
3186 { Origin-Host } | |
3187 { Origin-Realm } | |
3188 [ User-Name ] | |
3189 * [ Class ] | |
3190 [ Error-Message ] | |
3191 [ Error-Reporting-Host ] | |
3192 [ Failed-AVP ] | |
3193 [ Origin-State-Id ] | |
3194 * [ Redirect-Host ] | |
3195 [ Redirect-Host-Usage ] | |
3196 [ Redirect-Max-Cache-Time ] | |
3197 * [ Proxy-Info ] | |
3198 * [ AVP ] | |
3199 */ | |
3200 struct dict_object * cmd; | |
3201 struct dict_cmd_data data = { | |
3202 275, /* Code */ | |
3203 #if CC_SESSION_TERMINATION != 275 | |
3204 #error "CC_SESSION_TERMINATION definition mismatch" | |
3205 #endif | |
3206 "Session-Termination-Answer", /* Name */ | |
3207 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flags */ | |
3208 CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3209 }; | |
3210 struct local_rules_definition rules[] = | |
3211 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3212 ,{ "Result-Code", RULE_REQUIRED, -1, 1 } | |
3213 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3214 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3215 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3216 ,{ "Class", RULE_OPTIONAL, -1,-1 } | |
3217 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
3218 ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } | |
3219 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
3220 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3221 ,{ "Redirect-Host", RULE_OPTIONAL, -1,-1 } | |
3222 ,{ "Redirect-Host-Usage", RULE_OPTIONAL, -1, 1 } | |
3223 ,{ "Redirect-Max-Cache-Time", RULE_OPTIONAL, -1, 1 } | |
3224 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3225 }; | |
3226 | |
3227 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3228 PARSE_loc_rules( rules, cmd ); | |
3229 } | |
3230 | |
3231 /* Abort-Session-Request */ | |
3232 { | |
3233 /* | |
3234 The Abort-Session-Request (ASR), indicated by the Command-Code set to | |
3235 274 and the message flags' 'R' bit set, may be sent by any server to | |
3236 the access device that is providing session service, to request that | |
3237 the session identified by the Session-Id be stopped. | |
3238 | |
3239 | |
3240 Message Format | |
3241 | |
3242 <ASR> ::= < Diameter Header: 274, REQ, PXY > | |
3243 < Session-Id > | |
3244 { Origin-Host } | |
3245 { Origin-Realm } | |
3246 { Destination-Realm } | |
3247 { Destination-Host } | |
3248 { Auth-Application-Id } | |
3249 [ User-Name ] | |
3250 [ Origin-State-Id ] | |
3251 * [ Proxy-Info ] | |
3252 * [ Route-Record ] | |
3253 * [ AVP ] | |
3254 */ | |
3255 struct dict_object * cmd; | |
3256 struct dict_cmd_data data = { | |
3257 274, /* Code */ | |
3258 #if CC_ABORT_SESSION != 274 | |
3259 #error "CC_ABORT_SESSION definition mismatch" | |
3260 #endif | |
3261 "Abort-Session-Request", /* Name */ | |
3262 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ | |
3263 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3264 }; | |
3265 struct local_rules_definition rules[] = | |
3266 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3267 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3268 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3269 ,{ "Destination-Realm", RULE_REQUIRED, -1, 1 } | |
3270 ,{ "Destination-Host", RULE_REQUIRED, -1, 1 } | |
3271 ,{ "Auth-Application-Id", RULE_REQUIRED, -1, 1 } | |
3272 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3273 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3274 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3275 ,{ "Route-Record", RULE_OPTIONAL, -1,-1 } | |
3276 }; | |
3277 | |
3278 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3279 PARSE_loc_rules( rules, cmd ); | |
3280 } | |
3281 | |
3282 /* Abort-Session-Answer */ | |
3283 { | |
3284 /* | |
3285 The Abort-Session-Answer (ASA), indicated by the Command-Code set to | |
3286 274 and the message flags' 'R' bit clear, is sent in response to the | |
3287 ASR. The Result-Code AVP MUST be present, and indicates the | |
3288 disposition of the request. | |
3289 | |
3290 If the session identified by Session-Id in the ASR was successfully | |
3291 terminated, Result-Code is set to DIAMETER_SUCCESS. If the session | |
3292 is not currently active, Result-Code is set to | |
3293 DIAMETER_UNKNOWN_SESSION_ID. If the access device does not stop the | |
3294 session for any other reason, Result-Code is set to | |
3295 DIAMETER_UNABLE_TO_COMPLY. | |
3296 | |
3297 Message Format | |
3298 | |
3299 <ASA> ::= < Diameter Header: 274, PXY > | |
3300 < Session-Id > | |
3301 { Result-Code } | |
3302 { Origin-Host } | |
3303 { Origin-Realm } | |
3304 [ User-Name ] | |
3305 [ Origin-State-Id ] | |
3306 [ Error-Message ] | |
3307 [ Error-Reporting-Host ] | |
3308 [ Failed-AVP ] | |
3309 * [ Redirect-Host ] | |
3310 [ Redirect-Host-Usage ] | |
3311 [ Redirect-Max-Cache-Time ] | |
3312 * [ Proxy-Info ] | |
3313 * [ AVP ] | |
3314 */ | |
3315 struct dict_object * cmd; | |
3316 struct dict_cmd_data data = { | |
3317 274, /* Code */ | |
3318 #if CC_ABORT_SESSION != 274 | |
3319 #error "CC_ABORT_SESSION definition mismatch" | |
3320 #endif | |
3321 "Abort-Session-Answer", /* Name */ | |
3322 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flags */ | |
3323 CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3324 }; | |
3325 struct local_rules_definition rules[] = | |
3326 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3327 ,{ "Result-Code", RULE_REQUIRED, -1, 1 } | |
3328 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3329 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3330 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3331 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3332 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
3333 ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } | |
3334 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
3335 ,{ "Redirect-Host", RULE_OPTIONAL, -1,-1 } | |
3336 ,{ "Redirect-Host-Usage", RULE_OPTIONAL, -1, 1 } | |
3337 ,{ "Redirect-Max-Cache-Time", RULE_OPTIONAL, -1, 1 } | |
3338 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3339 }; | |
3340 | |
3341 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3342 PARSE_loc_rules( rules, cmd ); | |
3343 } | |
3344 | |
3345 /* Accounting-Request */ | |
3346 { | |
3347 /* | |
3348 The Accounting-Request (ACR) command, indicated by the Command-Code | |
3349 field set to 271 and the Command Flags' 'R' bit set, is sent by a | |
3350 Diameter node, acting as a client, in order to exchange accounting | |
3351 information with a peer. | |
3352 | |
3353 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs | |
3354 MUST be present. If the Vendor-Specific-Application-Id grouped AVP | |
3355 is present, it MUST include an Acct-Application-Id AVP. | |
3356 | |
3357 The AVP listed below SHOULD include service specific accounting AVPs, | |
3358 as described in Section 9.3. | |
3359 | |
3360 | |
3361 Message Format | |
3362 | |
3363 <ACR> ::= < Diameter Header: 271, REQ, PXY > | |
3364 < Session-Id > | |
3365 { Origin-Host } | |
3366 { Origin-Realm } | |
3367 { Destination-Realm } | |
3368 { Accounting-Record-Type } | |
3369 { Accounting-Record-Number } | |
3370 [ Acct-Application-Id ] | |
3371 [ Vendor-Specific-Application-Id ] | |
3372 [ User-Name ] | |
3373 [ Destination-Host ] | |
3374 [ Accounting-Sub-Session-Id ] | |
3375 [ Acct-Session-Id ] | |
3376 [ Acct-Multi-Session-Id ] | |
3377 [ Acct-Interim-Interval ] | |
3378 [ Accounting-Realtime-Required ] | |
3379 [ Origin-State-Id ] | |
3380 [ Event-Timestamp ] | |
3381 * [ Proxy-Info ] | |
3382 * [ Route-Record ] | |
3383 * [ AVP ] | |
3384 */ | |
3385 struct dict_object * cmd; | |
3386 struct dict_cmd_data data = { | |
3387 271, /* Code */ | |
3388 #if CC_ACCOUNTING != 271 | |
3389 #error "CC_ACCOUNTING definition mismatch" | |
3390 #endif | |
3391 "Accounting-Request", /* Name */ | |
3392 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ | |
3393 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3394 }; | |
3395 struct local_rules_definition rules[] = | |
3396 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3397 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3398 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3399 ,{ "Destination-Realm", RULE_REQUIRED, -1, 1 } | |
3400 ,{ "Accounting-Record-Type", RULE_REQUIRED, -1, 1 } | |
3401 ,{ "Accounting-Record-Number", RULE_REQUIRED, -1, 1 } | |
3402 ,{ "Acct-Application-Id", RULE_OPTIONAL, -1, 1 } | |
3403 ,{ "Vendor-Specific-Application-Id", RULE_OPTIONAL, -1, 1 } | |
3404 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3405 ,{ "Destination-Host", RULE_OPTIONAL, -1, 1 } | |
3406 ,{ "Accounting-Sub-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3407 ,{ "Acct-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3408 ,{ "Acct-Multi-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3409 ,{ "Acct-Interim-Interval", RULE_OPTIONAL, -1, 1 } | |
3410 ,{ "Accounting-Realtime-Required", RULE_OPTIONAL, -1, 1 } | |
3411 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3412 ,{ "Event-Timestamp", RULE_OPTIONAL, -1, 1 } | |
3413 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3414 ,{ "Route-Record", RULE_OPTIONAL, -1,-1 } | |
3415 }; | |
3416 | |
3417 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3418 PARSE_loc_rules( rules, cmd ); | |
3419 } | |
3420 | |
3421 /* Accounting-Answer */ | |
3422 { | |
3423 /* | |
3424 The Accounting-Answer (ACA) command, indicated by the Command-Code | |
3425 field set to 271 and the Command Flags' 'R' bit cleared, is used to | |
3426 acknowledge an Accounting-Request command. The Accounting-Answer | |
3427 command contains the same Session-Id as the corresponding request. | |
3428 | |
3429 Only the target Diameter Server, known as the home Diameter Server, | |
3430 SHOULD respond with the Accounting-Answer command. | |
3431 | |
3432 One of Acct-Application-Id and Vendor-Specific-Application-Id AVPs | |
3433 MUST be present. If the Vendor-Specific-Application-Id grouped AVP | |
3434 is present, it MUST contain an Acct-Application-Id AVP. | |
3435 | |
3436 The AVP listed below SHOULD include service specific accounting AVPs, | |
3437 as described in Section 9.3. | |
3438 | |
3439 | |
3440 Message Format | |
3441 | |
3442 <ACA> ::= < Diameter Header: 271, PXY > | |
3443 < Session-Id > | |
3444 { Result-Code } | |
3445 { Origin-Host } | |
3446 { Origin-Realm } | |
3447 { Accounting-Record-Type } | |
3448 { Accounting-Record-Number } | |
3449 [ Acct-Application-Id ] | |
3450 [ Vendor-Specific-Application-Id ] | |
3451 [ User-Name ] | |
3452 [ Accounting-Sub-Session-Id ] | |
3453 [ Acct-Session-Id ] | |
3454 [ Acct-Multi-Session-Id ] | |
3455 [ Error-Message ] | |
3456 [ Error-Reporting-Host ] | |
3457 [ Failed-AVP ] | |
3458 [ Acct-Interim-Interval ] | |
3459 [ Accounting-Realtime-Required ] | |
3460 [ Origin-State-Id ] | |
3461 [ Event-Timestamp ] | |
3462 * [ Proxy-Info ] | |
3463 * [ AVP ] | |
3464 */ | |
3465 struct dict_object * cmd; | |
3466 struct dict_cmd_data data = { | |
3467 271, /* Code */ | |
3468 #if CC_ACCOUNTING != 271 | |
3469 #error "CC_ACCOUNTING definition mismatch" | |
3470 #endif | |
3471 "Accounting-Answer", /* Name */ | |
3472 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flags */ | |
3473 CMD_FLAG_PROXIABLE /* Fixed flag values */ | |
3474 }; | |
3475 struct local_rules_definition rules[] = | |
3476 { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } | |
3477 ,{ "Result-Code", RULE_REQUIRED, -1, 1 } | |
3478 ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } | |
3479 ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } | |
3480 ,{ "Accounting-Record-Type", RULE_REQUIRED, -1, 1 } | |
3481 ,{ "Accounting-Record-Number", RULE_REQUIRED, -1, 1 } | |
3482 ,{ "Acct-Application-Id", RULE_OPTIONAL, -1, 1 } | |
3483 ,{ "Vendor-Specific-Application-Id", RULE_OPTIONAL, -1, 1 } | |
3484 ,{ "User-Name", RULE_OPTIONAL, -1, 1 } | |
3485 ,{ "Accounting-Sub-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3486 ,{ "Acct-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3487 ,{ "Acct-Multi-Session-Id", RULE_OPTIONAL, -1, 1 } | |
3488 ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } | |
3489 ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } | |
3490 ,{ "Failed-AVP", RULE_OPTIONAL, -1, 1 } | |
3491 ,{ "Acct-Interim-Interval", RULE_OPTIONAL, -1, 1 } | |
3492 ,{ "Accounting-Realtime-Required", RULE_OPTIONAL, -1, 1 } | |
3493 ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } | |
3494 ,{ "Event-Timestamp", RULE_OPTIONAL, -1, 1 } | |
3495 ,{ "Proxy-Info", RULE_OPTIONAL, -1,-1 } | |
3496 }; | |
3497 | |
3498 CHECK_dict_new( DICT_COMMAND, &data , NULL, &cmd); | |
3499 PARSE_loc_rules( rules, cmd ); | |
3500 } | |
3501 } | |
3502 | |
3503 return 0; | |
3504 } |