blob: c5dd8eb366efdad70beb1b665741d7c44f102d29 [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001/*
2* Copyright (c) 2017 Sprint
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17/****************
18 Generated By: fdtool enhancements to diafuzzer
19 License: same as freeDiameter
20****************/
21
22
23/*
24 * Dictionary definitions of objects specified in Sd (e30).
25 */
26#include <freeDiameter/extension.h>
27
28#define PROTO_VER "e30"
29#define GEN_DATE 1506697212.17
30
31const char *sd_proto_ver = PROTO_VER;
32const double sd_gen_date = GEN_DATE;
33
34/* The content of this file follows the same structure as dict_base_proto.c */
35
36#define CHECK_dict_new( _type, _data, _parent, _ref ) \
37{ \
38 int _ret = fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref) ); \
39 if ( _ret != 0 && _ret != EEXIST ) \
40 return _ret; \
41}
42
43#define CHECK_dict_search( _type, _criteria, _what, _result ) \
44 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) );
45
46struct local_rules_definition {
47 struct dict_avp_request avp_vendor_plus_name;
48 enum rule_position position;
49 int min;
50 int max;
51};
52
53#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 )
54
55/* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */
56#define PARSE_loc_rules( _rulearray, _parent) { \
57 int __ar; \
58 for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \
59 struct dict_rule_data __data = { NULL, \
60 (_rulearray)[__ar].position, \
61 0, \
62 (_rulearray)[__ar].min, \
63 (_rulearray)[__ar].max}; \
64 __data.rule_order = RULE_ORDER(__data.rule_position); \
65 CHECK_FCT( fd_dict_search( \
66 fd_g_config->cnf_dict, \
67 DICT_AVP, \
68 AVP_BY_NAME_AND_VENDOR, \
69 &(_rulearray)[__ar].avp_vendor_plus_name, \
70 &__data.rule_avp, 0 ) ); \
71 if ( !__data.rule_avp ) { \
72 TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
73 return ENOENT; \
74 } \
75 { \
76 int _ret = fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &(__data), (_parent), NULL ); \
77 if ( _ret != 0 && _ret != EEXIST ) { \
78 TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \
79 (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \
80 return EINVAL; \
81 } \
82 } \
83 } \
84}
85
86#define CHECK_vendor_new( _data ) { \
87 struct dict_object * vendor_found; \
88 if (fd_dict_search(fd_g_config->cnf_dict,DICT_VENDOR,VENDOR_BY_ID,&_data.vendor_id,&vendor_found,ENOENT) == ENOENT) { \
89 CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &_data, NULL, NULL)); \
90 } \
91}
92
93#define enumval_def_u32( _val_, _str_ ) \
94 { _str_, { .u32 = _val_ }}
95
96#define enumval_def_os( _len_, _val_, _str_ ) \
97 { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}}
98
99
100static int dict_sd_load_defs(char * conffile)
101{
102 TRACE_ENTRY("%p", conffile);
103 struct dict_object * app_id16777303;
104
105 /* Application Section */
106 {
107 {
108 struct dict_object * vendor;
109 CHECK_dict_search(DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor)
110 struct dict_application_data data = { 16777303, "Sd" };
111 CHECK_dict_new( DICT_APPLICATION, &data, vendor, &app_id16777303)
112 }
113 /* Result codes */
114 {
115 struct dict_object *type;
116 CHECK_dict_search(DICT_TYPE, TYPE_BY_NAME, "Enumerated(Result-Code)",&type);
117 struct dict_enumval_data t_1 = { "PCEF_Initiated_IP_CAN_Session_Modification", { .u32=1 }};
118 struct dict_enumval_data t_2 = { "PCRF_Initiated_IP_CAN_Session_Modification", { .u32=2 }};
119 struct dict_enumval_data t_3 = { "IP_CAN_Session_Termination", { .u32=3 }};
120 struct dict_enumval_data t_4 = { "IP_CAN_Session_Modification", { .u32=4 }};
121 struct dict_enumval_data t_5 = { "ADC_rule", { .u32=5 }};
122 struct dict_enumval_data t_6 = { "Subscriber_Identifier", { .u32=6 }};
123 struct dict_enumval_data t_7 = { "Default_QoS_control", { .u32=7 }};
124
125 CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL);
126 CHECK_dict_new( DICT_ENUMVAL, &t_2, type, NULL);
127 CHECK_dict_new( DICT_ENUMVAL, &t_3, type, NULL);
128 CHECK_dict_new( DICT_ENUMVAL, &t_4, type, NULL);
129 CHECK_dict_new( DICT_ENUMVAL, &t_5, type, NULL);
130 CHECK_dict_new( DICT_ENUMVAL, &t_6, type, NULL);
131 CHECK_dict_new( DICT_ENUMVAL, &t_7, type, NULL);
132
133 }
134 }
135
136
137 /* AVP section */
138 {
139 struct dict_object * Address_type;
140 struct dict_object * UTF8String_type;
141 struct dict_object * DiameterIdentity_type;
142 struct dict_object * DiameterURI_type;
143 struct dict_object * Time_type;
144 struct dict_object * IPFilterRule_type;
145
146 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type);
147 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
148 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type);
149 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type);
150 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type);
151 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "IPFilterRule", &IPFilterRule_type);
152
153
154 }
155
156 /* Commands section */
157 {
158 /* TS-Request */
159 {
160 struct dict_object* cmd;
161 struct dict_cmd_data data = {
162 8388637, /* Code */
163 "TS-Request", /* Name */
164 CMD_FLAG_REQUEST | CMD_FLAG_ERROR, /* Fixed flags */
165 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flag values */
166 };
167
168 CHECK_dict_new( DICT_COMMAND, &data , app_id16777303, &cmd)
169 }
170 /* TS-Answer */
171 {
172 struct dict_object* cmd;
173 struct dict_cmd_data data = {
174 8388637, /* Code */
175 "TS-Answer", /* Name */
176 CMD_FLAG_REQUEST, /* Fixed flags */
177 CMD_FLAG_PROXIABLE, /* Fixed flag values */
178 };
179
180 CHECK_dict_new( DICT_COMMAND, &data , app_id16777303, &cmd)
181 }
182
183 }
184
185 return 0;
186}
187
188static int dict_sd_load_rules(char * conffile)
189{
190 /* Grouped AVP section */
191 {
192
193 }
194
195 /* Commands section */
196 {
197 /* TS-Request */
198 {
199 struct dict_object* cmd;
200 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "TS-Request", &cmd)
201 struct local_rules_definition rules[] =
202 {
203 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
204 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
205 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
206 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
207 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
208 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
209 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
210 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
211 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
212 { { .avp_vendor = 0, .avp_name = "Subscription-Id"}, RULE_OPTIONAL, -1, -1 },
213 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
214 { { .avp_vendor = 0, .avp_name = "Framed-IP-Address"}, RULE_OPTIONAL, -1, -1 },
215 { { .avp_vendor = 0, .avp_name = "Framed-IPv6-Prefix"}, RULE_OPTIONAL, -1, -1 },
216 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
217 { { .avp_vendor = 10415, .avp_name = "RAT-Type"}, RULE_OPTIONAL, -1, -1 },
218 { { .avp_vendor = 10415, .avp_name = "AN-Trusted"}, RULE_OPTIONAL, -1, -1 },
219 { { .avp_vendor = 0, .avp_name = "User-Equipment-Info"}, RULE_OPTIONAL, -1, -1 },
220 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
221 { { .avp_vendor = 10415, .avp_name = "AN-GW-Address"}, RULE_OPTIONAL, 0, 2 },
222 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Address"}, RULE_OPTIONAL, -1, -1 },
223 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Ipv6-Address"}, RULE_OPTIONAL, -1, -1 },
224 { { .avp_vendor = 10415, .avp_name = "3GPP-GGSN-Address"}, RULE_OPTIONAL, -1, -1 },
225 { { .avp_vendor = 10415, .avp_name = "3GPP-GGSN-Ipv6-Address"}, RULE_OPTIONAL, -1, -1 },
226 { { .avp_vendor = 10415, .avp_name = "3GPP-Selection-Mode"}, RULE_OPTIONAL, -1, -1 },
227 { { .avp_vendor = 10415, .avp_name = "Dynamic-Address-Flag"}, RULE_OPTIONAL, -1, -1 },
228 { { .avp_vendor = 10415, .avp_name = "Dynamic-Address-Flag-Extension"}, RULE_OPTIONAL, -1, -1 },
229 { { .avp_vendor = 10415, .avp_name = "PDN-Connection-Charging-ID"}, RULE_OPTIONAL, -1, -1 },
230 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
231 { { .avp_vendor = 10415, .avp_name = "RAI"}, RULE_OPTIONAL, -1, -1 },
232 { { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
233 { { .avp_vendor = 10415, .avp_name = "Fixed-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
234 { { .avp_vendor = 10415, .avp_name = "User-CSG-Information"}, RULE_OPTIONAL, -1, -1 },
235 { { .avp_vendor = 10415, .avp_name = "TWAN-Identifier"}, RULE_OPTIONAL, -1, -1 },
236 { { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone"}, RULE_OPTIONAL, -1, -1 },
237 { { .avp_vendor = 10415, .avp_name = "3GPP-Charging-Characteristics"}, RULE_OPTIONAL, -1, -1 },
238 { { .avp_vendor = 0, .avp_name = "Called-Station-Id"}, RULE_OPTIONAL, -1, -1 },
239 { { .avp_vendor = 10415, .avp_name = "Charging-Information"}, RULE_OPTIONAL, -1, -1 },
240 { { .avp_vendor = 10415, .avp_name = "Online"}, RULE_OPTIONAL, -1, -1 },
241 { { .avp_vendor = 10415, .avp_name = "Offline"}, RULE_OPTIONAL, -1, -1 },
242 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
243 { { .avp_vendor = 10415, .avp_name = "Revalidation-Time"}, RULE_OPTIONAL, -1, -1 },
244 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
245 { { .avp_vendor = 10415, .avp_name = "CSG-Information-Reporting"}, RULE_OPTIONAL, -1, -1 },
246 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
247 { { .avp_vendor = 10415, .avp_name = "Presence-Reporting-Area-Information"}, RULE_OPTIONAL, -1, -1 },
248 { { .avp_vendor = 13019, .avp_name = "Logical-Access-Id"}, RULE_OPTIONAL, -1, -1 },
249 { { .avp_vendor = 13019, .avp_name = "Physical-Access-Id"}, RULE_OPTIONAL, -1, -1 },
250 { { .avp_vendor = 5535, .avp_name = "3GPP2-BSID"}, RULE_OPTIONAL, -1, -1 },
251 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
252 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
253 };
254 PARSE_loc_rules(rules, cmd);
255 }
256 /* TS-Answer */
257 {
258 struct dict_object* cmd;
259 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "TS-Answer", &cmd)
260 struct local_rules_definition rules[] =
261 {
262 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
263 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
264 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
265 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
266 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
267 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
268 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
269 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
270 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
271 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
272 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
273 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
274 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
275 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
276 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
277 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
278 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
279 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 },
280 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
281 };
282 PARSE_loc_rules(rules, cmd);
283 }
284 /* Credit-Control-Request */
285 {
286 struct dict_object* cmd;
287 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &cmd)
288 struct local_rules_definition rules[] =
289 {
290 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
291 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
292 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
293 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
294 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
295 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
296 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
297 { { .avp_vendor = 0, .avp_name = "CC-Request-Type"}, RULE_REQUIRED, -1, -1 },
298 { { .avp_vendor = 0, .avp_name = "CC-Request-Number"}, RULE_REQUIRED, -1, -1 },
299 { { .avp_vendor = 10415, .avp_name = "Credit-Management-Status"}, RULE_OPTIONAL, -1, -1 },
300 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
301 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
302 { { .avp_vendor = 0, .avp_name = "Framed-IP-Address"}, RULE_OPTIONAL, -1, -1 },
303 { { .avp_vendor = 0, .avp_name = "Framed-IPv6-Prefix"}, RULE_OPTIONAL, -1, -1 },
304 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
305 { { .avp_vendor = 10415, .avp_name = "Application-Detection-Information"}, RULE_OPTIONAL, -1, -1 },
306 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
307 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
308 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
309 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
310 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 },
311 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 }
312 };
313 PARSE_loc_rules(rules, cmd);
314 }
315 /* Credit-Control-Answer */
316 {
317 struct dict_object* cmd;
318 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &cmd)
319 struct local_rules_definition rules[] =
320 {
321 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
322 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
323 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
324 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
325 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
326 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
327 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
328 { { .avp_vendor = 0, .avp_name = "CC-Request-Type"}, RULE_REQUIRED, -1, -1 },
329 { { .avp_vendor = 0, .avp_name = "CC-Request-Number"}, RULE_REQUIRED, -1, -1 },
330 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
331 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
332 { { .avp_vendor = 0, .avp_name = "Framed-IPv6-Prefix"}, RULE_OPTIONAL, -1, -1 },
333 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
334 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
335 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
336 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
337 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
338 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
339 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
340 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Remove"}, RULE_OPTIONAL, -1, -1 },
341 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
342 { { .avp_vendor = 10415, .avp_name = "Revalidation-Time"}, RULE_OPTIONAL, -1, -1 },
343 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
344 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
345 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
346 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
347 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
348 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 },
349 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
350 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
351 };
352 PARSE_loc_rules(rules, cmd);
353 }
354 /* Re-Auth-Request */
355 {
356 struct dict_object* cmd;
357 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &cmd)
358 struct local_rules_definition rules[] =
359 {
360 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
361 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
362 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
363 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
364 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
365 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
366 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_REQUIRED, -1, -1 },
367 { { .avp_vendor = 0, .avp_name = "Re-Auth-Request-Type"}, RULE_REQUIRED, -1, -1 },
368 { { .avp_vendor = 10415, .avp_name = "Session-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
369 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
370 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
371 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
372 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
373 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
374 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Remove"}, RULE_OPTIONAL, -1, -1 },
375 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
376 { { .avp_vendor = 10415, .avp_name = "Revalidation-Time"}, RULE_OPTIONAL, -1, -1 },
377 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
378 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
379 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
380 };
381 PARSE_loc_rules(rules, cmd);
382 }
383 /* Re-Auth-Answer */
384 {
385 struct dict_object* cmd;
386 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &cmd)
387 struct local_rules_definition rules[] =
388 {
389 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
390 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
391 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
392 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
393 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
394 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
395 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
396 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
397 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
398 { { .avp_vendor = 10415, .avp_name = "ADC-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
399 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
400 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
401 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
402 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
403 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
404 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
405 };
406 PARSE_loc_rules(rules, cmd);
407 }
408
409 }
410
411 LOG_D( "Extension 'Dictionary definitions for Sd (e30)' initialized");
412 return 0;
413}
414
415int dict_entry(char * conffile)
416{
417 dict_sd_load_defs(conffile);
418 return dict_sd_load_rules(conffile);
419}
420
421const char* dict_sd_proto_ver(char * conffile) {
422 return sd_proto_ver;
423}
424
425const double dict_sd_gen_ts(char * conffile) {
426 return sd_gen_date;
427}
428
429EXTENSION_ENTRY2("dict_sd", dict_sd_load_defs, dict_sd_load_rules, "dict_ts32299_avps", "dict_ts29212_avps", "dict_ts29273_avps", "dict_ts29214_avps", "dict_ts29272_avps", "dict_ts29229_avps", "dict_ts29061_avps", "dict_CreditControl", "dict_rfc4006bis_avps", "dict_draftload_avps", "dict_rfc7683_avps", "dict_rfc7155_avps", "dict_etsi283034_avps", "dict_3gpp2_avps", "dict_rfc7944_avps");
430
431
432