XROAD
xroad_system.h File Reference
#include "xroad_node_fwd.h"
#include "xroad_node_types.h"
#include <common/xroad_common_types.h>
#include <common/xroad_string.h>
#include <common/xroad_string_decl.h>
#include <stdint.h>
#include <stdbool.h>
#include <signal.h>
Include dependency graph for xroad_system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  xroad_node_statistic_s
 
struct  xroad_posix_queue_params_t
 
struct  xroad_shm_queue_params_t
 
struct  xroad_node_link_t
 
struct  xroad_version_t
 
struct  xroad_node_data_t
 
struct  xroad_system_t
 

Macros

#define __xroad_system_cursor_dtor__   __dtor__(xroad_system_cursor_destructor)
 

Typedefs

typedef struct xroad_system_cursor_s xroad_system_cursor_t
 

Enumerations

enum  xroad_node_status_t {
  xroad_node_status_active = 1 , xroad_node_status_offline = 2 , xroad_node_status_dead = 3 , xroad_node_status_inactive = 4 ,
  xroad_node_status_sleep = 5 , xroad_node_status_deleted = 6
}
 
enum  xroad_node_flag_t {
  xroad_node_flag_stand_alone = 1 , xroad_node_flag_hidden = 2 , xroad_node_flag_memory_locked = 4 , xroad_node_flag_sleep_primary = 8 ,
  xroad_node_flag_sleep_backup = 16 , xroad_node_flag_alarm_disabled = 32 , xroad_node_flag_allow_clone = 64
}
 
enum  xroad_link_type_t { xroad_link_type_posix_queue = 1 , xroad_link_type_shm_queue = 2 }
 
enum  xroad_system_role_t { xroad_system_role_primary = 1 , xroad_system_role_backup = 2 }
 

Functions

xroad_errno_t xroad_system_init (bool out_of_system)
 
xroad_system_txroad_system_get ()
 
xroad_node_data_txroad_system_get_by_name (xroad_str_t name)
 
xroad_node_data_txroad_system_get_by_id (xroad_node_id_t id)
 
xroad_node_data_txroad_system_get_by_pid (pid_t pid)
 
xroad_str_t xroad_system_role_to_str (xroad_system_role_t role)
 
xroad_str_t xroad_node_status_to_str (xroad_node_status_t status)
 
xroad_hash_txroad_system_get_variables (const xroad_node_data_t *ndata)
 
xroad_xml_doc_t * xroad_system_read_config (const xroad_node_data_t *ndata)
 
xroad_system_cursor_t * xroad_system_create_cursor ()
 
void xroad_system_destroy_cursor (xroad_system_cursor_t *cursor)
 
void xroad_system_cursor_destructor (xroad_system_cursor_t **cursor)
 
xroad_node_data_txroad_system_cursor_get_first (xroad_system_cursor_t *cursor)
 
xroad_node_data_txroad_system_cursor_get_next (xroad_system_cursor_t *cursor)
 
xroad_node_data_txroad_system_cursor_get_last (xroad_system_cursor_t *cursor)
 
xroad_node_data_txroad_system_cursor_get_prev (xroad_system_cursor_t *cursor)
 

Detailed Description

Enumeration Type Documentation

◆ xroad_link_type_t

link type

◆ xroad_node_flag_t

node flags

Enumerator
xroad_node_flag_stand_alone 

node is a standalone, i.e. not controlled by init process

xroad_node_flag_hidden 

node is hidden, i.e. not shown by view or WebUI

xroad_node_flag_memory_locked 

node is locked in memory

xroad_node_flag_sleep_primary 

node is sleeping on primary system

xroad_node_flag_sleep_backup 

node is sleeping on backup system

xroad_node_flag_alarm_disabled 

node alarms enabled/disabled

xroad_node_flag_allow_clone 

node allowd to clone/delete/rename

◆ xroad_node_status_t

node status

Enumerator
xroad_node_status_active 

node is active and works

xroad_node_status_offline 

node started, but is not active

xroad_node_status_dead 

node is DEAD, process stopped

xroad_node_status_inactive 

node is working, but inactive

xroad_node_status_sleep 

node is sleeping

xroad_node_status_deleted 

node was deleted

◆ xroad_system_role_t

system role

Function Documentation

◆ xroad_node_status_to_str()

xroad_str_t xroad_node_status_to_str ( xroad_node_status_t  status)

status to string

Parameters
[in]status- status to convert
Returns
string

◆ xroad_system_create_cursor()

xroad_system_cursor_t* xroad_system_create_cursor ( )

create new cursor for node data traversal return new cursor

◆ xroad_system_cursor_get_first()

xroad_node_data_t* xroad_system_cursor_get_first ( xroad_system_cursor_t *  cursor)

get first node data

Parameters
[in]cursor- node data cursor
Returns
first node data

◆ xroad_system_cursor_get_last()

xroad_node_data_t* xroad_system_cursor_get_last ( xroad_system_cursor_t *  cursor)

get last node data

Parameters
[in]cursor- node data cursor
Returns
last node data

◆ xroad_system_cursor_get_next()

xroad_node_data_t* xroad_system_cursor_get_next ( xroad_system_cursor_t *  cursor)

get next node data

Parameters
[in]cursor- node data cursor
Returns
next node data

◆ xroad_system_cursor_get_prev()

xroad_node_data_t* xroad_system_cursor_get_prev ( xroad_system_cursor_t *  cursor)

get previous node data

Parameters
[in]cursor- node data cursor
Returns
previous node data

◆ xroad_system_destroy_cursor()

void xroad_system_destroy_cursor ( xroad_system_cursor_t *  cursor)

destroy cursor

Parameters
[in]cursor- cursor to destroy

◆ xroad_system_get()

xroad_system_t* xroad_system_get ( )

return pointer to created system

Returns
pointer to system

◆ xroad_system_get_by_id()

xroad_node_data_t* xroad_system_get_by_id ( xroad_node_id_t  id)

find node by id

Parameters
[in]id- id of node
Returns
pointer to node data in system, NULL - no such node

◆ xroad_system_get_by_name()

xroad_node_data_t* xroad_system_get_by_name ( xroad_str_t  name)

find node by name

Parameters
[in]name- name of node to find
Returns
pointer to node data in system, NULL - no such node

◆ xroad_system_get_by_pid()

xroad_node_data_t* xroad_system_get_by_pid ( pid_t  pid)

find node by pid

Parameters
[in]pid- pid of node
Returns
pointer to node data in system, NULL - no such node

◆ xroad_system_get_variables()

xroad_hash_t* xroad_system_get_variables ( const xroad_node_data_t ndata)

get environment variables

Parameters
[in]ndata- node data
Returns
hash table with varibles

◆ xroad_system_init()

xroad_errno_t xroad_system_init ( bool  out_of_system)

init system

Parameters
[in]out_of_system- true - process is not a part of system. it only has an access to cache
Returns
XROAD_OK - system has been initialized

◆ xroad_system_read_config()

xroad_xml_doc_t* xroad_system_read_config ( const xroad_node_data_t ndata)

read config file of node

Parameters
[in]ndata- node data
Returns
node config document

◆ xroad_system_role_to_str()

xroad_str_t xroad_system_role_to_str ( xroad_system_role_t  role)

role to string

Parameters
[in]role- role to convert
Returns
string