|
Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.4.4.5
|
#include <pthread.h>Go to the source code of this file.
Data Structures | |
| struct | syncdbClientHandle_t |
| syncdb Client Handle. More... | |
| struct | syncdbClientStatus_t |
| Client Table Status. More... | |
| struct | syncdbDataTableStatus_t |
| Data Table Status. More... | |
| struct | syncdbJsonNode_s |
| The JSON node definition. More... | |
Macros | |
| #define | SYNCDB_AGENT_MAX_MSG_SIZE 8000 |
| Maximum size of the message buffer between the SyncDB process and the SyncDB Agent. | |
| #define | SYNCDB_DUPNAME (-3) |
| Table exists with duplicate name. | |
| #define | SYNCDB_ENTRY_EXISTS (-9) |
| AVL entry with the specified key already exists. | |
| #define | SYNCDB_ERROR (-1) |
| General Error. | |
| #define | SYNCDB_FULL (-5) |
| Specified table is full. | |
| #define | SYNCDB_JSON_MAX_SCHEMA_SIZE (SYNCDB_RECORD_MAX_SIZE) |
| The schema for storable records is also defined using JSON format. | |
| #define | SYNCDB_MAX_CLIENTS (-2) |
| Reached maximum number of clients. | |
| #define | SYNCDB_MAX_STR_LEN 256 |
| Maximum length for string fields used by syncdb. | |
| #define | SYNCDB_NO_TABLE (-4) |
| Specified table does not exist. | |
| #define | SYNCDB_NOT_FOUND (-7) |
| Specified record is not in the table. | |
| #define | SYNCDB_OK (0) |
| Operation is Successful. | |
| #define | SYNCDB_RECORD_MAX_SIZE (1024*64) |
| Maximum size of a single data record. | |
| #define | SYNCDB_SCHEMA_ERROR (-8) |
| Schema validation error. | |
| #define | SYNCDB_SIZE (-6) |
| Specified record size is invalid for this table. | |
| #define | SYNCDB_TABLE_FLAG_EXISTS (1 << 3) |
| When this flag is set, the syncdbInsert() function returns an error if an entry with the specified key already exists. | |
| #define | SYNCDB_TABLE_FLAG_FILE_LOAD (1 << 2) |
| If this flag is enabled then the syncdb tries to populate the table from a file when creating the table. | |
| #define | SYNCDB_TABLE_FLAG_NSF (1 << 4) |
| When this flag is set, the content of the table is synchronized with the backup manager. | |
| #define | SYNCDB_TABLE_FLAG_NVRAM (1 << 1) |
| This table is copied to NVRAM when the table-store command is received. | |
| #define | SYNCDB_TABLE_FLAG_STORABLE (1 << 0) |
| This table can be stored in a file. | |
| #define | SYNCDB_TABLE_NAME_SIZE 32 |
| Maximum size of the text string that uniquely identifies a database table. | |
| #define | SYNCDB_TABLE_STAT_AVL_TREE_PURGED (1 << 2) |
| AVL Tree Purged (Cleared on Read) This bit indicates that all delete-pending entries have been removed from the AVL tree since the last call to the syncdbTableStatusGet() function. | |
| #define | SYNCDB_TABLE_STAT_CHANGED (1 << 1) |
| Changes pending for this client. | |
| #define | SYNCDB_TABLE_STAT_EXISTS (1 << 0) |
| Specified Table Exist If this bit is not set to 1 then all other bits are meaningless. | |
| #define | SYNCDB_TABLE_STAT_NEW_TABLE (1 << 3) |
| New Table (Cleared on Read) This bit indicates that the syncdbTableStatusGet() function is called for the first time since the table has been created. | |
| #define | SYNCDB_TABLE_TYPE_AVL_TREE 2 |
| #define | SYNCDB_TABLE_TYPE_QUEUE 3 |
| #define | SYNCDB_TABLE_TYPE_RECORD 0 |
| #define | SYNCDB_TABLE_TYPE_STORABLE_RECORD 1 |
Typedefs | |
| typedef struct syncdbJsonNode_s | syncdbJsonNode_t |
| The JSON node definition. | |
Enumerations | |
| enum | syncdbJsonDataType_e { SYNCDB_JSON_NUMBER = 1, SYNCDB_JSON_STRING = 2, SYNCDB_JSON_ARRAY = 3 } |
| The syncdb supports the following JSON data types: SYNCDB_JSON_NUMBER - A numeric value. More... | |
| enum | syncdbSchemaError_e { SYNCDB_SCHEMA_OK = 0, SYNCDB_SCHEMA_TOO_BIG = 1, SYNCDB_SCHEMA_OVERLAP = 2, SYNCDB_SCHEMA_TOO_SHORT = 3, SYNCDB_SCHEMA_GAP = 4, SYNCDB_SCHEMA_INT_OVERFLOW = 5, SYNCDB_SCHEMA_STRING_OVERFLOW = 6, SYNCDB_SCHEMA_INT_SIZE = 7, SYNCDB_SCHEMA_TYPE = 8, SYNCDB_SCHEMA_NO_ZERO_OFFSET = 9, SYNCDB_SCHEMA_ZERO_SIZE = 10, SYNCDB_SCHEMA_DUP_NAME = 11 } |
| The following errors may be reported during schema validation. More... | |
Functions | |
| int | syncdbAvlTableCreate (syncdbClientHandle_t *client_id, char *table_name, unsigned int table_version, unsigned int max_elements, unsigned int max_live_elements, unsigned int node_size, unsigned int key_size, unsigned int flags, char *schema, unsigned int schema_size) |
| Create AVL Table. | |
| int | syncdbClientDeregister (syncdbClientHandle_t *client_id) |
| Deregister a client from the syncdb. | |
| int | syncdbClientRegister (char *client_name, syncdbClientHandle_t *client_id) |
| Register a new client with the syncdb. | |
| int | syncdbClientStatusGet (syncdbClientHandle_t *client_id, syncdbClientStatus_t *client_status) |
| Get client information for the specified client ID. | |
| int | syncdbDelete (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size) |
| Delete an entry from the AVL table. | |
| int | syncdbFieldGet (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size, unsigned int field_offset, unsigned int field_size, int flags_unchanged, int *delete_pending) |
| Get the specified field in an entry from the table. | |
| int | syncdbFieldSet (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size, unsigned int field_offset, unsigned int field_size) |
| Set the specified field in an entry in the table. | |
| int | syncdbGet (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size, int *delete_pending) |
| Get an entry from the table. | |
| int | syncdbGetNext (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size, int *delete_pending) |
| Get the Next entry from the table. | |
| int | syncdbGetNextChanged (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size, int *delete_pending) |
| Get the Next Changed entry from the table. | |
| int | syncdbInsert (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size) |
| Insert a new entry into the AVL table. | |
| int | syncdbNsfModeSet (syncdbClientHandle_t *client_id, unsigned int sync_mode, unsigned int max_msg_size) |
| Tell SyncDB that it should start or stop data sync with the backup manager. | |
| int | syncdbRecordTableCreate (syncdbClientHandle_t *client_id, char *table_name, unsigned int table_version, unsigned int node_size, unsigned int flags, char *schema, unsigned int schema_size) |
| Create a Record Table. | |
| int | syncdbSet (syncdbClientHandle_t *client_id, char *table_name, void *element, unsigned int size) |
| Set an entry in the table. | |
| int | syncdbTableChangeCheck (syncdbClientHandle_t *client_id, int timeout_secs) |
| Check whether any change notifications are pending for this client. | |
| int | syncdbTableChangeNotify (syncdbClientHandle_t *client_id, char *table_name) |
| Notify this client about changes to the specified table. | |
| int | syncdbTableDelete (syncdbClientHandle_t *client_id, char *table_name) |
| Delete specified table or all tables. | |
| int | syncdbTableStatusGet (syncdbClientHandle_t *client_id, int num_tables, syncdbDataTableStatus_t *table_list) |
| Get Table Status as it pertains to the specified client. | |
| int | syncdbTableStore (syncdbClientHandle_t *client_id, char *table_name, unsigned int nvram) |
| Store specified table or all tables into the file system. | |
| int | syncdbUtilSchemaCreate (syncdbJsonNode_t *element_node, unsigned int node_schema_size, char *schema_buf, unsigned int buf_size, unsigned int *schema_size, unsigned int data_element_size, syncdbSchemaError_e *schema_error) |
| Generate a storable record schema. | |