re-implementation of the serval-dna daemon as a commotiond plugin More...
Go to the source code of this file.
Macros | |
#define | DEFAULT_SID "0000000000000000000000000000000000000000000000000000000000000000" |
#define | DEFAULT_MDP_PATH "/etc/commotion/keys.d/mdp.keyring/serval.keyring" |
#define | DEFAULT_SERVAL_PATH "/var/serval-node" |
#define | PATH_MAX 4096 |
#define | CHECK_ERR(A, M,...) |
#define | CHECK_ERR(A, M,...) |
#define | CLEAR_ERR() err_msg = NULL; |
#define | INS_ERROR() if (err_msg) { CMD_OUTPUT("errors",err_msg); } |
Functions | |
int | co_plugin_register (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
int | co_plugin_init (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
int | co_plugin_name (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
int | co_plugin_shutdown (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
int | serval_socket_cb (co_obj_t *self, co_obj_t *context) |
int | serval_timer_cb (co_obj_t *self, co_obj_t **output, co_obj_t *context) |
int | serval_schema (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
int | serval_daemon_handler (co_obj_t *self, co_obj_t **output, co_obj_t *params) |
Detailed Description
re-implementation of the serval-dna daemon as a commotiond plugin
Macro Definition Documentation
#define CHECK_ERR | ( | A, | |
M, | |||
... | |||
) |
Value:
if(!(A)) { \
ERROR(M, ##__VA_ARGS__); \
if (err_msg == NULL) \
err_msg = co_list16_create(); \
char *msg = NULL; \
int len = snprintf(NULL, 0, M, ##__VA_ARGS__); \
msg = calloc(len + 1,sizeof(char)); \
sprintf(msg, M, ##__VA_ARGS__); \
if (len < UINT8_MAX) { \
co_list_append(err_msg, co_str8_create(msg,len+1,0)); \
co_list_append(err_msg, co_str16_create(msg,len+1,0)); \
co_list_append(err_msg, co_str32_create(msg,len+1,0)); \
} \
free(msg); \
goto error; \
}
int co_list_append(co_obj_t *list, co_obj_t *new_obj)
insert new item at end of list
Definition: list.c:425
until we have nested tree support
#define CHECK_ERR | ( | A, | |
M, | |||
... | |||
) |
Value:
if(!(A)) { \
ERROR(M, ##__VA_ARGS__); \
if (err_msg) \
co_obj_free(err_msg); \
char *msg = NULL; \
int len = snprintf(NULL, 0, M, ##__VA_ARGS__); \
msg = calloc(len + 1,sizeof(char)); \
sprintf(msg, M, ##__VA_ARGS__); \
if (len < UINT8_MAX) { \
err_msg = co_str8_create(msg,len+1,0); \
} else if (len < UINT16_MAX) { \
err_msg = co_str16_create(msg,len+1,0); \
} else if (len < UINT32_MAX) { \
err_msg = co_str32_create(msg,len+1,0); \
} \
free(msg); \
goto error; \
}
until we have nested tree support
Function Documentation
Callback function for when Serval socket has data to read
References co_list_parse().
Referenced by _watch().
Definition: obj.h:131
Definition: socket.h:65
co_obj_t * co_list_parse(co_obj_t *list, co_iter_t iter, void *context)
process list with given iterator function
Definition: list.c:233
Definition: serval-dna.c:60
Generated on Fri Jun 6 2014 13:22:05 for commotiond by 1.8.7