blob: c97db985b7dd8b8a00a02aa50794321759d1724e [file] [log] [blame]
#ifndef __URSP_STRUCT_H__
#define __URSP_STRUCT_H__
#include "kal_general_types.h"
#include "kal_public_defs.h"
#include "mcd_l3_inc_struct.h"
#include "atcmd_enum.h"
#include "ursp_public_defs.h"
// Type definition
typedef struct ursp_hdr ursp_hdr_t;
typedef struct ursp_hdr* ursp_hdr_ptr_t;
// Macros
#define URSP_REQ_LOCAL_PARA_HDR \
LOCAL_PARA_HDR \
kal_uint16 seq_num;
#define URSP_CNF_LOCAL_PARA_HDR \
LOCAL_PARA_HDR \
kal_uint16 seq_num;
#define URSP_IND_LOCAL_PARA_HDR \
LOCAL_PARA_HDR \
kal_uint16 seq_num;
#define URSP_RSP_LOCAL_PARA_HDR \
LOCAL_PARA_HDR \
kal_uint16 seq_num;
// Interface
// N/A
// Implementation
struct ursp_hdr
{
LOCAL_PARA_HDR
kal_uint16 seq_num;
};
/*******************************************************************************
* URSP Internal *
*******************************************************************************/
// => Internal data type for URSP
#pragma pack(push, 1)
typedef struct
{
kal_uint8 ipv4_addr[URSP_TDC_LEN_IPV4_REMOTE_ADDR];
kal_uint8 ipv4_mask[URSP_TDC_LEN_IPV4_REMOTE_MASK];
}tdc_16_t;
typedef struct
{
kal_uint8 ipv6_addr[URSP_TDC_LEN_IPV6_REMOTE_ADDR];
kal_uint8 ipv6_prefix_len;
}tdc_33_t;
typedef union
{
kal_uint8 ipv4_prot_id;
kal_uint8 ipv6_next_hdr;
}tdc_48_t;
typedef struct tdc_81
{
kal_uint16 min_remote_port;
kal_uint16 max_remote_port;
}tdc_81_t;
typedef struct tdc_82
{
union
{
tdc_16_t ipv4;
tdc_33_t ipv6;
}remote_addr;
tdc_48_t prot_id_next_hdr;
union
{
kal_uint16 single;
tdc_81_t range;
}remote_port;
}tdc_82_t;
typedef struct
{
union
{
kal_uint8 ipv4_tos;
kal_uint8 ipv6_tc;
}val;
union
{
kal_uint8 ipv4_tos_mask;
kal_uint8 ipv6_tc_mask;
}mask;
}tdc_112_t;
typedef struct
{
kal_uint8 s_tag_pcp;
kal_uint8 s_tag_dei;
}tdc_134_t;
#pragma pack(pop)
typedef struct
{
kal_bool is_match_all;
kal_uint8 dnn_len;
kal_char dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
kal_uint8 os_id[URSP_TDC_LEN_OS_ID]; // UUID in RFC 4122
kal_uint8 app_id_len;
kal_uint8 app_id[URSP_TDC_LEN_OS_APP_ID];
kal_uint8 ipv4_addr[URSP_TDC_LEN_IPV4_REMOTE_ADDR];
kal_uint8 ipv4_mask[URSP_TDC_LEN_IPV4_REMOTE_MASK];
kal_uint8 ipv6_addr[URSP_TDC_LEN_IPV6_REMOTE_ADDR];
kal_uint8 ipv6_prefix_len;
kal_uint8 prot_id_next_hdr;
kal_uint16 single_remote_port;
kal_uint16 min_remote_port;
kal_uint16 max_remote_port;
kal_uint8 dst_fqdn_len;
kal_uint8 dst_fqdn[URSP_TDC_LEN_DST_FQDN];
}ursp_traffic_desc_struct;
typedef struct
{
kal_uint8 p_val;
kal_uint8 ssc_mode;
kal_uint8 s_nssai_len;
kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
kal_uint8 dnn_len;
kal_uint8 dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
kal_uint8 pdu_session_type;
kal_uint8 pref_access_type;
}ursp_route_sel_desc_struct;
typedef struct
{
kal_uint8 p_val;
ursp_traffic_desc_struct traffic_desc;
kal_uint8 num_of_rsd;
ursp_route_sel_desc_struct route_sel_desc_list[URSP_RULE_MAX_ROUTE_SEL_DESC_LIST_SIZE];
}ursp_rule_struct;
typedef struct
{
kal_uint8 ssc_mode;
kal_uint8 s_nssai_len;
kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
kal_uint8 dnn_len;
kal_uint8 dnn[URSP_TDC_LEN_DNN]; // APN in TS 23.003
kal_uint8 pdu_session_type;
kal_uint8 pref_access_type;
}ursp_ue_local_conf_struct;
typedef ursp_ue_local_conf_struct ursp_est_req_param_struct;
/*******************************************************************************
* User to URSP REQ *
*******************************************************************************/
// MSG_ID_URSP_GET_ROUTE_PROFILE_REQ
typedef struct
{
URSP_REQ_LOCAL_PARA_HDR
/* common part */
kal_int32 cid;
}ursp_get_route_profile_req_struct;
// MSG_ID_URSP_REEVAL_REQ
typedef struct
{
URSP_REQ_LOCAL_PARA_HDR
/* common part */
ursp_reeval_event_enum event;
union
{
// Periodic
struct
{
int unused;
}periodic;
// PDU release
struct
{
int unused;
}pdu_rel;
// PCF Update
struct
{
int unused;
}pcf_update;
// Inter-system change from S1 to N1
struct
{
int unused;
}inter_sys;
// Registered in N1
struct
{
int unused;
}reg;
// Establishing a connection to a WLAN access
struct
{
int unused;
}wlan_est;
// Releasing a connection to a WLAN access
struct
{
int unused;
}wlan_rel;
// Allowed NSSAI change
struct
{
int unused;
}allowed_nssai;
// LADN information changed
struct
{
kal_char dnn_list[APN_STRING_LEN * URSP_MAX_LADN_DNN_NUM];
kal_uint8 in_out[URSP_LDAN_DNN_BITMAP_SIZE];
}ladn;
}param;
}ursp_reeval_req_struct;
// MSG_ID_URSP_SET_PRECONF_UE_POLICY_REQ
typedef struct
{
URSP_REQ_LOCAL_PARA_HDR
plmn_id_struct plmn_id;
kal_uint8 num_of_rule;
ursp_rule_struct rule_list[URSP_UE_POLICY_MAX_RULE_LIST_SIZE];
}ursp_set_preconf_ue_policy_req_struct;
// MSG_ID_URSP_SET_USIM_UE_POLICY_REQ
typedef struct
{
URSP_REQ_LOCAL_PARA_HDR
int unused;
}ursp_set_usim_ue_policy_req_struct;
// MSG_ID_URSP_GET_UE_POLICY_REQ
typedef struct
{
URSP_REQ_LOCAL_PARA_HDR
plmn_id_struct plmn_id;
}ursp_get_ue_policy_req_struct;
/*******************************************************************************
* URSP to User CNF *
*******************************************************************************/
// MSG_ID_URSP_GET_ROUTE_PROFILE_CNF
typedef struct
{
URSP_CNF_LOCAL_PARA_HDR
/* common part */
ursp_res_enum res;
}ursp_get_route_profile_cnf_struct;
// MSG_ID_URSP_REEVAL_CNF
typedef struct
{
URSP_CNF_LOCAL_PARA_HDR
/* common part */
ursp_res_enum res;
}ursp_reeval_cnf_struct;
// MSG_ID_URSP_SET_PRECONF_UE_POLICY_CNF
typedef struct
{
URSP_CNF_LOCAL_PARA_HDR
/* common part */
ursp_res_enum res;
}ursp_set_preconf_ue_policy_cnf_struct;
// MSG_ID_URSP_SET_USIM_UE_POLICY_CNF
typedef struct
{
URSP_CNF_LOCAL_PARA_HDR
int unused;
}ursp_set_usim_ue_policy_cnf_struct;
// MSG_ID_URSP_GET_UE_POLICY_CNF
typedef struct
{
URSP_CNF_LOCAL_PARA_HDR
/* common part */
ursp_res_enum res;
}ursp_get_ue_policy_cnf_struct;
/*******************************************************************************
* URSP to User IND *
*******************************************************************************/
// MSG_ID_URSP_GET_ROUTE_PROFILE_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
/* common part */
kal_int32 cid;
ursp_est_req_param_struct est_req_param;
kal_uint32 attr;
}ursp_get_route_profile_ind_struct;
// MSG_ID_URSP_GET_ROUTE_SUPP_PROFILE_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
/* common part */
kal_int32 cid;
ursp_route_supp_profile_type_enum type;
union
{
struct
{
ursp_traffic_desc_struct traffic_desc;
ursp_ue_local_conf_struct ue_local_conf;
kal_bool match_all_disallow;
}req;
}info;
}ursp_get_route_supp_profile_ind_struct;
// MSG_ID_URSP_REEVAL_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
/* common part */
kal_uint8 cid[URSP_CID_BITMAP_SIZE]; // a bitmap
ursp_reeval_event_enum event;
}ursp_reeval_ind_struct;
// MSG_ID_URSP_GET_UE_POLICY_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
/* common part */
plmn_id_struct plmn_id;
kal_uint8 num_of_rule;
ursp_rule_struct rule_list[URSP_UE_POLICY_MAX_RULE_LIST_SIZE];
}ursp_get_ue_policy_ind_struct;
// MSG_ID_URSP_UE_POLICY_CHG_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
/* common part */
plmn_id_struct plmn_id;
}ursp_ue_policy_chg_ind_struct;
// MSG_ID_URSP_RULE_TBL_DUMP_IND
typedef struct
{
URSP_IND_LOCAL_PARA_HDR
// UPSI
plmn_id_struct plmn_id;
kal_uint16 upsc;
// URSP rule
kal_uint8 rule_p_val;
kal_uint8 rsd_p_val;
// Traffic descriptor
kal_bool is_match_all;
kal_uint8 os_id[URSP_TDC_LEN_OS_ID];
tdc_16_t tdc_16;
tdc_16_t tdc_33;
tdc_16_t tdc_48;
kal_uint16 single_remote_port;
tdc_16_t tdc_81;
kal_uint32 ipsec_spi;
tdc_16_t tdc_112;
kal_uint8 flow_label[3];
kal_uint8 dst_mac_addr[6];
kal_uint8 c_tag_vid[2];
kal_uint8 s_tag_vid[2];
kal_uint8 c_tag_pcp_dei;
kal_uint8 s_tag_pcp_dei;
kal_uint16 eth_type;
kal_uint8 td_dnn[URSP_TDC_LEN_DNN];
kal_uint8 conn_cap[URSP_TDC_LEN_CONN_CAP];
kal_uint8 dst_fqdn[URSP_TDC_LEN_DST_FQDN];
kal_uint8 os_app_id[URSP_TDC_LEN_OS_APP_ID];
// Route selection descriptor
kal_uint8 ssc_mode;
kal_uint8 s_nssai[URSP_RSDC_LEN_S_NSSAI];
kal_uint8 rsd_dnn[URSP_RSDC_LEN_DNN];
kal_uint8 pdu_session_type;
kal_uint8 pref_access_type;
kal_bool is_nsn3_offload;
}ursp_rule_tbl_dump_ind_struct;
/*******************************************************************************
* User to URSP RSP *
*******************************************************************************/
// N/A
#endif