anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2003-2018, Great Software Laboratory Pvt. Ltd. |
| 3 | * Copyright (c) 2017 Intel Corporation |
| 4 | * Copyright (c) 2019, Infosys Ltd. |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #ifndef __HSS_MSG_H_ |
| 20 | #define __HSS_MSG_H_ |
| 21 | |
| 22 | #include "sec.h" |
| 23 | |
| 24 | /*Information needed for AIR*/ |
| 25 | enum e_BUF_HDR { |
| 26 | HSS_AIR_MSG, |
| 27 | HSS_AIA_MSG, |
| 28 | HSS_ULR_MSG, |
| 29 | HSS_ULA_MSG, |
| 30 | //NI Detach |
| 31 | HSS_CLR_MSG, |
| 32 | HSS_CLA_MSG, |
| 33 | //NI Detach |
| 34 | HSS_PURGE_MSG, |
| 35 | HSS_PURGE_RESP_MSG, |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | #define IMSI_STR_LEN 16 |
| 40 | /*AIR - request. Struct is same for ULR*/ |
| 41 | struct hss_air_msg { |
| 42 | char imsi[IMSI_STR_LEN]; |
| 43 | unsigned char plmn_id[3]; |
| 44 | }; |
| 45 | |
| 46 | /*AIA - response*/ |
| 47 | struct hss_aia_msg { |
| 48 | struct RAND rand; |
| 49 | struct XRES xres; |
| 50 | struct AUTN autn; |
| 51 | struct KASME kasme; |
| 52 | }; |
| 53 | |
| 54 | #define HSS_MSISDN_LEN 10 |
| 55 | #define SPARE_LEN 52 |
| 56 | |
| 57 | /*ULA - response*/ |
| 58 | struct hss_ula_msg { |
| 59 | int subscription_state; |
| 60 | unsigned char msisdn[HSS_MSISDN_LEN]; |
| 61 | unsigned char a_msisdn[HSS_MSISDN_LEN]; |
| 62 | unsigned char spare[SPARE_LEN]; |
| 63 | }; |
| 64 | |
| 65 | struct hss_clr_msg { |
| 66 | char origin_host; |
| 67 | char origin_realm; |
| 68 | char user_name; |
| 69 | unsigned char cancellation_type; |
| 70 | }; |
| 71 | |
| 72 | |
| 73 | struct hss_pur_msg { |
| 74 | int ue_idx; |
| 75 | char imsi[IMSI_STR_LEN]; |
| 76 | }; |
| 77 | |
| 78 | struct hss_req_msg { |
| 79 | enum e_BUF_HDR hdr; |
| 80 | int ue_idx; |
| 81 | union req_data { |
| 82 | struct hss_air_msg air; |
| 83 | }data; |
| 84 | }; |
| 85 | |
| 86 | struct hss_resp_msg { |
| 87 | enum e_BUF_HDR hdr; |
| 88 | int ue_idx; |
| 89 | int result; |
| 90 | union resp_data { |
| 91 | struct hss_aia_msg aia; |
| 92 | struct hss_ula_msg ula; |
| 93 | struct hss_clr_msg clr; |
| 94 | }data; |
| 95 | }; |
| 96 | |
| 97 | #define HSS_RCV_BUF_SIZE 128 |
| 98 | #define HSS_REQ_MSG_SIZE sizeof(struct hss_req_msg) |
| 99 | #define HSS_RESP_MSG_SIZE sizeof(struct hss_resp_msg) |
| 100 | |
| 101 | #endif /*__STAGE6_S6A_MSG_H_*/ |
| 102 | |