blob: c97db985b7dd8b8a00a02aa50794321759d1724e [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001#ifndef __URSP_STRUCT_H__
2#define __URSP_STRUCT_H__
3
4#include "kal_general_types.h"
5#include "kal_public_defs.h"
6#include "mcd_l3_inc_struct.h"
7#include "atcmd_enum.h"
8#include "ursp_public_defs.h"
9
10// Type definition
11typedef struct ursp_hdr ursp_hdr_t;
12typedef struct ursp_hdr* ursp_hdr_ptr_t;
13
14// Macros
15#define URSP_REQ_LOCAL_PARA_HDR \
16 LOCAL_PARA_HDR \
17 kal_uint16 seq_num;
18
19#define URSP_CNF_LOCAL_PARA_HDR \
20 LOCAL_PARA_HDR \
21 kal_uint16 seq_num;
22
23#define URSP_IND_LOCAL_PARA_HDR \
24 LOCAL_PARA_HDR \
25 kal_uint16 seq_num;
26
27#define URSP_RSP_LOCAL_PARA_HDR \
28 LOCAL_PARA_HDR \
29 kal_uint16 seq_num;
30
31// Interface
32// N/A
33
34// Implementation
35struct ursp_hdr
36{
37 LOCAL_PARA_HDR
38 kal_uint16 seq_num;
39};
40
41
42/*******************************************************************************
43 * URSP Internal *
44 *******************************************************************************/
45
46// => Internal data type for URSP
47#pragma pack(push, 1)
48typedef struct
49{
50 kal_uint8 ipv4_addr[URSP_TDC_LEN_IPV4_REMOTE_ADDR];
51 kal_uint8 ipv4_mask[URSP_TDC_LEN_IPV4_REMOTE_MASK];
52}tdc_16_t;
53typedef struct
54{
55 kal_uint8 ipv6_addr[URSP_TDC_LEN_IPV6_REMOTE_ADDR];
56 kal_uint8 ipv6_prefix_len;
57}tdc_33_t;
58typedef union
59{
60 kal_uint8 ipv4_prot_id;
61 kal_uint8 ipv6_next_hdr;
62}tdc_48_t;
63typedef struct tdc_81
64{
65 kal_uint16 min_remote_port;
66 kal_uint16 max_remote_port;
67}tdc_81_t;
68typedef struct tdc_82
69{
70 union
71 {
72 tdc_16_t ipv4;
73 tdc_33_t ipv6;
74 }remote_addr;
75 tdc_48_t prot_id_next_hdr;
76 union
77 {
78 kal_uint16 single;
79 tdc_81_t range;
80 }remote_port;
81}tdc_82_t;
82typedef struct
83{
84 union
85 {
86 kal_uint8 ipv4_tos;
87 kal_uint8 ipv6_tc;
88 }val;
89 union
90 {
91 kal_uint8 ipv4_tos_mask;
92 kal_uint8 ipv6_tc_mask;
93 }mask;
94}tdc_112_t;
95typedef struct
96{
97 kal_uint8 s_tag_pcp;
98 kal_uint8 s_tag_dei;
99}tdc_134_t;
100#pragma pack(pop)
101
102typedef struct
103{
104 kal_bool is_match_all;
105 kal_uint8 dnn_len;
106 kal_char dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
107 kal_uint8 os_id[URSP_TDC_LEN_OS_ID]; // UUID in RFC 4122
108 kal_uint8 app_id_len;
109 kal_uint8 app_id[URSP_TDC_LEN_OS_APP_ID];
110 kal_uint8 ipv4_addr[URSP_TDC_LEN_IPV4_REMOTE_ADDR];
111 kal_uint8 ipv4_mask[URSP_TDC_LEN_IPV4_REMOTE_MASK];
112 kal_uint8 ipv6_addr[URSP_TDC_LEN_IPV6_REMOTE_ADDR];
113 kal_uint8 ipv6_prefix_len;
114 kal_uint8 prot_id_next_hdr;
115 kal_uint16 single_remote_port;
116 kal_uint16 min_remote_port;
117 kal_uint16 max_remote_port;
118 kal_uint8 dst_fqdn_len;
119 kal_uint8 dst_fqdn[URSP_TDC_LEN_DST_FQDN];
120}ursp_traffic_desc_struct;
121
122typedef struct
123{
124 kal_uint8 p_val;
125 kal_uint8 ssc_mode;
126 kal_uint8 s_nssai_len;
127 kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
128 kal_uint8 dnn_len;
129 kal_uint8 dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
130 kal_uint8 pdu_session_type;
131 kal_uint8 pref_access_type;
132}ursp_route_sel_desc_struct;
133
134typedef struct
135{
136 kal_uint8 p_val;
137 ursp_traffic_desc_struct traffic_desc;
138 kal_uint8 num_of_rsd;
139 ursp_route_sel_desc_struct route_sel_desc_list[URSP_RULE_MAX_ROUTE_SEL_DESC_LIST_SIZE];
140}ursp_rule_struct;
141
142typedef struct
143{
144 kal_uint8 ssc_mode;
145 kal_uint8 s_nssai_len;
146 kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
147 kal_uint8 dnn_len;
148 kal_uint8 dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
149 kal_uint8 pdu_session_type;
150 kal_uint8 pref_access_type;
151}ursp_ue_local_conf_struct;
152typedef ursp_ue_local_conf_struct ursp_est_req_param_struct;
153
154
155/*******************************************************************************
156 * User to URSP REQ *
157 *******************************************************************************/
158
159// MSG_ID_URSP_GET_ROUTE_PROFILE_REQ
160typedef struct
161{
162 URSP_REQ_LOCAL_PARA_HDR
163
164 /* common part */
165 kal_int32 cid;
166}ursp_get_route_profile_req_struct;
167
168// MSG_ID_URSP_REEVAL_REQ
169typedef struct
170{
171 URSP_REQ_LOCAL_PARA_HDR
172
173 /* common part */
174 ursp_reeval_event_enum event;
175 union
176 {
177 // Periodic
178 struct
179 {
180 int unused;
181 }periodic;
182
183 // PDU release
184 struct
185 {
186 int unused;
187 }pdu_rel;
188
189 // PCF Update
190 struct
191 {
192 int unused;
193 }pcf_update;
194
195 // Inter-system change from S1 to N1
196 struct
197 {
198 int unused;
199 }inter_sys;
200
201 // Registered in N1
202 struct
203 {
204 int unused;
205 }reg;
206
207 // Establishing a connection to a WLAN access
208 struct
209 {
210 int unused;
211 }wlan_est;
212
213 // Releasing a connection to a WLAN access
214 struct
215 {
216 int unused;
217 }wlan_rel;
218
219 // Allowed NSSAI change
220 struct
221 {
222 int unused;
223 }allowed_nssai;
224
225 // LADN information changed
226 struct
227 {
228 kal_char dnn_list[APN_STRING_LEN * URSP_MAX_LADN_DNN_NUM];
229 kal_uint8 in_out[URSP_LDAN_DNN_BITMAP_SIZE];
230 }ladn;
231 }param;
232}ursp_reeval_req_struct;
233
234// MSG_ID_URSP_SET_PRECONF_UE_POLICY_REQ
235typedef struct
236{
237 URSP_REQ_LOCAL_PARA_HDR
238
239 plmn_id_struct plmn_id;
240 kal_uint8 num_of_rule;
241 ursp_rule_struct rule_list[URSP_UE_POLICY_MAX_RULE_LIST_SIZE];
242}ursp_set_preconf_ue_policy_req_struct;
243
244// MSG_ID_URSP_SET_USIM_UE_POLICY_REQ
245typedef struct
246{
247 URSP_REQ_LOCAL_PARA_HDR
248
249 int unused;
250}ursp_set_usim_ue_policy_req_struct;
251
252// MSG_ID_URSP_GET_UE_POLICY_REQ
253typedef struct
254{
255 URSP_REQ_LOCAL_PARA_HDR
256
257 plmn_id_struct plmn_id;
258}ursp_get_ue_policy_req_struct;
259
260
261/*******************************************************************************
262 * URSP to User CNF *
263 *******************************************************************************/
264
265// MSG_ID_URSP_GET_ROUTE_PROFILE_CNF
266typedef struct
267{
268 URSP_CNF_LOCAL_PARA_HDR
269
270 /* common part */
271 ursp_res_enum res;
272}ursp_get_route_profile_cnf_struct;
273
274// MSG_ID_URSP_REEVAL_CNF
275typedef struct
276{
277 URSP_CNF_LOCAL_PARA_HDR
278
279 /* common part */
280 ursp_res_enum res;
281}ursp_reeval_cnf_struct;
282
283// MSG_ID_URSP_SET_PRECONF_UE_POLICY_CNF
284typedef struct
285{
286 URSP_CNF_LOCAL_PARA_HDR
287
288 /* common part */
289 ursp_res_enum res;
290}ursp_set_preconf_ue_policy_cnf_struct;
291
292// MSG_ID_URSP_SET_USIM_UE_POLICY_CNF
293typedef struct
294{
295 URSP_CNF_LOCAL_PARA_HDR
296
297 int unused;
298}ursp_set_usim_ue_policy_cnf_struct;
299
300// MSG_ID_URSP_GET_UE_POLICY_CNF
301typedef struct
302{
303 URSP_CNF_LOCAL_PARA_HDR
304
305 /* common part */
306 ursp_res_enum res;
307}ursp_get_ue_policy_cnf_struct;
308
309
310/*******************************************************************************
311 * URSP to User IND *
312 *******************************************************************************/
313
314// MSG_ID_URSP_GET_ROUTE_PROFILE_IND
315typedef struct
316{
317 URSP_IND_LOCAL_PARA_HDR
318
319 /* common part */
320 kal_int32 cid;
321 ursp_est_req_param_struct est_req_param;
322 kal_uint32 attr;
323}ursp_get_route_profile_ind_struct;
324
325// MSG_ID_URSP_GET_ROUTE_SUPP_PROFILE_IND
326typedef struct
327{
328 URSP_IND_LOCAL_PARA_HDR
329
330 /* common part */
331 kal_int32 cid;
332 ursp_route_supp_profile_type_enum type;
333 union
334 {
335 struct
336 {
337 ursp_traffic_desc_struct traffic_desc;
338 ursp_ue_local_conf_struct ue_local_conf;
339 kal_bool match_all_disallow;
340 }req;
341 }info;
342}ursp_get_route_supp_profile_ind_struct;
343
344// MSG_ID_URSP_REEVAL_IND
345typedef struct
346{
347 URSP_IND_LOCAL_PARA_HDR
348
349 /* common part */
350 kal_uint8 cid[URSP_CID_BITMAP_SIZE]; // a bitmap
351 ursp_reeval_event_enum event;
352}ursp_reeval_ind_struct;
353
354// MSG_ID_URSP_GET_UE_POLICY_IND
355typedef struct
356{
357 URSP_IND_LOCAL_PARA_HDR
358
359 /* common part */
360 plmn_id_struct plmn_id;
361 kal_uint8 num_of_rule;
362 ursp_rule_struct rule_list[URSP_UE_POLICY_MAX_RULE_LIST_SIZE];
363}ursp_get_ue_policy_ind_struct;
364
365// MSG_ID_URSP_UE_POLICY_CHG_IND
366typedef struct
367{
368 URSP_IND_LOCAL_PARA_HDR
369
370 /* common part */
371 plmn_id_struct plmn_id;
372}ursp_ue_policy_chg_ind_struct;
373
374// MSG_ID_URSP_RULE_TBL_DUMP_IND
375typedef struct
376{
377 URSP_IND_LOCAL_PARA_HDR
378
379 // UPSI
380 plmn_id_struct plmn_id;
381 kal_uint16 upsc;
382
383 // URSP rule
384 kal_uint8 rule_p_val;
385 kal_uint8 rsd_p_val;
386
387 // Traffic descriptor
388 kal_bool is_match_all;
389 kal_uint8 os_id[URSP_TDC_LEN_OS_ID];
390 tdc_16_t tdc_16;
391 tdc_16_t tdc_33;
392 tdc_16_t tdc_48;
393 kal_uint16 single_remote_port;
394 tdc_16_t tdc_81;
395 kal_uint32 ipsec_spi;
396 tdc_16_t tdc_112;
397 kal_uint8 flow_label[3];
398 kal_uint8 dst_mac_addr[6];
399 kal_uint8 c_tag_vid[2];
400 kal_uint8 s_tag_vid[2];
401 kal_uint8 c_tag_pcp_dei;
402 kal_uint8 s_tag_pcp_dei;
403 kal_uint16 eth_type;
404 kal_uint8 td_dnn[URSP_TDC_LEN_DNN];
405 kal_uint8 conn_cap[URSP_TDC_LEN_CONN_CAP];
406 kal_uint8 dst_fqdn[URSP_TDC_LEN_DST_FQDN];
407 kal_uint8 os_app_id[URSP_TDC_LEN_OS_APP_ID];
408
409 // Route selection descriptor
410 kal_uint8 ssc_mode;
411 kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
412 kal_uint8 rsd_dnn[URSP_RSDC_LEN_DNN];
413 kal_uint8 pdu_session_type;
414 kal_uint8 pref_access_type;
415 kal_bool is_nsn3_offload;
416}ursp_rule_tbl_dump_ind_struct;
417
418
419/*******************************************************************************
420 * User to URSP RSP *
421 *******************************************************************************/
422// N/A
423
424#endif