X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fntsim-ng%2Ffeatures%2Fweb_cut_through%2Fweb_cut_through.c;h=69a53149a03daac64b2a3f65bc7ec653040f254d;hp=0ae406a28376d58af1f03b8eac4dc4683e0f27f9;hb=c7e43513c1c4c3569d5079db0a9a31c124274e6c;hpb=908fe04b071e17feb1984cbc342ab9f45f325e18 diff --git a/ntsimulator/ntsim-ng/features/web_cut_through/web_cut_through.c b/ntsimulator/ntsim-ng/features/web_cut_through/web_cut_through.c index 0ae406a..69a5314 100644 --- a/ntsimulator/ntsim-ng/features/web_cut_through/web_cut_through.c +++ b/ntsimulator/ntsim-ng/features/web_cut_through/web_cut_through.c @@ -28,14 +28,7 @@ #include "core/session.h" #include "core/framework.h" - -#define SYSTEM_NAME_SCHEMA_XPATH "/ietf-system:system/onap-system:name" -#define SYSTEM_WEB_UI_SCHEMA_XPATH "/ietf-system:system/onap-system:web-ui" -#define IETF_SYSTEM_CONTACT_SCHEMA_XPATH "/ietf-system:system/contact" -#define IETF_SYSTEM_HOSTNAME_SCHEMA_XPATH "/ietf-system:system/hostname" -#define IETF_SYSTEM_LOCATION_SCHEMA_XPATH "/ietf-system:system/location" -#define IETF_SYSTEM_TIMEZONE_NAME_SCHEMA_XPATH "/ietf-system:system/clock/timezone-name" -#define IETF_SYSTEM_NTP_ENABLED_SCHEMA_XPATH "/ietf-system:system/ntp/enabled" +#include "core/xpath.h" static int web_cut_through_status = 0; @@ -49,7 +42,7 @@ int web_cut_through_feature_start(sr_session_ctx_t *current_session) { if(web_cut_through_status == 0) { //update ietf-system details - int rc = sr_set_item_str(current_session, SYSTEM_NAME_SCHEMA_XPATH, framework_environment.settings.hostname, 0, 0); + int rc = sr_set_item_str(current_session, IETF_SYSTEM_NAME_SCHEMA_XPATH, framework_environment.settings.hostname, 0, 0); if(rc != SR_ERR_OK) { log_error("sr_set_item_str failed\n"); return NTS_ERR_FAILED; @@ -70,7 +63,7 @@ int web_cut_through_feature_start(sr_session_ctx_t *current_session) { return NTS_ERR_FAILED; } - rc = sr_set_item_str(current_session, SYSTEM_WEB_UI_SCHEMA_XPATH, web_ui, 0, 0); + rc = sr_set_item_str(current_session, IETF_SYSTEM_WEB_UI_SCHEMA_XPATH, web_ui, 0, 0); free(web_ui); if(rc != SR_ERR_OK) { log_error("sr_set_item_str failed\n"); @@ -125,13 +118,13 @@ int web_cut_through_feature_stop(sr_session_ctx_t *current_session) { if(web_cut_through_status) { //update ietf-system details - int rc = sr_delete_item(current_session, SYSTEM_NAME_SCHEMA_XPATH, 0); + int rc = sr_delete_item(current_session, IETF_SYSTEM_NAME_SCHEMA_XPATH, 0); if(rc != SR_ERR_OK) { log_error("sr_delete_item failed\n"); return NTS_ERR_FAILED; } - rc = sr_delete_item(current_session, SYSTEM_WEB_UI_SCHEMA_XPATH, 0); + rc = sr_delete_item(current_session, IETF_SYSTEM_WEB_UI_SCHEMA_XPATH, 0); if(rc != SR_ERR_OK) { log_error("sr_delete_item failed\n"); return NTS_ERR_FAILED;