blob: 049ceca4bbf381e72a705e7bcbd043f2a1c458ad [file] [log] [blame]
#ifndef IPSEC_CP_MSG_H
#define IPSEC_CP_MSG_H
#include "ipsec_common_interface.h"
#ifdef __N3GPP_OVER_DATA__
#include "network_dev_info_struct.h"
#endif
//MSG_ID_IPSEC_SA_ADD_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;//req_id
//selector
ipsec_selector_t ipsec_selector[IPSEC_MAX_SELECTOR_NUM];
kal_uint32 ipsec_selector_count;/*the selector number in the SA entry, must <= IPSEC_MAX_SELECTOR_NUM*/
kal_uint32 spi;
ipsec_proto_enum ipsec_protocol;//ESP/AH
ipsec_mode_enum ipsec_mode;//Transport/Tunnel/Tunnel-UDP_Encap
kal_bool esn_flag;
kal_bool is_combined;
ipsec_encry_algo_enum encry_algo;//for ESP
ipsec_integ_algo_enum integrity_algo;//for ESP/AH
ipsec_com_algo_enum combined_algo;//reserved
kal_uint8 integ_key[IPSEC_ALGO_MAX_KEY_LEN];
kal_uint8 encry_key[IPSEC_ALGO_MAX_KEY_LEN];
kal_uint8 com_key[IPSEC_ALGO_MAX_KEY_LEN];
kal_uint32 encry_key_len;
kal_uint32 integ_key_len;
kal_uint32 com_key_len;
ipsec_tunnel_info_t tunnel_info;
ipsec_lft_t soft_lft;
ipsec_lft_t hard_lft;
#ifdef __N3GPP_OVER_DATA__
nw_device_id_enum dev_id;
#endif
}ipsec_sa_add_req_struct;
//MSG_ID_IPSEC_SA_ADD_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;//Used to instead selector to identify the SA, ipsec won't use it but just return to user in CNF msg.
kal_uint32 ipsec_said;//0xFFFFFFFF - invalid value
ipsec_status_enum status;// the result
} ipsec_sa_add_cnf_struct;
//MSG_ID_IPSEC_SP_ADD_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
kal_uint32 ipsec_said;// the related SA id
kal_uint32 interface_id;
//selector
ipsec_selector_t ipsec_selector[IPSEC_MAX_SELECTOR_NUM];
kal_uint32 ipsec_selector_count;/*the selector number in the SP entry, must <= IPSEC_MAX_SELECTOR_NUM*/
ipsec_proto_enum ipsec_protocol;
ipsec_mode_enum ipsec_mode;// Transport / Tunnel / Tunnel-UDP_Encap
ipsec_direction_enum direction;//int / out
/* As defined in RFC4301 Page31: Processing info */
ipsec_process_info_t *p_process_info;
}ipsec_sp_add_req_struct;
//MSG_ID_IPSEC_SP_ADD_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
kal_uint32 ipsec_spid;
ipsec_status_enum status;
} ipsec_sp_add_cnf_struct;
//MSG_ID_IPSEC_SP_DELETE_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_spid;
} ipsec_sp_delete_req_struct;
//MSG_ID_IPSEC_SA_DELETE_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
} ipsec_sa_delete_req_struct;
//MSG_ID_IPSEC_SA_DELETE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
ipsec_status_enum status;
} ipsec_sa_delete_cnf_struct;
//MSG_ID_IPSEC_SP_DELETE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_spid;
ipsec_status_enum status;
} ipsec_sp_delete_cnf_struct;
//MSG_ID_IPSEC_MULTI_SA_SP_DELETE_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
kal_uint32 sa_del_cnt;
kal_uint32 ipsec_said_list[IPSEC_MAX_SASP_DEL_NUM];
kal_uint32 sp_del_cnt;
kal_uint32 ipsec_spid_list[IPSEC_MAX_SASP_DEL_NUM];
}ipsec_multi_sa_sp_delete_req_struct;
//MSG_ID_IPSEC_MULTI_SA_SP_DELETE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
kal_uint32 sa_del_cnt;
kal_uint32 ipsec_said_list[IPSEC_MAX_SASP_DEL_NUM];
ipsec_status_enum ipsec_sa_status_list[IPSEC_MAX_SASP_DEL_NUM];
kal_uint32 sp_del_cnt;
kal_uint32 ipsec_spid_list[IPSEC_MAX_SASP_DEL_NUM];
ipsec_status_enum ipsec_sp_status_list[IPSEC_MAX_SASP_DEL_NUM];
}ipsec_multi_sa_sp_delete_cnf_struct;
//MSG_ID_IPSEC_REKEY_IND
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
} ipsec_rekey_ind_struct;
//MSG_ID_IPSEC_SA_DEL_IND
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
kal_uint32 cause;//indicate the cause that IPsec deletes SA itself.
} ipsec_sa_del_ind_struct;
//MSG_ID_IPSEC_SP_SAID_UPDATE_REQ
//for N3SAM to update sa link to the sp
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
kal_uint32 new_said;
kal_uint32 ipsec_spid;
} ipsec_sp_said_update_req_struct;
//MSG_ID_IPSEC_SP_SAID_UPDATE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 req_id;
ipsec_status_enum status;
} ipsec_sp_said_update_cnf_struct;
//MSG_ID_IPSEC_SA_TUNNEL_UPDATE_REQ
//for N3SAM to update tunnel address
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
kal_uint8 new_tunnel_src[MAX_IP_ADDR_SIZE];
kal_uint8 new_tunnel_dst[MAX_IP_ADDR_SIZE];
ipsec_addr_family_enum new_tunnel_addr_family;
#ifdef __N3GPP_OVER_DATA__
nw_device_id_enum dev_id;
#endif
}ipsec_sa_tunnel_update_req_struct;
//MSG_ID_IPSEC_SA_TUNNEL_UPDATE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint32 ipsec_said;
ipsec_status_enum status;
}ipsec_sa_tunnel_update_cnf_struct;
//MSG_ID_IPSEC_SPI_ALLOC_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
kal_uint32 min_spi;
kal_uint32 max_spi;
kal_uint8 src_addr[16];
kal_uint8 dst_addr[16];
ipsec_addr_family_enum addr_family;
ipsec_proto_enum ipsec_proto;
ipsec_mode_enum ipsec_mode;
kal_uint32 max_wait_time; //seconds
}ipsec_spi_alloc_req_struct;
//MSG_ID_IPSEC_SPI_ALLOC_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
kal_uint32 spi;
ipsec_status_enum status;
}ipsec_spi_alloc_cnf_struct;
//MSG_ID_IPSEC_SPI_FREE_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
kal_uint8 src_addr[16];
kal_uint8 dst_addr[16];
ipsec_addr_family_enum addr_family;
ipsec_proto_enum ipsec_proto;
kal_uint32 spi;
}ipsec_spi_free_req_struct;
//MSG_ID_IPSEC_MULTI_SPI_FREE_REQ
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
kal_uint32 spi_del_cnt;
kal_uint8 src_addr_list[16*IPSEC_MAX_SASP_DEL_NUM];
kal_uint8 dst_addr_list[16*IPSEC_MAX_SASP_DEL_NUM];
ipsec_addr_family_enum addr_family_list[IPSEC_MAX_SASP_DEL_NUM];
ipsec_proto_enum ipsec_proto_list[IPSEC_MAX_SASP_DEL_NUM];
kal_uint32 spi_del_list[IPSEC_MAX_SASP_DEL_NUM];
}ipsec_multi_spi_free_req_struct;
//MSG_ID_IPSEC_MULTI_SPI_FREE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
kal_uint32 spi_del_cnt;
kal_uint32 spi_del_list[IPSEC_MAX_SASP_DEL_NUM];
ipsec_status_enum spi_del_status_list[IPSEC_MAX_SASP_DEL_NUM];
}ipsec_multi_spi_free_cnf_struct;
//MSG_ID_IPSEC_SPI_FREE_CNF
typedef struct
{
LOCAL_PARA_HDR
kal_uint8 req_id;
ipsec_status_enum status;
}ipsec_spi_free_cnf_struct;
#endif