EII ConfigMgr C/C++ Reference
Macros | Enumerations | Functions
cfgmgr_util.h File Reference

Utility for ConfigManager. More...

#include <stdio.h>
#include <stdlib.h>
#include <cjson/cJSON.h>
#include <safe_lib.h>
#include <eii/utils/logger.h>
#include <eii/utils/string.h>
#include <stdbool.h>
#include <ctype.h>
#include "eii/utils/json_config.h"
#include "eii/config_manager/kv_store_plugin/kv_store_plugin.h"

Go to the source code of this file.

Macros

#define BROKERED   "brokered"
 
#define SOCKET_FILE   "socket_file"
 
#define ENDPOINT   "EndPoint"
 
#define TOPICS   "Topics"
 
#define NAME   "Name"
 
#define ALLOWED_CLIENTS   "AllowedClients"
 
#define PUBLIC_KEYS   "/Publickeys/"
 
#define PRIVATE_KEY   "/private_key"
 
#define MAX_CONFIG_KEY_LENGTH   250
 
#define MAX_ENDPOINT_LENGTH   40
 
#define MAX_MODE_LENGTH   10
 

Enumerations

enum  cfgmgr_iface_type_t { CFGMGR_PUBLISHER = 0, CFGMGR_SUBSCRIBER = 1, CFGMGR_SERVER = 2, CFGMGR_CLIENT = 3 }
 

Functions

char * cvt_to_char (config_value_t *config)
 
char * configt_to_char (config_t *config)
 
bool get_ipc_config (config_t *c_json, config_value_t *config, const char *end_point, cfgmgr_iface_type_t type)
 
char * cvt_obj_str_to_char (config_value_t *cvt)
 
bool construct_tcp_publisher_prod (char *app_name, config_t *c_json, config_t *inner_json, void *handle, config_value_t *config, kv_store_client_t *kv_store_client)
 
bool add_keys_to_config (config_t *sub_topic, char *app_name, kv_store_client_t *kv_store_client, void *handle, config_value_t *publisher_appname, config_value_t *sub_config)
 

Detailed Description

Utility for ConfigManager.

Enumeration Type Documentation

◆ cfgmgr_iface_type_t

ConfigMgr interface type

Function Documentation

◆ add_keys_to_config()

bool add_keys_to_config ( config_t *  sub_topic,
char *  app_name,
kv_store_client_t *  kv_store_client,
void *  handle,
config_value_t *  publisher_appname,
config_value_t *  sub_config 
)

construct_tcp_publisher_prod function constructs the publisher message bus config for prod mode

Parameters
sub_topic: sub_topic config_t object where the entire message bus config is held
app_name: Application name
kv_store_client: kv store client object
handle: kv store's handle
publisher_appnamePublisherAppName value
sub_config: subscriber's interface config
Returns
true on sucess, false on fail

◆ configt_to_char()

char* configt_to_char ( config_t *  config)

configt_to_char function to convert config_t to char*

Parameters
config- config_t object
Returns
NULL for any errors occured or char* on success

◆ construct_tcp_publisher_prod()

bool construct_tcp_publisher_prod ( char *  app_name,
config_t *  c_json,
config_t *  inner_json,
void *  handle,
config_value_t *  config,
kv_store_client_t *  kv_store_client 
)

construct_tcp_publisher_prod function constructs the publisher message bus config for prod mode

Parameters
app_name: Application name
c_json: Main config_t object where the entire message bus config is held
inner_json: nested json where endpoint and certificates details are stored
handle: kv store's handle
config: publisher's interface config
kv_store_client: kv store client object
Returns
true on sucess, false on fail

◆ cvt_obj_str_to_char()

char* cvt_obj_str_to_char ( config_value_t *  cvt)

cvt_obj_str_to_char function converts cvt object to char* provided for ipc

Parameters
cvt: config_value_t* object
Returns
char* value of the cvt

◆ cvt_to_char()

char* cvt_to_char ( config_value_t *  config)

cvt_to_char function to convert config_value_t* to char*

Parameters
config_value_t*- config_value_t* object
Returns
NULL for any errors occured or char* on success

◆ get_ipc_config()

bool get_ipc_config ( config_t *  c_json,
config_value_t *  config,
const char *  end_point,
cfgmgr_iface_type_t  type 
)

get_ipc_config function to creates json structure for ipc mode messagebus config

Parameters
c_json- config_t object for which ipc config to be added
config- Config from which values are extracted
end_point- endpoint of the application
type- to check whether type is CFGMGR_SERVER/CFGMGR_CLIENT to not fetch topics
Returns
result of the function passed or failed