#include "xroad_system.h"
#include "xroad_node_types.h"
#include <cache/xroad_cache.h>
#include <cache/xroad_objects.h>
#include <cache/xroad_storage_fwd.h>
#include <common/xroad_xml.h>
#include <common/xroad_string.h>
#include <common/xroad_aux.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/epoll.h>
Go to the source code of this file.
Classes | |
struct | xroad_node_callback_t |
struct | xroad_node_epoll_callback_t |
struct | xroad_epoll_timestamps |
Macros | |
#define | xroad_node_is_offline() |
#define | xroad_node_find_object(type, fun, ...) |
Functions | |
xroad_errno_t | xroad_node_create (xroad_str_t node_name, uint32_t major_version, uint32_t minor_version, xroad_str_t git_hash, xroad_node_callback_t callback) |
void | xroad_node_destroy (void) |
xroad_errno_t | xroad_node_reconfig (void) |
xroad_xml_doc_t * | xroad_node_get_config (void) |
const xroad_epoll_timestamps * | xroad_node_get_epoll_timestamps (void) |
int32_t | xroad_node_receive (void) |
int32_t | xroad_node_receive_ex (int32_t timeout) |
xroad_errno_t | xroad_node_add_epoll (uint32_t events, xroad_node_epoll_callback_t *cback) |
xroad_errno_t | xroad_node_mod_epoll (uint32_t events, xroad_node_epoll_callback_t *cback) |
xroad_errno_t | xroad_node_del_epoll (xroad_node_epoll_callback_t *cback) |
int32_t | xroad_node_get_epoll_fd (void) |
void * | xroad_node_create_object (xroad_object_type_t type) |
void * | xroad_node_clone_object (const void *obj) |
xroad_errno_t | xroad_node_send_object (void *obj, xroad_node_id_t id) |
xroad_errno_t | xroad_node_route_object (void *obj,...) |
xroad_errno_t | xroad_node_route_object_va (void *obj, va_list ap) |
void * | xroad_node_get_fun (xroad_str_t fname) |
void * | xroad_node_get_object (xroad_object_type_t type, xroad_object_id_t id) |
xroad_lock_by_pid_t * | xroad_node_get_used_lock (void) |
xroad_node_data_t * | xroad_node_get_data (void) |
void | xroad_node_reset_statistic (void) |
xroad_str_t | xroad_node_get_working_dir (void) |
void | xroad_node_set_flags (uint32_t flags) |
int32_t | xroad_node_get_link_descriptor (void) |
xroad_cursor_t * | xroad_node_create_cursor (xroad_object_type_t type) |
void | xroad_node_destroy_cursor (xroad_cursor_t *cursor) |
void * | xroad_node_cursor_get_next (xroad_cursor_t *cursor) |
void * | xroad_node_cursor_get_prev (xroad_cursor_t *cursor) |
void * | xroad_node_cursor_get_first (xroad_cursor_t *cursor) |
void * | xroad_node_cursor_get_last (xroad_cursor_t *cursor) |
void * | xroad_node_cursor_offset (xroad_cursor_t *cursor, int64_t offset) |
xroad_errno_t | xroad_node_clear_cache (xroad_object_type_t type, bool force) |
xroad_cache_t * | xroad_node_get_cache () |
size_t | xroad_node_get_object_count (xroad_object_type_t type) |
const xroad_version_t * | xroad_node_get_version (void) |
bool | xroad_node_is_initialized (void) |
xroad_errno_t | xroad_node_subscribe (xroad_domain_t group, xroad_node_callback_t cback) |
xroad_errno_t | xroad_node_unsubscribe (xroad_domain_t group, xroad_node_callback_t cback) |
xroad_str_t | xroad_node_get_env_param (xroad_str_t param) |
void | xroad_node_renamed () |
#define xroad_node_find_object | ( | type, | |
fun, | |||
... | |||
) |
find object using functor
[in] | type | - object type |
[in] | fun | - functor like bool fun(....) @oaram[in] ... - functor params |
#define xroad_node_is_offline | ( | ) |
xroad_errno_t xroad_node_add_epoll | ( | uint32_t | events, |
xroad_node_epoll_callback_t * | cback | ||
) |
add descriptor to epoll
[in] | events | - fd events |
[in] | cback | - pointer to epoll callback |
xroad_errno_t xroad_node_clear_cache | ( | xroad_object_type_t | type, |
bool | force | ||
) |
clear object cache
[in] | type | - type of objects to clear |
[in] | force | - force clear |
void* xroad_node_clone_object | ( | const void * | obj | ) |
clone object
[in] | obj | - object to clone |
xroad_errno_t xroad_node_create | ( | xroad_str_t | node_name, |
uint32_t | major_version, | ||
uint32_t | minor_version, | ||
xroad_str_t | git_hash, | ||
xroad_node_callback_t | callback | ||
) |
create new node and registers in system
[in] | node_name | - name of new node. Can be NULL. |
[in] | major_version | - marjor version. Override value from xroad_version.c |
[in] | minor_version | - minor version. Override value from xroad_version.c |
[in] | git_hash | - git hash. Override value from xroad_version.c |
[in] | callback | - callback method for objects |
xroad_cursor_t* xroad_node_create_cursor | ( | xroad_object_type_t | type | ) |
create new cache cursor
[in] | type | - type of cursor |
void* xroad_node_create_object | ( | xroad_object_type_t | type | ) |
create new object
[in] | type | - type of object to create |
void* xroad_node_cursor_get_first | ( | xroad_cursor_t * | cursor | ) |
return first object from cache
[in] | cursor | - cache cursor |
void* xroad_node_cursor_get_last | ( | xroad_cursor_t * | cursor | ) |
return last object from cache
[in] | cursor | - cache cursor |
void* xroad_node_cursor_get_next | ( | xroad_cursor_t * | cursor | ) |
return next object from cache
[in] | cursor | - cache cursor |
void* xroad_node_cursor_get_prev | ( | xroad_cursor_t * | cursor | ) |
return previous object from cache
[in] | cursor | - cache cursor |
void* xroad_node_cursor_offset | ( | xroad_cursor_t * | cursor, |
int64_t | offset | ||
) |
offset cursor
[in] | cursor | - cache cursor |
[in] | offset | - offset value. Can be negative for offset back |
xroad_errno_t xroad_node_del_epoll | ( | xroad_node_epoll_callback_t * | cback | ) |
remove descriptor from epoll
[in] | cback | - callback to remove |
void xroad_node_destroy | ( | void | ) |
destroy node and free resources
void xroad_node_destroy_cursor | ( | xroad_cursor_t * | cursor | ) |
destroy cursor
[in] | cursor | - cursor to destroy |
xroad_cache_t* xroad_node_get_cache | ( | ) |
returns pointer to cache
xroad_xml_doc_t* xroad_node_get_config | ( | void | ) |
return pointer to configuration
xroad_node_data_t* xroad_node_get_data | ( | void | ) |
xroad_str_t xroad_node_get_env_param | ( | xroad_str_t | param | ) |
get node environment parameter
[in] | param | - paramenter name |
int32_t xroad_node_get_epoll_fd | ( | void | ) |
return epoll file descriptor
const xroad_epoll_timestamps* xroad_node_get_epoll_timestamps | ( | void | ) |
Returns timestamps associated with epoll
void* xroad_node_get_fun | ( | xroad_str_t | fname | ) |
get function from dll by name
[in] | fname | - name of function |
int32_t xroad_node_get_link_descriptor | ( | void | ) |
return link descriptor. Can be used in epoll
void* xroad_node_get_object | ( | xroad_object_type_t | type, |
xroad_object_id_t | id | ||
) |
return object from cache
[in] | type | - type of object |
[in] | id | - id of object |
size_t xroad_node_get_object_count | ( | xroad_object_type_t | type | ) |
return count of objects of desired type
[in] | type | - type of objects to count |
xroad_lock_by_pid_t* xroad_node_get_used_lock | ( | void | ) |
const xroad_version_t* xroad_node_get_version | ( | void | ) |
return node version
xroad_str_t xroad_node_get_working_dir | ( | void | ) |
get node home dir
bool xroad_node_is_initialized | ( | void | ) |
check if node already created
xroad_errno_t xroad_node_mod_epoll | ( | uint32_t | events, |
xroad_node_epoll_callback_t * | cback | ||
) |
modify events of already added to epoll descriptor
[in] | events | - new fd events |
[in] | cback | - pointer to epoll callback |
int32_t xroad_node_receive | ( | void | ) |
receive and dispatch events
int32_t xroad_node_receive_ex | ( | int32_t | timeout | ) |
receive and dispatch events
[in] | timeout | - wait usecs for received message |
xroad_errno_t xroad_node_reconfig | ( | void | ) |
reconfigure node
void xroad_node_renamed | ( | ) |
must be called when node is renamed
void xroad_node_reset_statistic | ( | void | ) |
reset node statistic
xroad_errno_t xroad_node_route_object | ( | void * | obj, |
... | |||
) |
route object
[in] | obj | - object to send |
xroad_errno_t xroad_node_route_object_va | ( | void * | obj, |
va_list | ap | ||
) |
route object
[in] | obj | - object to send |
[in] | ap | - argument list |
xroad_errno_t xroad_node_send_object | ( | void * | obj, |
xroad_node_id_t | id | ||
) |
send object directly to node
[in] | obj | - object to send |
[in] | id | - id of destination node |
void xroad_node_set_flags | ( | uint32_t | flags | ) |
set node flags
[in] | flags | - new node flags |
xroad_errno_t xroad_node_subscribe | ( | xroad_domain_t | group, |
xroad_node_callback_t | cback | ||
) |
subscribe to objects of concrete group
[in] | domain | - object domain to subscribe |
[in] | cback | - callback |
xroad_errno_t xroad_node_unsubscribe | ( | xroad_domain_t | group, |
xroad_node_callback_t | cback | ||
) |
unsubscribe from group objects
[in] | domain | - object domain to usubscribe |
[in] | cback | - callback |