blob: 682a1197645f2218731fe1fd2cd649a333827f42 [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 Gx (e30).
25 */
26#include <freeDiameter/extension.h>
27
28#define PROTO_VER "e30"
Javier Bravo Condeeb10c6f2018-06-28 08:43:34 -050029#define GEN_DATE 1530130752.96
Brian Waters13d96012017-12-08 16:53:31 -060030
31const char *gx_proto_ver = PROTO_VER;
32const double gx_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_gx_load_defs(char * conffile)
101{
102 TRACE_ENTRY("%p", conffile);
103 struct dict_object * app_id16777224;
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 = { 16777224, "Gx" };
111 CHECK_dict_new( DICT_APPLICATION, &data, vendor, &app_id16777224)
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 = { "DIAMETER_USER_UNKNOWN", { .u32=5030 }};
118 struct dict_enumval_data t_2 = { "DIAMETER_ERROR_LATE_OVERLAPPING_REQUEST", { .u32=5453 }};
119 struct dict_enumval_data t_3 = { "DIAMETER_ERROR_TIMED_OUT_REQUEST", { .u32=5454 }};
120 struct dict_enumval_data t_4 = { "DIAMETER_ERROR_INITIAL_PARAMETERS", { .u32=5140 }};
121 struct dict_enumval_data t_5 = { "DIAMETER_ERROR_TRIGGER_EVENT", { .u32=5141 }};
122 struct dict_enumval_data t_6 = { "DIAMETER_PCC_RULE_EVENT", { .u32=5142 }};
123 struct dict_enumval_data t_7 = { "DIAMETER_ERROR_BEARER_NOT_AUTHORIZED", { .u32=5143 }};
124 struct dict_enumval_data t_8 = { "DIAMETER_ERROR_TRAFFIC_MAPPING_INFO_REJECTED", { .u32=5144 }};
125 struct dict_enumval_data t_9 = { "DIAMETER_ERROR_CONFLICTING_REQUEST", { .u32=5147 }};
126 struct dict_enumval_data t_10 = { "DIAMETER_ADC_RULE_EVENT", { .u32=5148 }};
127 struct dict_enumval_data t_11 = { "DIAMETER_ERROR_NBIFOM_NOT_AUTHORIZED", { .u32=5149 }};
128 struct dict_enumval_data t_12 = { "DIAMETER_PCC_BEARER_EVENT", { .u32=4141 }};
129 struct dict_enumval_data t_13 = { "DIAMETER_AN_GW_FAILED", { .u32=4143 }};
130 struct dict_enumval_data t_14 = { "DIAMETER_PENDING_TRANSACTION", { .u32=4144 }};
131
132 CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL);
133 CHECK_dict_new( DICT_ENUMVAL, &t_2, type, NULL);
134 CHECK_dict_new( DICT_ENUMVAL, &t_3, type, NULL);
135 CHECK_dict_new( DICT_ENUMVAL, &t_4, type, NULL);
136 CHECK_dict_new( DICT_ENUMVAL, &t_5, type, NULL);
137 CHECK_dict_new( DICT_ENUMVAL, &t_6, type, NULL);
138 CHECK_dict_new( DICT_ENUMVAL, &t_7, type, NULL);
139 CHECK_dict_new( DICT_ENUMVAL, &t_8, type, NULL);
140 CHECK_dict_new( DICT_ENUMVAL, &t_9, type, NULL);
141 CHECK_dict_new( DICT_ENUMVAL, &t_10, type, NULL);
142 CHECK_dict_new( DICT_ENUMVAL, &t_11, type, NULL);
143 CHECK_dict_new( DICT_ENUMVAL, &t_12, type, NULL);
144 CHECK_dict_new( DICT_ENUMVAL, &t_13, type, NULL);
145 CHECK_dict_new( DICT_ENUMVAL, &t_14, type, NULL);
146
147 }
148 }
149
150
151 /* AVP section */
152 {
153 struct dict_object * Address_type;
154 struct dict_object * UTF8String_type;
155 struct dict_object * DiameterIdentity_type;
156 struct dict_object * DiameterURI_type;
157 struct dict_object * Time_type;
158 struct dict_object * IPFilterRule_type;
159
160 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type);
161 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type);
162 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type);
163 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type);
164 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type);
165 CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "IPFilterRule", &IPFilterRule_type);
166
167
168 }
169
170 /* Commands section */
171 {
172
173 }
174
175 return 0;
176}
177
178static int dict_gx_load_rules(char * conffile)
179{
180 /* Grouped AVP section */
181 {
182
183 }
184
185 /* Commands section */
186 {
187 /* Credit-Control-Request */
188 {
189 struct dict_object* cmd;
190 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Request", &cmd)
191 struct local_rules_definition rules[] =
192 {
193 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
194 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
195 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
196 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
197 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
198 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
199 { { .avp_vendor = 0, .avp_name = "CC-Request-Type"}, RULE_REQUIRED, -1, -1 },
200 { { .avp_vendor = 0, .avp_name = "CC-Request-Number"}, RULE_REQUIRED, -1, -1 },
Javier Bravo Conde13b0e7d2018-07-09 17:08:51 -0500201 { { .avp_vendor = 0, .avp_name = "Service-Context-Id"}, RULE_OPTIONAL, -1, -1 },
Brian Waters13d96012017-12-08 16:53:31 -0600202 { { .avp_vendor = 10415, .avp_name = "Credit-Management-Status"}, RULE_OPTIONAL, -1, -1 },
203 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_OPTIONAL, -1, -1 },
204 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, 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 = 10415, .avp_name = "TDF-Information"}, RULE_OPTIONAL, -1, -1 },
209 { { .avp_vendor = 10415, .avp_name = "Network-Request-Support"}, RULE_OPTIONAL, -1, -1 },
210 { { .avp_vendor = 10415, .avp_name = "Packet-Filter-Information"}, RULE_OPTIONAL, -1, -1 },
211 { { .avp_vendor = 10415, .avp_name = "Packet-Filter-Operation"}, RULE_OPTIONAL, -1, -1 },
212 { { .avp_vendor = 10415, .avp_name = "Bearer-Identifier"}, RULE_OPTIONAL, -1, -1 },
213 { { .avp_vendor = 10415, .avp_name = "Bearer-Operation"}, RULE_OPTIONAL, -1, -1 },
214 { { .avp_vendor = 10415, .avp_name = "Dynamic-Address-Flag"}, RULE_OPTIONAL, -1, -1 },
215 { { .avp_vendor = 10415, .avp_name = "Dynamic-Address-Flag-Extension"}, RULE_OPTIONAL, -1, -1 },
216 { { .avp_vendor = 10415, .avp_name = "PDN-Connection-Charging-ID"}, RULE_OPTIONAL, -1, -1 },
217 { { .avp_vendor = 0, .avp_name = "Framed-IP-Address"}, RULE_OPTIONAL, -1, -1 },
218 { { .avp_vendor = 0, .avp_name = "Framed-IPv6-Prefix"}, RULE_OPTIONAL, -1, -1 },
219 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
220 { { .avp_vendor = 10415, .avp_name = "3GPP-RAT-Type"}, RULE_OPTIONAL, -1, -1 },
221 { { .avp_vendor = 10415, .avp_name = "AN-Trusted"}, RULE_OPTIONAL, -1, -1 },
222 { { .avp_vendor = 10415, .avp_name = "RAT-Type"}, RULE_OPTIONAL, -1, -1 },
223 { { .avp_vendor = 0, .avp_name = "Termination-Cause"}, RULE_OPTIONAL, -1, -1 },
224 { { .avp_vendor = 0, .avp_name = "User-Equipment-Info"}, RULE_OPTIONAL, -1, -1 },
225 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
226 { { .avp_vendor = 10415, .avp_name = "QoS-Negotiation"}, RULE_OPTIONAL, -1, -1 },
227 { { .avp_vendor = 10415, .avp_name = "QoS-Upgrade"}, RULE_OPTIONAL, -1, -1 },
228 { { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS"}, RULE_OPTIONAL, -1, -1 },
229 { { .avp_vendor = 10415, .avp_name = "Default-QoS-Information"}, RULE_OPTIONAL, -1, -1 },
230 { { .avp_vendor = 10415, .avp_name = "AN-GW-Address"}, RULE_OPTIONAL, 0, 2 },
231 { { .avp_vendor = 10415, .avp_name = "AN-GW-Status"}, RULE_OPTIONAL, -1, -1 },
232 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
233 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Address"}, RULE_OPTIONAL, -1, -1 },
234 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Ipv6-Address"}, RULE_OPTIONAL, -1, -1 },
235 { { .avp_vendor = 10415, .avp_name = "3GPP-GGSN-Address"}, RULE_OPTIONAL, -1, -1 },
236 { { .avp_vendor = 10415, .avp_name = "3GPP-GGSN-Ipv6-Address"}, RULE_OPTIONAL, -1, -1 },
237 { { .avp_vendor = 10415, .avp_name = "3GPP-Selection-Mode"}, RULE_OPTIONAL, -1, -1 },
238 { { .avp_vendor = 10415, .avp_name = "RAI"}, RULE_OPTIONAL, -1, -1 },
239 { { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
240 { { .avp_vendor = 10415, .avp_name = "Fixed-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
241 { { .avp_vendor = 10415, .avp_name = "User-Location-Info-Time"}, RULE_OPTIONAL, -1, -1 },
242 { { .avp_vendor = 10415, .avp_name = "User-CSG-Information"}, RULE_OPTIONAL, -1, -1 },
243 { { .avp_vendor = 10415, .avp_name = "TWAN-Identifier"}, RULE_OPTIONAL, -1, -1 },
244 { { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone"}, RULE_OPTIONAL, -1, -1 },
245 { { .avp_vendor = 10415, .avp_name = "RAN-NAS-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
246 { { .avp_vendor = 10415, .avp_name = "3GPP-Charging-Characteristics"}, RULE_OPTIONAL, -1, -1 },
247 { { .avp_vendor = 0, .avp_name = "Called-Station-Id"}, RULE_OPTIONAL, -1, -1 },
248 { { .avp_vendor = 10415, .avp_name = "PDN-Connection-ID"}, RULE_OPTIONAL, -1, -1 },
249 { { .avp_vendor = 10415, .avp_name = "Bearer-Usage"}, RULE_OPTIONAL, -1, -1 },
250 { { .avp_vendor = 10415, .avp_name = "Online"}, RULE_OPTIONAL, -1, -1 },
251 { { .avp_vendor = 10415, .avp_name = "Offline"}, RULE_OPTIONAL, -1, -1 },
252 { { .avp_vendor = 10415, .avp_name = "TFT-Packet-Filter-Information"}, RULE_OPTIONAL, -1, -1 },
253 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
254 { { .avp_vendor = 10415, .avp_name = "Application-Detection-Information"}, RULE_OPTIONAL, -1, -1 },
255 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
256 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
257 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Address"}, RULE_OPTIONAL, -1, -1 },
258 { { .avp_vendor = 10415, .avp_name = "Access-Network-Charging-Identifier-Gx"}, RULE_OPTIONAL, -1, -1 },
259 { { .avp_vendor = 10415, .avp_name = "CoA-Information"}, RULE_OPTIONAL, -1, -1 },
260 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
261 { { .avp_vendor = 10415, .avp_name = "NBIFOM-Support"}, RULE_OPTIONAL, -1, -1 },
262 { { .avp_vendor = 10415, .avp_name = "NBIFOM-Mode"}, RULE_OPTIONAL, -1, -1 },
263 { { .avp_vendor = 10415, .avp_name = "Default-Access"}, RULE_OPTIONAL, -1, -1 },
264 { { .avp_vendor = 10415, .avp_name = "Origination-Time-Stamp"}, RULE_OPTIONAL, -1, -1 },
265 { { .avp_vendor = 10415, .avp_name = "Maximum-Wait-Time"}, RULE_OPTIONAL, -1, -1 },
266 { { .avp_vendor = 10415, .avp_name = "Access-Availability-Change-Reason"}, RULE_OPTIONAL, -1, -1 },
267 { { .avp_vendor = 10415, .avp_name = "Routing-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
268 { { .avp_vendor = 10415, .avp_name = "Routing-Rule-Remove"}, RULE_OPTIONAL, -1, -1 },
269 { { .avp_vendor = 10415, .avp_name = "HeNB-Local-IP-Address"}, RULE_OPTIONAL, -1, -1 },
270 { { .avp_vendor = 10415, .avp_name = "UE-Local-IP-Address"}, RULE_OPTIONAL, -1, -1 },
271 { { .avp_vendor = 10415, .avp_name = "UDP-Source-Port"}, RULE_OPTIONAL, -1, -1 },
272 { { .avp_vendor = 10415, .avp_name = "Presence-Reporting-Area-Information"}, RULE_OPTIONAL, -1, -1 },
273 { { .avp_vendor = 13019, .avp_name = "Logical-Access-Id"}, RULE_OPTIONAL, -1, -1 },
274 { { .avp_vendor = 13019, .avp_name = "Physical-Access-Id"}, RULE_OPTIONAL, -1, -1 },
275 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
276 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 },
277 { { .avp_vendor = 10415, .avp_name = "3GPP-PS-Data-Off-Status"}, RULE_OPTIONAL, -1, -1 }
278 };
279 PARSE_loc_rules(rules, cmd);
280 }
281 /* Credit-Control-Answer */
282 {
283 struct dict_object* cmd;
284 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Credit-Control-Answer", &cmd)
285 struct local_rules_definition rules[] =
286 {
287 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
288 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
289 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
290 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
291 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
292 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
293 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
294 { { .avp_vendor = 0, .avp_name = "CC-Request-Type"}, RULE_REQUIRED, -1, -1 },
295 { { .avp_vendor = 0, .avp_name = "CC-Request-Number"}, RULE_REQUIRED, -1, -1 },
296 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
297 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
298 { { .avp_vendor = 10415, .avp_name = "Supported-Features"}, RULE_OPTIONAL, -1, -1 },
299 { { .avp_vendor = 10415, .avp_name = "Bearer-Control-Mode"}, RULE_OPTIONAL, -1, -1 },
300 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
301 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
302 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
303 { { .avp_vendor = 0, .avp_name = "Redirect-Host"}, RULE_OPTIONAL, -1, -1 },
304 { { .avp_vendor = 0, .avp_name = "Redirect-Host-Usage"}, RULE_OPTIONAL, -1, -1 },
305 { { .avp_vendor = 0, .avp_name = "Redirect-Max-Cache-Time"}, RULE_OPTIONAL, -1, -1 },
306 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Remove"}, RULE_OPTIONAL, -1, -1 },
307 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
308 { { .avp_vendor = 10415, .avp_name = "Charging-Information"}, RULE_OPTIONAL, -1, -1 },
309 { { .avp_vendor = 10415, .avp_name = "Online"}, RULE_OPTIONAL, -1, -1 },
310 { { .avp_vendor = 10415, .avp_name = "Offline"}, RULE_OPTIONAL, -1, -1 },
311 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
312 { { .avp_vendor = 10415, .avp_name = "Revalidation-Time"}, RULE_OPTIONAL, -1, -1 },
313 { { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS"}, RULE_OPTIONAL, -1, -1 },
314 { { .avp_vendor = 10415, .avp_name = "Default-QoS-Information"}, RULE_OPTIONAL, -1, -1 },
315 { { .avp_vendor = 10415, .avp_name = "Bearer-Usage"}, RULE_OPTIONAL, -1, -1 },
316 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
317 { { .avp_vendor = 10415, .avp_name = "CSG-Information-Reporting"}, RULE_OPTIONAL, -1, -1 },
318 { { .avp_vendor = 10415, .avp_name = "User-CSG-Information"}, RULE_OPTIONAL, -1, -1 },
319 { { .avp_vendor = 10415, .avp_name = "PRA-Install"}, RULE_OPTIONAL, -1, -1 },
320 { { .avp_vendor = 10415, .avp_name = "PRA-Remove"}, RULE_OPTIONAL, -1, -1 },
321 { { .avp_vendor = 10415, .avp_name = "Presence-Reporting-Area-Information"}, RULE_OPTIONAL, -1, -1 },
322 { { .avp_vendor = 10415, .avp_name = "Session-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
323 { { .avp_vendor = 10415, .avp_name = "NBIFOM-Support"}, RULE_OPTIONAL, -1, -1 },
324 { { .avp_vendor = 10415, .avp_name = "NBIFOM-Mode"}, RULE_OPTIONAL, -1, -1 },
325 { { .avp_vendor = 10415, .avp_name = "Default-Access"}, RULE_OPTIONAL, -1, -1 },
326 { { .avp_vendor = 10415, .avp_name = "RAN-Rule-Support"}, RULE_OPTIONAL, -1, -1 },
327 { { .avp_vendor = 10415, .avp_name = "Routing-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
328 { { .avp_vendor = 10415, .avp_name = "Conditional-Policy-Information"}, RULE_OPTIONAL, 0, 4 },
329 { { .avp_vendor = 10415, .avp_name = "Removal-Of-Access"}, RULE_OPTIONAL, -1, -1 },
330 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
331 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
332 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
333 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
334 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
335 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 },
336 { { .avp_vendor = 0, .avp_name = "Load"}, RULE_OPTIONAL, -1, -1 }
337 };
338 PARSE_loc_rules(rules, cmd);
339 }
340 /* Re-Auth-Request */
341 {
342 struct dict_object* cmd;
343 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Request", &cmd)
344 struct local_rules_definition rules[] =
345 {
346 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
347 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
348 { { .avp_vendor = 0, .avp_name = "Auth-Application-Id"}, RULE_REQUIRED, -1, -1 },
349 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
350 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
351 { { .avp_vendor = 0, .avp_name = "Destination-Realm"}, RULE_REQUIRED, -1, -1 },
352 { { .avp_vendor = 0, .avp_name = "Destination-Host"}, RULE_REQUIRED, -1, -1 },
353 { { .avp_vendor = 0, .avp_name = "Re-Auth-Request-Type"}, RULE_REQUIRED, -1, -1 },
354 { { .avp_vendor = 10415, .avp_name = "Session-Release-Cause"}, RULE_OPTIONAL, -1, -1 },
355 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
356 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
357 { { .avp_vendor = 10415, .avp_name = "Event-Trigger"}, RULE_OPTIONAL, -1, -1 },
358 { { .avp_vendor = 10415, .avp_name = "Event-Report-Indication"}, RULE_OPTIONAL, -1, -1 },
359 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Remove"}, RULE_OPTIONAL, -1, -1 },
360 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Install"}, RULE_OPTIONAL, -1, -1 },
361 { { .avp_vendor = 10415, .avp_name = "Default-EPS-Bearer-QoS"}, RULE_OPTIONAL, -1, -1 },
362 { { .avp_vendor = 10415, .avp_name = "QoS-Information"}, RULE_OPTIONAL, -1, -1 },
363 { { .avp_vendor = 10415, .avp_name = "Default-QoS-Information"}, RULE_OPTIONAL, -1, -1 },
364 { { .avp_vendor = 10415, .avp_name = "Revalidation-Time"}, RULE_OPTIONAL, -1, -1 },
365 { { .avp_vendor = 10415, .avp_name = "Usage-Monitoring-Information"}, RULE_OPTIONAL, -1, -1 },
366 { { .avp_vendor = 10415, .avp_name = "PCSCF-Restoration-Indication"}, RULE_OPTIONAL, -1, -1 },
367 { { .avp_vendor = 10415, .avp_name = "Conditional-Policy-Information"}, RULE_OPTIONAL, 0, 4 },
368 { { .avp_vendor = 10415, .avp_name = "Removal-Of-Access"}, RULE_OPTIONAL, -1, -1 },
369 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
370 { { .avp_vendor = 10415, .avp_name = "PRA-Install"}, RULE_OPTIONAL, -1, -1 },
371 { { .avp_vendor = 10415, .avp_name = "PRA-Remove"}, RULE_OPTIONAL, -1, -1 },
372 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 },
373 { { .avp_vendor = 0, .avp_name = "Route-Record"}, RULE_OPTIONAL, -1, -1 }
374 };
375 PARSE_loc_rules(rules, cmd);
376 }
377 /* Re-Auth-Answer */
378 {
379 struct dict_object* cmd;
380 CHECK_dict_search( DICT_COMMAND, CMD_BY_NAME, "Re-Auth-Answer", &cmd)
381 struct local_rules_definition rules[] =
382 {
383 { { .avp_vendor = 0, .avp_name = "Session-Id"}, RULE_FIXED_HEAD, -1, -1 },
384 { { .avp_vendor = 0, .avp_name = "DRMP"}, RULE_OPTIONAL, -1, -1 },
385 { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 },
386 { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 },
387 { { .avp_vendor = 0, .avp_name = "Result-Code"}, RULE_OPTIONAL, -1, -1 },
388 { { .avp_vendor = 0, .avp_name = "Experimental-Result"}, RULE_OPTIONAL, -1, -1 },
389 { { .avp_vendor = 0, .avp_name = "Origin-State-Id"}, RULE_OPTIONAL, -1, -1 },
390 { { .avp_vendor = 0, .avp_name = "OC-Supported-Features"}, RULE_OPTIONAL, -1, -1 },
391 { { .avp_vendor = 0, .avp_name = "OC-OLR"}, RULE_OPTIONAL, -1, -1 },
392 { { .avp_vendor = 10415, .avp_name = "IP-CAN-Type"}, RULE_OPTIONAL, -1, -1 },
393 { { .avp_vendor = 10415, .avp_name = "RAT-Type"}, RULE_OPTIONAL, -1, -1 },
394 { { .avp_vendor = 10415, .avp_name = "AN-Trusted"}, RULE_OPTIONAL, -1, -1 },
395 { { .avp_vendor = 10415, .avp_name = "AN-GW-Address"}, RULE_OPTIONAL, 0, 2 },
396 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-MCC-MNC"}, RULE_OPTIONAL, -1, -1 },
397 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Address"}, RULE_OPTIONAL, -1, -1 },
398 { { .avp_vendor = 10415, .avp_name = "3GPP-SGSN-Ipv6-Address"}, RULE_OPTIONAL, -1, -1 },
399 { { .avp_vendor = 10415, .avp_name = "RAI"}, RULE_OPTIONAL, -1, -1 },
400 { { .avp_vendor = 10415, .avp_name = "3GPP-User-Location-Info"}, RULE_OPTIONAL, -1, -1 },
401 { { .avp_vendor = 10415, .avp_name = "User-Location-Info-Time"}, RULE_OPTIONAL, -1, -1 },
402 { { .avp_vendor = 10415, .avp_name = "NetLoc-Access-Support"}, RULE_OPTIONAL, -1, -1 },
403 { { .avp_vendor = 10415, .avp_name = "User-CSG-Information"}, RULE_OPTIONAL, -1, -1 },
404 { { .avp_vendor = 10415, .avp_name = "3GPP-MS-TimeZone"}, RULE_OPTIONAL, -1, -1 },
405 { { .avp_vendor = 10415, .avp_name = "Default-QoS-Information"}, RULE_OPTIONAL, -1, -1 },
406 { { .avp_vendor = 10415, .avp_name = "Charging-Rule-Report"}, RULE_OPTIONAL, -1, -1 },
407 { { .avp_vendor = 0, .avp_name = "Error-Message"}, RULE_OPTIONAL, -1, -1 },
408 { { .avp_vendor = 0, .avp_name = "Error-Reporting-Host"}, RULE_OPTIONAL, -1, -1 },
409 { { .avp_vendor = 0, .avp_name = "Failed-AVP"}, RULE_OPTIONAL, -1, -1 },
410 { { .avp_vendor = 0, .avp_name = "Proxy-Info"}, RULE_OPTIONAL, -1, -1 }
411 };
412 PARSE_loc_rules(rules, cmd);
413 }
414
415 }
416
417 LOG_D( "Extension 'Dictionary definitions for Gx (e30)' initialized");
418 return 0;
419}
420
421int dict_entry(char * conffile)
422{
423 dict_gx_load_defs(conffile);
424 return dict_gx_load_rules(conffile);
425}
426
Javier Bravo Condeeb10c6f2018-06-28 08:43:34 -0500427const char* dict_proto_ver(char * conffile) {
Brian Waters13d96012017-12-08 16:53:31 -0600428 return gx_proto_ver;
429}
430
Javier Bravo Condeeb10c6f2018-06-28 08:43:34 -0500431const double dict_gen_ts(char * conffile) {
Brian Waters13d96012017-12-08 16:53:31 -0600432 return gx_gen_date;
433}
434
435EXTENSION_ENTRY2("dict_gx", dict_gx_load_defs, dict_gx_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");
436
437
438