blob: e4aa383947ffcb9e4c0a36667c67fcdd2b39e365 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301/*
2 * Copyright (c) 2003-2018, Great Software Laboratory Pvt. Ltd.
3 * Copyright (c) 2017 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef __S6A_H_
19#define __S6A_H_
20
21#include <freeDiameter/freeDiameter-host.h>
22#include <freeDiameter/libfdproto.h>
23#include <freeDiameter/libfdcore.h>
24
25#include "log.h"
26#include "hss_message.h"
27
28#define S6A_FD_CONF "conf/s6a_fd.conf"
29#define HSS_RESP_THREADPOOL_SIZE 10
30#define STR_IMSI_LEN 16
31#define SESS_ID_LEN 128
32
33/**
34 * brief: Structure to store s6a freediameter session information
35 */
36struct s6a_sess_info {
37 unsigned char imsi[8];
38 char sess_id[SESS_ID_LEN];
39 int sess_id_len;
40};
41
42/**
43 * @brief Handle HSS reponse message
44 * @param[in] message buffer
45 * @return void
46 */
47void
48hss_resp_handler(void *message);
49
50/**
51 * @brief Handler thread for AIR/ULR request coming from mme-app
52 * This function sends both AIR and ULR
53 * @param[in] data- message buffer
54 * @return void*
55 */
56void*
57AIR_handler(void *data);
58
59/**
60 * @brief Handler thread for detach request coming from mme-app
61 * @param[in] data- message buffer
62 * @return void *
63 */
64void*
65detach_handler(void *data);
66
67/*Handler for AIA coming from built in perf HS*/
68void
69handle_perf_hss_aia(int ue_idx, struct hss_aia_msg *aia);
70
71/*Handler for ULA coming from built in perf HS*/
72void
73handle_perf_hss_ula(int ue_idx, struct hss_ula_msg *ula);
74
75/*Handler for AIA coming from built in perf HS*/
76void
77handle_perf_hss_purge_resp(int ue_idx);
78
79
80//NI Detach
81/*Handler for CLR coming from built in perf HSS*/
82void
83handle_perf_hss_clr(int ue_idx, struct hss_clr_msg *clr);
84
85/**
86 * @brief convert binary imsi to string imsi
87 * Binary imsi is stored in 8 bytes, each nibble representing each imsi char.
88 * char imsi stroes each char in 1 byte.
89 * @param[in] b_imsi : Binary imsi
90 * @param[out] s_imsi : Converted string imsi
91 * @return void
92 */
93void
94imsi_bin_to_str(unsigned char *b_imsi, char *s_imsi);
95
96#endif /*S6A*/