blob: 287de2b1d7ddd63c8509dbb5163b44e1b6d8ba1a [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 Sh (e20).
25 */
26#include <freeDiameter/extension.h>
27
28#define PROTO_VER "e20"
29#define GEN_DATE 1506697212.31
30
31const char *sh_proto_ver = PROTO_VER;
32const double sh_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_sh_load_defs(char * conffile)
101{
102 TRACE_ENTRY("%p", conffile);
103 struct dict_object * app_id16777217;
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 = { 16777217, "Sh" };
111 CHECK_dict_new( DICT_APPLICATION, &data, vendor, &app_id16777217)
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 = { "used_in_Sh", { .u32=1 }};
118 struct dict_enumval_data t_2 = { "Command_Code_values", { .u32=3 }};
119 struct dict_enumval_data t_3 = { "Application_ID_value", { .u32=4 }};
120 struct dict_enumval_data t_4 = { "Special_Requirements", { .u32=7 }};
121
122 CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL);
123 CHECK_dict_new( DICT_ENUMVAL, &t_2, type, NULL);
124 CHECK_dict_new( DICT_ENUMVAL, &t_3, type, NULL);
125 CHECK_dict_new( DICT_ENUMVAL, &t_4, type, NULL);
126
127 }
128 }
129
130
131 /* AVP section */
132 {
133 struct dict_object * Address_type;
134 struct dict_object * UTF8String_type;
135 struct dict_object * DiameterIdentity_type;
136 struct dict_object * DiameterURI_type;
137 struct dict_object * Time_type;
138 struct dict_object * IPFilterRule_type;
139
140 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type);
141 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
142 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type);
143 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type);
144 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type);
145 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "IPFilterRule", &IPFilterRule_type);
146
147
148 }
149
150 /* Commands section */
151 {
152 /* User-Data-Request */
153 {
154 struct dict_object* cmd;
155 struct dict_cmd_data data = {
156 306, /* Code */
157 "User-Data-Request", /* Name */
158 CMD_FLAG_REQUEST | CMD_FLAG_ERROR, /* Fixed flags */
159 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flag values */
160 };
161
162 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
163 }
164 /* User-Data-Answer */
165 {
166 struct dict_object* cmd;
167 struct dict_cmd_data data = {
168 306, /* Code */
169 "User-Data-Answer", /* Name */
170 CMD_FLAG_REQUEST, /* Fixed flags */
171 CMD_FLAG_PROXIABLE, /* Fixed flag values */
172 };
173
174 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
175 }
176 /* Profile-Update-Request */
177 {
178 struct dict_object* cmd;
179 struct dict_cmd_data data = {
180 307, /* Code */
181 "Profile-Update-Request", /* Name */
182 CMD_FLAG_REQUEST | CMD_FLAG_ERROR, /* Fixed flags */
183 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flag values */
184 };
185
186 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
187 }
188 /* Profile-Update-Answer */
189 {
190 struct dict_object* cmd;
191 struct dict_cmd_data data = {
192 307, /* Code */
193 "Profile-Update-Answer", /* Name */
194 CMD_FLAG_REQUEST, /* Fixed flags */
195 CMD_FLAG_PROXIABLE, /* Fixed flag values */
196 };
197
198 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
199 }
200 /* Subscribe-Notifications-Request */
201 {
202 struct dict_object* cmd;
203 struct dict_cmd_data data = {
204 308, /* Code */
205 "Subscribe-Notifications-Request", /* Name */
206 CMD_FLAG_REQUEST | CMD_FLAG_ERROR, /* Fixed flags */
207 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flag values */
208 };
209
210 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
211 }
212 /* Subscribe-Notifications-Answer */
213 {
214 struct dict_object* cmd;
215 struct dict_cmd_data data = {
216 308, /* Code */
217 "Subscribe-Notifications-Answer", /* Name */
218 CMD_FLAG_REQUEST, /* Fixed flags */
219 CMD_FLAG_PROXIABLE, /* Fixed flag values */
220 };
221
222 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
223 }
224 /* Push-Notification-Request */
225 {
226 struct dict_object* cmd;
227 struct dict_cmd_data data = {
228 309, /* Code */
229 "Push-Notification-Request", /* Name */
230 CMD_FLAG_REQUEST | CMD_FLAG_ERROR, /* Fixed flags */
231 CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE, /* Fixed flag values */
232 };
233
234 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
235 }
236 /* Push-Notification-Answer */
237 {
238 struct dict_object* cmd;
239 struct dict_cmd_data data = {
240 309, /* Code */
241 "Push-Notification-Answer", /* Name */
242 CMD_FLAG_REQUEST, /* Fixed flags */
243 CMD_FLAG_PROXIABLE, /* Fixed flag values */
244 };
245
246 CHECK_dict_new( DICT_COMMAND, &data , app_id16777217, &cmd)
247 }
248
249 }
250
251 return 0;
252}
253
254static int dict_sh_load_rules(char * conffile)
255{
256 /* Grouped AVP section */
257 {
258
259 }
260
261 /* Commands section */
262 {
263 /* User-Data-Request */
264 {
265 struct dict_object* cmd;
266 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "User-Data-Request", &cmd)
267 struct local_rules_definition rules[] =
268 {
269 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
270 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
271 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
272 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
273 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
274 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
275 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
276 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
277 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
278 { { .avp_vendor = 10415, .avp_name = "User-Identity"}, RULE_REQUIRED, -1, -1 },
279 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
280 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
281 { { .avp_vendor = 10415, .avp_name = "Server-Name"}, RULE_OPTIONAL, -1, -1 },
282 { { .avp_vendor = 10415, .avp_name = "Service-Indication"}, RULE_OPTIONAL, -1, -1 },
283 { { .avp_vendor = 10415, .avp_name = "Data-Reference"}, RULE_REQUIRED, -1, -1 },
284 { { .avp_vendor = 10415, .avp_name = "Identity-Set"}, RULE_OPTIONAL, -1, -1 },
285 { { .avp_vendor = 10415, .avp_name = "Requested-Domain"}, RULE_OPTIONAL, -1, -1 },
286 { { .avp_vendor = 10415, .avp_name = "Current-Location"}, RULE_OPTIONAL, -1, -1 },
287 { { .avp_vendor = 10415, .avp_name = "DSAI-Tag"}, RULE_OPTIONAL, -1, -1 },
288 { { .avp_vendor = 10415, .avp_name = "Session-Priority"}, RULE_OPTIONAL, -1, -1 },
289 { { .avp_vendor = 0, .avp_name = "User-Name"}, RULE_OPTIONAL, -1, -1 },
290 { { .avp_vendor = 10415, .avp_name = "Requested-Nodes"}, RULE_OPTIONAL, -1, -1 },
291 { { .avp_vendor = 10415, .avp_name = "Serving-Node-Indication"}, RULE_OPTIONAL, -1, -1 },
292 { { .avp_vendor = 10415, .avp_name = "Pre-paging-Supported"}, RULE_OPTIONAL, -1, -1 },
293 { { .avp_vendor = 10415, .avp_name = "Local-Time-Zone-Indication"}, RULE_OPTIONAL, -1, -1 },
294 { { .avp_vendor = 10415, .avp_name = "UDR-Flags"}, RULE_OPTIONAL, -1, -1 },
295 { { .avp_vendor = 10415, .avp_name = "Call-Reference-Info"}, RULE_OPTIONAL, -1, -1 },
296 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
297 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
298 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
299 };
300 PARSE_loc_rules(rules, cmd);
301 }
302 /* User-Data-Answer */
303 {
304 struct dict_object* cmd;
305 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "User-Data-Answer", &cmd)
306 struct local_rules_definition rules[] =
307 {
308 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
309 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
310 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
311 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
312 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
313 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
314 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
315 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
316 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
317 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
318 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
319 { { .avp_vendor = 10415, .avp_name = "User-Data"}, RULE_OPTIONAL, -1, -1 },
320 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
321 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
322 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 },
323 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
324 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
325 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
326 };
327 PARSE_loc_rules(rules, cmd);
328 }
329 /* Profile-Update-Request */
330 {
331 struct dict_object* cmd;
332 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Profile-Update-Request", &cmd)
333 struct local_rules_definition rules[] =
334 {
335 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
336 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
337 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
338 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
339 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
340 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
341 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
342 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
343 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
344 { { .avp_vendor = 10415, .avp_name = "User-Identity"}, RULE_REQUIRED, -1, -1 },
345 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
346 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
347 { { .avp_vendor = 0, .avp_name = "User-Name"}, RULE_OPTIONAL, -1, -1 },
348 { { .avp_vendor = 10415, .avp_name = "Data-Reference"}, RULE_REQUIRED, -1, -1 },
349 { { .avp_vendor = 10415, .avp_name = "User-Data"}, RULE_REQUIRED, -1, -1 },
350 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
351 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
352 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
353 };
354 PARSE_loc_rules(rules, cmd);
355 }
356 /* Profile-Update-Answer */
357 {
358 struct dict_object* cmd;
359 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Profile-Update-Answer", &cmd)
360 struct local_rules_definition rules[] =
361 {
362 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
363 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
364 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
365 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
366 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
367 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
368 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
369 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
370 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
371 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
372 { { .avp_vendor = 10415, .avp_name = "Repository-Data-ID"}, RULE_OPTIONAL, -1, -1 },
373 { { .avp_vendor = 10415, .avp_name = "Data-Reference"}, RULE_OPTIONAL, -1, -1 },
374 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
375 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
376 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
377 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 },
378 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
379 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
380 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
381 };
382 PARSE_loc_rules(rules, cmd);
383 }
384 /* Subscribe-Notifications-Request */
385 {
386 struct dict_object* cmd;
387 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Subscribe-Notifications-Request", &cmd)
388 struct local_rules_definition rules[] =
389 {
390 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
391 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
392 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
393 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
394 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
395 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
396 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
397 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
398 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
399 { { .avp_vendor = 10415, .avp_name = "User-Identity"}, RULE_REQUIRED, -1, -1 },
400 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
401 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
402 { { .avp_vendor = 10415, .avp_name = "Service-Indication"}, RULE_OPTIONAL, -1, -1 },
403 { { .avp_vendor = 10415, .avp_name = "Send-Data-Indication"}, RULE_OPTIONAL, -1, -1 },
404 { { .avp_vendor = 10415, .avp_name = "Server-Name"}, RULE_OPTIONAL, -1, -1 },
405 { { .avp_vendor = 10415, .avp_name = "Subs-Req-Type"}, RULE_REQUIRED, -1, -1 },
406 { { .avp_vendor = 10415, .avp_name = "Data-Reference"}, RULE_REQUIRED, -1, -1 },
407 { { .avp_vendor = 10415, .avp_name = "Identity-Set"}, RULE_OPTIONAL, -1, -1 },
408 { { .avp_vendor = 10415, .avp_name = "Expiry-Time"}, RULE_OPTIONAL, -1, -1 },
409 { { .avp_vendor = 10415, .avp_name = "DSAI-Tag"}, RULE_OPTIONAL, -1, -1 },
410 { { .avp_vendor = 10415, .avp_name = "One-Time-Notification"}, RULE_OPTIONAL, -1, -1 },
411 { { .avp_vendor = 0, .avp_name = "User-Name"}, RULE_OPTIONAL, -1, -1 },
412 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
413 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
414 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
415 };
416 PARSE_loc_rules(rules, cmd);
417 }
418 /* Subscribe-Notifications-Answer */
419 {
420 struct dict_object* cmd;
421 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Subscribe-Notifications-Answer", &cmd)
422 struct local_rules_definition rules[] =
423 {
424 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
425 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
426 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
427 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
428 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
429 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
430 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
431 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
432 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
433 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
434 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
435 { { .avp_vendor = 10415, .avp_name = "User-Data"}, RULE_OPTIONAL, -1, -1 },
436 { { .avp_vendor = 10415, .avp_name = "Expiry-Time"}, RULE_OPTIONAL, -1, -1 },
437 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
438 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
439 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 },
440 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
441 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
442 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
443 };
444 PARSE_loc_rules(rules, cmd);
445 }
446 /* Push-Notification-Request */
447 {
448 struct dict_object* cmd;
449 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Push-Notification-Request", &cmd)
450 struct local_rules_definition rules[] =
451 {
452 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
453 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
454 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
455 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
456 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
457 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
458 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_REQUIRED, -1, -1 },
459 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
460 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
461 { { .avp_vendor = 10415, .avp_name = "User-Identity"}, RULE_REQUIRED, -1, -1 },
462 { { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity"}, RULE_OPTIONAL, -1, -1 },
463 { { .avp_vendor = 10415, .avp_name = "Wildcarded-IMPU"}, RULE_OPTIONAL, -1, -1 },
464 { { .avp_vendor = 0, .avp_name = "User-Name"}, RULE_OPTIONAL, -1, -1 },
465 { { .avp_vendor = 10415, .avp_name = "User-Data"}, RULE_REQUIRED, -1, -1 },
466 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
467 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
468 };
469 PARSE_loc_rules(rules, cmd);
470 }
471 /* Push-Notification-Answer */
472 {
473 struct dict_object* cmd;
474 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Push-Notification-Answer", &cmd)
475 struct local_rules_definition rules[] =
476 {
477 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
478 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
479 { { .avp_vendor = 0, .avp_name = "Vendor-Specific-Application-Id"}, RULE_REQUIRED, -1, -1 },
480 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
481 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
482 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_REQUIRED, -1, -1 },
483 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
484 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
485 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
486 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
487 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
488 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
489 };
490 PARSE_loc_rules(rules, cmd);
491 }
492
493 }
494
495 LOG_D( "Extension 'Dictionary definitions for Sh (e20)' initialized");
496 return 0;
497}
498
499int dict_entry(char * conffile)
500{
501 dict_sh_load_defs(conffile);
502 return dict_sh_load_rules(conffile);
503}
504
505const char* dict_sh_proto_ver(char * conffile) {
506 return sh_proto_ver;
507}
508
509const double dict_sh_gen_ts(char * conffile) {
510 return sh_gen_date;
511}
512
513EXTENSION_ENTRY2("dict_sh", dict_sh_load_defs, dict_sh_load_rules, "dict_ts29329_avps", "dict_ts29229_avps", "dict_draftload_avps", "dict_rfc7683_avps", "dict_rfc7944_avps");
514
515
516