blob: 19ad57df6388c2e67f5168dec275a2ab09c3be18 [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 Rx (e30).
25 */
26#include <freeDiameter/extension.h>
27
28#define PROTO_VER "e30"
29#define GEN_DATE 1506697208.6
30
31const char *rx_proto_ver = PROTO_VER;
32const double rx_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_rx_load_defs(char * conffile)
101{
102 TRACE_ENTRY("%p", conffile);
103 struct dict_object * app_id16777224;
104 struct dict_object * app_id16777229;
105
106 /* Application Section */
107 {
108 {
109 struct dict_object * vendor;
110 CHECK_dict_search(DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor)
111 struct dict_application_data data = { 16777224, "Rx" };
112 CHECK_dict_new( DICT_APPLICATION, &data, vendor, &app_id16777224)
113 }
114 {
115 struct dict_object * vendor;
116 CHECK_dict_search(DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor)
117 struct dict_application_data data = { 16777229, "Rx-app16777229" };
118 CHECK_dict_new( DICT_APPLICATION, &data, vendor, &app_id16777229)
119 }
120 /* Result codes */
121 {
122 struct dict_object *type;
123 CHECK_dict_search(DICT_TYPE, TYPE_BY_NAME, "Enumerated(Result-Code)",&type);
124 struct dict_enumval_data t_1 = { "REQUESTED_SERVICE_TEMPORARILY_NOT_AUTHORIZED", { .u32=4261 }};
125 struct dict_enumval_data t_2 = { "INVALID_SERVICE_INFORMATION", { .u32=5061 }};
126 struct dict_enumval_data t_3 = { "FILTER_RESTRICTIONS", { .u32=5062 }};
127 struct dict_enumval_data t_4 = { "REQUESTED_SERVICE_NOT_AUTHORIZED", { .u32=5063 }};
128 struct dict_enumval_data t_5 = { "DUPLICATED_AF_SESSION", { .u32=5064 }};
129 struct dict_enumval_data t_6 = { "IP-CAN_SESSION_NOT_AVAILABLE", { .u32=5065 }};
130 struct dict_enumval_data t_7 = { "UNAUTHORIZED_NON_EMERGENCY_SESSION", { .u32=5066 }};
131 struct dict_enumval_data t_8 = { "UNAUTHORIZED_SPONSORED_DATA_CONNECTIVITY", { .u32=5067 }};
132 struct dict_enumval_data t_9 = { "TEMPORARY_NETWORK_FAILURE", { .u32=5068 }};
133
134 CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL);
135 CHECK_dict_new( DICT_ENUMVAL, &t_2, type, NULL);
136 CHECK_dict_new( DICT_ENUMVAL, &t_3, type, NULL);
137 CHECK_dict_new( DICT_ENUMVAL, &t_4, type, NULL);
138 CHECK_dict_new( DICT_ENUMVAL, &t_5, type, NULL);
139 CHECK_dict_new( DICT_ENUMVAL, &t_6, type, NULL);
140 CHECK_dict_new( DICT_ENUMVAL, &t_7, type, NULL);
141 CHECK_dict_new( DICT_ENUMVAL, &t_8, type, NULL);
142 CHECK_dict_new( DICT_ENUMVAL, &t_9, type, NULL);
143
144 }
145 }
146
147
148 /* AVP section */
149 {
150 struct dict_object * Address_type;
151 struct dict_object * UTF8String_type;
152 struct dict_object * DiameterIdentity_type;
153 struct dict_object * DiameterURI_type;
154 struct dict_object * Time_type;
155 struct dict_object * IPFilterRule_type;
156
157 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type);
158 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
159 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type);
160 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type);
161 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type);
162 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "IPFilterRule", &IPFilterRule_type);
163
164
165 }
166
167 /* Commands section */
168 {
169
170 }
171
172 return 0;
173}
174
175static int dict_rx_load_rules(char * conffile)
176{
177 /* Grouped AVP section */
178 {
179
180 }
181
182 /* Commands section */
183 {
184 /* AA-Request */
185 {
186 struct dict_object* cmd;
187 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "AA-Request", &cmd)
188 struct local_rules_definition rules[] =
189 {
190 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
191 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
192 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
193 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
194 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
195 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
196 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
197 { { .avp_vendor = 10415, .avp_name = "IP-Domain-Id"}, RULE_OPTIONAL, -1, -1 },
198 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_OPTIONAL, -1, -1 },
199 { { .avp_vendor = 10415, .avp_name = "AF-Application-Identifier"}, RULE_OPTIONAL, -1, -1 },
200 { { .avp_vendor = 10415, .avp_name = "Media-Component-Description"}, RULE_OPTIONAL, -1, -1 },
201 { { .avp_vendor = 10415, .avp_name = "Service-Info-Status"}, RULE_OPTIONAL, -1, -1 },
202 { { .avp_vendor = 10415, .avp_name = "AF-Charging-Identifier"}, RULE_OPTIONAL, -1, -1 },
203 { { .avp_vendor = 10415, .avp_name = "SIP-Forking-Indication"}, RULE_OPTIONAL, -1, -1 },
204 { { .avp_vendor = 10415, .avp_name = "Specific-Action"}, RULE_OPTIONAL, -1, -1 },
205 { { .avp_vendor = 0, .avp_name = "Subscription-Id"}, RULE_OPTIONAL, -1, -1 },
206 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
207 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
208 { { .avp_vendor = 13019, .avp_name = "Reservation-Priority"}, RULE_OPTIONAL, -1, -1 },
209 { { .avp_vendor = 0, .avp_name = "Framed-IP-Address"}, RULE_OPTIONAL, -1, -1 },
210 { { .avp_vendor = 0, .avp_name = "Framed-IPv6-Prefix"}, RULE_OPTIONAL, -1, -1 },
211 { { .avp_vendor = 0, .avp_name = "Called-Station-Id"}, RULE_OPTIONAL, -1, -1 },
212 { { .avp_vendor = 10415, .avp_name = "Service-URN"}, RULE_OPTIONAL, -1, -1 },
213 { { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data"}, RULE_OPTIONAL, -1, -1 },
214 { { .avp_vendor = 10415, .avp_name = "MPS-Identifier"}, RULE_OPTIONAL, -1, -1 },
215 { { .avp_vendor = 10415, .avp_name = "GCS-Identifier"}, RULE_OPTIONAL, -1, -1 },
216 { { .avp_vendor = 10415, .avp_name = "MCPTT-Identifier"}, RULE_OPTIONAL, -1, -1 },
217 { { .avp_vendor = 10415, .avp_name = "Rx-Request-Type"}, RULE_OPTIONAL, -1, -1 },
218 { { .avp_vendor = 10415, .avp_name = "Required-Access-Info"}, RULE_OPTIONAL, -1, -1 },
219 { { .avp_vendor = 10415, .avp_name = "AF-Requested-Data"}, RULE_OPTIONAL, -1, -1 },
220 { { .avp_vendor = 10415, .avp_name = "Reference-Id"}, RULE_OPTIONAL, -1, -1 },
221 { { .avp_vendor = 10415, .avp_name = "Pre-emption-Control-Info"}, RULE_OPTIONAL, -1, -1 },
222 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
223 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
224 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
225 };
226 PARSE_loc_rules(rules, cmd);
227 }
228 /* AA-Answer */
229 {
230 struct dict_object* cmd;
231 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "AA-Answer", &cmd)
232 struct local_rules_definition rules[] =
233 {
234 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
235 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
236 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
237 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
238 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
239 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
240 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
241 { { .avp_vendor = 0, .avp_name = "Auth-Session-State"}, RULE_OPTIONAL, -1, -1 },
242 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier"}, RULE_OPTIONAL, -1, -1 },
243 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address"}, RULE_OPTIONAL, -1, -1 },
244 { { .avp_vendor = 10415, .avp_name = "Acceptable-Service-Info"}, RULE_OPTIONAL, -1, -1 },
245 { { .avp_vendor = 10415, .avp_name = "AN-GW-Address"}, RULE_OPTIONAL, -1, -1 },
246 { { .avp_vendor = 10415, .avp_name = "AN-Trusted"}, RULE_OPTIONAL, -1, -1 },
247 { { .avp_vendor = 10415, .avp_name = "Service-Authorization-Info"}, RULE_OPTIONAL, -1, -1 },
248 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
249 { { .avp_vendor = 10415, .avp_name = "NetLoc-Access-Support"}, RULE_OPTIONAL, -1, -1 },
250 { { .avp_vendor = 10415, .avp_name = "RAT-Type"}, RULE_OPTIONAL, -1, -1 },
251 { { .avp_vendor = 10415, .avp_name = "Flows"}, RULE_OPTIONAL, -1, -1 },
252 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
253 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
254 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
255 { { .avp_vendor = 0, .avp_name = "Subscription-Id"}, RULE_OPTIONAL, -1, -1 },
256 { { .avp_vendor = 0, .avp_name = "User-Equipment-Info"}, RULE_OPTIONAL, -1, -1 },
257 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
258 { { .avp_vendor = 0, .avp_name = "Class"}, RULE_OPTIONAL, -1, -1 },
259 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
260 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
261 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
262 { { .avp_vendor = 10415, .avp_name = "Retry-Interval"}, RULE_OPTIONAL, -1, -1 },
263 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
264 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
265 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
266 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
267 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
268 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
269 };
270 PARSE_loc_rules(rules, cmd);
271 }
272 /* Re-Auth-Request */
273 {
274 struct dict_object* cmd;
275 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &cmd)
276 struct local_rules_definition rules[] =
277 {
278 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
279 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
280 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
281 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
282 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
283 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_REQUIRED, -1, -1 },
284 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
285 { { .avp_vendor = 10415, .avp_name = "Specific-Action"}, RULE_REQUIRED, -1, -1 },
286 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
287 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier"}, RULE_OPTIONAL, -1, -1 },
288 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address"}, RULE_OPTIONAL, -1, -1 },
289 { { .avp_vendor = 10415, .avp_name = "AN-GW-Address"}, RULE_OPTIONAL, -1, -1 },
290 { { .avp_vendor = 10415, .avp_name = "AN-Trusted"}, RULE_OPTIONAL, -1, -1 },
291 { { .avp_vendor = 10415, .avp_name = "Flows"}, RULE_OPTIONAL, -1, -1 },
292 { { .avp_vendor = 0, .avp_name = "Subscription-Id"}, RULE_OPTIONAL, -1, -1 },
293 { { .avp_vendor = 10415, .avp_name = "Abort-Cause"}, RULE_OPTIONAL, -1, -1 },
294 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
295 { { .avp_vendor = 10415, .avp_name = "NetLoc-Access-Support"}, RULE_OPTIONAL, -1, -1 },
296 { { .avp_vendor = 10415, .avp_name = "RAT-Type"}, RULE_OPTIONAL, -1, -1 },
297 { { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data"}, RULE_OPTIONAL, -1, -1 },
298 { { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
299 { { .avp_vendor = 10415, .avp_name = "User-Location-Info-Time"}, RULE_OPTIONAL, -1, -1 },
300 { { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone"}, RULE_OPTIONAL, -1, -1 },
301 { { .avp_vendor = 10415, .avp_name = "RAN-NAS-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
302 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
303 { { .avp_vendor = 10415, .avp_name = "TWAN-Identifier"}, RULE_OPTIONAL, -1, -1 },
304 { { .avp_vendor = 10415, .avp_name = "TCP-Source-Port"}, RULE_OPTIONAL, -1, -1 },
305 { { .avp_vendor = 10415, .avp_name = "UDP-Source-Port"}, RULE_OPTIONAL, -1, -1 },
306 { { .avp_vendor = 10415, .avp_name = "UE-Local-IP-Address"}, RULE_OPTIONAL, -1, -1 },
307 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
308 { { .avp_vendor = 0, .avp_name = "Class"}, 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 };
312 PARSE_loc_rules(rules, cmd);
313 }
314 /* Re-Auth-Answer */
315 {
316 struct dict_object* cmd;
317 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &cmd)
318 struct local_rules_definition rules[] =
319 {
320 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
321 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
322 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
323 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
324 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
325 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
326 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
327 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
328 { { .avp_vendor = 10415, .avp_name = "Media-Component-Description"}, RULE_OPTIONAL, -1, -1 },
329 { { .avp_vendor = 10415, .avp_name = "Service-URN"}, RULE_OPTIONAL, -1, -1 },
330 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
331 { { .avp_vendor = 0, .avp_name = "Class"}, RULE_OPTIONAL, -1, -1 },
332 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
333 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
334 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
335 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
336 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
337 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
338 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 }
339 };
340 PARSE_loc_rules(rules, cmd);
341 }
342 /* Session-Termination-Request */
343 {
344 struct dict_object* cmd;
345 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Request", &cmd)
346 struct local_rules_definition rules[] =
347 {
348 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
349 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
350 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
351 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
352 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
353 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
354 { { .avp_vendor = 0, .avp_name = "Termination-Cause"}, RULE_REQUIRED, -1, -1 },
355 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
356 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
357 { { .avp_vendor = 10415, .avp_name = "Required-Access-Info"}, RULE_OPTIONAL, -1, -1 },
358 { { .avp_vendor = 0, .avp_name = "Class"}, RULE_OPTIONAL, -1, -1 },
359 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
360 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
361 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
362 };
363 PARSE_loc_rules(rules, cmd);
364 }
365 /* Session-Termination-Answer */
366 {
367 struct dict_object* cmd;
368 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Session-Termination-Answer", &cmd)
369 struct local_rules_definition rules[] =
370 {
371 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
372 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
373 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
374 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
375 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
376 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
377 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
378 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
379 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
380 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
381 { { .avp_vendor = 10415, .avp_name = "Sponsored-Connectivity-Data"}, RULE_OPTIONAL, -1, -1 },
382 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
383 { { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
384 { { .avp_vendor = 10415, .avp_name = "User-Location-Info-Time"}, RULE_OPTIONAL, -1, -1 },
385 { { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone"}, RULE_OPTIONAL, -1, -1 },
386 { { .avp_vendor = 10415, .avp_name = "RAN-NAS-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
387 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
388 { { .avp_vendor = 10415, .avp_name = "TWAN-Identifier"}, RULE_OPTIONAL, -1, -1 },
389 { { .avp_vendor = 10415, .avp_name = "TCP-Source-Port"}, RULE_OPTIONAL, -1, -1 },
390 { { .avp_vendor = 10415, .avp_name = "UDP-Source-Port"}, RULE_OPTIONAL, -1, -1 },
391 { { .avp_vendor = 10415, .avp_name = "UE-Local-IP-Address"}, RULE_OPTIONAL, -1, -1 },
392 { { .avp_vendor = 10415, .avp_name = "NetLoc-Access-Support"}, RULE_OPTIONAL, -1, -1 },
393 { { .avp_vendor = 0, .avp_name = "Class"}, RULE_OPTIONAL, -1, -1 },
394 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
395 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
396 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
397 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
398 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
399 };
400 PARSE_loc_rules(rules, cmd);
401 }
402 /* Abort-Session-Request */
403 {
404 struct dict_object* cmd;
405 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Request", &cmd)
406 struct local_rules_definition rules[] =
407 {
408 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
409 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
410 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
411 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
412 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
413 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_REQUIRED, -1, -1 },
414 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
415 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
416 { { .avp_vendor = 10415, .avp_name = "Abort-Cause"}, RULE_REQUIRED, -1, -1 },
417 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
418 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
419 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
420 };
421 PARSE_loc_rules(rules, cmd);
422 }
423 /* Abort-Session-Answer */
424 {
425 struct dict_object* cmd;
426 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Abort-Session-Answer", &cmd)
427 struct local_rules_definition rules[] =
428 {
429 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
430 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
431 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
432 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
433 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
434 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
435 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
436 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
437 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
438 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
439 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
440 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
441 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
442 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
443 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 }
444 };
445 PARSE_loc_rules(rules, cmd);
446 }
447
448 }
449
450 LOG_D( "Extension 'Dictionary definitions for Rx (e30)' initialized");
451 return 0;
452}
453
454int dict_entry(char * conffile)
455{
456 dict_rx_load_defs(conffile);
457 return dict_rx_load_rules(conffile);
458}
459
460const char* dict_rx_proto_ver(char * conffile) {
461 return rx_proto_ver;
462}
463
464const double dict_rx_gen_ts(char * conffile) {
465 return rx_gen_date;
466}
467
468EXTENSION_ENTRY2("dict_rx", dict_rx_load_defs, dict_rx_load_rules, "dict_ts32299_avps", "dict_ts29214_avps", "dict_ts29212_avps", "dict_ts29273_avps", "dict_ts29229_avps", "dict_ts29154_avps", "dict_ts29061_avps", "dict_NAS", "dict_rfc4006bis_avps", "dict_draftload_avps", "dict_rfc7683_avps", "dict_rfc7155_avps", "dict_etsi283034_avps", "dict_rfc7944_avps");
469
470
471