 |
AM261x MCU+ SDK
10.02.00
|
|
Go to the documentation of this file.
50 #ifndef YANG_DB_RUNTIME_H_
51 #define YANG_DB_RUNTIME_H_
53 #include "../uc_dbal.h"
54 #include "../hal/uc_hwal.h"
55 #include "../uc_notice.h"
56 #include "yang_db_access.h"
62 #define YANG_DB_LINE_BUF_SIZE 512u
107 char *kstr,
char *vstr, uint8_t onhw);
117 uc_notice_data_t *ucntd);
131 const char* line,
void **kvs, uint8_t *kss,
144 const char* line,
void **value, uint32_t *vsize);
151 const char* line,
char *semname, UC_NOTICE_SIG_T **sem);
164 uint8_t *vkey, uint8_t *vtype);
172 uint8_t *aps, uint8_t vkindex,
char **rstr);
185 void *waitv, uint32_t wvsize,
int tout_ms);
197 kvs_t *kvs, uint8_t *kss,
char **rstr);
203 void *key, uint32_t ksize,
char **rstr);
213 char *kstr,
char *vstr);
245 const char* line, uint8_t *aps,
void **kvs, uint8_t *kss);
257 uint8_t aps[],
void *kvs[], uint8_t kss[]);
275 const char* line,
void *kvs[], uint8_t kss[],
276 bool status,
void **value,
277 uint32_t *vsize,
char **qstr);
284 const char* line,
bool status,
285 char **rvalue,
int *rvsize);
int yang_db_runtime_get_oneline(yang_db_runtime_dataq_t *ydrd, const char *line, void **value, uint32_t *vsize)
get one node db data by a string line
int yang_db_runtime_nodestr2apkv(yang_db_runtime_dataq_t *ydrd, const char *line, uint8_t *aps, void **kvs, uint8_t *kss)
convert yang key string to aps,kvs,kss,,, in ydrd
int yang_db_runtime_put_oneline(yang_db_runtime_dataq_t *ydrd, char *kstr, char *vstr, uint8_t onhw)
write one node db data by a string line
uc_range * yang_db_runtime_range_fromline(yang_db_runtime_dataq_t *ydrd, const char *line, void **kvs, uint8_t *kss, bool status)
get a range from line
int yang_db_runtime_notice_register(yang_db_runtime_dataq_t *ydrd, uc_notice_data_t *ucntd, const char *line, char *semname, UC_NOTICE_SIG_T **sem)
int yang_db_runtime_read_conffile(uc_dbald *dbald, const char *fname)
internally create ydrd and then call "yang_db_runtime_readfile"
int yang_db_runtime_getkeyvkstr(uc_dbald *dbald, void *key, uint32_t ksize, char **rstr)
'key node string' and 'value key node string' of key
int yang_db_runtime_askaction(yang_db_runtime_dataq_t *ydrd, uc_notice_data_t *ucntd)
ask to call 'uc_nc_askaction_push'
int yang_db_runtime_iterate_fromline(yang_db_runtime_dataq_t *ydrd, uc_range **range, const char *line, void *kvs[], uint8_t kss[], bool status, void **value, uint32_t *vsize, char **qstr)
get a range from line, then iterate the contents
int yang_db_runtime_readfile(yang_db_runtime_dataq_t *ydrd, const char *fname)
read from a config file, and set data.
const char * convxml2conf_getconf(yang_db_runtime_dataq_t *ydrd, const char *ifname, const char *ofname)
convert xml format config file to Excelfore format config file
int yang_db_runtime_waititem(yang_db_runtime_dataq_t *ydrd, const char *witem, void *waitv, uint32_t wvsize, int tout_ms)
wait witem, if waitv!=NULL wait unitl the value matches. if waitv==NULL wait appearance of witem.
int yang_db_runtime_proc_nodestring(yang_db_runtime_dataq_t *ydrd, bool reset, char *kstr, char *vstr)
uint8_t yang_db_runtime_getvknum(uc_dbald *dbald, uint8_t *aps)
bool yang_db_runtime_needaction(yang_db_runtime_dataq_t *ydrd)
void yang_db_runtime_close(yang_db_runtime_dataq_t *ydrd)
yang_db_runtime_dataq_t * yang_db_runtime_init(uc_dbald *dbald, uc_hwald *hwald)
int yang_db_runtime_cache_fromline(yang_db_runtime_dataq_t *ydrd, const char *line, bool status, char **rvalue, int *rvsize)
call 'yang_db_runtime_iterate_fromline' internally and cache (qstr, vstr) into 'rvalue'.
void yang_db_runtime_cache_fromline_release(char *rvalue)
release the reserved memory in 'yang_db_runtime_cache_fromline'
int yang_db_runtime_getvkvtype(uc_dbald *dbald, uint8_t *aps, uint8_t vkindex, uint8_t *vkey, uint8_t *vtype)
int yang_db_runtime_state_keyvkstr(yang_db_runtime_dataq_t *ydrd, char **rstr)
call yang_db_runtime_getkeyvkstr with the internal ydrd state
void yang_db_runtime_readdb_log(bool consoleprint, uc_dbald *dbald, const char *headmsg, uint8_t aps[], void *kvs[], uint8_t kss[])
read from the DB, and print into the log file, optionally print on console.
struct yang_db_runtime_data yang_db_runtime_dataq_t
Definition: yang_db_runtime.h:64
void yang_db_runtime_set_hwadl(yang_db_runtime_dataq_t *ydrd, uc_hwald *hwald)
hwald is set with yang_db_runtime_init, this function sets/resets later.
int yang_db_runtime_get_vtype(uc_dbald *dbald, uint8_t *aps)
get value type of 'aps' leaf
int yang_db_runtime_apkv2keyvkstr(uc_dbald *dbald, uint8_t *aps, kvs_t *kvs, uint8_t *kss, char **rstr)
'key node string' and 'value key node string' of (aps,kvs,kss)
int yang_db_runtime_getvkstr(uc_dbald *dbald, uint8_t *aps, uint8_t vkindex, char **rstr)