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