Backend daemon startup modes

This commit is contained in:
Olof hagsand 2017-11-19 11:52:30 +01:00
parent 23e40384f7
commit 496d676ad3
26 changed files with 769 additions and 280 deletions

View file

@ -63,6 +63,13 @@ enum genmodel_type{
GT_ALL, /* Keywords on all variables */
};
/*! See clixon-config.yang type startup_mode */
enum startup_mode_t{
SM_NONE=0,
SM_STARTUP,
SM_RUNNING,
SM_INIT
};
/*
* Prototypes
@ -93,6 +100,7 @@ char *clicon_clispec_dir(clicon_handle h);
char *clicon_netconf_dir(clicon_handle h);
char *clicon_restconf_dir(clicon_handle h);
char *clicon_xmldb_plugin(clicon_handle h);
int clicon_startup_mode(clicon_handle h);
int clicon_sock_family(clicon_handle h);
char *clicon_sock(clicon_handle h);
int clicon_sock_port(clicon_handle h);

View file

@ -75,34 +75,34 @@ typedef int (xmldb_getopt_t)(xmldb_handle xh, char *optname, void **value);
typedef int (xmldb_setopt_t)(xmldb_handle xh, char *optname, void *value);
/* Type of xmldb get function */
typedef int (xmldb_get_t)(xmldb_handle xh, char *db, char *xpath, int config, cxobj **xtop);
typedef int (xmldb_get_t)(xmldb_handle xh, const char *db, char *xpath, int config, cxobj **xtop);
/* Type of xmldb put function */
typedef int (xmldb_put_t)(xmldb_handle xh, char *db, enum operation_type op, cxobj *xt);
typedef int (xmldb_put_t)(xmldb_handle xh, const char *db, enum operation_type op, cxobj *xt);
/* Type of xmldb copy function */
typedef int (xmldb_copy_t)(xmldb_handle xh, char *from, char *to);
typedef int (xmldb_copy_t)(xmldb_handle xh, const char *from, const char *to);
/* Type of xmldb lock function */
typedef int (xmldb_lock_t)(xmldb_handle xh, char *db, int pid);
typedef int (xmldb_lock_t)(xmldb_handle xh, const char *db, int pid);
/* Type of xmldb unlock function */
typedef int (xmldb_unlock_t)(xmldb_handle xh, char *db);
typedef int (xmldb_unlock_t)(xmldb_handle xh, const char *db);
/* Type of xmldb unlock_all function */
typedef int (xmldb_unlock_all_t)(xmldb_handle xh, int pid);
/* Type of xmldb islocked function */
typedef int (xmldb_islocked_t)(xmldb_handle xh, char *db);
typedef int (xmldb_islocked_t)(xmldb_handle xh, const char *db);
/* Type of xmldb exists function */
typedef int (xmldb_exists_t)(xmldb_handle xh, char *db);
typedef int (xmldb_exists_t)(xmldb_handle xh, const char *db);
/* Type of xmldb delete function */
typedef int (xmldb_delete_t)(xmldb_handle xh, char *db);
typedef int (xmldb_delete_t)(xmldb_handle xh, const char *db);
/* Type of xmldb init function */
typedef int (xmldb_create_t)(xmldb_handle xh, char *db);
typedef int (xmldb_create_t)(xmldb_handle xh, const char *db);
/* plugin init struct for the api */
struct xmldb_api{
@ -133,20 +133,20 @@ struct xmldb_api{
int xmldb_plugin_load(clicon_handle h, char *filename);
int xmldb_plugin_unload(clicon_handle h);
int xmldb_validate_db(char *db);
int xmldb_validate_db(const char *db);
int xmldb_connect(clicon_handle h);
int xmldb_disconnect(clicon_handle h);
int xmldb_getopt(clicon_handle h, char *optname, void **value);
int xmldb_setopt(clicon_handle h, char *optname, void *value);
int xmldb_get(clicon_handle h, char *db, char *xpath, int config, cxobj **xtop);
int xmldb_put(clicon_handle h, char *db, enum operation_type op, cxobj *xt);
int xmldb_copy(clicon_handle h, char *from, char *to);
int xmldb_lock(clicon_handle h, char *db, int pid);
int xmldb_unlock(clicon_handle h, char *db);
int xmldb_get(clicon_handle h, const char *db, char *xpath, int config, cxobj **xtop);
int xmldb_put(clicon_handle h, const char *db, enum operation_type op, cxobj *xt);
int xmldb_copy(clicon_handle h, const char *from, const char *to);
int xmldb_lock(clicon_handle h, const char *db, int pid);
int xmldb_unlock(clicon_handle h, const char *db);
int xmldb_unlock_all(clicon_handle h, int pid);
int xmldb_islocked(clicon_handle h, char *db);
int xmldb_exists(clicon_handle h, char *db);
int xmldb_delete(clicon_handle h, char *db);
int xmldb_create(clicon_handle h, char *db);
int xmldb_islocked(clicon_handle h, const char *db);
int xmldb_exists(clicon_handle h, const char *db);
int xmldb_delete(clicon_handle h, const char *db);
int xmldb_create(clicon_handle h, const char *db);
#endif /* _CLIXON_XML_DB_H */