X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fsrc%2Futils%2Futils.c;h=217675be4625e8f78bfb612642d445585cc30aee;hp=5242f6d777882dadfb264a14027961247cd99625;hb=3472441e3d90935c770f84c449b6541784afd6a5;hpb=22d42e2cb4dced153aa8ee785ea2a102962a31b4 diff --git a/ntsimulator/src/utils/utils.c b/ntsimulator/src/utils/utils.c index 5242f6d..217675b 100644 --- a/ntsimulator/src/utils/utils.c +++ b/ntsimulator/src/utils/utils.c @@ -2082,6 +2082,50 @@ int writeSkeletonConfigFile() return SR_ERR_OPERATION_FAILED; } + cJSON *controllerDetails = cJSON_CreateObject(); + if (controllerDetails == NULL) + { + printf("Could not create JSON object: controllerDetails\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + cJSON_AddItemToObject(configObject, "controller-details", controllerDetails); + + if (cJSON_AddStringToObject(controllerDetails, "controller-ip", "172.17.0.1") == NULL) + { + printf("Could not create JSON object: controller-ip\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + + if (cJSON_AddNumberToObject(controllerDetails, "controller-port", 8181) == NULL) + { + printf("Could not create JSON object: controller-port\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + + if (cJSON_AddNumberToObject(controllerDetails, "netconf-call-home-port", 6666) == NULL) + { + printf("Could not create JSON object: netconf-call-home-port\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + + if (cJSON_AddStringToObject(controllerDetails, "controller-username", "admin") == NULL) + { + printf("Could not create JSON object: controller-username\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + + if (cJSON_AddStringToObject(controllerDetails, "controller-password", "admin") == NULL) + { + printf("Could not create JSON object: controller-password\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + if (cJSON_AddNumberToObject(configObject, "ssh-connections", 1) == NULL) { printf("Could not create JSON object: ssh-connections\n"); @@ -2096,6 +2140,13 @@ int writeSkeletonConfigFile() return SR_ERR_OPERATION_FAILED; } + if (cJSON_AddFalseToObject(configObject, "netconf-call-home") == NULL) + { + printf("Could not create JSON object: netconf-call-home\n"); + cJSON_Delete(configObject); + return SR_ERR_OPERATION_FAILED; + } + char *config_string = NULL; config_string = cJSON_PrintUnformatted(configObject);