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