| #ifndef IPSEC_TCPIP_MSG_H |
| #define IPSEC_TCPIP_MSG_H |
| |
| #include "ipsec_common_interface.h" |
| |
| /*example: |
| MSG_ID_TDD_CRLC_CONFIG_AM_ESTABLISH_REQ |
| tdd_crlc_config_am_establish_req_struct |
| Name MUST exactly match: |
| MSG_ID_ + TDD_CRLC_CONFIG_AM_ESTABLISH_REQ |
| tdd_crlc_config_am_establish_req + _struct |
| */ |
| |
| //MSG_ID_TCPIP_IPSEC_ENCAP_REQ |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 transaction_id; // to identify the packet |
| kal_uint32 input_data_len; // or input_payload_len |
| kal_uint32 input_buffer_len; |
| kal_uint32 output_buffer_len; |
| kal_uint32 sa_id; |
| void* p_input_buffer; // point to the beginning of the TCP/UDP header for ENCAP |
| void* p_output_buffer; |
| ipsec_proto_enum next_header; // {TCP or UDP or ICMP or MH or IP} for ENCAP_REQ; |
| } tcpip_ipsec_encap_req_struct; |
| |
| |
| //MSG_ID_TCPIP_IPSEC_DECAP_REQ |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 transaction_id; // to identify the packet |
| kal_uint32 input_data_len; |
| kal_uint32 input_buffer_len; |
| kal_uint32 output_buffer_len; |
| void* p_input_buffer; // point to the beginning of the ESP header for DECAP |
| void* p_output_buffer; |
| kal_uint8 src_addr[MAX_IP_ADDR_SIZE]; // IP_ADDR_MAX_LEN = 16 BYTES |
| kal_uint8 dst_addr[MAX_IP_ADDR_SIZE]; |
| ipsec_addr_family_enum addr_family; // ipv4 or ipv6 |
| ipsec_proto_enum next_header; // {ESP or AH} for DECAP_REQ |
| } tcpip_ipsec_decap_req_struct; |
| |
| |
| //MSG_ID_TCPIP_IPSEC_ENCAP_RSP |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 transaction_id;//to identify the packet |
| kal_uint32 output_data_len;//not always be equal to the input output_buffer_len in ENCAP_REQ/DECAP_REQ |
| ipsec_proto_enum next_header;//{ESP or AH} for ENCAP_RSP |
| ipsec_status_enum status;//result |
| |
| } tcpip_ipsec_encap_rsp_struct; |
| |
| |
| //MSG_ID_TCPIP_IPSEC_DECAP_RSP |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 transaction_id;//to identify the packet |
| kal_uint32 output_data_len;//not always be equal to the input output_buffer_len in ENCAP_REQ/DECAP_REQ |
| ipsec_proto_enum next_header;//{TCP or UDP or ICMP or MH or IP} for DECAP_RSP; |
| ipsec_status_enum status;//result |
| |
| } tcpip_ipsec_decap_rsp_struct; |
| |
| |
| //MSG_ID_TCPIP_IPSEC_SA_CREATION_IND |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 interface_id; |
| kal_uint32 spi; |
| kal_uint32 sa_id; |
| |
| ipsec_selector_t sel[IPSEC_MAX_SELECTOR_NUM]; /* equal to sp.sel */ |
| kal_uint32 ipsec_selector_count; |
| /* |
| kal_uint8 src_addr[MAX_IP_ADDR_SIZE]; |
| kal_uint8 dst_addr[MAX_IP_ADDR_SIZE]; |
| kal_uint8 addr_family; |
| ipsec_proto_enum next_header; |
| kal_uint16 src_port; |
| kal_uint16 dst_port; |
| */ |
| ipsec_proto_enum ipsec_protocol;//ESP or AH |
| |
| kal_uint32 overhead_fixed_len; |
| kal_uint32 overhead_block_size; |
| } tcpip_ipsec_sa_creation_ind_struct; |
| |
| |
| //MSG_ID_TCPIP_IPSEC_SA_DELETION_IND |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 sa_id; |
| } tcpip_ipsec_sa_deletion_ind_struct; |
| |
| // MSG_ID_TCPIP_IPSEC_MULTI_SA_DELETION_IND |
| typedef struct |
| { |
| LOCAL_PARA_HDR |
| |
| kal_uint32 sa_del_cnt; |
| kal_uint32 ipsec_said_list[IPSEC_MAX_SASP_DEL_NUM]; |
| } tcpip_ipsec_multi_sa_deletion_ind_struct; |
| |
| #endif |
| |
| |