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