blob: ab7d9a018ccf9763aa722584c0f839b55410418e [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 * 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
20#include <stdio.h>
21#include <stdlib.h>
22#include <arpa/inet.h>
23#include <unistd.h>
24#include <string.h>
25#include <pthread.h>
26
27#include "log.h"
28#include "hss_message.h"
29#include "s6a.h"
30
31/**Global and externs **/
32
33/*Handle all messages coming from in built perf hss*/
34void
35hss_resp_handler(void *message)
36{
37 struct hss_resp_msg *msg = (struct hss_resp_msg*)message;
38
39 log_msg(LOG_INFO, "HSS response msg handler for ue_idx %d\n",
40 msg->ue_idx);
41
42 switch(msg->hdr){
43 case HSS_AIA_MSG:
44 handle_perf_hss_aia(msg->ue_idx,
45 (struct hss_aia_msg *)&(msg->data.aia));
46 break;
47
48 case HSS_ULA_MSG:
49 handle_perf_hss_ula(msg->ue_idx,
50 (struct hss_ula_msg *)&(msg->data.ula));
51 break;
52#if 0
53 case HSS_PURGE_RESP_MSG:
54 handle_perf_hss_purge_resp(msg->ue_idx);
55 break;
56#endif
57 //NI Detach
58 case HSS_CLR_MSG:
59 log_msg(LOG_INFO,"clr msg from TC\n");
60 handle_perf_hss_clr(msg->ue_idx,
61 (struct hss_clr_msg *)&(msg->data.clr));
62 break;
63
64 default:
65 log_msg(LOG_ERROR, "Unknown message received from HSS - %d\n",
66 msg->hdr);
67 }
68 return;
69
70 /*free allocated message buffer*/
71 free(message);
72}