diff --git a/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_app b/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_app
new file mode 100644
index 0000000..a775219
--- /dev/null
+++ b/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_app
@@ -0,0 +1,4 @@
+FROM openjdk:8-jre-alpine
+ADD target/libs /app/libs
+ADD target/netconfsimulator-5.0.0-SNAPSHOT.jar /app/netconf-simulator.jar
+CMD java -cp /app/libs/*:/app/netconf-simulator.jar org.onap.netconfsimulator.Main
\ No newline at end of file
diff --git a/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_netopeer b/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_netopeer
new file mode 100644
index 0000000..876b786
--- /dev/null
+++ b/test/mocks/pnfsimulator/netconfsimulator/Dockerfile_netopeer
@@ -0,0 +1,6 @@
+FROM sysrepo/sysrepo-netopeer2:latest
+ADD apt.conf /etc/apt/apt.conf
+RUN apt-get update &&  apt-get install -y python3 python3-pip python-pip && pip3 install flask flask_restful kafka-python && pip install kafka-python
+RUN cd /opt/dev/sysrepo && cmake -DGEN_PYTHON_VERSION=2 -DREPOSITORY_LOC:PATH=/etc/sysrepo . && make install
+
+CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
diff --git a/test/mocks/pnfsimulator/netconfsimulator/apt.conf b/test/mocks/pnfsimulator/netconfsimulator/apt.conf
new file mode 100644
index 0000000..9146b6b
--- /dev/null
+++ b/test/mocks/pnfsimulator/netconfsimulator/apt.conf
@@ -0,0 +1,5 @@
+Acquire::http {
+    	No-Cache "true";
+    	No-Store "true";
+    	Pipeline-Depth "0";
+    };
\ No newline at end of file
diff --git a/test/mocks/pnfsimulator/netconfsimulator/docker-compose.yml b/test/mocks/pnfsimulator/netconfsimulator/docker-compose.yml
index ebacb4f..5e9acbe 100644
--- a/test/mocks/pnfsimulator/netconfsimulator/docker-compose.yml
+++ b/test/mocks/pnfsimulator/netconfsimulator/docker-compose.yml
@@ -39,7 +39,7 @@
     - netopeer
 
   netopeer:
-    image: sysrepo/sysrepo-netopeer2:devel
+    image: nexus3.onap.org:10003/netopeer
     ports:
     - "830:830"
     - "5002:5002"
@@ -56,9 +56,6 @@
     depends_on:
     - sftp-server
     - ftpes-server
-    environment:
-      http_proxy: ${http_proxy}
-      https_proxy: ${https_proxy}
     command:
     - /netconf/initialize_netopeer.sh
 
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netconf/initialize_netopeer.sh b/test/mocks/pnfsimulator/netconfsimulator/netconf/initialize_netopeer.sh
index 3ce53d5..59fc8a1 100755
--- a/test/mocks/pnfsimulator/netconfsimulator/netconf/initialize_netopeer.sh
+++ b/test/mocks/pnfsimulator/netconfsimulator/netconf/initialize_netopeer.sh
@@ -20,16 +20,6 @@
 # ============LICENSE_END=========================================================
 ###
 
-cat > /etc/apt/apt.conf << EOF
-Acquire::http {
-	No-Cache "true";
-	No-Store "true";
-	Pipeline-Depth "0";
-};
-EOF
-
-NETOPEER_CHANGE_SAVER=netopeer-change-saver
-
 cp /tls/* /usr/local/etc/keystored/keys/
 cp /netconf/*.xml /tmp/
 
@@ -42,18 +32,6 @@
 sysrepocfg --merge=/tmp/load_server_certs.xml --format=xml --datastore=startup ietf-keystore
 sysrepocfg --merge=/tmp/tls_listen.xml --format=xml --datastore=startup ietf-netconf-server
 
-apt-get update
-apt-get install -y python3 python3-pip librdkafka-dev
-pip3 install flask flask_restful
 nohup python3 /netconf/yang_loader_server.py &
 
-cd /opt/dev/sysrepo && cmake .
-cd /opt/dev/sysrepo && make -j2
-
-/bin/cp -R /$NETOPEER_CHANGE_SAVER /opt/dev/
-cp /opt/dev/sysrepo/swig/libSysrepo-cpp.so /opt/dev/$NETOPEER_CHANGE_SAVER/
-ln -s /opt/dev/sysrepo/build/src/libsysrepo.so /opt/dev/$NETOPEER_CHANGE_SAVER/libsysrepo.so
-
-cd  /opt/dev/$NETOPEER_CHANGE_SAVER && cmake .
-cd  /opt/dev/$NETOPEER_CHANGE_SAVER && make
-/opt/dev/$NETOPEER_CHANGE_SAVER/bin/netopeer-change-saver pnf-simulator kafka1 config
+python /netconf/netopeer_change_saver.py pnf-simulator kafka1:9092 config
\ No newline at end of file
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netconf/netopeer_change_saver.py b/test/mocks/pnfsimulator/netconfsimulator/netconf/netopeer_change_saver.py
new file mode 100644
index 0000000..0a9e841
--- /dev/null
+++ b/test/mocks/pnfsimulator/netconfsimulator/netconf/netopeer_change_saver.py
@@ -0,0 +1,107 @@
+###
+# ============LICENSE_START=======================================================
+# Simulator
+# ================================================================================
+# Copyright (C) 2019 Nokia. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+import sysrepo as sr
+import sys
+import json
+import time
+import logging
+from kafka import KafkaProducer
+from enum import Enum
+
+logging.basicConfig(filename='netopeer_change_saver.log', level=logging.DEBUG)
+
+kafka_producer = None
+topic = "config"
+
+
+class OperationType(Enum):
+    CREATED = sr.SR_OP_CREATED
+    DELETED = sr.SR_OP_DELETED
+    MODIFIED = sr.SR_OP_MODIFIED
+    MOVED = sr.SR_OP_MOVED
+
+
+def module_change_callback(session, name, event, private_ctx):
+    if sr.SR_EV_APPLY == event:
+        change_path = "/{}:*".format(name)
+        changes = session.get_changes_iter(change_path)
+        change = session.get_change_next(changes)
+        while change:
+            try:
+                process_change(change)
+                change = session.get_change_next(changes)
+            except Exception:
+                logging.exception("Exception occured")
+
+    return sr.SR_ERR_OK
+
+
+def process_change(change):
+    if change:
+        message = {"type": OperationType(change.oper()).name}
+        if change.old_val():
+            message["old"] = {"path": change.old_val().xpath(), "value": change.old_val().val_to_string()}
+        if change.new_val():
+            message["new"] = {"path": change.new_val().xpath(), "value": change.new_val().val_to_string()}
+        send_message(message)
+
+
+def send_message(message):
+    logging.debug("Message to kafka : %s", message)
+    response = kafka_producer.send(topic, message)
+    logging.info(response.get(timeout=90))
+
+
+def create_producer(server):
+    for i in range(10):
+        try:
+            return KafkaProducer(bootstrap_servers=server, value_serializer=lambda v: json.dumps(v).encode('utf-8'))
+        except Exception:
+            time.sleep(15)
+    raise Exception("Could not connect to kafka server")
+
+
+def print_current_config(kafka_session, module):
+    name = "/{}:*//*".format(module)
+    logging.info("Retrieving current config for %s module", name)
+    values = kafka_session.get_items(name)
+    for i in range(values.val_cnt()):
+        logging.info(values.val(i).to_string())
+
+
+if __name__ == "__main__":
+    try:
+        module_name = sys.argv[1]
+        bootstrap_servers = sys.argv[2]
+        topic = sys.argv[3]
+        connection = sr.Connection("example_application2")
+        session = sr.Session(connection)
+        subscribe = sr.Subscribe(session)
+        subscribe.module_change_subscribe(module_name, module_change_callback)
+
+        print_current_config(session, module_name)
+
+        kafka_producer = create_producer(bootstrap_servers)
+
+        sr.global_loop()
+    except Exception as e:
+        logging.exception("Exception occured")
+        raise e
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netconf/test_yang_loader_server.py b/test/mocks/pnfsimulator/netconfsimulator/netconf/test_yang_loader_server.py
index f282517..c5bd08d 100644
--- a/test/mocks/pnfsimulator/netconfsimulator/netconf/test_yang_loader_server.py
+++ b/test/mocks/pnfsimulator/netconfsimulator/netconf/test_yang_loader_server.py
@@ -78,7 +78,7 @@
         helper.start_change_listener_for_model("sampleModule")
 
         mocked_output.assert_called_with(
-            ['pgrep', '-f', '/opt/dev/netopeer-change-saver/bin/netopeer-change-saver sampleModule kafka1 config'],
+            ['pgrep', '-f', 'python /netconf/netopeer_change_saver.py sampleModule kafka1:9092 config'],
             stderr=-2, universal_newlines=True)
 
     @mock.patch('yang_loader_server.check_output')
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netconf/yang_loader_server.py b/test/mocks/pnfsimulator/netconfsimulator/netconf/yang_loader_server.py
index 716d071..f414467 100644
--- a/test/mocks/pnfsimulator/netconfsimulator/netconf/yang_loader_server.py
+++ b/test/mocks/pnfsimulator/netconfsimulator/netconf/yang_loader_server.py
@@ -31,7 +31,7 @@
 api = Api(app)
 logger = logging.getLogger("yang-loader")
 logger.addHandler(logging.StreamHandler())
-KAFKA_BROKER_NAME="kafka1"
+KAFKA_BROKER_NAME="kafka1:9092"
 KAFKA_TOPIC_NAME="config"
 
 
@@ -68,7 +68,7 @@
     @classmethod
     def start_change_listener_for_model(cls, module_name: str):
         logger.info("Starting listener for model: %s", module_name)
-        command = "/opt/dev/netopeer-change-saver/bin/netopeer-change-saver {} {} {}" \
+        command = "python /netconf/netopeer_change_saver.py {} {} {}" \
             .format(module_name, KAFKA_BROKER_NAME, KAFKA_TOPIC_NAME)
         try:
             check_output(["pgrep", "-f" , command], stderr=subprocess.STDOUT, universal_newlines=True)
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.cpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.cpp
deleted file mode 100644
index 56c33f0..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#include "Application.h"
-#include <cstdio>
-#include <unistd.h>
-#include "sysrepo/Session.hpp"
-#include "SysrepoCallback.h"
-
-Application::~Application() {
-    this->subscriber->unsubscribe();
-    this->session->session_stop();
-    sr_disconnect(this->connection->_conn);
-    std::cout << "Application closed correctly " << std::endl;
-}
-
-void Application::run() {
-    /*create kafka wrapper object*/
-    auto kafkaWrapper = std::make_shared<KafkaWrapper>(this->brokers,this->topic_name);
-
-    std::cout << "Application will watch for changes in " << module_name << std::endl;
-    /* connect to sysrepo */
-    this->connection = new sysrepo::Connection("example_application");
-    sysrepo::S_Connection conn(new sysrepo::Connection("example_application"));
-
-    /* start session */
-    sysrepo::S_Session sess(new sysrepo::Session(conn));
-
-    this->session = sess;
-    /* subscribe for changes in running config */
-    sysrepo::S_Subscribe subscribe(new sysrepo::Subscribe(sess));
-    std::shared_ptr<SysrepoCallback> cb(new SysrepoCallback(kafkaWrapper));
-
-    subscribe->module_change_subscribe(module_name, cb);
-    this->subscriber = subscribe;
-    
-    /* read startup config */
-    std::cout << "\n ========== READING STARTUP CONFIG: ==========\n" << std::endl;
-
-    cb->print_current_config(sess, module_name);
-
-    std::cout << "\n ========== STARTUP CONFIG APPLIED AS RUNNING ==========\n" << std::endl;
-
-    /* loop until ctrl-c is pressed / SIGINT is received */
-    while (!exit_application) {
-        sleep(1000);  /* or do some more useful work... */
-    }
-
-    std::cout << "Application exit requested, exiting." << std::endl;
-
-}
-
-Application::Application(const char *module_name, const char *brokers, const char *topic_name) {
-    this->module_name = module_name;
-    this->brokers = brokers;
-    this->topic_name = topic_name;
-}
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.h
deleted file mode 100644
index c41f7e2..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/Application.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#ifndef NETOPEER_CHANGE_SAVER_CPP_APPLICATION_H
-#define NETOPEER_CHANGE_SAVER_CPP_APPLICATION_H
-#include "sysrepo/Sysrepo.hpp"
-
-extern volatile int exit_application;
-
-class Application {
-private:
-    const char *module_name;
-    const char *brokers;
-    const char *topic_name;
-    sysrepo::S_Session session;
-    sysrepo::S_Subscribe subscriber;
-    sysrepo::Connection *connection;
-
-public:
-    Application(const char *module_name, const char *brokers, const char *topic_name);
-    ~Application();
-    void run();
-
-};
-
-#endif //NETOPEER_CHANGE_SAVER_CPP_APPLICATION_H
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/CMakeLists.txt b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/CMakeLists.txt
deleted file mode 100755
index f21576d..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-cmake_minimum_required(VERSION 3.7)
-project(netopeer-change-saver)
-
-set(CMAKE_CXX_STANDARD 11)
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-set (CMAKE_EXE_LINKER_FLAGS "-Wl,--unresolved-symbols=ignore-all")
-link_directories(.)
-
-find_package(Threads REQUIRED)
-
-add_executable(netopeer-change-saver main.cpp sysrepo.h Application.cpp Application.h KafkaWrapper.cpp KafkaWrapper.h
-        SysrepoCallback.cpp SysrepoCallback.h)
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libSysrepo-cpp.so
-        DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin)
-
-target_link_libraries(netopeer-change-saver libSysrepo-cpp.so)
-target_link_libraries(netopeer-change-saver libsysrepo.so)
-target_link_libraries(netopeer-change-saver Threads::Threads)
-target_link_libraries(netopeer-change-saver librdkafka.so)
\ No newline at end of file
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.cpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.cpp
deleted file mode 100644
index cd018a3..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#include "KafkaWrapper.h"
-#include <cstdlib>
-#include <cinttypes>
-#include <iostream>
-
-extern "C" {
-    rd_kafka_resp_err_t rd_kafka_last_error (void);
-    rd_kafka_resp_err_t rd_kafka_flush (rd_kafka_t *rk, int timeout_ms);
-}
-
-extern "C" {
-void kafka_delivery_report_callback(rd_kafka_t *rk, const rd_kafka_message_t *rkmessage, void *opaque) {
-#ifdef DEBUG
-    if (rkmessage->err)
-        std::cout<<"%% Message delivery failed: %s\n"<<rd_kafka_err2str(rkmessage->err)<<std::endl;
-    else
-        std::cout<<
-                "%% Message delivered ("<<rkmessage->len <<" bytes, partition " << rkmessage->partition <<")" << std::endl;
-    /* The rkmessage is destroyed automatically by librdkafka */
-#endif
-}
-}
-
-KafkaWrapper::KafkaWrapper(const char *brokers, const char *topic_name) {
-    this->brokers = brokers;
-    this->topic_name = topic_name;
-
-    init();
-}
-
-KafkaWrapper::~KafkaWrapper() {
-    std::cerr<<"%% Flushing final messages..."<<std::endl;
-    rd_kafka_flush(rk, 10 * 1000);
-    rd_kafka_destroy(rk);
-}
-
-void KafkaWrapper::init() {
-    /*Kafka stuff*/
-    conf = rd_kafka_conf_new();
-    if (rd_kafka_conf_set(conf, "bootstrap.servers", brokers, errstr, sizeof(errstr)) != RD_KAFKA_CONF_OK) {
-        perror(errstr);
-        exit(1);
-    }
-
-    rd_kafka_conf_set_dr_msg_cb(conf, kafka_delivery_report_callback);
-    rk = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errstr, sizeof(errstr));
-    if (!rk) {
-        std::cerr<<"%% Failed to create new producer: %s\n"<<errstr<<std::endl;
-        exit(1);
-    }
-
-    rkt = rd_kafka_topic_new(rk, topic_name, nullptr);
-    if (!rkt) {
-        std::cerr<<"%% Failed to create topic object: %s\n"<<
-                rd_kafka_err2str(rd_kafka_last_error())<<std::endl;
-        rd_kafka_destroy(rk);
-        exit(1);
-    }
-}
-
-void KafkaWrapper::kafka_send_message(std::string message) {
-    size_t len = message.length();
-    int retry = 1;
-    while (retry) {
-#ifdef DEBUG
-        std::cout<<"Sending the message to topic...\n"<<std::endl;
-#endif
-        if (rd_kafka_produce(rkt, RD_KAFKA_PARTITION_UA, RD_KAFKA_MSG_F_COPY, (void *) message.c_str(), len, nullptr, 0,
-                             nullptr)) {
-            retry = 1;
-            rd_kafka_resp_err_t last_error = rd_kafka_last_error();
-            std::cerr<<"%% Failed to produce to topic %s: %s\n"<<topic_name<<rd_kafka_err2str(last_error)<<std::endl;
-            if (last_error == RD_KAFKA_RESP_ERR__QUEUE_FULL) {
-                rd_kafka_poll(rk, 1000);
-            } else {
-                std::cerr<<"%% Enqueued message (%zd bytes) for topic %s\n"<<len<<topic_name<<std::endl;
-            }
-        } else {
-            retry = 0;
-        }
-    }
-    rd_kafka_poll(rk, 0/*non-blocking*/);
-}
-
-
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.h
deleted file mode 100644
index 804afa7..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/KafkaWrapper.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#ifndef NETOPEER_CHANGE_SAVER_CPP_KAFKAWRAPPER_H
-#define NETOPEER_CHANGE_SAVER_CPP_KAFKAWRAPPER_H
-#include "librdkafka/rdkafka.h"
-#include <string>
-
-class KafkaWrapper {
-private:
-    char errstr[512];
-    const char *brokers;
-    const char *topic_name;
-    rd_kafka_t *rk;
-    rd_kafka_topic_t *rkt;
-    rd_kafka_conf_t *conf;
-
-    void init();
-
-public:
-    KafkaWrapper(const char *brokers, const char *topic_name);
-    ~KafkaWrapper();
-    void kafka_send_message(std::string message);
-};
-
-
-#endif //NETOPEER_CHANGE_SAVER_CPP_KAFKAWRAPPER_H
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.cpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.cpp
deleted file mode 100644
index 225fe03..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#include "SysrepoCallback.h"
-#define CREATED "CREATED"
-#define DELETED "DELETED"
-#define MODIFIED "MODIFIED"
-#define MOVED "MOVED"
-#define XPATH_MAX_LEN 100
-
-
-int SysrepoCallback::module_change(sysrepo::S_Session sess, const char *module_name, sr_notif_event_t event, void *private_ctx) {
-    {
-        if (event == SR_EV_APPLY) {
-            char change_path[XPATH_MAX_LEN];
-
-            try {
-#ifdef DEBUG
-                std::cout << "\n ========== CHANGES: =============================================\n" << std::endl;
-#endif
-                snprintf(change_path, XPATH_MAX_LEN, "/%s:*", module_name);
-                auto it = sess->get_changes_iter(&change_path[0]);
-                while (auto change = sess->get_change_next(it)) {
-                    std::string message = create_message(change);
-                    std::cout<<message<<std::endl;
-                    kafkaWrapper->kafka_send_message(message);
-                }
-#ifdef DEBUG
-                std::cout << "\n ========== END OF CHANGES =======================================\n" << std::endl;
-#endif
-            } catch( const std::exception& e ) {
-                std::cerr << e.what() << std::endl;
-            }
-        }
-        return SR_ERR_OK;
-    }
-}
-
-SysrepoCallback::SysrepoCallback(std::shared_ptr<KafkaWrapper> wrapper) {
-    this->kafkaWrapper = wrapper;
-}
-
-std::string SysrepoCallback::create_message(sysrepo::S_Change change) {
-    std::string change_details;
-    sysrepo::S_Val new_val = change->new_val();
-    sysrepo::S_Val old_val = change->old_val();
-
-    switch (change->oper()) {
-        case SR_OP_CREATED:
-            if (nullptr != new_val) {
-                change_details.append(CREATED).append(": ").append(new_val->to_string());
-            }
-            break;
-        case SR_OP_DELETED:
-            if (nullptr != old_val) {
-                change_details.append(DELETED).append(": ").append(old_val->to_string());
-            }
-            break;
-        case SR_OP_MODIFIED:
-            if (nullptr != old_val && nullptr != new_val) {
-                change_details.append(MODIFIED).append(": ").append(": old value: ").append(old_val->to_string())
-                .append(", new value: ").append(new_val->to_string());
-            }
-            break;
-        case SR_OP_MOVED:
-            if (nullptr != old_val && nullptr != new_val) {
-                change_details.append(MOVED).append(": ").append(new_val->to_string())
-                        .append(" after ").append(old_val->to_string());
-            } else if (nullptr != new_val) {
-                change_details.append(MOVED).append(": ").append(new_val->xpath()).append(" last");
-            }
-            break;
-    }
-    return change_details;
-}
-
-void SysrepoCallback::print_current_config(sysrepo::S_Session session, const char *module_name) {
-    char select_xpath[XPATH_MAX_LEN];
-    try {
-        snprintf(select_xpath, XPATH_MAX_LEN, "/%s:*//*", module_name);
-
-        auto values = session->get_items(&select_xpath[0]);
-        if (values == nullptr)
-            return;
-
-        for(unsigned int i = 0; i < values->val_cnt(); i++)
-            std::cout << values->val(i)->to_string();
-    } catch( const std::exception& e ) {
-        std::cout << e.what() << std::endl;
-    }
-}
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.h
deleted file mode 100644
index 7d2cd72..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/SysrepoCallback.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#ifndef NETOPEER_CHANGE_SAVER_CPP_SYSREPOCALLBACK_H
-#define NETOPEER_CHANGE_SAVER_CPP_SYSREPOCALLBACK_H
-#include "KafkaWrapper.h"
-#include "sysrepo/Session.hpp"
-#include <memory>
-
-class SysrepoCallback: public sysrepo::Callback {
-private:
-    std::shared_ptr<KafkaWrapper> kafkaWrapper;
-
-public:
-    explicit SysrepoCallback(std::shared_ptr<KafkaWrapper> wrapper);
-    void print_current_config(sysrepo::S_Session session, const char *module_name);
-
-private:
-    std::string create_message(sysrepo::S_Change change);
-    int module_change(sysrepo::S_Session sess, const char *module_name, sr_notif_event_t event, void *private_ctx);
-
-};
-
-
-#endif //NETOPEER_CHANGE_SAVER_CPP_SYSREPOCALLBACK_H
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/main.cpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/main.cpp
deleted file mode 100644
index 0329f05..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/main.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Simulator
- * ================================================================================
- * Copyright (C) 2019 Nokia. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-#include <iostream>
-#include <csignal>
-#include "Application.h"
-
-volatile int exit_application = 0;
-
-void sigint_handler(int signum) {
-    std::cout << "Interrupt signal (" << signum << ") received." << std::endl;
-    exit_application = 1;
-}
-
-int main(int argc, char *argv[]) {
-    if (argc != 4) {
-        std::cerr<<"Usage: "<<argv[0]<<" <module_name> <broker> <topic> "<<std::endl;
-        return 1;
-    }
-
-    signal(SIGINT, sigint_handler);
-
-    const char *module_name = argv[1];
-    const char *brokers = argv[2];
-    const char *topic_name = argv[3];
-
-    Application application(module_name, brokers, topic_name);
-    application.run();
-
-    return 0;
-}
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo.h
deleted file mode 100644
index 9d541d1..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo.h
+++ /dev/null
@@ -1,2015 +0,0 @@
-/**
- * @file sysrepo.h
- * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>
- * @brief Sysrepo Client Library public API.
- *
- * @copyright
- * Copyright 2015 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_H_
-#define SYSREPO_H_
-
-/**
- * @defgroup cl Client Library
- * @{
- *
- * @brief Provides the public API towards applications using sysrepo to store
- * their configuration data, or towards management agents.
- *
- * Communicates with Sysrepo Engine (@ref cm), which is running either inside
- * of dedicated sysrepo daemon, or within this library if daemon is not alive.
- *
- * Access to the sysrepo datastore is connection- and session- oriented. Before
- * calling any data access/manipulation API, one needs to connect to the datastore
- * via ::sr_connect and open a session via ::sr_session_start. One connection
- * can serve multiple sessions.
- *
- * Each data access/manipulation request call is blocking - blocks the connection
- * until the response from Sysrepo Engine comes, or until an error occurs. It is
- * safe to call multiple requests on the same session (or different session that
- * belongs to the same connection) from multiple threads at the same time,
- * however it is not effective, since each call is blocked until previous one
- * finishes. If you need fast multi-threaded access to sysrepo, use a dedicated
- * connection for each thread.
- *
- * @see
- * See @ref main_page "Sysrepo Introduction" for details about sysrepo architecture.
- * @see
- * @ref xp_page "XPath Addressing" is used for node identification in data-related calls.
- */
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <time.h>
-#ifdef __APPLE__
-    #include <sys/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Common typedefs and API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Sysrepo connection context used to identify a connection to sysrepo datastore.
- */
-typedef struct sr_conn_ctx_s sr_conn_ctx_t;
-
-/**
- * @brief Sysrepo session context used to identify a configuration session.
- */
-typedef struct sr_session_ctx_s sr_session_ctx_t;
-
-/**
- * @brief Memory context used for efficient memory management for values, trees and GPB messages.
- */
-typedef struct sr_mem_ctx_s sr_mem_ctx_t;
-
-/**
- * @brief Possible types of an data element stored in the sysrepo datastore.
- */
-typedef enum sr_type_e {
-    /* special types that does not contain any data */
-    SR_UNKNOWN_T,              /**< Element unknown to sysrepo (unsupported element). */
-    SR_TREE_ITERATOR_T,        /**< Special type of tree node used to store all data needed for iterative tree loading. */
-
-    SR_LIST_T,                 /**< List instance. ([RFC 6020 sec 7.8](http://tools.ietf.org/html/rfc6020#section-7.8)) */
-    SR_CONTAINER_T,            /**< Non-presence container. ([RFC 6020 sec 7.5](http://tools.ietf.org/html/rfc6020#section-7.5)) */
-    SR_CONTAINER_PRESENCE_T,   /**< Presence container. ([RFC 6020 sec 7.5.1](http://tools.ietf.org/html/rfc6020#section-7.5.1)) */
-    SR_LEAF_EMPTY_T,           /**< A leaf that does not hold any value ([RFC 6020 sec 9.11](http://tools.ietf.org/html/rfc6020#section-9.11)) */
-    SR_NOTIFICATION_T,         /**< Notification instance ([RFC 7095 sec 7.16](https://tools.ietf.org/html/rfc7950#section-7.16)) */
-
-    /* types containing some data */
-    SR_BINARY_T,       /**< Base64-encoded binary data ([RFC 6020 sec 9.8](http://tools.ietf.org/html/rfc6020#section-9.8)) */
-    SR_BITS_T,         /**< A set of bits or flags ([RFC 6020 sec 9.7](http://tools.ietf.org/html/rfc6020#section-9.7)) */
-    SR_BOOL_T,         /**< A boolean value ([RFC 6020 sec 9.5](http://tools.ietf.org/html/rfc6020#section-9.5)) */
-    SR_DECIMAL64_T,    /**< 64-bit signed decimal number ([RFC 6020 sec 9.3](http://tools.ietf.org/html/rfc6020#section-9.3)) */
-    SR_ENUM_T,         /**< A string from enumerated strings list ([RFC 6020 sec 9.6](http://tools.ietf.org/html/rfc6020#section-9.6)) */
-    SR_IDENTITYREF_T,  /**< A reference to an abstract identity ([RFC 6020 sec 9.10](http://tools.ietf.org/html/rfc6020#section-9.10)) */
-    SR_INSTANCEID_T,   /**< References a data tree node ([RFC 6020 sec 9.13](http://tools.ietf.org/html/rfc6020#section-9.13)) */
-    SR_INT8_T,         /**< 8-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_INT16_T,        /**< 16-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_INT32_T,        /**< 32-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_INT64_T,        /**< 64-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_STRING_T,       /**< Human-readable string ([RFC 6020 sec 9.4](http://tools.ietf.org/html/rfc6020#section-9.4)) */
-    SR_UINT8_T,        /**< 8-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_UINT16_T,       /**< 16-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_UINT32_T,       /**< 32-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_UINT64_T,       /**< 64-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    SR_ANYXML_T,       /**< Unknown chunk of XML ([RFC 6020 sec 7.10](https://tools.ietf.org/html/rfc6020#section-7.10)) */
-    SR_ANYDATA_T,      /**< Unknown set of nodes, encoded in XML ([RFC 7950 sec 7.10](https://tools.ietf.org/html/rfc7950#section-7.10)) */
-} sr_type_t;
-
-/**
- * @brief Data of an element (if applicable), properly set according to the type.
- */
-typedef union sr_data_u {
-    char *binary_val;       /**< Base64-encoded binary data ([RFC 6020 sec 9.8](http://tools.ietf.org/html/rfc6020#section-9.8)) */
-    char *bits_val;         /**< A set of bits or flags ([RFC 6020 sec 9.7](http://tools.ietf.org/html/rfc6020#section-9.7)) */
-    bool bool_val;          /**< A boolean value ([RFC 6020 sec 9.5](http://tools.ietf.org/html/rfc6020#section-9.5)) */
-    double decimal64_val;   /**< 64-bit signed decimal number ([RFC 6020 sec 9.3](http://tools.ietf.org/html/rfc6020#section-9.3)) */
-    char *enum_val;         /**< A string from enumerated strings list ([RFC 6020 sec 9.6](http://tools.ietf.org/html/rfc6020#section-9.6)) */
-    char *identityref_val;  /**< A reference to an abstract identity ([RFC 6020 sec 9.10](http://tools.ietf.org/html/rfc6020#section-9.10)) */
-    char *instanceid_val;   /**< References a data tree node ([RFC 6020 sec 9.13](http://tools.ietf.org/html/rfc6020#section-9.13)) */
-    int8_t int8_val;        /**< 8-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    int16_t int16_val;      /**< 16-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    int32_t int32_val;      /**< 32-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    int64_t int64_val;      /**< 64-bit signed integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    char *string_val;       /**< Human-readable string ([RFC 6020 sec 9.4](http://tools.ietf.org/html/rfc6020#section-9.4)) */
-    uint8_t uint8_val;      /**< 8-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    uint16_t uint16_val;    /**< 16-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    uint32_t uint32_val;    /**< 32-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    uint64_t uint64_val;    /**< 64-bit unsigned integer ([RFC 6020 sec 9.2](http://tools.ietf.org/html/rfc6020#section-9.2)) */
-    char *anyxml_val;       /**< Unknown chunk of XML ([RFC 6020 sec 7.10](https://tools.ietf.org/html/rfc6020#section-7.10)) */
-    char *anydata_val;      /**< Unknown set of nodes, encoded in XML ([RFC 7950 sec 7.10](https://tools.ietf.org/html/rfc7950#section-7.10)) */
-} sr_data_t;
-
-/**
- * @brief Structure that contains value of an data element stored in the sysrepo datastore.
- */
-typedef struct sr_val_s {
-    /**
-     * Memory context used internally by Sysrepo for efficient storage
-     * and conversion of this structure.
-     */
-    sr_mem_ctx_t *_sr_mem;
-
-    /**
-     * XPath identifier of the data element, as defined in
-     * @ref xp_page "Path Addressing" documentation
-     */
-    char *xpath;
-
-    /** Type of an element. */
-    sr_type_t type;
-
-    /**
-     * Flag for node with default value (applicable only for leaves).
-     * It is set to TRUE only if the value was *implicitly* set by the datastore as per
-     * module schema. Explicitly set/modified data element (through the sysrepo API) always
-     * has this flag unset regardless of the entered value.
-     */
-    bool dflt;
-
-    /** Data of an element (if applicable), properly set according to the type. */
-    sr_data_t data;
-
-} sr_val_t;
-
-/**
- * @brief A data element stored in the sysrepo datastore represented as a tree node.
- *
- * @note Can be safely casted to ::sr_val_t, only *xpath* member will point to node name rather
- * than to an actual xpath.
- */
-typedef struct sr_node_s {
-    /**
-     * Memory context used internally by Sysrepo for efficient storage
-     * and conversion of this structure.
-     */
-    sr_mem_ctx_t *_sr_mem;
-
-    /** Name of the node. */
-    char *name;
-
-    /** Type of an element. */
-    sr_type_t type;
-
-    /** Flag for default node (applicable only for leaves). */
-    bool dflt;
-
-    /** Data of an element (if applicable), properly set according to the type. */
-    sr_data_t data;
-
-    /**
-     * Name of the module that defines scheme of this node.
-     * NULL if it is the same as that of the predecessor.
-     */
-    char *module_name;
-
-    /** Pointer to the parent node (NULL in case of root node). */
-    struct sr_node_s *parent;
-
-    /** Pointer to the next sibling node (NULL if there is no one). */
-    struct sr_node_s *next;
-
-    /** Pointer to the previous sibling node (NULL if there is no one). */
-    struct sr_node_s *prev;
-
-    /** Pointer to the first child node (NULL if this is a leaf). */
-    struct sr_node_s *first_child;
-
-    /** Pointer to the last child node (NULL if this is a leaf). */
-    struct sr_node_s *last_child;
-} sr_node_t;
-
-/**
- * @brief Sysrepo error codes.
- */
-typedef enum sr_error_e {
-    SR_ERR_OK = 0,             /**< No error. */
-    SR_ERR_INVAL_ARG,          /**< Invalid argument. */
-    SR_ERR_NOMEM,              /**< Not enough memory. */
-    SR_ERR_NOT_FOUND,          /**< Item not found. */
-    SR_ERR_INTERNAL,           /**< Other internal error. */
-    SR_ERR_INIT_FAILED,        /**< Sysrepo infra initialization failed. */
-    SR_ERR_IO,                 /**< Input/Output error. */
-    SR_ERR_DISCONNECT,         /**< The peer disconnected. */
-    SR_ERR_MALFORMED_MSG,      /**< Malformed message. */
-    SR_ERR_UNSUPPORTED,        /**< Unsupported operation requested. */
-    SR_ERR_UNKNOWN_MODEL,      /**< Request includes unknown schema */
-    SR_ERR_BAD_ELEMENT,        /**< Unknown element in existing schema */
-    SR_ERR_VALIDATION_FAILED,  /**< Validation of the changes failed. */
-    SR_ERR_OPERATION_FAILED,   /**< An operation failed. */
-    SR_ERR_DATA_EXISTS,        /**< Item already exists. */
-    SR_ERR_DATA_MISSING,       /**< Item does not exists. */
-    SR_ERR_UNAUTHORIZED,       /**< Operation not authorized. */
-    SR_ERR_INVAL_USER,         /**< Invalid username. */
-    SR_ERR_LOCKED,             /**< Requested resource is already locked. */
-    SR_ERR_TIME_OUT,           /**< Time out has expired. */
-    SR_ERR_RESTART_NEEDED,     /**< Sysrepo Engine restart is needed. */
-    SR_ERR_VERSION_MISMATCH,   /**< Incompatible client library used to communicate with sysrepo. */
-} sr_error_t;
-
-/**
- * @brief Detailed sysrepo error information.
- */
-typedef struct sr_error_info_s {
-    const char *message;  /**< Error message. */
-    const char *xpath;    /**< XPath to the node where the error has been discovered. */
-} sr_error_info_t;
-
-/**
- * @brief Returns the error message corresponding to the error code.
- *
- * @param[in] err_code Error code.
- *
- * @return Error message (statically allocated, do not free).
- */
-const char *sr_strerror(int err_code);
-
-/**
- * @brief Log levels used to determine if message of certain severity should be printed.
- */
-typedef enum {
-    SR_LL_NONE,  /**< Do not print any messages. */
-    SR_LL_ERR,   /**< Print only error messages. */
-    SR_LL_WRN,   /**< Print error and warning messages. */
-    SR_LL_INF,   /**< Besides errors and warnings, print some other informational messages. */
-    SR_LL_DBG,   /**< Print all messages including some development debug messages. */
-} sr_log_level_t;
-
-/**
- * @brief Enables / disables / changes log level (verbosity) of logging to
- * standard error output.
- *
- * By default, logging to stderr is disabled. Setting log level to any value
- * other than SR_LL_NONE enables the logging to stderr. Setting log level
- * back to SR_LL_NONE disables the logging to stderr.
- *
- * @param[in] log_level requested log level (verbosity).
- */
-void sr_log_stderr(sr_log_level_t log_level);
-
-/**
- * @brief Enables / disables / changes log level (verbosity) of logging to system log.
- *
- * By default, logging into syslog is disabled. Setting log level to any value
- * other than SR_LL_NONE enables the logging into syslog. Setting log level
- * back to SR_LL_NONE disables the logging into syslog.
- *
- * @note Please note that enabling logging into syslog will overwrite your syslog
- * connection settings (calls openlog), if you are connected to syslog already.
- *
- * @param[in] log_level requested log level (verbosity).
- */
-void sr_log_syslog(sr_log_level_t log_level);
-
-/**
- * @brief Sets callback that will be called when a log entry would be populated.
- *
- * @param[in] level Verbosity level of the log entry.
- * @param[in] message Message of the log entry.
- */
-typedef void (*sr_log_cb)(sr_log_level_t level, const char *message);
-
-/**
- * @brief Sets callback that will be called when a log entry would be populated.
- * Callback will be called for each message with any log level.
- *
- * @param[in] log_callback Callback to be called when a log entry would populated.
- */
-void sr_log_set_cb(sr_log_cb log_callback);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Connection / Session Management
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Flags used to override default connection handling by ::sr_connect call.
- */
-typedef enum sr_conn_flag_e {
-    SR_CONN_DEFAULT = 0,          /**< Default behavior - instantiate library-local Sysrepo Engine if
-                                       the connection to sysrepo daemon is not possible. */
-    SR_CONN_DAEMON_REQUIRED = 1,  /**< Require daemon connection - do not instantiate library-local Sysrepo Engine
-                                       if the library cannot connect to the sysrepo daemon  (and return an error instead). */
-    SR_CONN_DAEMON_START = 2,     /**< If sysrepo daemon is not running, and SR_CONN_DAEMON_REQUIRED was specified,
-                                       start it (only if the process calling ::sr_connect is running under root privileges). */
-} sr_conn_flag_t;
-
-/**
- * @brief Options overriding default connection handling by ::sr_connect call,
- * it is supposed to be bitwise OR-ed value of any ::sr_conn_flag_t flags.
- */
-typedef uint32_t sr_conn_options_t;
-
-/**
- * @brief Flags used to override default session handling (used by ::sr_session_start
- * and ::sr_session_start_user calls).
- */
-typedef enum sr_session_flag_e {
-    SR_SESS_DEFAULT = 0,       /**< Default (normal) session behavior. */
-    SR_SESS_CONFIG_ONLY = 1,   /**< Session will process only configuration data (e.g. sysrepo won't
-                                    return any state data by ::sr_get_items / ::sr_get_items_iter calls). */
-    SR_SESS_ENABLE_NACM = 2,   /**< Enable NETCONF access control for this session (disabled by default). */
-
-    SR_SESS_MUTABLE_OPTS = 3   /**< Bit-mask of options that can be set by the user
-                                    (immutable flags are defined in sysrepo.proto file). */
-} sr_session_flag_t;
-
-/**
- * @brief Options overriding default connection session handling,
- * it is supposed to be bitwise OR-ed value of any ::sr_session_flag_t flags.
- */
-typedef uint32_t sr_sess_options_t;
-
-/**
- * @brief Data stores that sysrepo supports. Both are editable via implicit candidate.
- * To make changes permanent in edited datastore ::sr_commit must be issued.
- * @see @ref ds_page "Datastores & Sessions" information page.
- */
-typedef enum sr_datastore_e {
-    SR_DS_STARTUP = 0,    /**< Contains configuration data that should be loaded by the controlled application when it starts. */
-    SR_DS_RUNNING = 1,    /**< Contains currently applied configuration and state data of a running application.
-                               @note This datastore is supported only by applications that subscribe for notifications
-                               about the changes made in the datastore (e.g. ::sr_module_change_subscribe). */
-    SR_DS_CANDIDATE = 2,  /**< Contains configuration that can be manipulated without impacting the current configuration.
-                               Its content is set to the content of running datastore by default. Changes made within
-                               the candidate can be later committed to the running datastore or copied to any datastore.
-
-                               @note The main difference between working with running and candidate datastore is in commit
-                               operation - commit of candidate session causes the content of running configuration to be set
-                               the value of the candidate configuration (running datastore is overwritten), whereas commit of
-                               runnnig session merges the changes made within the session with the actual state of running. */
-} sr_datastore_t;
-
-/**
- * @brief Connects to the sysrepo datastore (Sysrepo Engine).
- *
- * @note If the client library loses connection to the Sysrepo Engine during
- * the lifetime of the application, all Sysrepo API calls will start returning
- * ::SR_ERR_DISCONNECT error on active sessions. In this case, the application is supposed to reconnect
- * with another ::sr_connect call and restart all lost sessions.
- *
- * @param[in] app_name Name of the application connecting to the datastore
- * (can be a static string). Used only for accounting purposes.
- * @param[in] opts Options overriding default connection handling by this call.
- * @param[out] conn_ctx Connection context that can be used for subsequent API calls
- * (automatically allocated, it is supposed to be released by the caller using ::sr_disconnect).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_connect(const char *app_name, const sr_conn_options_t opts, sr_conn_ctx_t **conn_ctx);
-
-/**
- * @brief Disconnects from the sysrepo datastore (Sysrepo Engine).
- *
- * Cleans up and frees connection context allocated by ::sr_connect. All sessions
- * started within the connection will be automatically stopped and cleaned up too.
- *
- * @param[in] conn_ctx Connection context acquired with ::sr_connect call.
- */
-void sr_disconnect(sr_conn_ctx_t *conn_ctx);
-
-/**
- * @brief Starts a new configuration session.
- *
- * @see @ref ds_page "Datastores & Sessions" for more information about datastores and sessions.
- *
- * @param[in] conn_ctx Connection context acquired with ::sr_connect call.
- * @param[in] datastore Datastore on which all sysrepo functions within this
- * session will operate. Later on, datastore can be later changed using
- * ::sr_session_switch_ds call. Functionality of some sysrepo calls does not depend on
- * datastore. If your session will contain just calls like these, you can pass
- * any valid value (e.g. SR_RUNNING).
- * @param[in] opts Options overriding default session handling.
- * @param[out] session Session context that can be used for subsequent API
- * calls (automatically allocated, can be released by calling ::sr_session_stop).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_session_start(sr_conn_ctx_t *conn_ctx, const sr_datastore_t datastore,
-        const sr_sess_options_t opts, sr_session_ctx_t **session);
-
-/**
- * @brief Starts a new configuration session on behalf of a different user.
- *
- * This call is intended for northbound access to sysrepo from management
- * applications, that need sysrepo to authorize the operations not only
- * against the user under which the management application is running, but
- * also against another user (e.g. user that connected to the management application).
- *
- * @note Be aware that authorization of specified user may fail with unexpected
- * errors in case that the client library uses its own Sysrepo Engine at the
- * moment and your process in not running under root privileges. To prevent
- * this situation, consider specifying SR_CONN_DAEMON_REQUIRED flag by
- * ::sr_connect call or using ::sr_session_start instead of this function.
- *
- * @see @ref ds_page "Datastores & Sessions" for more information about datastores and sessions.
- *
- * @param[in] conn_ctx Connection context acquired with ::sr_connect call.
- * @param[in] user_name Effective user name used to authorize the access to
- * datastore (in addition to automatically-detected real user name).
- * @param[in] datastore Datastore on which all sysrepo functions within this
- * session will operate. Functionality of some sysrepo calls does not depend on
- * datastore. If your session will contain just calls like these, you can pass
- * any valid value (e.g. SR_RUNNING).
- * @param[in] opts Options overriding default session handling.
- * @param[out] session Session context that can be used for subsequent API calls
- * (automatically allocated, it is supposed to be released by caller using ::sr_session_stop).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_session_start_user(sr_conn_ctx_t *conn_ctx, const char *user_name, const sr_datastore_t datastore,
-        const sr_sess_options_t opts, sr_session_ctx_t **session);
-
-/**
- * @brief Stops current session and releases resources tied to the session.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_session_stop(sr_session_ctx_t *session);
-
-/**
- * @brief Refreshes configuration data cached within the session and starts
- * operating on fresh data loaded from the datastore.
- *
- * Call this function in case that you leave session open for longer time period
- * and you expect that the data in the datastore may have been changed since
- * last data (re)load (which occurs by ::sr_session_start, ::sr_commit and
- * ::sr_discard_changes).
- *
- * @see @ref ds_page "Datastores & Sessions" for information about session data caching.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_session_refresh(sr_session_ctx_t *session);
-
-/**
- * @brief Checks aliveness and validity of the session & connection tied to it.
- *
- * If the connection to the Sysrepo Engine has been lost in the meantime, returns SR_ERR_DICONNECT.
- * In this case, the application is supposed to stop the session (::sr_session_stop), disconnect (::sr_disconnect)
- * and then reconnect (::sr_connect) and start a new session (::sr_session_start).
- *
- * @note If the client library loses connection to the Sysrepo Engine during the lifetime of the application,
- * all Sysrepo API calls will start returning SR_ERR_DISCONNECT error on active sessions. This is the primary
- * mechanism that can be used to detect connection issues, ::sr_session_check is just an addition to it. Since
- * ::sr_session_check sends a message to the Sysrepo Engine and waits for the response, it costs some extra overhead
- * in contrast to catching SR_ERR_DISCONNECT error.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK in case that the session is healthy,
- * SR_ERR_DICONNECT in case that connection to the Sysrepo Engine has been lost).
- */
-int sr_session_check(sr_session_ctx_t *session);
-
-/**
- * @brief Changes datastore to which the session is tied to. All subsequent
- * calls will be issued on the chosen datastore.
- *
- * @param [in] session
- * @param [in] ds
- * @return Error code (SR_ERR_OK on success)
- */
-int sr_session_switch_ds(sr_session_ctx_t *session, sr_datastore_t ds);
-
-/**
- * @brief Alter the session options. E.g.: set/unset SR_SESS_CONFIG_ONLY flag.
- *
- * @param [in] session
- * @param [in] opts - new value for session options
- * @return Error code (SR_ERR_OK on success)
- */
-int sr_session_set_options(sr_session_ctx_t *session, const sr_sess_options_t opts);
-
-/**
- * @brief Retrieves detailed information about the error that has occurred
- * during the last operation executed within provided session.
- *
- * If multiple errors has occurred within the last operation, only the first
- * one is returned. This call is sufficient for all data retrieval and data
- * manipulation functions that operate on single-item basis. For operations
- * such as ::sr_validate or ::sr_commit where multiple errors can occur,
- * use ::sr_get_last_errors instead.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[out] error_info Detailed error information. Be aware that
- * returned pointer may change by the next API call executed within the provided
- * session,  so it's not safe to use this function by concurrent access to the
- * same session within multiple threads. Do not free or modify returned values.
- *
- * @return Error code of the last operation executed within provided session.
- */
-int sr_get_last_error(sr_session_ctx_t *session, const sr_error_info_t **error_info);
-
-/**
- * @brief Retrieves detailed information about all errors that have occurred
- * during the last operation executed within provided session.
- *
- * Use this call instead of ::sr_get_last_error by operations where multiple
- * errors can occur, such as ::sr_validate or ::sr_commit.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[out] error_info Array of detailed error information. Be aware that
- * returned pointer may change by the next API call executed within the provided
- * session,  so it's not safe to use this function by concurrent access to the
- * same session within multiple threads. Do not free or modify returned values.
- * @param[out] error_cnt Number of errors returned in the error_info array.
- *
- * @return Error code of the last operation executed within provided session.
- */
-int sr_get_last_errors(sr_session_ctx_t *session, const sr_error_info_t **error_info, size_t *error_cnt);
-
-/**
- * @brief Sets detailed error information into provided session. Used to notify
- * the client library about errors that occurred in application code.
- *
- * @note Intended for commit verifiers (notification session) - the call has no
- * impact on any other sessions.
- *
- * @param[in] session Session context passed into notification callback.
- * @param[in] message Human-readable error message.
- * @param[in] xpath XPath to the node where the error has occurred. NULL value
- * is also accepted.
- *
- * @return Error code (SR_ERR_OK on success)
- */
-int sr_set_error(sr_session_ctx_t *session, const char *message, const char *xpath);
-
-/**
- * @brief Returns the assigned id of the session. Can be used to pair the session with
- * netconf-config-change notification initiator.
- * @param [in] session
- * @return session id or 0 in case of error
- */
-uint32_t sr_session_get_id(sr_session_ctx_t *session);
-
-////////////////////////////////////////////////////////////////////////////////
-// Data Retrieval API (get / get-config functionality)
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Structure that contains information about one particular schema file installed in sysrepo.
- */
-typedef struct sr_sch_revision_s {
-    const char *revision;         /**< Revision of the module/submodule. */
-    const char *file_path_yang;   /**< Absolute path to file where the module/submodule is stored (YANG format). */
-    const char *file_path_yin;    /**< Absolute path to file where the module/submodule is stored (.yin format). */
-} sr_sch_revision_t;
-
-/**
- * @brief Structure that contains information about submodules of a module installed in sysrepo.
- */
-typedef struct sr_sch_submodule_s {
-    const char *submodule_name;    /**< Submodule name. */
-    sr_sch_revision_t revision;    /**< Revision of the submodule. */
-} sr_sch_submodule_t;
-
-/**
- * @brief Structure that contains information about a module installed in sysrepo.
- */
-typedef struct sr_schema_s {
-    /**
-     * Memory context used internally by Sysrepo for efficient storage
-     * and conversion of this structure.
-     */
-    sr_mem_ctx_t *_sr_mem;
-
-    const char *module_name;         /**< Name of the module. */
-    const char *ns;                  /**< Namespace of the module used in @ref xp_page "XPath". */
-    const char *prefix;              /**< Prefix of the module. */
-    bool installed;                  /**< TRUE if the module was explicitly installed. */
-    bool implemented;                /**< TRUE if the module is implemented (does not have to be installed),
-                                          not just imported. */
-
-    sr_sch_revision_t revision;      /**< Revision the module. */
-
-    sr_sch_submodule_t *submodules;  /**< Array of all installed submodules of the module. */
-    size_t submodule_count;          /**< Number of module's submodules. */
-
-    char **enabled_features;         /**< Array of enabled features */
-    size_t enabled_feature_cnt;      /**< Number of enabled feature */
-} sr_schema_t;
-
-/**
- * @brief Format types of ::sr_get_schema result
- */
-typedef enum sr_schema_format_e {
-    SR_SCHEMA_YANG,                         /**< YANG format */
-    SR_SCHEMA_YIN                           /**< YIN format */
-} sr_schema_format_t;
-
-/**
- * @brief Iterator used for accessing data nodes via ::sr_get_items_iter call.
- */
-typedef struct sr_val_iter_s sr_val_iter_t;
-
-/**
- * @brief Retrieves list of schemas installed in the sysrepo datastore.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[out] schemas Array of installed schemas information (allocated by
- * the function, it is supposed to be freed by caller using ::sr_free_schemas call).
- * @param[out] schema_cnt Number of schemas returned in the array.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_list_schemas(sr_session_ctx_t *session, sr_schema_t **schemas, size_t *schema_cnt);
-
-/**
- * @brief Retrieves the content of specified schema file. If the module
- * can not be found SR_ERR_NOT_FOUND is returned.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] module_name Name of the requested module.
- * @param[in] revision Requested revision of the module. If NULL
- * is passed, the latest revision will be returned.
- * @param[in] submodule_name Name of the requested submodule. Pass NULL if you are
- * requesting the content of the main module.
- * @param[in] format of the returned schema
- * @param[out] schema_content Content of the specified schema file. Automatically
- * allocated by the function, should be freed by the caller.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_schema(sr_session_ctx_t *session, const char *module_name, const char *revision,
-         const char *submodule_name, sr_schema_format_t format, char **schema_content);
-
-/**
- * @brief Retrieves the content of the specified submodule schema file. If the submodule
- * cannot be found, SR_ERR_NOT_FOUND is returned.
- *
- * @param[in] session Session context acquired from ::sr_session_start call.
- * @param[in] submodule_name Name of the requested submodule.
- * @param[in] submodule_revision Requested revision of the submodule. If NULL
- * is passed, the latest revision will be returned.
- * @param[in] format of the returned schema.
- * @param[out] schema_content Content of the specified schema file. Automatically
- * allocated by the function, should be freed by the caller.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_submodule_schema(sr_session_ctx_t *session, const char *submodule_name, const char *submodule_revision,
-                            sr_schema_format_t format, char **schema_content);
-
-/**
- * @brief Retrieves a single data element stored under provided XPath. If multiple
- * nodes matches the xpath SR_ERR_INVAL_ARG is returned.
- *
- * If the xpath identifies an empty leaf, a list or a container, the value
- * has no data filled in and its type is set properly (SR_LEAF_EMPTY_T / SR_LIST_T / SR_CONTAINER_T / SR_CONTAINER_PRESENCE_T).
- *
- * @see @ref xp_page "Path Addressing" documentation, or
- * https://tools.ietf.org/html/draft-ietf-netmod-yang-json#section-6.11
- * for XPath syntax used for identification of yang nodes in sysrepo calls.
- *
- * @see Use ::sr_get_items or ::sr_get_items_iter for retrieving larger chunks
- * of data from the datastore. Since they retrieve the data from datastore in
- * larger chunks, they can work much more efficiently than multiple ::sr_get_item calls.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element to be retrieved.
- * @param[out] value Structure containing information about requested element
- * (allocated by the function, it is supposed to be freed by the caller using ::sr_free_val).
- *
- * @return Error code (SR_ERR_OK on success)
- */
-int sr_get_item(sr_session_ctx_t *session, const char *xpath, sr_val_t **value);
-
-/**
- * @brief Retrieves an array of data elements matching provided XPath
- *
- * All data elements are transferred within one message from the datastore,
- * which is much more efficient that calling multiple ::sr_get_item calls.
- *
- * If the user does not have read permission to access certain nodes, these
- * won't be part of the result. SR_ERR_NOT_FOUND will be returned if there are
- * no nodes matching xpath in the data tree, or the user does not have read permission to access them.
- *
- * If the response contains too many elements time out may be exceeded, SR_ERR_TIME_OUT
- * will be returned, use ::sr_get_items_iter.
- *
- * @see @ref xp_page "Path Addressing" documentation
- * for Path syntax used for identification of yang nodes in sysrepo calls.
- *
- * @see ::sr_get_items_iter can be used for the same purpose as ::sr_get_items
- * call if you expect that ::sr_get_items could return too large data sets.
- * Since ::sr_get_items_iter also retrieves the data from datastore in larger chunks,
- * in can still work very efficiently for large datasets.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element to be retrieved.
- * @param[out] values Array of structures containing information about requested data elements
- * (allocated by the function, it is supposed to be freed by the caller using ::sr_free_values).
- * @param[out] value_cnt Number of returned elements in the values array.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_items(sr_session_ctx_t *session, const char *xpath, sr_val_t **values, size_t *value_cnt);
-
-/**
- * @brief Creates an iterator for retrieving of the data elements stored under provided xpath.
- *
- * Requested data elements are transferred from the datastore in larger chunks
- * of pre-defined size, which is much more efficient that calling multiple
- * ::sr_get_item calls, and may be less memory demanding than calling ::sr_get_items
- * on very large datasets.
- *
- * @see @ref xp_page "Path Addressing" documentation, or
- * https://tools.ietf.org/html/draft-ietf-netmod-yang-json#section-6.11
- * for XPath syntax used for identification of yang nodes in sysrepo calls.
- *
- * @see ::sr_get_item_next for iterating over returned data elements.
- * @note Iterator allows to iterate through the values once. To start iteration
- *  from the beginning new iterator must be created.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element / subtree to be retrieved.
- * @param[out] iter Iterator context that can be used to retrieve individual data
- * elements via ::sr_get_item_next calls. Allocated by the function, should be
- * freed with ::sr_free_val_iter.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_items_iter(sr_session_ctx_t *session, const char *xpath, sr_val_iter_t **iter);
-
-/**
- * @brief Returns the next item from the dataset of provided iterator created
- * by ::sr_get_items_iter call. If there is no item left SR_ERR_NOT_FOUND is returned.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in,out] iter Iterator acquired with ::sr_get_items_iter call.
- * @param[out] value Structure containing information about requested element
- * (allocated by the function, it is supposed to be freed by the caller using ::sr_free_val).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_item_next(sr_session_ctx_t *session, sr_val_iter_t *iter, sr_val_t **value);
-
-/**
- * @brief Flags used to customize the behaviour of ::sr_get_subtree and ::sr_get_subtrees calls.
- */
-typedef enum sr_get_subtree_flag_e {
-    /**
-     * Default get-subtree(s) behaviour.
-     * All matched subtrees are sent with all their content in one message.
-     */
-    SR_GET_SUBTREE_DEFAULT = 0,
-
-    /**
-     * The iterative get-subtree(s) behaviour.
-     * The matched subtrees are sent in chunks and only as needed while they are iterated
-     * through using functions ::sr_node_get_child, ::sr_node_get_next_sibling and
-     * ::sr_node_get_parent from "sysrepo/trees.h". This behaviour gives much better
-     * performance than the default one if only a small portion of matched subtree(s) is
-     * actually iterated through.
-     * @note It is considered a programming error to access \p next, \p prev, \p parent,
-     * \p first_child and \p last_child data members of ::sr_node_t on a partially loaded tree.
-     */
-    SR_GET_SUBTREE_ITERATIVE = 1
-} sr_get_subtree_flag_t;
-
-/**
- * @brief Options for get-subtree and get-subtrees operations.
- * It is supposed to be bitwise OR-ed value of any ::sr_get_subtree_flag_t flags.
- */
-typedef uint32_t sr_get_subtree_options_t;
-
-/**
- * @brief Retrieves a single subtree whose root node is stored under the provided XPath.
- * If multiple nodes matches the xpath SR_ERR_INVAL_ARG is returned.
- *
- * The functions returns values and all associated information stored under the root node and
- * all its descendants. While the same data can be obtained using ::sr_get_items in combination
- * with the expressive power of XPath addressing, the recursive nature of the output data type
- * also preserves the hierarchical relationships between data elements.
- *
- * Values of internal nodes of the subtree have no data filled in and their type is set properly
- * (SR_LIST_T / SR_CONTAINER_T / SR_CONTAINER_PRESENCE_T), whereas leaf nodes are carrying actual
- * data (apart from SR_LEAF_EMPTY_T).
- *
- * @see @ref xp_page "Path Addressing" documentation
- * for XPath syntax used for identification of yang nodes in sysrepo calls.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier referencing the root node of the subtree to be retrieved.
- * @param[in] opts Options overriding default behavior of this operation.
- * @param[out] subtree Nested structure storing all data of the requested subtree
- * (allocated by the function, it is supposed to be freed by the caller using ::sr_free_tree).
- *
- * @return Error code (SR_ERR_OK on success)
- */
-int sr_get_subtree(sr_session_ctx_t *session, const char *xpath, sr_get_subtree_options_t opts,
-        sr_node_t **subtree);
-
-/**
- * @brief Retrieves an array of subtrees whose root nodes match the provided XPath.
- *
- * If the user does not have read permission to access certain nodes, these together with
- * their descendants won't be part of the result. SR_ERR_NOT_FOUND will be returned if there are
- * no nodes matching xpath in the data tree, or the user does not have read permission to access them.
- *
- * Subtrees that match the provided XPath are not merged even if they overlap. This significantly
- * simplifies the implementation and decreases the cost of this operation. The downside is that
- * the user must choose the XPath carefully. If the subtree selection process results in too many
- * node overlaps, the cost of the operation may easily outshine the benefits. As an example,
- * a common XPath expression "//." is normally used to select all nodes in a data tree, but for this
- * operation it would result in an excessive duplication of transfered data elements.
- * Since you get all the descendants of each matched node implicitly, you probably should not need
- * to use XPath wildcards deeper than on the top-level.
- * (i.e. "/." is preferred alternative to "//." for get-subtrees operation).
- *
- * If the response contains too many elements time out may be exceeded, SR_ERR_TIME_OUT
- * will be returned.
- *
- * @see @ref xp_page "Path Addressing" documentation, or
- * https://tools.ietf.org/html/draft-ietf-netmod-yang-json#section-6.11
- * for XPath syntax used for identification of yang nodes in sysrepo calls.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier referencing root nodes of subtrees to be retrieved.
- * @param[in] opts Options overriding default behavior of this operation.
- * @param[out] subtrees Array of nested structures storing all data of the requested subtrees
- * (allocated by the function, it is supposed to be freed by the caller using ::sr_free_trees).
- * @param[out] subtree_cnt Number of returned trees in the subtrees array.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_subtrees(sr_session_ctx_t *session, const char *xpath, sr_get_subtree_options_t opts,
-        sr_node_t **subtrees, size_t *subtree_cnt);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Data Manipulation API (edit-config functionality)
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Flags used to override default behavior of data manipulation calls.
- */
-typedef enum sr_edit_flag_e {
-    SR_EDIT_DEFAULT = 0,        /**< Default behavior - recursive and non-strict. */
-    SR_EDIT_NON_RECURSIVE = 1,  /**< Non-recursive behavior:
-                                     by ::sr_set_item, all preceding nodes (parents) of the identified element must exist,
-                                     by ::sr_delete_item xpath must not identify an non-empty list or non-empty container. */
-    SR_EDIT_STRICT = 2          /**< Strict behavior:
-                                     by ::sr_set_item the identified element must not exist (similar to netconf create operation),
-                                     by ::sr_delete_item the identified element must exist (similar to netconf delete operation). */
-} sr_edit_flag_t;
-
-/**
- * @brief Options overriding default behavior of data manipulation calls,
- * it is supposed to be bitwise OR-ed value of any ::sr_edit_flag_t flags.
- */
-typedef uint32_t sr_edit_options_t;
-
-/**
- * @brief Options for specifying move direction of ::sr_move_item call.
- */
-typedef enum sr_move_position_e {
-    SR_MOVE_BEFORE = 0,    /**< Move the specified item before the selected sibling. */
-    SR_MOVE_AFTER = 1,     /**< Move the specified item after the selected. */
-    SR_MOVE_FIRST = 2,     /**< Move the specified item to the position of the first child. */
-    SR_MOVE_LAST = 3,      /**< Move the specified item to the position of the last child. */
-} sr_move_position_t;
-
-/**
- * @brief Sets the value of the leaf, leaf-list, list or presence container.
- *
- * With default options it recursively creates all missing nodes (containers and
- * lists including their key leaves) in the xpath to the specified node (can be
- * turned off with SR_EDIT_NON_RECURSIVE option). If SR_EDIT_STRICT flag is set,
- * the node must not exist (otherwise an error is returned).
- *
- * To create a list use xpath with key values included and pass NULL as value argument.
- *
- * Setting of a leaf-list value appends the value at the end of the leaf-list.
- * A value of leaf-list can be specified either by predicate in xpath or by value argument.
- * If both are present, value argument is ignored and xpath predicate is used.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element to be set.
- * @param[in] value Value to be set on specified xpath. xpath member of the
- * ::sr_val_t structure can be NULL. Value will be copied - can be allocated on stack.
- * @param[in] opts Options overriding default behavior of this call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_set_item(sr_session_ctx_t *session, const char *xpath, const sr_val_t *value, const sr_edit_options_t opts);
-
-
-/**
- * @brief Functions is similar to ::sr_set_item with the difference that the value to be set
- * is provided as string.
- * @param [in] session Session context acquired with ::sr_session_start call.
- * @param [in] xpath @ref xp_page "Data Path" identifier of the data element to be set.
- * @param [in] value string representation of the value to be set
- * @param [in] opts same as for ::sr_set_item
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_set_item_str(sr_session_ctx_t *session, const char *xpath, const char *value, const sr_edit_options_t opts);
-/**
- * @brief Deletes the nodes under the specified xpath.
- *
- * To delete non-empty lists or containers SR_EDIT_NON_RECURSIVE flag must not be set.
- * If SR_EDIT_STRICT flag is set the specified node must must exist in the datastore.
- * If the xpath includes the list keys, the specified list instance is deleted.
- * If the xpath to list does not include keys, all instances of the list are deleted.
- * SR_ERR_UNAUTHORIZED will be returned if the user does not have write permission to any affected node.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element to be deleted.
- * @param[in] opts Options overriding default behavior of this call.
- *
- * @return Error code (SR_ERR_OK on success).
- **/
-int sr_delete_item(sr_session_ctx_t *session, const char *xpath, const sr_edit_options_t opts);
-
-/**
- * @brief Move the instance of an user-ordered list or leaf-list to the specified position.
- *
- * Item can be move to the first or last position or positioned relatively to its sibling.
- * @note To determine current order, you can issue a ::sr_get_items call
- * (without specifying keys of the list in question).
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the data element to be moved.
- * @param[in] position Requested move direction.
- * @param[in] relative_item xpath Identifier of the data element that is used
- * to determine relative position, used only if position argument is SR_MOVE_BEFORE or SR_MOVE_AFTER.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_move_item(sr_session_ctx_t *session, const char *xpath, const sr_move_position_t position, const char *relative_item);
-
-/**
- * @brief Perform the validation of changes made in current session, but do not
- * commit nor discard them.
- *
- * Provides only YANG validation, commit verify subscribers won't be notified in this case.
- *
- * @see Use ::sr_get_last_errors to retrieve error information if the validation
- * returned with an error.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_validate(sr_session_ctx_t *session);
-
-/**
- * @brief Apply changes made in current session.
- *
- * @note Note that in case that you are committing to the running datstore, you also
- * need to copy the config to startup to make changes permanent after restart.
- *
- * @see Use ::sr_get_last_errors to retrieve error information if the commit
- * operation returned with an error.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_commit(sr_session_ctx_t *session);
-
-/**
- * @brief Discard non-committed changes made in current session.
- *
- * @note Since the function effectively clears all the cached data within the session,
- * the next operation will operate on fresh data loaded from the datastore
- * (i.e. no need to call ::sr_session_refresh afterwards).
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_discard_changes(sr_session_ctx_t *session);
-
-/**
- * @brief Replaces an entire configuration datastore  with the contents of
- * another complete configuration datastore. If the module is specified, limits
- * the copy operation only to one specified module. If it's not specified,
- * the operation is performed on all modules that are currently active in the
- * source datastore.
- *
- * If the target datastore exists, it is overwritten. Otherwise, a new one is created.
- *
- * @note ::sr_session_refresh is needed to see the result of a copy-config operation
- * in a session apart from the case when SR_DS_CANDIDATE is the destination datastore.
- * Since the candidate is not shared among sessions, data trees are copied only to the
- * canidate in the session issuing the copy-config operation.
- *
- * @note Operation may fail, if it tries to copy a not enabled configuration to the
- * running datastore.
- *
- * @note \p session \p dst_datastore uncommitted changes will get discarded.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] module_name If specified, only limits the copy operation only to
- * one specified module.
- * @param[in] src_datastore Source datastore.
- * @param[in] dst_datastore Destination datastore.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_copy_config(sr_session_ctx_t *session, const char *module_name,
-        sr_datastore_t src_datastore, sr_datastore_t dst_datastore);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Locking API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Locks the datastore which the session is tied to. If there is
- * a module locked by the other session SR_ERR_LOCKED is returned.
- * Operation fails if there is a modified data tree in session.
- *
- * All data models within the datastore will be locked for writing until
- * ::sr_unlock_datastore is called or until the session is stopped or terminated
- * for any reason.
- *
- * The lock operation will not be allowed if the user does not have sufficient
- * permissions for writing into each of the data models in the datastore.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_lock_datastore(sr_session_ctx_t *session);
-
-/**
- * @brief Unlocks the datastore which the session is tied to.
- *
- * All data models within the datastore will be unlocked if they were locked
- * by this session.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_unlock_datastore(sr_session_ctx_t *session);
-
-/**
- * @brief Locks specified data module within the datastore which the session
- * is tied to. Operation fails if the data tree has been modified.
- *
- * Specified data module will be locked for writing in the datastore until
- * ::sr_unlock_module is called or until the session is stopped or terminated
- * for any reason.
- *
- * The lock operation will not be allowed if the user does not have sufficient
- * permissions for writing into the specified data module.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] module_name Name of the module to be locked.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_lock_module(sr_session_ctx_t *session, const char *module_name);
-
-/**
- * @brief Unlocks specified data module within the datastore which the session
- * is tied to.
- *
- * Specified data module will be unlocked if was locked in the datastore
- * by this session.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] module_name Name of the module to be unlocked.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_unlock_module(sr_session_ctx_t *session, const char *module_name);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Change Notifications API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Flags used to override default handling of subscriptions.
- */
-typedef enum sr_subscr_flag_e {
-    /**
-     * @brief Default behavior of the subscription. In case of ::sr_module_change_subscribe and
-     * ::sr_subtree_change_subscribe calls it means that:
-     *
-     * - the subscriber is the "owner" of the subscribed data tree and and the data tree will be enabled in the running
-     *   datastore while this subscription is alive (if not already, can be changed using ::SR_SUBSCR_PASSIVE flag),
-     * - configuration data of the subscribed module or subtree is copied from startup to running datastore
-     *   (only if the module was not enabled before),
-     * - the callback will be called twice, once with ::SR_EV_VERIFY event and once with ::SR_EV_APPLY / ::SR_EV_ABORT
-     *   event passed in (can be changed with ::SR_SUBSCR_APPLY_ONLY flag).
-     */
-    SR_SUBSCR_DEFAULT = 0,
-
-    /**
-     * @brief This option enables the application to re-use an already existing subscription context previously returned
-     * from any sr_*_subscribe call instead of requesting the creation of a new one. In that case a single
-     * ::sr_unsubscribe call unsubscribes from all subscriptions filed within the context.
-     */
-    SR_SUBSCR_CTX_REUSE = 1,
-
-    /**
-     * @brief The subscriber is not the "owner" of the subscribed data tree, just a passive watcher for changes.
-     * When this option is passed in to ::sr_module_change_subscribe or ::sr_subtree_change_subscribe,
-     * the subscription will have no effect on the presence of the subtree in the running datastore.
-     */
-    SR_SUBSCR_PASSIVE = 2,
-
-    /**
-     * @brief The subscriber does not support verification of the changes and wants to be notified only after
-     * the changes has been applied in the datastore, without the possibility to deny them
-     * (it will receive only ::SR_EV_APPLY events).
-     */
-    SR_SUBSCR_APPLY_ONLY = 4,
-
-    /**
-     * @brief The subscriber wants ::SR_EV_ENABLED notifications to be sent to them.
-     */
-    SR_SUBSCR_EV_ENABLED = 8,
-
-    /**
-     * @brief The subscriber will not receive ::SR_EV_ABORT if he returns an error in verify phase
-     * (if the commit is refused by other verifier ::SR_EV_ABORT will be delivered).
-     */
-    SR_SUBSCR_NO_ABORT_FOR_REFUSED_CFG = 16,
-
-    /**
-     * @brief No real-time notifications will be delivered until ::sr_event_notif_replay is called
-     * and replay has finished (::SR_EV_NOTIF_T_REPLAY_COMPLETE is delivered).
-     */
-    SR_SUBSCR_NOTIF_REPLAY_FIRST = 32,
-} sr_subscr_flag_t;
-
-/**
- * @brief Type of the notification event that has occurred (passed to notification callbacks).
- *
- * @note Each change is normally notified twice: first as ::SR_EV_VERIFY event and then as ::SR_EV_APPLY or ::SR_EV_ABORT
- * event. If the subscriber does not support verification, it can subscribe only to ::SR_EV_APPLY event by providing
- * ::SR_SUBSCR_APPLY_ONLY subscription flag.
- */
-typedef enum sr_notif_event_e {
-    SR_EV_VERIFY,  /**< Occurs just before the changes are committed to the datastore,
-                        the subscriber is supposed to verify that the changes are valid and can be applied
-                        and prepare all resources required for the changes. The subscriber can still deny the changes
-                        in this phase by returning an error from the callback. */
-    SR_EV_APPLY,   /**< Occurs just after the changes have been successfully committed to the datastore,
-                        the subscriber is supposed to apply the changes now, but it cannot deny the changes in this
-                        phase anymore (any returned errors are just logged and ignored). */
-    SR_EV_ABORT,   /**< Occurs in case that the commit transaction has failed (possibly because one of the verifiers
-                        has denied the change / returned an error). The subscriber is supposed to return the managed
-                        application to the state before the commit. Any returned errors are just logged and ignored. */
-    SR_EV_ENABLED, /**< Occurs just after the subscription. Subscriber gets notified about configuration that was copied
-                        from startup to running. This allows to reuse the callback for applying changes made in running to
-                        reflect the changes when the configuration is copied from startup to running during subscription process */
-} sr_notif_event_t;
-
-/**
- * @brief Type of the operation made on an item, used by changeset retrieval in ::sr_get_change_next.
- */
-typedef enum sr_change_oper_e {
-    SR_OP_CREATED,   /**< The item has been created by the change. */
-    SR_OP_MODIFIED,  /**< The value of the item has been modified by the change. */
-    SR_OP_DELETED,   /**< The item has been deleted by the change. */
-    SR_OP_MOVED,     /**< The item has been moved in the subtree by the change (applicable for leaf-lists and user-ordered lists). */
-} sr_change_oper_t;
-
-/**
- * @brief State of a module as returned by the ::sr_module_install_cb callback.
- */
-typedef enum sr_module_state_e {
-    SR_MS_UNINSTALLED,  /**< The module is not installed in the sysrepo repository. */
-    SR_MS_IMPORTED,     /**< The module has been implicitly installed into the sysrepo repository
-                             as it is imported by another implemented/imported module. */
-    SR_MS_IMPLEMENTED   /**< The module has been explicitly installed into the sysrepo repository by the user. */
-} sr_module_state_t;
-
-/**
- * @brief Sysrepo subscription context returned from sr_*_subscribe calls,
- * it is supposed to be released by the caller using ::sr_unsubscribe call.
- */
-typedef struct sr_subscription_ctx_s sr_subscription_ctx_t;
-
-/**
- * @brief Iterator used for retrieval of a changeset using ::sr_get_changes_iter call.
- */
-typedef struct sr_change_iter_s sr_change_iter_t;
-
-/**
- * @brief Options overriding default behavior of subscriptions,
- * it is supposed to be a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- */
-typedef uint32_t sr_subscr_options_t;
-
-/**
- * @brief Callback to be called by the event of changing any running datastore
- * content within the specified module. Subscribe to it by ::sr_module_change_subscribe call.
- *
- * @param[in] session Automatically-created session that can be used for obtaining changed data
- * (e.g. by ::sr_get_changes_iter call ot ::sr_get_item -like calls). Do not stop this session.
- * @param[in] module_name Name of the module where the change has occurred.
- * @param[in] event Type of the notification event that has occurred.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to
- * ::sr_module_change_subscribe call.
- */
-typedef int (*sr_module_change_cb)(sr_session_ctx_t *session, const char *module_name,
-        sr_notif_event_t event, void *private_ctx);
-
-/**
- * @brief Callback to be called by the event of changing any running datastore
- * content within the specified subtree. Subscribe to it by ::sr_subtree_change_subscribe call.
- *
- * @param[in] session Automatically-created session that can be used for obtaining changed data
- * (e.g. by ::sr_get_changes_iter call or ::sr_get_item -like calls). Do not stop this session.
- * @param[in] xpath @ref xp_page "Data Path" of the subtree where the change has occurred.
- * @param[in] event Type of the notification event that has occurred.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to
- * ::sr_subtree_change_subscribe call.
- */
-typedef int (*sr_subtree_change_cb)(sr_session_ctx_t *session, const char *xpath,
-        sr_notif_event_t event, void *private_ctx);
-
-/**
- * @brief Callback to be called by the event of installation / uninstallation
- * of a new module into sysrepo. Subscribe to it by ::sr_module_install_subscribe call.
- *
- * @param[in] module_name Name of the newly installed / uinstalled module.
- * @param[in] revision Revision of the newly installed module (if specified
- * within the YANG model).
- * @param[in] state The new state of the module (uninstalled vs. imported vs. implemented).
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to
- * ::sr_module_install_subscribe call.
- */
-typedef void (*sr_module_install_cb)(const char *module_name, const char *revision, sr_module_state_t state,
-        void *private_ctx);
-
-/**
- * @brief Callback to be called by the event of enabling / disabling of
- * a YANG feature within a module. Subscribe to it by ::sr_feature_enable_subscribe call.
- *
- * @param[in] module_name Name of the module where the feature has been enabled / disabled.
- * @param[in] feature_name Name of the feature that has been enabled / disabled.
- * @param[in] enabled TRUE if the feature has been enabled, FALSE if disabled.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to
- * ::sr_feature_enable_subscribe call.
- */
-typedef void (*sr_feature_enable_cb)(const char *module_name, const char *feature_name, bool enabled, void *private_ctx);
-
-/**
- * @brief Subscribes for notifications about the changes made within specified
- * module in running datastore.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] module_name Name of the module of interest for change notifications.
- * @param[in] callback Callback to be called when the change in the datastore occurs.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] priority Specifies the order in which the callbacks will be called (callbacks with higher
- * priority will be called sooner, callbacks with the priority of 0 will be called at the end).
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_module_change_subscribe(sr_session_ctx_t *session, const char *module_name, sr_module_change_cb callback,
-        void *private_ctx, uint32_t priority, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for notifications about the changes made within specified
- * subtree in running datastore.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the subtree of the interest for change notifications.
- * @param[in] callback Callback to be called when the change in the datastore occurs.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] priority Specifies the order in which the callbacks will be called (callbacks with higher
- * priority will be called sooner, callbacks with the priority of 0 will be called at the end).
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_subtree_change_subscribe(sr_session_ctx_t *session, const char *xpath, sr_subtree_change_cb callback,
-        void *private_ctx, uint32_t priority, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for notifications about installation / uninstallation
- * of a new module into sysrepo.
- *
- * Mainly intended for northbound management applications that need to be
- * always aware of all active modules installed in sysrepo.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] callback Callback to be called when the event occurs.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_module_install_subscribe(sr_session_ctx_t *session, sr_module_install_cb callback, void *private_ctx,
-        sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for notifications about enabling / disabling of
- * a YANG feature within a module.
- *
- * Mainly intended for northbound management applications that need to be
- * always aware of all active features within the modules installed in sysrepo.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] callback Callback to be called when the event occurs.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_feature_enable_subscribe(sr_session_ctx_t *session, sr_feature_enable_cb callback, void *private_ctx,
-        sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Unsubscribes from a subscription acquired by any of sr_*_subscribe
- * calls and releases all subscription-related data.
- *
- * @note In case that the same subscription context was used to subscribe for
- * multiple subscriptions, unsubscribes from all of them.
- *
- * @param[in] session Session context acquired with ::sr_session_start call. Does not
- * need to be the same as used for subscribing. NULL can be passed too, in that case
- * a temporary session used for unsubscribe will be automatically created by sysrepo.
- * @param[in] subscription Subscription context acquired by any of sr_*_subscribe calls.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_unsubscribe(sr_session_ctx_t *session, sr_subscription_ctx_t *subscription);
-
-/**
- * @brief Creates an iterator for retrieving of the changeset (list of newly
- * added / removed / modified nodes) in notification callbacks.
- *
- * @see ::sr_get_change_next for iterating over the changeset using this iterator.
- *
- * @param[in] session Session context as passed to notication the callbacks (e.g.
- * ::sr_module_change_cb or ::sr_subtree_change_cb). Will not work with any other sessions.
- * @param[in] xpath @ref xp_page "Data Path" identifier of the subtree from which the changeset
- * should be obtained. Only XPaths that would be accepted by ::sr_subtree_change_subscribe are allowed.
- * @param[out] iter Iterator context that can be used to retrieve individual changes using
- * ::sr_get_change_next calls. Allocated by the function, should be freed with ::sr_free_change_iter.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_changes_iter(sr_session_ctx_t *session, const char *xpath, sr_change_iter_t **iter);
-
-/**
- * @brief Returns the next change from the changeset of provided iterator created
- * by ::sr_get_changes_iter call. If there is no item left, SR_ERR_NOT_FOUND is returned.
- *
- * @note If the operation is ::SR_OP_MOVED the meaning of new_value and old value argument is
- * as follows - the value pointed by new_value was moved after the old_value. If the
- * old value is NULL it was moved to the first position.
- *
- * @param[in] session Session context as passed to notication the callbacks (e.g.
- * ::sr_module_change_cb or ::sr_subtree_change_cb). Will not work with any other sessions.
- * @param[in,out] iter Iterator acquired with ::sr_get_changes_iter call.
- * @param[out] operation Type of the operation made on the returned item.
- * @param[out] old_value Old value of the item (the value before the change).
- * NULL in case that the item has been just created (operation == SR_OP_CREATED).
- * @param[out] new_value New (modified) value of the the item. NULL in case that
- * the item has been just deleted (operation == SR_OP_DELETED).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_get_change_next(sr_session_ctx_t *session, sr_change_iter_t *iter, sr_change_oper_t *operation,
-        sr_val_t **old_value, sr_val_t **new_value);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// RPC (Remote Procedure Calls) API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Check if the owner of this session is authorized by NACM to invoke the protocol
- * operation defined in a (installed) YANG module under the given xpath (as RPC or Action).
- *
- * This call is intended for northbound management applications that need to implement
- * the NETCONF Access Control Model (RFC 6536) to restrict the protocol operations that
- * each user is authorized to execute.
- *
- * NETCONF access control is already included in the processing of ::sr_rpc_send,
- * ::sr_rpc_send_tree, ::sr_action_send and ::sr_action_send_tree and thus it should be
- * sufficient to call this function only prior to executing any of the NETCONF standard
- * protocol operations as they cannot be always directly translated to a single sysrepo
- * API call.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the protocol operation.
- * @param[out] permitted TRUE if the user is permitted to execute the given operation, FALSE otherwise.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_check_exec_permission(sr_session_ctx_t *session, const char *xpath, bool *permitted);
-
-/**
- * @brief Callback to be called by the delivery of RPC specified by xpath.
- * Subscribe to it by ::sr_rpc_subscribe call.
- *
- * @param[in] xpath @ref xp_page "Data Path" identifying the RPC.
- * @param[in] input Array of input parameters.
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters. Should be allocated on heap,
- * will be freed by sysrepo after sending of the RPC response.
- * @param[out] output_cnt Number of output parameters.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to ::sr_rpc_subscribe call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-typedef int (*sr_rpc_cb)(const char *xpath, const sr_val_t *input, const size_t input_cnt,
-        sr_val_t **output, size_t *output_cnt, void *private_ctx);
-
-/**
- * @brief Callback to be called by the delivery of RPC specified by xpath.
- * This RPC callback variant operates with sysrepo trees rather than with sysrepo values,
- * use it with ::sr_rpc_subscribe_tree and ::sr_rpc_send_tree.
- *
- * @param[in] xpath @ref xp_page "Data Path" identifying the RPC.
- * @param[in] input Array of input parameters (represented as trees).
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters (represented as trees). Should be allocated on heap,
- * will be freed by sysrepo after sending of the RPC response.
- * @param[out] output_cnt Number of output parameters.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to ::sr_rpc_subscribe_tree call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-typedef int (*sr_rpc_tree_cb)(const char *xpath, const sr_node_t *input, const size_t input_cnt,
-        sr_node_t **output, size_t *output_cnt, void *private_ctx);
-
-/**
- * @brief Subscribes for delivery of RPC specified by xpath.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying the RPC.
- * @param[in] callback Callback to be called when the RPC is called.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_rpc_subscribe(sr_session_ctx_t *session, const char *xpath, sr_rpc_cb callback, void *private_ctx,
-        sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for delivery of RPC specified by xpath. Unlike ::sr_rpc_subscribe, this
- * function expects callback of type ::sr_rpc_tree_cb, therefore use this version if you prefer
- * to manipulate with RPC input and output data organized in a list of trees rather than as a flat
- * enumeration of all values.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying the RPC.
- * @param[in] callback Callback to be called when the RPC is called.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_rpc_subscribe_tree(sr_session_ctx_t *session, const char *xpath, sr_rpc_tree_cb callback,
-        void *private_ctx, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Sends a RPC specified by xpath and waits for the result.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the RPC.
- * @param[in] input Array of input parameters (array of all nodes that hold some
- * data in RPC input subtree - same as ::sr_get_items would return).
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters (all nodes that hold some data
- * in RPC output subtree). Will be allocated by sysrepo and should be freed by
- * caller using ::sr_free_values.
- * @param[out] output_cnt Number of output parameters.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_rpc_send(sr_session_ctx_t *session, const char *xpath,
-        const sr_val_t *input,  const size_t input_cnt, sr_val_t **output, size_t *output_cnt);
-
-/**
- * @brief Sends a RPC specified by xpath and waits for the result. Input and output data
- * are represented as arrays of subtrees reflecting the scheme of RPC arguments.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the RPC.
- * @param[in] input Array of input parameters (organized in trees).
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters (organized in trees).
- * Will be allocated by sysrepo and should be freed by caller using ::sr_free_trees.
- * @param[out] output_cnt Number of output parameters.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_rpc_send_tree(sr_session_ctx_t *session, const char *xpath,
-        const sr_node_t *input,  const size_t input_cnt, sr_node_t **output, size_t *output_cnt);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Action API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Callback to be called by the delivery of Action (operation connected to a specific data node)
- * specified by xpath. Subscribe to it by ::sr_action_subscribe call.
- * @see This type is an alias for @ref sr_rpc_cb "the RPC callback type"
- */
-typedef sr_rpc_cb sr_action_cb;
-
-/**
- * @brief Callback to be called by the delivery of Action (operation connected to a specific data node)
- * specified by xpath.
- * This callback variant operates with sysrepo trees rather than with sysrepo values,
- * use it with ::sr_action_subscribe_tree and ::sr_action_send_tree.
- * @see This type is an alias for tree variant of @ref sr_rpc_tree_cb "the RPC callback "
- */
-typedef sr_rpc_tree_cb sr_action_tree_cb;
-
-/**
- * @brief Subscribes for delivery of Action specified by xpath.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying the Action.
- * @param[in] callback Callback to be called when the Action is called.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_action_subscribe(sr_session_ctx_t *session, const char *xpath, sr_action_cb callback, void *private_ctx,
-        sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for delivery of Action specified by xpath. Unlike ::sr_action_subscribe, this
- * function expects callback of type ::sr_action_tree_cb, therefore use this version if you prefer
- * to manipulate with Action input and output data organized in a list of trees rather than as a flat
- * enumeration of all values.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying the Action.
- * @param[in] callback Callback to be called when the Action is called.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_action_subscribe_tree(sr_session_ctx_t *session, const char *xpath, sr_action_tree_cb callback,
-        void *private_ctx, sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Executes an action specified by xpath and waits for the result.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the Action.
- * @param[in] input Array of input parameters (array of all nodes that hold some
- * data in Action input subtree - same as ::sr_get_items would return).
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters (all nodes that hold some data
- * in Action output subtree). Will be allocated by sysrepo and should be freed by
- * caller using ::sr_free_values.
- * @param[out] output_cnt Number of output parameters.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_action_send(sr_session_ctx_t *session, const char *xpath,
-        const sr_val_t *input,  const size_t input_cnt, sr_val_t **output, size_t *output_cnt);
-
-/**
- * @brief Executes an action specified by xpath and waits for the result. Input and output data
- * are represented as arrays of subtrees reflecting the scheme of Action arguments.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the Action.
- * @param[in] input Array of input parameters (organized in trees).
- * @param[in] input_cnt Number of input parameters.
- * @param[out] output Array of output parameters (organized in trees).
- * Will be allocated by sysrepo and should be freed by caller using ::sr_free_trees.
- * @param[out] output_cnt Number of output parameters.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_action_send_tree(sr_session_ctx_t *session, const char *xpath,
-        const sr_node_t *input,  const size_t input_cnt, sr_node_t **output, size_t *output_cnt);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Event Notifications API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Type of the notification passed to the ::sr_event_notif_cb and ::sr_event_notif_tree_cb callbacks.
- */
-typedef enum sr_ev_notif_type_e {
-    SR_EV_NOTIF_T_REALTIME,         /**< Real-time notification. The only possible type if you don't use ::sr_event_notif_replay. */
-    SR_EV_NOTIF_T_REPLAY,           /**< Replayed notification. */
-    SR_EV_NOTIF_T_REPLAY_COMPLETE,  /**< Not a real notification, just a signal that the notification replay has completed
-                                         (all the stored notifications from the given time interval have been delivered). */
-    SR_EV_NOTIF_T_REPLAY_STOP,      /**< Not a real notification, just a signal that replay stop time has been reached
-                                         (delivered only if stop_time was specified to ::sr_event_notif_replay). */
-} sr_ev_notif_type_t;
-
-/**
- * @brief Flags used to override default notification handling i the datastore.
- */
-typedef enum sr_ev_notif_flag_e {
-    SR_EV_NOTIF_DEFAULT = 0,      /**< Notification will be handled normally. */
-    SR_EV_NOTIF_EPHEMERAL = 1,    /**< Notification will not be stored in the notification store
-                                       (and therefore will be also delivered faster). */
-} sr_ev_notif_flag_t;
-
-/**
- * @brief Callback to be called by the delivery of event notification specified by xpath.
- * Subscribe to it by ::sr_event_notif_subscribe call.
- *
- * @param[in] notif_type Type of the notification.
- * @param[in] xpath @ref xp_page "Data Path" identifying the event notification.
- * @param[in] values Array of all nodes that hold some data in event notification subtree.
- * @param[in] values_cnt Number of items inside the values array.
- * @param[in] timestamp Time when the notification was generated
- * @param[in] private_ctx Private context opaque to sysrepo,
- * as passed to ::sr_event_notif_subscribe call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-typedef void (*sr_event_notif_cb)(const sr_ev_notif_type_t notif_type, const char *xpath,
-        const sr_val_t *values, const size_t values_cnt, time_t timestamp, void *private_ctx);
-
-/**
- * @brief Callback to be called by the delivery of event notification specified by xpath.
- * This callback variant operates with sysrepo trees rather than with sysrepo values,
- * use it with ::sr_event_notif_subscribe_tree and ::sr_event_notif_send_tree.
- *
- * @param[in] notif_type Type of the notification.
- * @param[in] xpath @ref xp_page "Data Path" identifying the event notification.
- * @param[in] trees Array of subtrees carrying event notification data.
- * @param[in] tree_cnt Number of subtrees with data.
- * @param[in] timestamp Time when the notification was generated
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to ::sr_event_notif_subscribe_tree call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-typedef void (*sr_event_notif_tree_cb)(const sr_ev_notif_type_t notif_type, const char *xpath,
-        const sr_node_t *trees, const size_t tree_cnt, time_t timestamp, void *private_ctx);
-
-/**
- * @brief Subscribes for delivery of an event notification specified by xpath.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying one event notification or special
- * path in the form of a module name in which the whole module is subscribed to.
- * @param[in] callback Callback to be called when the event notification is send.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_event_notif_subscribe(sr_session_ctx_t *session, const char *xpath,
-        sr_event_notif_cb callback, void *private_ctx, sr_subscr_options_t opts,
-        sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Subscribes for delivery of event notification specified by xpath.
- * Unlike ::sr_event_notif_subscribe, this function expects callback of type ::sr_event_notif_tree_cb,
- * therefore use this version if you prefer to manipulate with event notification data organized
- * in a list of trees rather than as a flat enumeration of all values.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Schema Path" identifying one event notification or special
- * path in the form of a module name in which the whole module is subscribed to.
- * @param[in] callback Callback to be called when the event notification is called.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- * @note An existing context may be passed in case that SR_SUBSCR_CTX_REUSE option is specified.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_event_notif_subscribe_tree(sr_session_ctx_t *session, const char *xpath,
-        sr_event_notif_tree_cb callback, void *private_ctx, sr_subscr_options_t opts,
-        sr_subscription_ctx_t **subscription);
-
-/**
- * @brief Sends an event notification specified by xpath and waits for the result.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the event notification.
- * @param[in] values Array of all nodes that hold some data in event notification subtree
- * (same as ::sr_get_items would return).
- * @param[in] values_cnt Number of items inside the values array.
- * @param[in] opts Options overriding default handling of the notification, it is supposed to be
- * a bitwise OR-ed value of any ::sr_ev_notif_flag_t flags.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_event_notif_send(sr_session_ctx_t *session, const char *xpath, const sr_val_t *values,
-        const size_t values_cnt, sr_ev_notif_flag_t opts);
-
-/**
- * @brief Sends an event notification specified by xpath and waits for the result.
- * The notification data are represented as arrays of subtrees reflecting the scheme
- * of the event notification.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the RPC.
- * @param[in] trees Array of subtrees carrying event notification data.
- * @param[in] tree_cnt Number of subtrees with data.
- * @param[in] opts Options overriding default handling of the notification, it is supposed to be
- * a bitwise OR-ed value of any ::sr_ev_notif_flag_t flags.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_event_notif_send_tree(sr_session_ctx_t *session, const char *xpath, const sr_node_t *trees,
-        const size_t tree_cnt, sr_ev_notif_flag_t opts);
-
-/**
- * @brief Replays already generated notifications stored in the notification store related to
- * the provided notification subscription (or subscriptions, in case that ::SR_SUBSCR_CTX_REUSE
- * was used). Notification callbacks of the given susbscriptions will be called with the type set to
- * ::SR_EV_NOTIF_T_REPLAY, ::SR_EV_NOTIF_T_REPLAY_COMPLETE or ::SR_EV_NOTIF_T_REPLAY_STOP.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] subscription Session context acquired with ::sr_session_start call.
- * @param[in] start_time Starting time of the desired time window for notification replay.
- * @param[in] stop_time End time of the desired time window for notification replay. If set to 0,
- * no stop time will be applied (all notifications up to the current time will be delivered,
- * ::SR_EV_NOTIF_T_REPLAY_STOP notification won't be delivered).
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_event_notif_replay(sr_session_ctx_t *session, sr_subscription_ctx_t *subscription,
-        time_t start_time, time_t stop_time);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Operational Data API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Callback to be called when operational data at the selected level is requested.
- * Subscribe to it by ::sr_dp_get_items_subscribe call.
- *
- * Callback handler is supposed to provide data of all nodes at the level selected by the xpath argument:
- *
- * - If the xpath identifies a container, the provider is supposed to return all leaves and leaf-lists values within it.
- * Nested lists and containers should not be provided - sysrepo will ask for them in subsequent calls.
- * - If the xpath identifies a list, the provider is supposed to return all leaves (except for keys!) and
- * leaf-lists values within all instances of the list. Nested lists and containers should not be provided - sysrepo
- * will ask for them in subsequent calls.
- * - If the xpath identifies a leaf-list, the provider is supposed to return all leaf-list values.
- * - If the xpath identifies a leaf, the provider is supposed to return just the leaf in question.
- *
- * The xpath argument passed to callback can be only the xpath that was used for the subscription, or xpath of
- * any nested lists or containers.
- *
- * @param[in] xpath @ref xp_page "Data Path" identifying the level under which the nodes are requested.
- * @param[out] values Array of values at the selected level (allocated by the provider).
- * @param[out] values_cnt Number of values returned.
- * @param[in] request_id An ID identifying the originating request.
- * @param[in] private_ctx Private context opaque to sysrepo, as passed to ::sr_dp_get_items_subscribe call.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-typedef int (*sr_dp_get_items_cb)(const char *xpath, sr_val_t **values, size_t *values_cnt, uint64_t request_id, void *private_ctx);
-
-/**
- * @brief Registers for providing of operational data under given xpath.
- *
- * @note The XPath must be generic - must not include any list key values.
- * @note This API works only for operational data (subtrees marked in YANG as "config false").
- * Subscribing as a data provider for configuration data does not have any effect.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] xpath @ref xp_page "Data Path" identifying the subtree under which the provider is able to provide
- * operational data.
- * @param[in] callback Callback to be called when the operational data nder given xpat is needed.
- * @param[in] private_ctx Private context passed to the callback function, opaque to sysrepo.
- * @param[in] opts Options overriding default behavior of the subscription, it is supposed to be
- * a bitwise OR-ed value of any ::sr_subscr_flag_t flags.
- * @param[in,out] subscription Subscription context that is supposed to be released by ::sr_unsubscribe.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_dp_get_items_subscribe(sr_session_ctx_t *session, const char *xpath, sr_dp_get_items_cb callback, void *private_ctx,
-        sr_subscr_options_t opts, sr_subscription_ctx_t **subscription);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Application-local File Descriptor Watcher API
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Event that has occurred on a monitored file descriptor.
- */
-typedef enum sr_fd_event_e {
-    SR_FD_INPUT_READY = 1,   /**< File descriptor is now readable without blocking. */
-    SR_FD_OUTPUT_READY = 2,  /**< File descriptor is now writable without blocking. */
-} sr_fd_event_t;
-
-/**
- * @brief Action that needs to be taken on a file descriptor.
- */
-typedef enum sr_fd_action_s {
-    SR_FD_START_WATCHING,  /**< Start watching for the specified event on the file descriptor. */
-    SR_FD_STOP_WATCHING,   /**< Stop watching for the specified event on the file descriptor. */
-} sr_fd_action_t;
-
-/**
- * @brief Structure representing a change in the set of file descriptors monitored by the application.
- */
-typedef struct sr_fd_change_s {
-    int fd;                 /**< File descriptor whose monitored state should be changed. */
-    int events;             /**< Monitoring events tied to the change (or-ed value of ::sr_fd_event_t). */
-    sr_fd_action_t action;  /**< Action that is supposed to be performed by application-local file descriptor watcher. */
-} sr_fd_change_t;
-
-/**
- * @brief Callback when the subscription manager is terminated
- */
-typedef void (*sr_fd_sm_terminated_cb)();
-
-/**
- * @brief Initializes application-local file descriptor watcher.
- *
- * This can be used in those applications that subscribe for changes or providing data in sysrepo, which have their
- * own event loop that is capable of monitoring of the events on provided file descriptors. In case that the
- * application-local file descriptor watcher is initialized, sysrepo client library won't use a separate thread
- * for the delivery of the notifications and for calling the callbacks - they will be called from the main thread of the
- * application's event loop (inside of ::sr_fd_event_process calls).
- *
- * @note Calling this function has global consequences on the behavior of the sysrepo client library within the process
- * that called it. It is supposed to be called as the first sysrepo API call within the application.
- *
- * @param[out] fd Initial file descriptor that is supposed to be monitored for readable events by the application.
- * Once there is an event detected on this file descriptor, the application is supposed to call ::sr_fd_event_process.
- *
- * @param[in] sm_terminate_cb Function to be called when the subscription manager is terminated. If this callback is provided,
- * it shall block until all pending events on any file descriptor associated with sysrepo have been handled. I.e., ensure that
- * the event loop has called sr_fd_event_process() for all pending events before returning from this callback. If this callback
- * doesn't block, errors will be shown in the log.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_fd_watcher_init(int *fd, sr_fd_sm_terminated_cb sm_terminate_cb);
-
-/**
- * @brief Cleans-up the application-local file descriptor watcher previously initiated by ::sr_fd_watcher_init.
- * It is supposed to be called as the last sysrepo API within the application.
- */
-void sr_fd_watcher_cleanup();
-
-/**
- * @brief Processes an event that has occurred on one of the file descriptors that the application is monitoring for
- * sysrepo client library purposes. As a result of this event, another file descriptors may need to be started or
- * stopped monitoring by the application. These are returned as \p fd_change_set array.
- *
- * @param[in] fd File descriptor where an event occurred.
- * @param[in] event Type of the event that occurred on the given file descriptor.
- * @param[out] fd_change_set Array of file descriptors that need to be started or stopped monitoring for specified event
- * by the application. The application is supposed to free this array after it processes it.
- * @param[out] fd_change_set_cnt Count of the items in the \p fd_change_set array.
- *
- * @return Error code (SR_ERR_OK on success).
- */
-int sr_fd_event_process(int fd, sr_fd_event_t event, sr_fd_change_t **fd_change_set, size_t *fd_change_set_cnt);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Cleanup Routines
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * @brief Frees ::sr_val_t structure and all memory allocated within it.
- *
- * @param[in] value Value to be freed.
- */
-void sr_free_val(sr_val_t *value);
-
-/**
- * @brief Frees array of ::sr_val_t structures (and all memory allocated
- * within of each array element).
- *
- * @param[in] values Array of values to be freed.
- * @param[in] count Number of elements stored in the array.
- */
-void sr_free_values(sr_val_t *values, size_t count);
-
-/**
- * @brief Frees ::sr_val_iter_t iterator and all memory allocated within it.
- *
- * @param[in] iter Iterator to be freed.
- */
-void sr_free_val_iter(sr_val_iter_t *iter);
-
-/**
- * @brief Frees ::sr_change_iter_t iterator and all memory allocated within it.
- *
- * @param[in] iter Iterator to be freed.
- */
-void sr_free_change_iter(sr_change_iter_t *iter);
-
-/**
- * @brief Frees array of ::sr_schema_t structures (and all memory allocated
- * within of each array element).
- *
- * @param [in] schemas Array of schemas to be freed.
- * @param [in] count Number of elements stored in the array.
- */
-void sr_free_schemas(sr_schema_t *schemas, size_t count);
-
-/**
- * @brief Frees sysrepo tree data.
- *
- * @param[in] tree Tree data to be freed.
- */
-void sr_free_tree(sr_node_t *tree);
-
-/**
- * @brief Frees array of sysrepo trees. For each tree, the ::sr_free_tree is called too.
- *
- * @param[in] trees
- * @param[in] count length of array
- */
-void sr_free_trees(sr_node_t *trees, size_t count);
-
-/**@} cl */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSREPO_H_ */
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Connection.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Connection.hpp
deleted file mode 100644
index eb944f7..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Connection.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file Connection.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo Connection class header.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- * Modifications Copyright (C) 2019 Nokia. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CONNECTION_H
-#define CONNECTION_H
-
-#include <iostream>
-
-#include "Sysrepo.hpp"
-#include "Internal.hpp"
-
-extern "C" {
-#include "../sysrepo.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-/**
- * @brief Class for wrapping sr_conn_ctx_t.
- * @class Connection
- */
-class Connection
-{
-public:
-    /** Wrapper for [sr_connect](@ref sr_connect) */
-    Connection(const char *app_name, const sr_conn_options_t opts = CONN_DEFAULT);
-    ~Connection();
-
-    sr_conn_ctx_t *_conn;
-    friend class Session;
-
-private:
-    sr_conn_options_t _opts;
-};
-
-/**@} */
-}
-
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Internal.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Internal.hpp
deleted file mode 100644
index aec62f9..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Internal.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * @file Internal.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo class header for internal C++ classes.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef INTERNAL_H
-#define INTERNAL_H
-
-#include <iostream>
-#include <memory>
-
-extern "C" {
-#include "../sysrepo.h"
-#include "../sysrepo/trees.h"
-}
-
-namespace sysrepo {
-
-enum class Free_Type {
-    VAL,
-    VALS,
-    VALS_POINTER,
-    TREE,
-    TREES,
-    TREES_POINTER,
-    SCHEMAS,
-    SESSION,
-};
-
-typedef union value_e {
-    sr_val_t *_val;
-    sr_val_t **p_vals;
-    sr_node_t *_tree;
-    sr_node_t **p_trees;
-    sr_schema_t *_sch;
-    sr_session_ctx_t *_sess;
-} value_t;
-
-typedef union count_e {
-    size_t _cnt;
-    size_t *p_cnt;
-} count_t;
-
-class Deleter
-{
-public:
-    Deleter(sr_val_t *val);
-    Deleter(sr_val_t *vals, size_t cnt);
-    Deleter(sr_val_t **vals, size_t *cnt);
-    Deleter(sr_node_t *tree);
-    Deleter(sr_node_t *trees, size_t cnt);
-    Deleter(sr_node_t **trees, size_t *cnt);
-    Deleter(sr_schema_t *sch, size_t cnt);
-    Deleter(sr_session_ctx_t *sess);
-    ~Deleter();
-
-private:
-    count_t c;
-    value_t v;
-    Free_Type _t;
-};
-
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Session.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Session.hpp
deleted file mode 100644
index 02d03ed..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Session.hpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * @file Session.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo Session class header.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SESSION_H
-#define SESSION_H
-
-#include <iostream>
-#include <memory>
-#include <map>
-#include <vector>
-
-#include "Sysrepo.hpp"
-#include "Internal.hpp"
-#include "Struct.hpp"
-#include "Tree.hpp"
-#include "Connection.hpp"
-#include "Session.hpp"
-
-extern "C" {
-#include "../sysrepo.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-/**
- * @brief Class for wrapping sr_session_ctx_t.
- * @class Session
- */
-class Session
-{
-
-public:
-    /** Wrapper for [sr_session_start](@ref sr_session_start) and [sr_session_start_user](@ref sr_session_start_user)
-     * if user_name is set.*/
-    Session(S_Connection conn, sr_datastore_t datastore = (sr_datastore_t) DS_RUNNING, \
-            const sr_sess_options_t opts = SESS_DEFAULT, const char *user_name = nullptr);
-    /** Wrapper for [sr_session_ctx_t](@ref sr_session_ctx_t), for internal use only.*/
-    Session(sr_session_ctx_t *sess, sr_sess_options_t opts = SESS_DEFAULT, S_Deleter deleter = nullptr);
-    /** Wrapper for [sr_session_stop](@ref sr_session_stop) */
-    void session_stop();
-    /** Wrapper for [sr_session_switch_ds](@ref sr_session_switch_ds) */
-    void session_switch_ds(sr_datastore_t ds);
-    /** Wrapper for [sr_get_last_error](@ref sr_get_last_error) */
-    S_Error get_last_error();
-    /** Wrapper for [sr_get_last_errors](@ref sr_get_last_errors) */
-    S_Errors get_last_errors();
-    /** Wrapper for [sr_list_schemas](@ref sr_list_schemas) */
-    S_Yang_Schemas list_schemas();
-    /** Wrapper for [sr_get_schema](@ref sr_get_schema) */
-    std::string get_schema(const char *module_name, const char *revision,
-                           const char *submodule_name, sr_schema_format_t format);
-    /** Wrapper for [sr_get_item](@ref sr_get_item) */
-    S_Val get_item(const char *xpath);
-    /** Wrapper for [sr_get_items](@ref sr_get_items) */
-    S_Vals get_items(const char *xpath);
-    /** Wrapper for [sr_get_items_iter](@ref sr_get_items_iter) */
-    S_Iter_Value get_items_iter(const char *xpath);
-    /** Wrapper for [sr_get_item_next](@ref sr_get_item_next) */
-    S_Val get_item_next(S_Iter_Value iter);
-    /** Wrapper for [sr_get_subtree](@ref sr_get_subtree) */
-    S_Tree get_subtree(const char *xpath, sr_get_subtree_options_t opts = GET_SUBTREE_DEFAULT);
-    /** Wrapper for [sr_get_subtrees](@ref sr_get_subtrees) */
-    S_Trees get_subtrees(const char *xpath, sr_get_subtree_options_t opts = GET_SUBTREE_DEFAULT);
-
-    /** Wrapper for [sr_node_get_child](@ref sr_node_get_child) */
-    S_Tree get_child(S_Tree in_tree);
-    /** Wrapper for [sr_node_get_next_sibling](@ref sr_node_get_next_sibling) */
-    S_Tree get_next_sibling(S_Tree in_tree);
-    /** Wrapper for [sr_node_get_parent](@ref sr_node_get_parent) */
-    S_Tree get_parent(S_Tree in_tree);
-
-    /** Wrapper for [sr_set_item](@ref sr_set_item) */
-    void set_item(const char *xpath, S_Val value = nullptr, const sr_edit_options_t opts = EDIT_DEFAULT);
-    /** Wrapper for [sr_set_item_str](@ref sr_set_item_str) */
-    void set_item_str(const char *xpath, const char *value, const sr_edit_options_t opts = EDIT_DEFAULT);
-    /** Wrapper for [sr_delete_item](@ref sr_delete_item) */
-    void delete_item(const char *xpath, const sr_edit_options_t opts = EDIT_DEFAULT);
-    /** Wrapper for [sr_move_item](@ref sr_move_item) */
-    void move_item(const char *xpath, const sr_move_position_t position, const char *relative_item = nullptr);
-    /** Wrapper for [sr_session_refresh](@ref sr_session_refresh) */
-    void refresh();
-    /** Wrapper for [sr_validate](@ref sr_validate) */
-    void validate();
-    /** Wrapper for [sr_commit](@ref sr_commit) */
-    void commit();
-    /** Wrapper for [sr_lock_datastore](@ref sr_lock_datastore) */
-    void lock_datastore();
-    /** Wrapper for [sr_unlock_datastore](@ref sr_unlock_datastore) */
-    void unlock_datastore();
-    /** Wrapper for [sr_lock_module](@ref sr_lock_module) */
-    void lock_module(const char *module_name);
-    /** Wrapper for [sr_unlock_module](@ref sr_unlock_module) */
-    void unlock_module(const char *module_name);
-    /** Wrapper for [sr_discard_changes](@ref sr_discard_changes) */
-    void discard_changes();
-    /** Wrapper for [sr_copy_config](@ref sr_copy_config) */
-    void copy_config(const char *module_name, sr_datastore_t src_datastore, sr_datastore_t dst_datastore);
-    /** Wrapper for [sr_session_set_options](@ref sr_session_set_options) */
-    void set_options(const sr_sess_options_t opts);
-    /** Wrapper for [sr_get_changes_iter](@ref sr_get_changes_iter) */
-    S_Iter_Change get_changes_iter(const char *xpath);
-    /** Wrapper for [sr_get_change_next](@ref sr_get_change_next) */
-    S_Change get_change_next(S_Iter_Change iter);
-    ~Session();
-
-    /** Wrapper for [sr_rpc_send](@ref sr_rpc_send) */
-    S_Vals rpc_send(const char *xpath, S_Vals input);
-    /** Wrapper for [sr_rpc_send_tree](@ref sr_rpc_send_tree) */
-    S_Trees rpc_send(const char *xpath, S_Trees input);
-    /** Wrapper for [sr_action_send](@ref sr_action_send) */
-    S_Vals action_send(const char *xpath, S_Vals input);
-    /** Wrapper for [sr_action_send_tree](@ref sr_action_send_tree) */
-    S_Trees action_send(const char *xpath, S_Trees input);
-    /** Wrapper for [sr_event_notif_send](@ref sr_event_notif_send) */
-    void event_notif_send(const char *xpath, S_Vals values, const sr_ev_notif_flag_t options = SR_EV_NOTIF_DEFAULT);
-    /** Wrapper for [sr_event_notif_send_tree](@ref sr_event_notif_send_tree) */
-    void event_notif_send(const char *xpath, S_Trees trees, const sr_ev_notif_flag_t options = SR_EV_NOTIF_DEFAULT);
-
-    friend class Subscribe;
-
-private:
-    sr_session_ctx_t *_sess;
-    sr_datastore_t _datastore;
-    sr_sess_options_t _opts;
-    S_Connection _conn;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Helper class for calling C callbacks, C++ only.
- * @class Callback
- */
-class Callback
-{
-public:
-    Callback();
-    virtual ~Callback();
-
-    /** Wrapper for [sr_module_change_cb](@ref sr_module_change_cb) callback.*/
-    virtual int module_change(S_Session session, const char *module_name, sr_notif_event_t event, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_subtree_change_cb](@ref sr_subtree_change_cb) callback.*/
-    virtual int subtree_change(S_Session session, const char *xpath, sr_notif_event_t event, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_module_install_cb](@ref sr_module_install_cb) callback.*/
-    virtual void module_install(const char *module_name, const char *revision, sr_module_state_t state, void *private_ctx) {return;};
-    /** Wrapper for [sr_feature_enable_cb](@ref sr_feature_enable_cb) callback.*/
-    virtual void feature_enable(const char *module_name, const char *feature_name, bool enabled, void *private_ctx) {return;};
-    /** Wrapper for [sr_rpc_cb](@ref sr_rpc_cb) callback.*/
-    virtual int rpc(const char *xpath, const S_Vals input, S_Vals_Holder output, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_action_cb](@ref sr_action_cb) callback.*/
-    virtual int action(const char *xpath, const S_Vals input, S_Vals_Holder output, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_rpc_tree_cb](@ref sr_rpc_tree_cb) callback.*/
-    virtual int rpc_tree(const char *xpath, const S_Trees input, S_Trees_Holder output, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_action_tree_cb](@ref sr_action_tree_cb) callback.*/
-    virtual int action_tree(const char *xpath, const S_Trees input, S_Trees_Holder output, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_dp_get_items_cb](@ref sr_dp_get_items_cb) callback.*/
-    virtual int dp_get_items(const char *xpath, S_Vals_Holder vals, uint64_t request_id, void *private_ctx) {return SR_ERR_OK;};
-    /** Wrapper for [sr_event_notif_cb](@ref sr_event_notif_cb) callback.*/
-    virtual void event_notif(const sr_ev_notif_type_t notif_type, const char *xpath, S_Vals vals, time_t timestamp, void *private_ctx) {return;};
-    /** Wrapper for [sr_event_notif_tree_cb](@ref sr_event_notif_tree_cb) callback.*/
-    virtual void event_notif_tree(const sr_ev_notif_type_t notif_type, const char *xpath, S_Trees trees, time_t timestamp, void *private_ctx) {return;};
-    Callback *get() {return this;};
-
-    std::map<const char *, void*> private_ctx;
-};
-
-/**
- * @brief Class for wrapping sr_subscription_ctx_t.
- * @class Subscribe
- */
-class Subscribe
-{
-
-public:
-    /** Wrapper for [sr_subscription_ctx_t](@ref sr_subscription_ctx_t), for internal use only.*/
-    Subscribe(S_Session sess);
-
-    /** Wrapper for [sr_module_change_subscribe](@ref sr_module_change_subscribe) */
-    void module_change_subscribe(const char *module_name, S_Callback callback, void *private_ctx = nullptr, uint32_t priority = 0, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_subtree_change_subscribe](@ref sr_subtree_change_subscribe) */
-    void subtree_change_subscribe(const char *xpath, S_Callback callback, void *private_ctx = nullptr, uint32_t priority = 0, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_module_install_subscribe](@ref sr_module_install_subscribe) */
-    void module_install_subscribe(S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_feature_enable_subscribe](@ref sr_feature_enable_subscribe) */
-    void feature_enable_subscribe(S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_rpc_subscribe](@ref sr_rpc_subscribe) */
-    void rpc_subscribe(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_action_subscribe](@ref sr_action_subscribe) */
-    void action_subscribe(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_event_notif_subscribe_tree](@ref sr_event_notif_subscribe_tree) */
-    void event_notif_subscribe_tree(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_event_notif_subscribe](@ref sr_event_notif_subscribe) */
-    void event_notif_subscribe(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_rpc_subscribe_tree](@ref sr_rpc_subscribe_tree) */
-    void rpc_subscribe_tree(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_action_subscribe_tree](@ref sr_action_subscribe_tree) */
-    void action_subscribe_tree(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    /** Wrapper for [sr_dp_get_items_subscribe](@ref sr_dp_get_items_subscribe) */
-    void dp_get_items_subscribe(const char *xpath, S_Callback callback, void *private_ctx = nullptr, sr_subscr_options_t opts = SUBSCR_DEFAULT);
-    std::vector<S_Callback > cb_list;
-
-    /** Wrapper for [sr_unsubscribe](@ref sr_unsubscribe) */
-    void unsubscribe();
-    ~Subscribe();
-
-    /** SWIG specific, internal use only.*/
-    sr_subscription_ctx_t **swig_sub() { return &_sub;};
-    /** SWIG specific, internal use only.*/
-    sr_session_ctx_t *swig_sess() {return _sess->_sess;};
-    /** SWIG specific, internal use only.*/
-    std::vector<void*> wrap_cb_l;
-    /** SWIG specific, internal use only.*/
-    void additional_cleanup(void *private_ctx) {return;};
-
-private:
-    sr_subscription_ctx_t *_sub;
-    S_Session _sess;
-    S_Deleter sess_deleter;
-};
-
-/**@} */
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Struct.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Struct.hpp
deleted file mode 100644
index 7f48d56..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Struct.hpp
+++ /dev/null
@@ -1,514 +0,0 @@
-/**
- * @file Struct.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo class header for C struts.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef STRUCT_H
-#define STRUCT_H
-
-#include <iostream>
-#include <memory>
-
-#include "Sysrepo.hpp"
-#include "Internal.hpp"
-
-extern "C" {
-#include "../sysrepo.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-/**
- * @brief Class for wrapping sr_data_t.
- * @class Data
- */
-class Data
-{
-public:
-    /** Wrapper for [sr_data_t](@ref sr_data_t), for internal use only.*/
-    Data(sr_data_t data, sr_type_t type, S_Deleter deleter);
-    ~Data();
-    /** Getter for binary data.*/
-    char *get_binary() const;
-    /** Getter for bits.*/
-    char *get_bits() const;
-    /** Getter for bool.*/
-    bool get_bool() const;
-    /** Getter for decimal64.*/
-    double get_decimal64() const;
-    /** Getter for enum.*/
-    char *get_enum() const;
-    /** Getter for identityref.*/
-    char *get_identityref() const;
-    /** Getter for instanceid.*/
-    char *get_instanceid() const;
-    /** Getter for int8.*/
-    int8_t get_int8() const;
-    /** Getter for int16.*/
-    int16_t get_int16() const;
-    /** Getter for int32.*/
-    int32_t get_int32() const;
-    /** Getter for int64.*/
-    int64_t get_int64() const;
-    /** Getter for string.*/
-    char *get_string() const;
-    /** Getter for uint8.*/
-    uint8_t get_uint8() const;
-    /** Getter for uint16.*/
-    uint16_t get_uint16() const;
-    /** Getter for uint32.*/
-    uint32_t get_uint32() const;
-    /** Getter for uint64.*/
-    uint64_t get_uint64() const;
-
-private:
-    sr_data_t _d;
-    sr_type_t _t;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_val_t.
- * @class Val
- */
-class Val
-{
-public:
-    /** Constructor for an empty value.*/
-    Val();
-    /** Wrapper for [sr_val_t](@ref sr_val_t).*/
-    Val(sr_val_t *val, S_Deleter deleter);
-    /** Constructor for string value, type can be SR_STRING_T, SR_BINARY_T, SR_BITS_T, SR_ENUM_T,
-     * SR_IDENTITYREF_T and SR_INSTANCEID_T.*/
-    Val(const char *val, sr_type_t type = SR_STRING_T);
-    /** Constructor for bool value.*/
-    Val(bool bool_val, sr_type_t type = SR_BOOL_T);
-    /** Constructor for decimal64 value.*/
-    Val(double decimal64_val);
-    /** Constructor for int8 value, C++ only.*/
-    Val(int8_t int8_val, sr_type_t type);
-    /** Constructor for int16 value, C++ only.*/
-    Val(int16_t int16_val, sr_type_t type);
-    /** Constructor for int32 value, C++ only.*/
-    Val(int32_t int32_val, sr_type_t type);
-    /** Constructor for int64 value, type can be SR_INT8_T, SR_INT16_T, SR_INT32_T,
-     * SR_INT64_T, SR_UINT8_T, SR_UINT16_T and SR_UINT32_T,*/
-    Val(int64_t int64_val, sr_type_t type);
-    /** Constructor for uint8 value, C++ only.*/
-    Val(uint8_t uint8_val, sr_type_t type);
-    /** Constructor for uint16 value, C++ only.*/
-    Val(uint16_t uint16_val, sr_type_t type);
-    /** Constructor for uint32 value, C++ only.*/
-    Val(uint32_t uint32_val, sr_type_t type);
-    /** Constructor for uint64 value, C++ only.*/
-    Val(uint64_t uint64_val, sr_type_t type);
-   ~Val();
-    /** Setter for string value, type can be SR_STRING_T, SR_BINARY_T, SR_BITS_T, SR_ENUM_T,
-     * SR_IDENTITYREF_T and SR_INSTANCEID_T.*/
-    void set(const char *xpath, const char *val, sr_type_t type = SR_STRING_T);
-    /** Setter for bool value.*/
-    void set(const char *xpath, bool bool_val, sr_type_t type = SR_BOOL_T);
-    /** Setter for decimal64 value.*/
-    void set(const char *xpath, double decimal64_val);
-    /** Setter for int8 value, C++ only.*/
-    void set(const char *xpath, int8_t int8_val, sr_type_t type);
-    /** Setter for int16 value, C++ only.*/
-    void set(const char *xpath, int16_t int16_val, sr_type_t type);
-    /** Setter for int32 value, C++ only.*/
-    void set(const char *xpath, int32_t int32_val, sr_type_t type);
-    /** Setter for int64 value, type can be SR_INT8_T, SR_INT16_T, SR_INT32_T,
-     * SR_INT64_T, SR_UINT8_T, SR_UINT16_T and SR_UINT32_T,*/
-    void set(const char *xpath, int64_t int64_val, sr_type_t type);
-    /** Setter for uint8 value, C++ only.*/
-    void set(const char *xpath, uint8_t uint8_val, sr_type_t type);
-    /** Setter for uint16 value, C++ only.*/
-    void set(const char *xpath, uint16_t uint16_val, sr_type_t type);
-    /** Setter for uint32 value, C++ only.*/
-    void set(const char *xpath, uint32_t uint32_val, sr_type_t type);
-    /** Setter for uint64 value, C++ only.*/
-    void set(const char *xpath, uint64_t uint64_val, sr_type_t type);
-    /** Getter for xpath.*/
-    char *xpath() {return _val->xpath;};
-    /** Setter for xpath.*/
-    void xpath_set(char *xpath);
-    /** Getter for type.*/
-    sr_type_t type() {return _val->type;};
-    /** Getter for dflt.*/
-    bool dflt() {return _val->dflt;};
-    /** Setter for dflt.*/
-    void dflt_set(bool data) {_val->dflt = data;};
-    /** Getter for data.*/
-    S_Data data() {S_Data data(new Data(_val->data, _val->type, _deleter)); return data;};
-    /** Wrapper for [sr_print_val_mem](@ref sr_print_val_mem) */
-    std::string to_string();
-    /** Wrapper for [sr_val_to_string](@ref sr_val_to_string) */
-    std::string val_to_string();
-    /** Wrapper for [sr_dup_val](@ref sr_dup_val) */
-    S_Val dup();
-
-    friend class Session;
-    friend class Subscribe;
-
-private:
-    sr_val_t *_val;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_val_t array.
- * @class Vals
- */
-class Vals
-{
-public:
-    /** Wrapper for [sr_val_t](@ref sr_val_t) array, internal use only.*/
-    Vals(const sr_val_t *vals, const size_t cnt, S_Deleter deleter = nullptr);
-    /** Wrapper for [sr_val_t](@ref sr_val_t) array, internal use only.*/
-    Vals(sr_val_t **vals, size_t *cnt, S_Deleter deleter = nullptr);
-    /** Wrapper for [sr_val_t](@ref sr_val_t) array, create n-array.*/
-    Vals(size_t cnt);
-    /** Constructor for an empty [sr_val_t](@ref sr_val_t) array.*/
-    Vals();
-    ~Vals();
-    /** Getter for [sr_val_t](@ref sr_val_t), get the n-th element in array.*/
-    S_Val val(size_t n);
-    /** Getter for array size */
-    size_t val_cnt() {return _cnt;};
-    /** Wrapper for [sr_dup_values](@ref sr_dup_values) */
-    S_Vals dup();
-
-    friend class Session;
-    friend class Subscribe;
-
-private:
-    size_t _cnt;
-    sr_val_t *_vals;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_val_t in callbacks.
- * @class Vals_holder
- */
-class Vals_Holder
-{
-public:
-    /** Wrapper for [sr_val_t](@ref sr_val_t) array, used only in callbacks.*/
-    Vals_Holder(sr_val_t **vals, size_t *cnt);
-    /** Create [sr_val_t](@ref sr_val_t) array of n size.*/
-    S_Vals allocate(size_t n);
-    ~Vals_Holder();
-
-private:
-    size_t *p_cnt;
-    sr_val_t **p_vals;
-    bool _allocate;
-};
-
-/**
- * @brief Class for wrapping sr_val_iter_t.
- * @class Val_Iter
- */
-class Val_Iter
-{
-public:
-    /** Wrapper for [sr_val_iter_t](@ref sr_val_iter_t).*/
-    Val_Iter(sr_val_iter_t *iter = nullptr);
-    ~Val_Iter();
-    /** Getter for [sr_val_iter_t](@ref sr_val_iter_t).*/
-    sr_val_iter_t *iter() {return _iter;};
-
-private:
-    sr_val_iter_t *_iter;
-};
-
-/**
- * @brief Class for wrapping sr_change_iter_t.
- * @class Change_Iter
- */
-class Change_Iter
-{
-public:
-    /** Wrapper for [sr_change_iter_t](@ref sr_change_iter_t).*/
-    Change_Iter(sr_change_iter_t *iter = nullptr);
-    ~Change_Iter();
-    /** Getter for [sr_change_iter_t](@ref sr_change_iter_t).*/
-    sr_change_iter_t *iter() {return _iter;};
-
-private:
-    sr_change_iter_t *_iter;
-};
-
-/**
- * @brief Class for wrapping sr_error_info_t.
- * @class Error
- */
-class Error
-{
-public:
-    /** Constructor for an empty [sr_error_info_t](@ref sr_error_info_t).*/
-    Error();
-    /** Wrapper for [sr_error_info_t](@ref sr_error_info_t).*/
-    Error(const sr_error_info_t *info);
-    ~Error();
-    /** Getter for message.*/
-    const char *message() const {if (_info) return _info->message; else return nullptr;};
-    /** Getter for xpath.*/
-    const char *xpath() const {if (_info) return _info->xpath; else return nullptr;};
-
-    friend class Session;
-
-private:
-    const sr_error_info_t *_info;
-};
-
-/**
- * @brief Class for wrapping sr_error_info_t array.
- * @class Errors
- */
-class Errors
-{
-public:
-    /** Constructor for an empty [sr_error_info_t](@ref sr_error_info_t) array.*/
-    Errors();
-    ~Errors();
-    /** Getter for [sr_error_info_t](@ref sr_error_info_t), get the n-th element in array.*/
-    S_Error error(size_t n);
-    /** Getter for array size.*/
-    size_t error_cnt() {return _cnt;};
-
-    friend class Session;
-
-private:
-    size_t _cnt;
-    const sr_error_info_t *_info;
-};
-
-/**
- * @brief Class for wrapping sr_sch_revision_t array.
- * @class Schema_Revision
- */
-class Schema_Revision
-{
-public:
-    /** Wrapper for [sr_sch_revision_t](@ref sr_sch_revision_t).*/
-    Schema_Revision(sr_sch_revision_t rev);
-    ~Schema_Revision();
-    /** Getter for revision.*/
-    const char *revision() const {return _rev.revision;};
-    /** Getter for file_path_yang.*/
-    const char *file_path_yang() const {return _rev.file_path_yang;};
-    /** Getter for file_path_yin.*/
-    const char *file_path_yin() const {return _rev.file_path_yin;};
-
-private:
-    sr_sch_revision_t _rev;
-};
-
-/**
- * @brief Class for wrapping sr_sch_submodule_t.
- * @class Schema_Submodule
- */
-class Schema_Submodule
-{
-public:
-    /** Wrapper for [sr_sch_submodule_t](@ref sr_sch_submodule_t).*/
-    Schema_Submodule(sr_sch_submodule_t sub, S_Deleter deleter);
-    ~Schema_Submodule();
-    /** Getter for submodule_name.*/
-    const char *submodule_name() const {return _sub.submodule_name;};
-    /** Getter for revision.*/
-    S_Schema_Revision revision();
-
-private:
-    sr_sch_submodule_t _sub;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_schema_t.
- * @class Yang_Schema
- */
-class Yang_Schema
-{
-public:
-    /** Wrapper for [sr_schema_t](@ref sr_schema_t).*/
-    Yang_Schema(sr_schema_t *sch, S_Deleter deleter);
-    ~Yang_Schema();
-    /** Getter for module_name.*/
-    const char *module_name() const {return _sch->module_name;};
-    /** Getter for ns.*/
-    const char *ns() const {return _sch->ns;};
-    /** Getter for prefix.*/
-    const char *prefix() const {return _sch->prefix;};
-    /** Getter for implemented.*/
-    bool implemented() const {return _sch->implemented;};
-    /** Getter for revision.*/
-    S_Schema_Revision revision();
-    /** Getter for submodule.*/
-    S_Schema_Submodule submodule(size_t n);
-    /** Getter for submodule_cnt.*/
-    size_t submodule_cnt() const {return _sch->submodule_count;};
-    /** Getter for enabled_features.*/
-    char *enabled_features(size_t n);
-    /** Getter for enabled_features_cnt.*/
-    size_t enabled_feature_cnt() const {return _sch->enabled_feature_cnt;};
-
-    friend class Session;
-
-private:
-    sr_schema_t *_sch;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_schema_t array.
- * @class Yang_Schemas
- */
-class Yang_Schemas
-{
-public:
-    /** Constructor for an empty [sr_schema_t](@ref sr_schema_t) array.*/
-    Yang_Schemas();
-    ~Yang_Schemas();
-    /** Getter for [sr_schema_t](@ref sr_schema_t) array, get the n-th element in array.*/
-    S_Yang_Schema schema(size_t n);
-    /** Getter for array size.*/
-    size_t schema_cnt() const {return _cnt;};
-
-    friend class Session;
-
-private:
-    size_t _cnt;
-    sr_schema_t *_sch;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_fd_change_t.
- * @class Fd_Change
- */
-class Fd_Change
-{
-public:
-    /** Wrapper for [sr_fd_change_t](@ref sr_fd_change_t).*/
-    Fd_Change(sr_fd_change_t *ch);
-    ~Fd_Change();
-    /** Getter for fd.*/
-    int fd() const {return _ch->fd;};
-    /** Getter for events.*/
-    int events() const {return _ch->events;};
-    /** Getter for action.*/
-    sr_fd_action_t action() const {return _ch->action;};
-
-private:
-    sr_fd_change_t *_ch;
-};
-
-/**
- * @brief Class for wrapping sr_fd_change_t array.
- * @class Fd_Changes
- */
-class Fd_Changes
-{
-public:
-    /** Wrapper for [sr_fd_change_t](@ref sr_fd_change_t) array.*/
-    Fd_Changes(sr_fd_change_t *ch, size_t cnt);
-    ~Fd_Changes();
-    /** Getter for [sr_fd_change_t](@ref sr_fd_change_t) array, get the n-th element in array.*/
-    S_Fd_Change fd_change(size_t n);
-
-private:
-    sr_fd_change_t *_ch;
-    size_t _cnt;
-};
-
-/**
- * @brief Class for wrapping sr_val_iter_t.
- * @class Fd_Changes
- */
-class Iter_Value
-{
-
-public:
-    /** Wrapper for [sr_val_iter_t](@ref sr_val_iter_t).*/
-    Iter_Value(sr_val_iter_t *iter = nullptr);
-    ~Iter_Value();
-    /** Setter for [sr_val_iter_t](@ref sr_val_iter_t).*/
-    void Set(sr_val_iter_t *iter);
-
-    friend class Session;
-
-private:
-    sr_val_iter_t *_iter;
-};
-
-/**
- * @brief Class for wrapping sr_change_iter_t.
- * @class Iter_Change
- */
-class Iter_Change
-{
-
-public:
-    /** Wrapper for [sr_change_iter_t](@ref sr_change_iter_t).*/
-    Iter_Change(sr_change_iter_t *iter = nullptr);
-    ~Iter_Change();
-
-    friend class Session;
-
-private:
-    sr_change_iter_t *_iter;
-};
-
-/**
- * @brief Class for wrapping sr_change_oper_t.
- * @class Change
- */
-class Change
-{
-public:
-    /** Constructor for an empty [sr_change_oper_t](@ref sr_change_oper_t).*/
-    Change();
-    ~Change();
-    /** Getter for sr_change_oper_t.*/
-    sr_change_oper_t oper() {return _oper;};
-    /** Getter for new sr_val_t.*/
-    S_Val new_val();
-    /** Getter for old sr_val_t.*/
-    S_Val old_val();
-
-    friend class Session;
-
-private:
-    sr_change_oper_t _oper;
-    sr_val_t *_new;
-    sr_val_t *_old;
-    S_Deleter _deleter_new;
-    S_Deleter _deleter_old;
-};
-
-/**@} */
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Sysrepo.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Sysrepo.hpp
deleted file mode 100644
index d3b7648..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Sysrepo.hpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * @file Sysrepo.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo Sysrepo class header.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_H
-#define SYSREPO_H
-
-#include <iostream>
-#include <memory>
-#include <stdexcept>
-
-#include "Internal.hpp"
-
-extern "C" {
-#include "../sysrepo.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-class Iter_Value;
-class Iter_Change;
-class Session;
-class Subscribe;
-class Connection;
-class Operation;
-class Schema_Content;
-class Error;
-class Errors;
-class Data;
-class Schema_Revision;
-class Schema_Submodule;
-class Yang_Schema;
-class Yang_Schemas;
-class Fd_Change;
-class Fd_Changes;
-class Val;
-class Vals_Holder;
-class Vals;
-class Tree;
-class Trees;
-class Trees_Holder;
-class Xpath_Ctx;
-class Logs;
-class Change;
-class Counter;
-class Callback;
-class Deleter;
-
-#ifdef SWIGLUA
-using S_Iter_Value       = Iter_Value*;
-using S_Iter_Change      = Iter_Change*;
-using S_Session          = Session*;
-using S_Subscribe        = Subscribe*;
-using S_Connection       = Connection*;
-using S_Operation        = Operation*;
-using S_Schema_Content   = Schema_Content*;
-using S_Error            = Error*;
-using S_Errors           = Errors*;
-using S_Data             = Data*;
-using S_Schema_Revision  = Schema_Revision*;
-using S_Schema_Submodule = Schema_Submodule*;
-using S_Yang_Schema      = Yang_Schema*;
-using S_Yang_Schemas     = Yang_Schemas*;
-using S_Fd_Change        = Fd_Change*;
-using S_Fd_Changes       = Fd_Changes*;
-using S_Val              = Val*;
-using S_Vals_Holder      = Vals_Holder*;
-using S_Vals             = Vals*;
-using S_Tree             = Tree*;
-using S_Trees            = Trees*;
-using S_Trees_Holder     = Trees_Holder*;
-using S_Xpath_Ctx        = Xpath_Ctx*;
-using S_Logs             = Logs*;
-using S_Change           = Change*;
-using S_Counter          = Counter*;
-using S_Callback         = Callback*;
-#else
-using S_Iter_Value       = std::shared_ptr<Iter_Value>;
-using S_Iter_Change      = std::shared_ptr<Iter_Change>;
-using S_Session          = std::shared_ptr<Session>;
-using S_Subscribe        = std::shared_ptr<Subscribe>;
-using S_Connection       = std::shared_ptr<Connection>;
-using S_Operation        = std::shared_ptr<Operation>;
-using S_Schema_Content   = std::shared_ptr<Schema_Content>;
-using S_Error            = std::shared_ptr<Error>;
-using S_Errors           = std::shared_ptr<Errors>;
-using S_Data             = std::shared_ptr<Data>;
-using S_Schema_Revision  = std::shared_ptr<Schema_Revision>;
-using S_Schema_Submodule = std::shared_ptr<Schema_Submodule>;
-using S_Yang_Schema      = std::shared_ptr<Yang_Schema>;
-using S_Yang_Schemas     = std::shared_ptr<Yang_Schemas>;
-using S_Fd_Change        = std::shared_ptr<Fd_Change>;
-using S_Fd_Changes       = std::shared_ptr<Fd_Changes>;
-using S_Val              = std::shared_ptr<Val>;
-using S_Vals_Holder      = std::shared_ptr<Vals_Holder>;
-using S_Vals             = std::shared_ptr<Vals>;
-using S_Tree             = std::shared_ptr<Tree>;
-using S_Trees            = std::shared_ptr<Trees>;
-using S_Trees_Holder     = std::shared_ptr<Trees_Holder>;
-using S_Xpath_Ctx        = std::shared_ptr<Xpath_Ctx>;
-using S_Logs             = std::shared_ptr<Logs>;
-using S_Change           = std::shared_ptr<Change>;
-using S_Counter          = std::shared_ptr<Counter>;
-using S_Callback         = std::shared_ptr<Callback>;
-using S_Deleter          = std::shared_ptr<Deleter>;
-#endif
-
-/* this is a workaround for python not recognizing
- * enum's in function default values */
-static const int SESS_DEFAULT = SR_SESS_DEFAULT;
-static const int DS_RUNNING = SR_DS_RUNNING;
-static const int EDIT_DEFAULT = SR_EDIT_DEFAULT;
-static const int CONN_DEFAULT = SR_CONN_DEFAULT;
-static const int GET_SUBTREE_DEFAULT = SR_GET_SUBTREE_DEFAULT;
-static const int SUBSCR_DEFAULT = SR_SUBSCR_DEFAULT;
-
-#ifdef SWIG
-// https://github.com/swig/swig/issues/1158
-void throw_exception (int error);
-#else
-void throw_exception [[noreturn]] (int error);
-#endif
-
-/**
- * @brief Class for wrapping sr_error_t.
- * @class sysrepo_exception
- */
-class sysrepo_exception : public std::runtime_error
-{
-public:
-    explicit sysrepo_exception(const sr_error_t error_code);
-    virtual ~sysrepo_exception() override;
-    sr_error_t error_code() const;
-private:
-    sr_error_t m_error_code;
-};
-
-/**
- * @brief Class for wrapping ref sr_log_level_t.
- * @class Logs
- */
-class Logs
-{
-public:
-    Logs();
-    ~Logs();
-    /** Wrapper for [sr_log_stderr](@ref sr_log_stderr) */
-    void set_stderr(sr_log_level_t log_level);
-    /** Wrapper for [sr_log_syslog](@ref sr_log_syslog) */
-    void set_syslog(sr_log_level_t log_level);
-};
-
-/**@} */
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Tree.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Tree.hpp
deleted file mode 100644
index 31f3abd..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Tree.hpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * @file Trees.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo class header for C header trees.h.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef TREE_H
-#define TREE_H
-
-#include "Sysrepo.hpp"
-#include "Struct.hpp"
-
-extern "C" {
-#include "../sysrepo.h"
-#include "../sysrepo/trees.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-/**
- * @brief Class for wrapping sr_node_t.
- * @class Tree
- */
-class Tree
-{
-public:
-    /** Constructor for an empty [sr_node_t](@ref sr_node_t).*/
-    Tree();
-    /** Wrapper for [sr_new_tree](@ref sr_new_tree).*/
-    Tree(const char *root_name, const char *root_module_name);
-    /** Wrapper for [sr_node_t](@ref sr_node_t).*/
-    Tree(sr_node_t *tree, S_Deleter deleter);
-    /** Wrapper for [sr_dup_tree](@ref sr_dup_tree).*/
-    S_Tree dup();
-    /** Get the node value.*/
-    S_Tree node();
-    /** Getter for name.*/
-    char *name() {return _node->name;};
-    /** Getter for type.*/
-    sr_type_t type() {return _node->type;};
-    /** Getter for dflt.*/
-    bool dflt() {return _node->dflt;};
-    /** Getter for data.*/
-    S_Data data() {S_Data data(new Data(_node->data, _node->type, _deleter)); return data;};
-    /** Getter for module_name.*/
-    char *module_name() {return _node->module_name;};
-    /** Getter for parent.*/
-    S_Tree parent();
-    /** Getter for next.*/
-    S_Tree next();
-    /** Getter for prev.*/
-    S_Tree prev();
-    /** Getter for first_child.*/
-    S_Tree first_child();
-    /** Getter for last_child.*/
-    S_Tree last_child();
-    /** Wrapper for [sr_print_tree_mem](@ref sr_print_tree_mem).*/
-    std::string to_string(int depth_limit);
-    /** Wrapper for [sr_print_val_mem](@ref sr_print_val_mem).*/
-    std::string value_to_string();
-    /** Wrapper for [sr_node_set_name](@ref sr_node_set_name).*/
-    void set_name(const char *name);
-    /** Wrapper for [sr_node_set_module](@ref sr_node_set_module).*/
-    void set_module(const char *module_name);
-    /** Wrapper for [sr_node_set_str_data](@ref sr_node_set_str_data).*/
-    void set_str_data(sr_type_t type, const char *string_val);
-    /** Wrapper for [sr_node_add_child](@ref sr_node_add_child).*/
-    void add_child(const char *child_name, const char *child_module_name, S_Tree child);
-    /** Setter for string value, type can be SR_STRING_T, SR_BINARY_T, SR_BITS_T, SR_ENUM_T,
-     * SR_IDENTITYREF_T and SR_INSTANCEID_T.*/
-    void set(const char *val, sr_type_t type = SR_STRING_T);
-    /** Setter for bool value.*/
-    void set(bool bool_val, sr_type_t type = SR_BOOL_T);
-    /** Setter for decimal64 value.*/
-    void set(double decimal64_val);
-    /** Setter for int8 value, C++ only.*/
-    void set(int8_t int8_val, sr_type_t type);
-    /** Setter for int16 value, C++ only.*/
-    void set(int16_t int16_val, sr_type_t type);
-    /** Setter for int32 value, C++ only.*/
-    void set(int32_t int32_val, sr_type_t type);
-    /** Setter for int64 value, type can be SR_INT8_T, SR_INT16_T, SR_INT32_T,
-     * SR_INT64_T, SR_UINT8_T, SR_UINT16_T and SR_UINT32_T,*/
-    void set(int64_t int64_val, sr_type_t type);
-    /** Setter for uint8 value, C++ only.*/
-    void set(uint8_t uint8_val, sr_type_t type);
-    /** Setter for uint16 value, C++ only.*/
-    void set(uint16_t uint16_val, sr_type_t type);
-    /** Setter for uint32 value, C++ only.*/
-    void set(uint32_t uint32_val, sr_type_t type);
-    /** Setter for uint64 value, C++ only.*/
-    void set(uint64_t uint64_val, sr_type_t type);
-    ~Tree();
-
-    friend class Session;
-    friend class Subscribe;
-
-private:
-    sr_node_t *_node;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_node_t array.
- * @class Trees
- */
-class Trees
-{
-public:
-    /** Constructor for an empty [sr_node_t](@ref sr_node_t) array.*/
-    Trees();
-    /** Wrapper for [sr_node_t](@ref sr_node_t) array, create n-array.*/
-    Trees(size_t n);
-    /** Wrapper for [sr_node_t](@ref sr_node_t) array, internal use only.*/
-    Trees(sr_node_t **trees, size_t *cnt, S_Deleter deleter = nullptr);
-    /** Wrapper for [sr_node_t](@ref sr_node_t) array, internal use only.*/
-    Trees(const sr_node_t *trees, const size_t n, S_Deleter deleter = nullptr);
-    /** Getter for [sr_node_t](@ref sr_node_t), get the n-th element in array.*/
-    S_Tree tree(size_t n);
-    /** Wrapper for [sr_dup_trees](@ref sr_dup_trees) */
-    S_Trees dup();
-    /** Getter for array size */
-    size_t tree_cnt() {return _cnt;};
-    ~Trees();
-
-    friend class Session;
-    friend class Subscribe;
-
-private:
-    size_t _cnt;
-    sr_node_t *_trees;
-    S_Deleter _deleter;
-};
-
-/**
- * @brief Class for wrapping sr_node_t in callbacks.
- * @class Trees_Holder
- */
-class Trees_Holder
-{
-public:
-    /** Wrapper for [sr_node_t](@ref sr_node_t) array, used only in callbacks.*/
-    Trees_Holder(sr_node_t **trees, size_t *cnt);
-    /** Create [sr_node_t](@ref sr_node_t) array of n size.*/
-    S_Trees allocate(size_t n);
-    ~Trees_Holder();
-
-private:
-    size_t *p_cnt;
-    sr_node_t **p_trees;
-    bool _allocate;
-};
-
-/**@} */
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Xpath.hpp b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Xpath.hpp
deleted file mode 100644
index 4406134..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/Xpath.hpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * @file Xpath.h
- * @author Mislav Novakovic <mislav.novakovic@sartura.hr>
- * @brief Sysrepo class header for C header xpath_utils.h.
- *
- * @copyright
- * Copyright 2016 Deutsche Telekom AG.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef XPATH_H
-#define XPATH_H
-
-#include <iostream>
-
-extern "C" {
-#include "../sysrepo/xpath.h"
-}
-
-namespace sysrepo {
-
-/**
- * @defgroup classes C++/Python
- * @{
- */
-
-/**
- * @brief Class for wrapping sr_xpath_ctx_t.
- * @class Xpath_Ctx
- */
-class Xpath_Ctx
-{
-public:
-    /** Constructor for an empty [sr_xpath_ctx_t](@ref sr_xpath_ctx_t).*/
-    Xpath_Ctx();
-    /** Getter for begining.*/
-    char *begining() {if (_state != nullptr) return _state->begining; return nullptr;};
-    /** Getter for current_node.*/
-    char *current_node() {if (_state != nullptr) return _state->current_node; return nullptr;};
-    /** Getter for replaced_position.*/
-    char *replaced_position() {if (_state != nullptr) return _state->replaced_position; return nullptr;};
-    /** Getter for replaced_char.*/
-    char replaced_char() {if (_state != nullptr) return _state->replaced_char; return (char) 0;};
-    ~Xpath_Ctx();
-    /** Wrapper for [sr_xpath_next_node](@ref sr_xpath_next_node).*/
-    char *next_node(char *xpath) {return sr_xpath_next_node(xpath, _state);};
-    /** Wrapper for [sr_xpath_next_node_with_ns](@ref sr_xpath_next_node_with_ns).*/
-    char *next_node_with_ns(char *xpath) {return sr_xpath_next_node_with_ns(xpath, _state);};
-    /** Wrapper for [sr_xpath_next_key_name](@ref sr_xpath_next_key_name).*/
-    char *next_key_name(char *xpath) {return sr_xpath_next_key_name(xpath, _state);};
-    /** Wrapper for [sr_xpath_next_key_value](@ref sr_xpath_next_key_value).*/
-    char *next_key_value(char *xpath) {return sr_xpath_next_key_value(xpath, _state);};
-    /** Wrapper for [sr_xpath_node](@ref sr_xpath_node).*/
-    char *node(char *xpath, const char *node_name) {return sr_xpath_node(xpath, node_name, _state);};
-    /** Wrapper for [sr_xpath_node_rel](@ref sr_xpath_node_rel).*/
-    char *node_rel(char *xpath, const char *node_name) {return sr_xpath_node_rel(xpath, node_name, _state);};
-    /** Wrapper for [sr_xpath_node_idx](@ref sr_xpath_node_idx).*/
-    char *node_idx(char *xpath, size_t index) {return sr_xpath_node_idx(xpath, index, _state);};
-    /** Wrapper for [sr_xpath_node_idx_rel](@ref sr_xpath_node_idx_rel).*/
-    char *node_idx_rel(char *xpath, size_t index) {return sr_xpath_node_idx_rel(xpath, index, _state);};
-    /** Wrapper for [sr_xpath_node_key_value](@ref sr_xpath_node_key_value).*/
-    char *node_key_value(char *xpath, const char *key) {return sr_xpath_node_key_value(xpath, key, _state);};
-    /** Wrapper for [sr_xpath_node_key_value_idx](@ref sr_xpath_node_key_value_idx).*/
-    char *node_key_value_idx(char *xpath, size_t index) {return sr_xpath_node_key_value_idx(xpath, index, _state);};
-    /** Wrapper for [sr_xpath_key_value](@ref sr_xpath_key_value).*/
-    char *key_value(char *xpath, const char *node_name, const char *key_name) {
-                    return sr_xpath_key_value(xpath, node_name, key_name, _state);};
-    /** Wrapper for [sr_xpath_key_value_idx](@ref sr_xpath_key_value_idx).*/
-    char *key_value_idx(char *xpath, size_t node_index, size_t key_index) {
-                        return sr_xpath_key_value_idx(xpath, node_index, key_index, _state);};
-    /** Wrapper for [sr_xpath_last_node](@ref sr_xpath_last_node).*/
-    char *last_node(char *xpath) {return sr_xpath_last_node(xpath, _state);};
-    /** Wrapper for [sr_xpath_node_name](@ref sr_xpath_node_name).*/
-    char *node_name(const char *xpath) {return sr_xpath_node_name(xpath);};
-    /** Wrapper for [sr_xpath_node_name_eq](@ref sr_xpath_node_name_eq).*/
-    bool node_name_eq(const char *xpath, const char *node_str) {return sr_xpath_node_name_eq(xpath, node_str);};
-    /** Wrapper for [sr_xpath_recover](@ref sr_xpath_recover).*/
-    void recover() {return sr_xpath_recover(_state);};
-
-private:
-    sr_xpath_ctx_t *_state;
-};
-
-/**@} */
-}
-#endif
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/plugins.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/plugins.h
deleted file mode 100644
index 3c4efc9..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/plugins.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * @file plugins.h
- * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>
- * @brief Sysrepo helpers for plugin integrations.
- *
- * @copyright
- * Copyright 2016 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_PLUGINS_H_
-#define SYSREPO_PLUGINS_H_
-
-#include <stdio.h>
-#include <stdint.h>
-#include <errno.h>
-#include <string.h>
-#include <syslog.h>
-
-#include <sysrepo.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup plugin_utils Plugin Utilities
- * @{
- *
- *  @brief Utilities that expand sysrepo API aimed for sysrepo plugins.
- *
- *  The provided features are: logging macros.
- */
-
-/** Prints an error message (with format specifiers). */
-#define SRP_LOG_ERR(MSG, ...) SRP_LOG__INTERNAL(SR_LL_ERR, MSG, __VA_ARGS__)
-/** Prints an error message. */
-#define SRP_LOG_ERR_MSG(MSG) SRP_LOG__INTERNAL(SR_LL_ERR, MSG "%s", "")
-
-/** Prints a warning message (with format specifiers). */
-#define SRP_LOG_WRN(MSG, ...) SRP_LOG__INTERNAL(SR_LL_WRN, MSG, __VA_ARGS__)
-/** Prints a warning message. */
-#define SRP_LOG_WRN_MSG(MSG) SRP_LOG__INTERNAL(SR_LL_WRN, MSG "%s", "")
-
-/** Prints an informational message (with format specifiers). */
-#define SRP_LOG_INF(MSG, ...) SRP_LOG__INTERNAL(SR_LL_INF, MSG, __VA_ARGS__)
-/** Prints an informational message. */
-#define SRP_LOG_INF_MSG(MSG) SRP_LOG__INTERNAL(SR_LL_INF, MSG "%s", "")
-
-/** Prints a development debug message (with format specifiers). */
-#define SRP_LOG_DBG(MSG, ...) SRP_LOG__INTERNAL(SR_LL_DBG, MSG, __VA_ARGS__)
-/** Prints a development debug message. */
-#define SRP_LOG_DBG_MSG(MSG) SRP_LOG__INTERNAL(SR_LL_DBG, MSG "%s", "")
-
-/**@} plugin_utils */
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Internal macros (not intended to be used directly)
-////////////////////////////////////////////////////////////////////////////////
-
-#ifdef NDEBUG
-    #define SRP_LOG_PRINT_FUNCTION_NAMES (0)    /**< Do not print function names in messages */
-#else
-    #define SRP_LOG_PRINT_FUNCTION_NAMES (1)    /**< Every message will include the function that generated the output */
-#endif
-
-extern volatile uint8_t sr_ll_stderr;       /**< Holds current level of stderr debugs. */
-extern volatile uint8_t sr_ll_syslog;       /**< Holds current level of syslog debugs. */
-
-/**
- * @brief Matching log level to message beginning
- */
-#define SRP_LOG__LL_STR(LL) \
-    ((SR_LL_DBG == LL) ? "DBG" : \
-     (SR_LL_INF == LL) ? "INF" : \
-     (SR_LL_WRN == LL) ? "WRN" : \
-     "ERR")
-
-/**
- * @brief Matching log level to message macros
- */
-#define SRP_LOG__LL_FACILITY(LL) \
-    ((SR_LL_DBG == LL) ? LOG_DEBUG : \
-     (SR_LL_INF == LL) ? LOG_INFO : \
-     (SR_LL_WRN == LL) ? LOG_WARNING : \
-      LOG_ERR)
-
-#if SRP_LOG_PRINT_FUNCTION_NAMES
-/**
- * @brief Syslog output macro with function names.
- */
-#define SRP_LOG__SYSLOG(LL, MSG, ...) \
-        syslog(SRP_LOG__LL_FACILITY(LL), "[%s] (%s:%d) " MSG, SRP_LOG__LL_STR(LL), __func__, __LINE__, __VA_ARGS__);
-/**
- * @brief Stderr output macro with function names.
- */
-#define SRP_LOG__STDERR(LL, MSG, ...) \
-        fprintf(stderr, "[%s] (%s:%d) " MSG "\n", SRP_LOG__LL_STR(LL), __func__, __LINE__, __VA_ARGS__);
-#else
-/**
- * @brief Syslog output macro without function names.
- */
-#define SRP_LOG__SYSLOG(LL, MSG, ...) \
-        syslog(SRP_LOG__LL_FACILITY(LL), "[%s] " MSG, SRP_LOG__LL_STR(LL), __VA_ARGS__);
-/**
- * @brief Stderr output macro without function names.
- */
-#define SRP_LOG__STDERR(LL, MSG, ...) \
-        fprintf(stderr, "[%s] " MSG "\n", SRP_LOG__LL_STR(LL), __VA_ARGS__);
-#endif
-
-/**
- * @brief Internal outptu macro.
- */
-#define SRP_LOG__INTERNAL(LL, MSG, ...) \
-    do { \
-        if (sr_ll_stderr >= LL) \
-            SRP_LOG__STDERR(LL, MSG, __VA_ARGS__) \
-        if (sr_ll_syslog >= LL) \
-            SRP_LOG__SYSLOG(LL, MSG, __VA_ARGS__) \
-    } while(0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSREPO_PLUGINS_H_ */
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/trees.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/trees.h
deleted file mode 100644
index 8db1602..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/trees.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * @file trees.h
- * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>,
- *         Milan Lenco <milan.lenco@pantheon.tech>
- * @brief Functions for simplified manipulation with Sysrepo trees.
- *
- * @copyright
- * Copyright 2016 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_TREES_H_
-#define SYSREPO_TREES_H_
-
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup trees Tree Manipulation Utilities
- * @{
- *
- *  @brief Set of functions facilitating simplified manipulation and traversal
- *  of Sysrepo trees. As there are many connections between the tree nodes
- *  and also some internal attributes associated with each node, it is actually
- *  recommended to use these function rather than to allocate and initialize trees
- *  manually, which is very likely to lead to time-wasting and hard-to-debug programming
- *  errors.
- *  Iterative tree loading (@see SR_GET_SUBTREE_ITERATIVE) even requires to use
- *  designated functions for tree traversal -- ::sr_node_get_child and ::sr_node_get_next_sibling.
- *
- *  Another added benefit of using these function is that the trees created using
- *  ::sr_new_tree and ::sr_new_trees will be allocated using the Sysrepo's own memory management
- *  (if enabled) which was proven to be more efficient for larger data sets
- *  (far less copying, quicker conversion to/from google protocol buffer messages,
- *  stable memory footprint, etc.).
- */
-
-/**
- * @brief Allocate an instance of Sysrepo tree. The newly allocated tree has only
- * one node -- the tree root -- and can be expanded to its full desired size
- * through a repeated use of the function ::sr_node_add_child.
- *
- * @param [in] root_name Name for the newly allocated tree root. Can be NULL.
- * @param [in] root_module_name Name of the module that defines scheme of the tree root.
- *                              Can be NULL.
- * @param [out] tree Returned newly allocated Sysrepo tree.
- */
-int sr_new_tree(const char *root_name, const char *root_module_name, sr_node_t **tree);
-
-/**
- * @brief Allocate an array of sysrepo trees (uninitialized tree roots).
- *
- * @param [in] tree_cnt Length of the array to allocate.
- * @param [out] trees Returned newly allocated array of trees.
- */
-int sr_new_trees(size_t tree_cnt, sr_node_t **trees);
-
-/**
- * @brief Reallocate an array of sysrepo trees (uninitialized tree roots).
- *
- * @param [in] old_tree_cnt Current length of the tree array.
- * @param [in] new_tree_cnt Desired length of the tree array.
- * @param [in,out] trees Returned newly allocated/enlarged array of trees.
- */
-int sr_realloc_trees(size_t old_tree_cnt, size_t new_tree_cnt, sr_node_t **trees);
-
-/**
- * @brief Set/change name of a Sysrepo node.
- *
- * @param [in] node Sysrepo node to change the name of.
- * @param [in] name Name to set.
- */
-int sr_node_set_name(sr_node_t *node, const char *name);
-
-/**
- * @brief Set/change module of a Sysrepo node.
- *
- * @param [in] node Sysrepo node to change the module of.
- * @param [in] module_name Module name to set.
- */
-int sr_node_set_module(sr_node_t *node, const char *module_name);
-
-/**
- * @brief Store data of string type into the Sysrepo node data.
- *
- * @param [in] node Sysrepo node to edit.
- * @param [in] type Exact type of the data.
- * @param [in] string_val String value to set.
- */
-int sr_node_set_str_data(sr_node_t *node, sr_type_t type, const char *string_val);
-
-/**
- * @brief Store data of string type into the Sysrepo node data. The actual data
- * will be built from the a format string and a variable arguments list.
- *
- * @param [in] node Sysrepo node to edit.
- * @param [in] type Exact type of the data.
- * @param [in] format Format string used to build the data.
- */
-int sr_node_build_str_data(sr_node_t *node, sr_type_t type, const char *format, ...);
-
-/**
- * @brief Create a new child for a given Sysrepo node.
- *
- * @param [in] parent Sysrepo node that should be parent of the newly created node.
- * @param [in] child_name Name of the newly created child node. Can be NULL.
- * @param [in] child_module_name Name of the module that defines scheme of the newly created
- *                               child node. Can be NULL.
- * @param [out] child Returned newly allocated child node.
- */
-int sr_node_add_child(sr_node_t *parent, const char *child_name, const char *child_module_name,
-        sr_node_t **child);
-
-/**
- * @brief Duplicate node and all its descendants (with or without Sysrepo memory context)
- * into a new instance of Sysrepo tree with memory context.
- *
- * @param [in] tree Sysrepo tree to duplicate.
- * @param [out] tree_dup Returned duplicate of the input tree.
- */
-int sr_dup_tree(const sr_node_t *tree, sr_node_t **tree_dup);
-
-/**
- * @brief Duplicate an array of trees (with or without Sysrepo memory context) into a new
- * array of trees with memory context.
- *
- * @param [in] trees Array of sysrepo trees to duplicate.
- * @param [in] count Size of the array to duplicate.
- * @param [out] trees_dup Returned duplicate of the input array.
- */
-int sr_dup_trees(const sr_node_t *trees, size_t count, sr_node_t **trees_dup);
-
-/**
- * @brief Print sysrepo tree to STDOUT.
- *
- * @param [in] tree Sysrepo tree to print.
- * @param [in] depth_limit Maximum number of tree levels to print.
- */
-int sr_print_tree(const sr_node_t *tree, int depth_limit);
-
-/**
- * @brief Print sysrepo tree to the specified file descriptor.
- *
- * @param [in] fd File descriptor to print the tree into.
- * @param [in] tree Sysrepo tree to print.
- * @param [in] depth_limit Maximum number of tree levels to print.
- */
-int sr_print_tree_fd(int fd, const sr_node_t *tree, int depth_limit);
-
-/**
- * @brief Print sysrepo tree to the specified output file stream.
- *
- * @param [in] stream Output file stream to print the tree into.
- * @param [in] tree Sysrepo tree to print.
- * @param [in] depth_limit Maximum number of tree levels to print.
- */
-int sr_print_tree_stream(FILE *stream, const sr_node_t *tree, int depth_limit);
-
-/**
- * @brief Print sysrepo tree into a newly allocated memory buffer.
- * The caller is expected to eventually free the returned string.
- *
- * @param [in] mem_p Pointer to store the resulting dump.
- * @param [in] tree Sysrepo tree to print.
- * @param [in] depth_limit Maximum number of tree levels to print.
- */
-int sr_print_tree_mem(char **mem_p, const sr_node_t *tree, int depth_limit);
-
-/**
- * @brief Returns pointer to the first child (based on the schema) of a given node.
- * For a fully loaded tree it is equivalent to "node->first_child". For a partially
- * loaded tree (@see SR_GET_SUBTREE_ITERATIVE) it may internally issue a sysrepo
- * get-subtree-chunk request in order to obtain the data of the child
- * (and the data of some surrounding nodes with it for efficiency).
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] node Node to get the child of.
- * @return Pointer to a child node. NULL if there is none or an error occured.
- */
-sr_node_t *sr_node_get_child(sr_session_ctx_t *session, sr_node_t *node);
-
-/**
- * @brief Returns pointer to the next sibling (based on the schema) of a given node.
- * For a fully loaded tree it is equivalent to "node->next". For a partially
- * loaded tree (@see SR_GET_SUBTREE_ITERATIVE) it may internally issue a sysrepo
- * get-subtree-chunk request in order to obtain the data of the next sibling
- * (and the data of some surrounding nodes with it for efficiency).
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] node Node to get the next sibling of.
- * @return Pointer to the next sibling. NULL if this is the last sibling or an error occured.
- */
-sr_node_t *sr_node_get_next_sibling(sr_session_ctx_t *session, sr_node_t *node);
-
-/**
- * @brief Get the parent of a given node. It is equivalent to "node->parent", but for
- * a partially loaded tree it is preferred to use this function rather than to access
- * the pointer directly just for the sake of code cleanliness.
- *
- * @param[in] session Session context acquired with ::sr_session_start call.
- * @param[in] node Node to get the parent of.
- * @return Pointer to the node's parent or NULL if the node is a root of a (sub)tree.
- */
-sr_node_t *sr_node_get_parent(sr_session_ctx_t *session, sr_node_t *node);
-
-/**@} trees */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSREPO_TREES_H_ */
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/values.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/values.h
deleted file mode 100644
index 049c82f..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/values.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * @file values.h
- * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>,
- *         Milan Lenco <milan.lenco@pantheon.tech>
- * @brief Functions for simplified manipulation with Sysrepo values.
- *
- * @copyright
- * Copyright 2016 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_VALUES_H_
-#define SYSREPO_VALUES_H_
-
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup values Value Manipulation Utilities
- * @{
- *
- *  @brief Set of functions facilitating simplified manipulation with sysrepo
- *  values. It is not necessary to use these functions in any scenario, values
- *  can be allocated and initialized manually (just remember to set all uninitialized
- *  members to zero!).
- *
- *  Using these utilities, however, has several benefits. Firstly, all the memory
- *  allocations associated with creating values and setting their attributes get
- *  hidden behind these functions. The "old-way" was (and still is) to set xpath
- *  and string values using strdup, which may repeat in applications communicating
- *  with sysrepo very often and becomes very annoying to write.
- *  Secondly, the programmer may actually forget to copy or give-up on the ownership
- *  of a string passed to sysrepo value which will then get unexpectedly deallocated
- *  in ::sr_free_val or ::sr_free_values.
- *  The third benefit is that the values created using ::sr_new_val
- *  and ::sr_new_values will be allocated using the Sysrepo's own memory management
- *  (if enabled) which was proven to be more efficient for larger data sets
- *  (far less copying, quicker conversion to/from google protocol buffer messages,
- *  stable memory footprint, etc.).
- */
-
-/**
- * @brief Allocate an instance of Sysrepo value.
- *
- * @param [in] xpath Xpath to set for the newly allocated value. Can be NULL.
- * @param [out] value Returned newly allocated value.
- */
-int sr_new_val(const char *xpath, sr_val_t **value);
-
-/**
- * @brief Allocate an array of sysrepo values.
- *
- * @param [in] value_cnt Length of the array to allocate.
- * @param [out] values Returned newly allocated array of values.
- */
-int sr_new_values(size_t value_cnt, sr_val_t **values);
-
-/**
- * @brief Reallocate an array of sysrepo values.
- *
- * @param [in] old_value_cnt Current length of the value array.
- * @param [in] new_value_cnt Desired length of the value array.
- * @param [in,out] values Returned newly allocated/enlarged array of values.
- */
-int sr_realloc_values(size_t old_value_cnt, size_t new_value_cnt, sr_val_t **values);
-
-/**
- * @brief Set/change xpath of a Sysrepo value.
- *
- * @param [in] value Sysrepo value to change the xpath of.
- * @param [in] xpath XPath to set.
- */
-int sr_val_set_xpath(sr_val_t *value, const char *xpath);
-
-/**
- * @brief Set/change xpath of a Sysrepo value to a new one, built from
- * a format string and a variable arguments list.
- *
- * @param [in] value Sysrepo value to change the xpath of.
- * @param [in] format Format string used to build XPath.
- */
-int sr_val_build_xpath(sr_val_t *value, const char *format, ...);
-
-/**
- * @brief Store data of string type into the Sysrepo value data.
- *
- * @param [in] value Sysrepo value to edit.
- * @param [in] type Exact type of the data.
- * @param [in] string_val String value to set.
- */
-int sr_val_set_str_data(sr_val_t *value, sr_type_t type, const char *string_val);
-
-/**
- * @brief Store data of string type into the Sysrepo value data. The actual data
- * will be built from the a format string and a variable arguments list.
- *
- * @param [in] value Sysrepo value to edit.
- * @param [in] type Exact type of the data.
- * @param [in] format Format string used to build the data.
- */
-int sr_val_build_str_data(sr_val_t *value, sr_type_t type, const char *format, ...);
-
-/**
- * @brief Duplicate value (with or without Sysrepo memory context) into a new
- * instance with memory context.
- *
- * @param [in] value Sysrepo value to duplicate
- * @param [out] value_dup Returned duplicate of the input value.
- */
-int sr_dup_val(const sr_val_t *value, sr_val_t **value_dup);
-
-/**
- * @brief Duplicate values (with or without Sysrepo memory context) into a new
- * array with memory context.
- *
- * @param [in] values Array of sysrepo values to duplicate
- * @param [in] count Size of the array to duplicate.
- * @param [out] values_dup Returned duplicate of the input array.
- */
-int sr_dup_values(const sr_val_t *values, size_t count, sr_val_t **values_dup);
-
-/**
- * @brief Print sysrepo value to STDOUT.
- *
- * @param [in] value Sysrepo value to print.
- */
-int sr_print_val(const sr_val_t *value);
-
-/**
- * @brief Print sysrepo value to the specified file descriptor.
- *
- * @param [in] fd File descriptor to print the value into.
- * @param [in] value Sysrepo value to print.
- */
-int sr_print_val_fd(int fd, const sr_val_t *value);
-
-/**
- * @brief Print sysrepo value to the specified output file stream.
- *
- * @param [in] stream Output file stream to print the value into.
- * @param [in] value Sysrepo value to print.
- */
-int sr_print_val_stream(FILE *stream, const sr_val_t *value);
-
-/**
- * @brief Print sysrepo value into a newly allocated memory buffer.
- * The caller is expected to eventually free the returned string.
- *
- * @param [in] mem_p Pointer to store the resulting dump.
- * @param [in] value Sysrepo value to print.
- */
-int sr_print_val_mem(char **mem_p, const sr_val_t *value);
-
-/**
- * @brief Converts value to string representation
- * @param [in] value
- * @return allocated string representation of value (must be freed by caller), NULL in case of error
- * @note In case of SR_DECIMAL64_T type, number of fraction digits doesn't have to
- * correspond to schema.
- */
-char *sr_val_to_str(const sr_val_t *value);
-
-/**
- * @brief Converts value to string and prints it to the provided buffer including
- * terminating NULL byte
- * @param [in] value
- * @param [in] buffer - buffer provided by caller where the data will be printed
- * @param [in] size - the size of the buffer
- * @return number of characters that was written in case of success, otherwise number of characters which would have been
- * written if enough space had been available (excluding terminating NULL byte)
- * @note In case of SR_DECIMAL64_T type, number of fraction digits doesn't have to
- * correspond to schema.
- */
-int sr_val_to_buff(const sr_val_t *value, char buffer[], size_t size);
-
-/**@} values */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSREPO_VALUES_H_ */
diff --git a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/xpath.h b/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/xpath.h
deleted file mode 100644
index 7eca41e..0000000
--- a/test/mocks/pnfsimulator/netconfsimulator/netopeer-change-saver-native/sysrepo/xpath.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * @file xpath.h
- * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>
- * @brief Sysrepo helpers for node's address manipulation.
- *
- * @copyright
- * Copyright 2015 Cisco Systems, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYSREPO_XPATH_H_
-#define SYSREPO_XPATH_H_
-
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup xpath_utils XPath Processing Utilities
- * @{
- *
- *  @brief Set of helpers working on a subset of xpath expressions used of node identification
- *  Functions modify inputs arguments by placing termination zero at appropriate places to save up
- *  string duplication. The state of processing is stored in ::sr_xpath_ctx_t opaque for user.
- *  It allows to continue in processing where the processing stopped or recover processed input.
- *
- *  Similarly to strtok function in all subsequent calls that is supposed to work with the same
- *  input xpath must be NULL.
- */
-
-/**
- * @brief State of xpath parsing. User must not modify nor rely on the content
- * of the structure.
- */
-typedef struct sr_xpath_ctx_s {
-    char *begining;          /**< Pointer to the begining of the processed string */
-    char *current_node;      /**< Pointer to the currently processed node, used as a context for key search */
-    char *replaced_position; /**< Pointer to the posistion where the last terminating 0 by was written */
-    char replaced_char;      /**< Character that was overwritten by the last termination 0 */
-} sr_xpath_ctx_t;
-
-/**
- * @brief The function returns a pointer to  the following node. If xpath is
- * not NULL returns the first node name, otherwise returns the subsequent node
- * according to the state.
- *
- * The state is modified upon function successful return from function, so the subsequent
- * calls can continue in processing or xpath can be recovered by calling ::sr_xpath_recover.
- *
- * @note It writes terminating zero at the and of the node name.
- *
- * @note Skips the namespace if it is present to get node name qualified by namespace use ::sr_xpath_next_node_with_ns
- *
- * @param [in] xpath - xpath to be processed, can be NULL
- * @param [in] state
- * @return Pointer to the node name, NULL if there are no more node names
- */
-char *sr_xpath_next_node(char *xpath, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns pointer to the last node.
- * @param [in] xpath
- * @param [in] state
- * @return Pointer to the last node
- */
-char *sr_xpath_last_node(char *xpath, sr_xpath_ctx_t *state);
-
-/**
- * @brief Same as ::sr_xpath_next_node with the difference that namespace is included in result if present in xpath
- *
- * @param [in] xpath - xpath to be processed, can be NULL if the user wants to continue in processing of previous input
- * @param [in] state
- * @return Pointer to the node name including namespace, NULL if there are no more node names
- */
-char *sr_xpath_next_node_with_ns(char *xpath, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns the name of the next key at the current level in processed xpath.
- *
- * @param [in] xpath
- * @param [in] state
- * @return Pointer to the key name, NULL if there are no more keys at the current level
- */
-char *sr_xpath_next_key_name(char *xpath, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns the value of the next key at the current level in processed xpath.
- *
- * @param [in] xpath
- * @param [in] state
- * @return Pointer to the key value, NULL if there are no more keys at the current level
- */
-char *sr_xpath_next_key_value(char *xpath, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns a pointer to the node specified by name. It searches from the beginning of the xpath, returns first match.
- * Can be used to jump at the desired node xpath and subsequent analysis of key values.
- *
- * @param [in] xpath
- * @param [in] node_name
- * @param [in] state
- * @return Pointer to the node, NULL if the node with the specified name is not found
- */
-char *sr_xpath_node(char *xpath, const char *node_name, sr_xpath_ctx_t *state);
-
-/**
- * @brief Similar to ::sr_xpath_node. The difference is that search start at current node
- * according to the state.
- *
- * @param [in] xpath
- * @param [in] node_name
- * @param [in] state
- * @return Pointer to the node, NULL if the node with the specified name is not found
- */
-char *sr_xpath_node_rel(char *xpath, const char *node_name, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns node specified by index starting at the begin of expression.
- * First node has index 0.
- *
- * @param [in] xpath
- * @param [in] index
- * @param [in] state
- * @return Pointer to the specified node, NULL if the index is out of bounds
- */
-char *sr_xpath_node_idx(char *xpath, size_t index, sr_xpath_ctx_t *state);
-
-/**
- * @brief Return node specified by index. Following node has index zero.
- *
- * @param [in] xpath
- * @param [in] index
- * @param [in] state
- * @return Pointer to the specified node, NULL if the index is out of bounds
- */
-char *sr_xpath_node_idx_rel(char *xpath, size_t index, sr_xpath_ctx_t *state);
-
-/**
- * @brief Looks up the value for the key at the current level in xpath.
- *
- * @param [in] xpath
- * @param [in] key - key name to be looked up
- * @param [in] state
- * @return Key value, NULL if the key with the specified name is not found
- */
-char *sr_xpath_node_key_value(char *xpath, const char *key, sr_xpath_ctx_t *state);
-
-/**
- * @brief Looks up the value for the key at the current level in xpath specified by index.
- * First key has index zero.
- *
- * @param [in] xpath
- * @param [in] index
- * @param [in] state
- * @return Key value, NULL if the index is out of bound
- */
-char *sr_xpath_node_key_value_idx(char *xpath, size_t index, sr_xpath_ctx_t *state);
-
-/**
- * @brief Looks up the value of the key in a node specified by name.
- *
- * @param [in] xpath
- * @param [in] node_name
- * @param [in] key_name
- * @param [in] state
- * @return Pointer to the key value, NULL if not found
- */
-char *sr_xpath_key_value(char *xpath, const char *node_name, const char *key_name, sr_xpath_ctx_t *state);
-
-/**
- * @brief Looks up the value of the key in a node specified by index. First node has index zero.
- *
- * @param [in] xpath
- * @param [in] node_index
- * @param [in] key_index
- * @param [in] state
- * @return Pointer to the key value, NULL if not found or index out of bound
- */
-char *sr_xpath_key_value_idx(char *xpath, size_t node_index, size_t key_index, sr_xpath_ctx_t *state);
-
-/**
- * @brief Returns pointer to the string after the last slash in xpath (node name).
- *
- * @note The returned string can also contain namespace and/or key values
- * if they were specified for the last node in xpath.
- *
- * @param [in] xpath
- * @return Result, NULL in case of the slash was not found
- */
-char *sr_xpath_node_name(const char *xpath);
-
-/**
- * @brief Compares string after the last slash in xpath (node name) with provided string.
- *
- * @note The returned string can also contain namespace and/or key values
- * if they were specified for the last node in xpath.
- *
- * @param [in] xpath
- * @param [in] node_str String to test for equality.
- * @return true in case that the Node names are equal, false otherwise
- */
-bool sr_xpath_node_name_eq(const char *xpath, const char *node_str);
-
-/**
- * @brief Recovers the xpath string to the original state (puts back the character
- * that was replaced by termination zero).
- *
- * @param [in] state
- */
-void sr_xpath_recover(sr_xpath_ctx_t *state);
-
-/**@} xpath_utils */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SYSREPO_XPATH_H_ */
-
diff --git a/test/mocks/pnfsimulator/netconfsimulator/pom.xml b/test/mocks/pnfsimulator/netconfsimulator/pom.xml
index d83c5b3..d5d7157 100644
--- a/test/mocks/pnfsimulator/netconfsimulator/pom.xml
+++ b/test/mocks/pnfsimulator/netconfsimulator/pom.xml
@@ -52,6 +52,7 @@
     <netopeer-saver-build-dir>${project.build.directory}/cmake</netopeer-saver-build-dir>
     <netopeer-saver-executable-dir>${netopeer-saver-build-dir}/bin</netopeer-saver-executable-dir>
     <skipITs>true</skipITs>
+    <proxy>""</proxy>
   </properties>
 
   <dependencies>
@@ -240,30 +241,38 @@
           </executions>
       </plugin>
       <plugin>
-        <groupId>com.spotify</groupId>
-        <artifactId>docker-maven-plugin</artifactId>
-        <version>1.0.0</version>
-        <configuration>
-          <imageName>${docker.registry}/${docker.image.name}</imageName>
-          <dockerDirectory>${project.basedir}/docker</dockerDirectory>
-          <forceTags>true</forceTags>
-          <registryUrl>${docker.registry}</registryUrl>
-          <imageTags>
-            <imageTag>latest</imageTag>
-          </imageTags>
-          <resources>
-            <resource>
-              <targetPath>${dependency.directory.name}</targetPath>
-              <directory>${dependency.directory.location}</directory>
-            </resource>
-            <resource>
-              <targetPath>/</targetPath>
-              <directory>${project.build.directory}</directory>
-              <include>${project.build.finalName}.jar</include>
-            </resource>
-          </resources>
-          <forceTags>true</forceTags>
-        </configuration>
+      <groupId>io.fabric8</groupId>
+      <artifactId>docker-maven-plugin</artifactId>
+      <version>0.31.0</version>
+      <executions>
+        <execution>
+          <id>build-images</id>
+          <goals>
+            <goal>push</goal>
+          </goals>
+        </execution>
+      </executions>
+      <configuration>
+        <images>
+          <image>
+            <name>${docker.registry}/${docker.image.name}</name>
+            <build>
+              <contextDir>${project.basedir}</contextDir>
+              <dockerFile>${project.basedir}/Dockerfile_app</dockerFile>
+            </build>
+          </image>
+          <image>
+            <name>${docker.registry}/netopeer</name>
+            <build>
+              <contextDir>${project.basedir}</contextDir>
+              <dockerFile>${project.basedir}/Dockerfile_netopeer</dockerFile>
+              <args>
+                <PROXY>${proxy}</PROXY>
+              </args>
+            </build>
+          </image>
+        </images>
+      </configuration>
       </plugin>
     </plugins>
   </build>
diff --git a/test/mocks/pnfsimulator/pnfsimulator/docker/Dockerfile b/test/mocks/pnfsimulator/pnfsimulator/Dockerfile
similarity index 70%
rename from test/mocks/pnfsimulator/pnfsimulator/docker/Dockerfile
rename to test/mocks/pnfsimulator/pnfsimulator/Dockerfile
index 814cf64..62d131a 100644
--- a/test/mocks/pnfsimulator/pnfsimulator/docker/Dockerfile
+++ b/test/mocks/pnfsimulator/pnfsimulator/Dockerfile
@@ -1,6 +1,6 @@
 FROM openjdk:8-jre-alpine
-ADD libs /app/libs
-ADD pnfsimulator-5.0.0-SNAPSHOT.jar /app/pnf-simulator.jar
+ADD target/libs /app/libs
+ADD target/pnfsimulator-5.0.0-SNAPSHOT.jar /app/pnf-simulator.jar
 CMD apk update
 CMD apk add ca-certificates
 ADD certificates  /usr/local/share/ca-certificates/
diff --git a/test/mocks/pnfsimulator/pnfsimulator/docker/certificates/AAF_RootCA.crt b/test/mocks/pnfsimulator/pnfsimulator/certificates/AAF_RootCA.crt
similarity index 100%
rename from test/mocks/pnfsimulator/pnfsimulator/docker/certificates/AAF_RootCA.crt
rename to test/mocks/pnfsimulator/pnfsimulator/certificates/AAF_RootCA.crt
diff --git a/test/mocks/pnfsimulator/pnfsimulator/docker/certificates/dcaelocal.crt b/test/mocks/pnfsimulator/pnfsimulator/certificates/dcaelocal.crt
similarity index 100%
rename from test/mocks/pnfsimulator/pnfsimulator/docker/certificates/dcaelocal.crt
rename to test/mocks/pnfsimulator/pnfsimulator/certificates/dcaelocal.crt
diff --git a/test/mocks/pnfsimulator/pnfsimulator/pom.xml b/test/mocks/pnfsimulator/pnfsimulator/pom.xml
index 83aa3f0..30f1c50 100644
--- a/test/mocks/pnfsimulator/pnfsimulator/pom.xml
+++ b/test/mocks/pnfsimulator/pnfsimulator/pom.xml
@@ -308,30 +308,27 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>com.spotify</groupId>
+                <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
-                <version>1.0.0</version>
+                <version>0.31.0</version>
+                <executions>
+                    <execution>
+                        <id>build-image</id>
+                        <goals>
+                            <goal>push</goal>
+                        </goals>
+                    </execution>
+                </executions>
                 <configuration>
-                    <registryUrl>${onap.nexus.dockerregistry.daily}</registryUrl>
-                    <imageName>${onap.nexus.dockerregistry.daily}/${docker.image.name}</imageName>
-                    <dockerDirectory>${project.basedir}/docker</dockerDirectory>
-                    <forceTags>true</forceTags>
-                    <imageTags>
-                        <imageTag>latest</imageTag>
-                    </imageTags>
-
-                    <resources>
-                        <resource>
-                            <targetPath>${dependency.directory.name}</targetPath>
-                            <directory>${dependency.directory.location}</directory>
-                        </resource>
-                        <resource>
-                            <targetPath>/</targetPath>
-                            <directory>${project.build.directory}</directory>
-                            <include>${project.build.finalName}.jar</include>
-                        </resource>
-                    </resources>
-                    <forceTags>true</forceTags>
+                    <images>
+                        <image>
+                            <name>${onap.nexus.dockerregistry.daily}/${docker.image.name}</name>
+                            <build>
+                                <contextDir>${project.basedir}</contextDir>
+                                <dockerFile>${project.basedir}/Dockerfile</dockerFile>
+                            </build>
+                        </image>
+                    </images>
                 </configuration>
             </plugin>
             <plugin>
diff --git a/test/mocks/pnfsimulator/pom.xml b/test/mocks/pnfsimulator/pom.xml
index 2f683a9..32d9daf 100644
--- a/test/mocks/pnfsimulator/pom.xml
+++ b/test/mocks/pnfsimulator/pom.xml
@@ -68,9 +68,9 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>com.spotify</groupId>
+                <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
-                <version>1.1.1</version>
+                <version>0.31.0</version>
             </plugin>
         </plugins>
     </build>
