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