Merge "Bump version to 1.1.2-SNAPSHOT" into amsterdam
[demo.git] / vnfs / vCPE / kea-sdnc-notify-mod / src / load_unload.cc
1 /**************************************************************************//**
2 * @file
3 * load_unload the module in kea 
4 *
5 *
6 * License
7 * -------
8 *
9 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *        http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 ****************************************************************************/
23
24
25 #include "library_common.h"
26
27 using namespace isc::hooks;
28 namespace pt = boost::property_tree;
29
30 std::string param_url;
31 std::string json_params[3];
32
33 extern "C" {
34 int load(LibraryHandle& handle) {
35     pt::ptree root;
36     pt::read_json("/etc/kea/kea-sdnc-notify.conf", root);
37
38     json_params[0] = (root.get<std::string>("url"));
39     json_params[1] = (root.get<std::string>("siaddr"));
40
41     std::cout << "kea-sdnc-notify.so loaded\n" << std::endl;
42     return 0;
43 }
44 int unload() {
45     return (0);
46 }
47 }