#include "app_common.h"
#include "nf_oran_du.h"
+#include "nf_oran_ru_supervision.h"
#define NF_FUNCTION_CONTROL_BUFFER_LENGTH 32
}
}
- if(pthread_mutex_init(&nf_function_control_lock, NULL) != 0) {
- log_error("mutex init has failed\n");
- return NTS_ERR_FAILED;
+ if(pthread_mutex_init(&nf_function_control_lock, NULL) != 0) {
+ log_error("mutex init has failed\n");
+ return NTS_ERR_FAILED;
}
//ietf-netconf-monitoring schemas populate with modules and submodules (overwrite default Netopeer2 behaviour)
return NTS_ERR_FAILED;
}
- if(pthread_mutex_init(&faults_lock, NULL) != 0) {
- log_error("mutex init has failed\n");
- return NTS_ERR_FAILED;
+ if(pthread_mutex_init(&faults_lock, NULL) != 0) {
+ log_error("mutex init has failed\n");
+ return NTS_ERR_FAILED;
}
if(pthread_create(&faults_thread, 0, faults_thread_routine, 0)) {
nf_function_control_buffer_in = 0;
}
- log_add_verbose(1, LOG_COLOR_BOLD_YELLOW"running in NETWORK FUNCTION STANDALONE mode!\n"LOG_COLOR_RESET);
+ log_add_verbose(1, LOG_COLOR_BOLD_YELLOW"running in NETWORK FUNCTION STANDALONE mode as a %s\n"LOG_COLOR_RESET, framework_environment.nts.function_type);
log_add_verbose(1, "Currently enabled features are: %s\n", framework_environment.nts.nf_standalone_start_features);
log_add_verbose(1, LOG_COLOR_BOLD_YELLOW"Docker IP:"LOG_COLOR_RESET" %s\n", framework_environment.settings.ip_v6_enabled ? framework_environment.settings.ip_v6 : framework_environment.settings.ip_v4);
log_add_verbose(1, LOG_COLOR_BOLD_YELLOW"Docker ports"LOG_COLOR_RESET": ");
if(strcmp(framework_environment.nts.function_type, "NTS_FUNCTION_TYPE_O_RAN_O_DU") == 0) {
rc = nf_oran_du_init();
if(rc != NTS_ERR_OK) {
- log_error("nf_oran_du_init failed\n");
- return NTS_ERR_FAILED;
+ log_error("nf_oran_du_init failed\n");
+ return NTS_ERR_FAILED;
+ }
+ }
+
+ if(strcmp(framework_environment.nts.function_type, "NTS_FUNCTION_TYPE_O_RAN_O_RU_FH") == 0) {
+ log_add_verbose(1, "Initializing o-ran-supervision function...\n");
+ rc = nf_oran_ru_supervision_init();
+ if(rc != NTS_ERR_OK) {
+ log_error("nf_oran_ru_supervision_init failed, continuing...\n");
}
}
if (!strcmp("sysrepo", mod->name) || !strcmp("sysrepo-monitoring", mod->name) || !strcmp("sysrepo-plugind", mod->name)) {
continue;
}
-
+
list = lyd_new(root, NULL, "schema");
lyd_new_leaf(list, NULL, "identifier", mod->name);
lyd_new_leaf(list, NULL, "version", (mod->rev ? mod->rev[0].date : NULL));
struct lyd_node *stream = lyd_new_path(root, 0, NC_NOTIFICATIONS_STREAMS_SCHEMA_XPATH"/stream[name='NETCONF']", NULL, 0, 0);
lyd_new_leaf(stream, stream->schema->module, "description", "Default NETCONF stream containing notifications from all the modules. Replays only notifications for modules that support replay.");
lyd_new_leaf(stream, stream->schema->module, "replaySupport", "true");
-
+
/* all other streams */
struct lyd_node *sr_data;
struct lyd_node *sr_mod;
rep_sup = set->set.d[0];
}
ly_set_free(set);
-
+
lyd_new_leaf(stream, NULL, "replaySupport", rep_sup ? "true" : "false");
if(rep_sup) {
char buf[26];
pthread_mutex_unlock(&nf_function_control_lock);
}
-
+
return rc;
}
if(ves_file_ready_feature_get_status()) {
strcat(started_features, "ves-file-ready ");
}
-
+
if(ves_pnf_registration_feature_get_status()) {
strcat(started_features, "ves-pnf-registration ");
}
if(ves_heartbeat_feature_get_status()) {
strcat(started_features, "ves-heartbeat ");
}
-
+
if(manual_notification_feature_get_status()) {
strcat(started_features, "manual-notification-generation ");
}
if(netconf_call_home_feature_get_status()) {
strcat(started_features, "netconf-call-home ");
}
-
+
if(web_cut_through_feature_get_status()) {
strcat(started_features, "web-cut-through ");
}
assert_session();
int ret = NTS_ERR_OK;
-
+
int rc;
struct lyd_node *data;
rc = sr_get_subtree(session, NTS_NF_FAULT_GENERATION_SCHEMA_XPATH, 0, &data);
}
}
}
-
+
}
-
+
faults_update_config_free:
lyd_free(data);
log_error("lyd_parse_mem failed\n");
goto fault_send_ves;
}
-
+
rc = sr_event_notif_send_tree(current_session_running, notif);
lyd_free(notif);
if(rc != SR_ERR_OK) {
}
while((rc = sr_get_change_next(session, it, &oper, &old_value, &new_value)) == SR_ERR_OK) {
-
+
if(new_value->xpath && (strcmp(new_value->xpath, NTS_NF_NETWORK_FUNCTION_FTYPE_SCHEMA_XPATH) == 0)) {
if(old_value && !old_value->dflt) {
rc = sr_set_item(session, old_value->xpath, old_value, 0);