blob: 5c6c1af1c9bdc7f118e4eeb2191ee30860ca522a [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#include "json_data.h"
19#include "s11_config.h"
20#include "err_codes.h"
21
22s11_config g_s11_cfg;
23
24void
25init_parser(char *path)
26{
27 load_json(path);
28}
29
30int
31parse_s11_conf()
32{
33 /*s1ap information*/
34 g_s11_cfg.local_egtp_ip = get_ip_scalar("s11.egtp_local_addr");
35 if(-1 == g_s11_cfg.local_egtp_ip) return -1;
36 g_s11_cfg.egtp_def_port = get_int_scalar("s11.egtp_default_port");
37 if(-1 == g_s11_cfg.egtp_def_port) return -1;
38
39 g_s11_cfg.sgw_ip = get_ip_scalar("s11.sgw_addr");
40 if(-1 == g_s11_cfg.sgw_ip) return -1;
41 g_s11_cfg.pgw_ip = get_ip_scalar("s11.pgw_addr");
42 if(-1 == g_s11_cfg.pgw_ip) return -1;
43
44 return SUCCESS;
45}