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