src/mimik_edge_services.c
int mk_json_parse_nodecfg(char *databuff, nodecfg_json *nr)
{
   cJSON *jroot = NULL;
   char *name = NULL;
   int rc = 0;

   if ((!databuff) || (!nr)) {
      return -1;
   }

   if (nr->jroot != NULL) {
      MK_LOG(LOG_ERR,"%s() nr->jroot=%p is not empty, may have been parsed already \n",__func__,nr->jroot);
      mk_free_nodecfg_json(nr);
   }

   jroot = cJSON_Parse(databuff);
   if (!jroot) {
      return -1;
   }
   nr->jroot = jroot;

   //"sslPort"
    name = "sslPort";
    rc = mk_json_get_number_item_value(jroot,name,&nr->sslPort);
    if (rc == 0) {
        MK_LOG(LOG_NOTICE,"%s() name(%s) => value(%u) \n ",__func__,name,nr->sslPort);
    }

   return 0;
}
//returns 0 on success and -1 on failure
returns 0 on success and -1 on failure
returns 0 on success and - 1 on failure
int mk_json_parse_nodecfg(char *databuff, nodecfg_json *nr)
{
   cJSON *jroot = NULL;
   char *name = NULL;
   int rc = 0;
   if ((!databuff) || (!nr)) {
      return -1;
   }
   if (nr->jroot != NULL) {
      MK_LOG(LOG_ERR,"%s() nr->jroot=%p is not empty, may have been parsed already \n",__func__,nr->jroot);
      mk_free_nodecfg_json(nr);
   }
   jroot = cJSON_Parse(databuff);
   if (!jroot) {
      return -1;
   }
   nr->jroot = jroot;
    name = "sslPort";
    rc = mk_json_get_number_item_value(jroot,name,&nr->sslPort);
    if (rc == 0) {
        MK_LOG(LOG_NOTICE,"%s() name(%s) => value(%u) \n ",__func__,name,nr->sslPort);
    }
   return 0;
}
int mk_json_parse_nodecfg ( char * databuff , nodecfg_json * nr ) { cJSON * jroot = NULL ; char * name = NULL ; int rc = 0 ; if ( ( ! databuff ) || ( ! nr ) ) { return -1 ; } if ( nr -> jroot != NULL ) { MK_LOG ( LOG_ERR , " \n " , __func__ , nr -> jroot ) ; mk_free_nodecfg_json ( nr ) ; } jroot = cJSON_Parse ( databuff ) ; if ( ! jroot ) { return -1 ; } nr -> jroot = jroot ; name = " " ; rc = mk_json_get_number_item_value ( jroot , name , & nr -> sslPort ) ; if ( rc == 0 ) { MK_LOG ( LOG_NOTICE , " \n " , __func__ , name , nr -> sslPort ) ; } return 0 ; }
returns 0 on success and -1 on failure
returns 0 on success and - 1 on failure
//"sslPort"