DataSource for C SDK  6.2.20.310828
datasrc.h File Reference

Go to the source code of this file.

Data Structures

struct  _ds5_namespace_s
 Definition of the interface that you should implement if you require custom subject matching logic. More...
 
struct  _ds_data
 A data update object. More...
 
struct  _ds_field
 A field within a data update. More...
 
struct  ds5_connectionlistener_t
 Implement this interface to receive connection status information when using the DSv5 API. More...
 
struct  ds5_dataprovider_t
 Interface that must be implemented in order to receive subscirption request and subscription discard events for DataSource subjects from connected DataSource peers. the implementation sends data to connected peers in response to subscription requests. More...
 
struct  ds5_subscriptionlistener_t
 An implementation of this interface allows applications to receive events raised for a ds5_subscription_t. More...
 
struct  ds_arguments_t
 Structure defining the arguments for Monitoring methods. More...
 
struct  ds_array_t
 The container object for monitoring array types. More...
 
struct  ds_config_enum_t
 Enumerated types structure. More...
 
struct  ds_init_t
 Defines the DataSource initialisation object. More...
 
struct  ds_monauth_t
 Monitoring credentials object. More...
 
struct  ds_monitor_t
 The container object for all monitoring values. More...
 

Macros

#define ds5_namespace_free(nspace)   nspace->free(nspace)
 A convenience macro for invoking the ds5_namespace_t::delete() function on a namespace. More...
 
#define ds5_namespace_match(nspace, subject)   nspace->match(nspace, subject)
 A convenience macro for invoking the ds5_namespace_t::match() function on a namespace. More...
 
#define DS_AND(p1, p2, a)
 Combine two peersets using bitwise and. More...
 
#define DS_AND3_ISZERO(p1, p2, p3)
 Test if the bitwise and of 3 peersets is 0. More...
 
#define DS_AND_ISZERO(p1, p2)
 Test if the bitwise and of 2 peersets is 0. More...
 
#define DS_CACHE_DATASRC
 Peer index of cache datasrc. More...
 
#define DS_CLR(n, p)
 Clears peer n in peerset p. More...
 
#define DS_CONFIG_BOOL   0x0001
 
#define DS_CONFIG_CHAR   0x0005
 
#define DS_CONFIG_CHAR_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_CHAR)
 
#define DS_CONFIG_DEPRECATED   0x0400
 
#define DS_CONFIG_FILE   0x0007
 
#define DS_CONFIG_FLOAT   0x0003
 
#define DS_CONFIG_FLOAT_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_FLOAT)
 
#define DS_CONFIG_FUNC   0x0006
 
#define DS_CONFIG_INT   0x0002
 
#define DS_CONFIG_INT_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_INT)
 
#define DS_CONFIG_STR   0x0004
 
#define DS_CONFIG_STR_ARRAY   (DS_CONFIG_ARRAY|DS_CONFIG_STR)
 
#define DS_CONFIG_STRICT   0x0200
 
#define DS_CONTAINER_TYPE   228
 Define the container data type. More...
 
#define DS_FIELDS_NOT_DEFINED
 Value returned by field API functions when a field is not defined. More...
 
#define DS_FIELDS_SEPARATOR
 Defines the separator between multiple type 2/type 3 or permission row updates within a single packet. More...
 
#define DS_GENERIC_TYPE   231
 Define the generic object data type. More...
 
#define DS_INITIALISER
 Default initialiser for the ds_init_t object. More...
 
#define DS_INTERNAL_DATASRC
 Peer index of internal datasrc. More...
 
#define DS_ISEQUAL(p1, p2)
 Test if 2 peersets are equal. More...
 
#define DS_ISSET(n, p)
 Tests whether peer n in peerset p. More...
 
#define DS_ISZERO(p)
 Checks if all peers in peerset p are cleared. More...
 
#define DS_LOG_CONFIG   0
 Used for log messages that indicate a problem or feedback with library configuration. More...
 
#define DS_LOG_CRIT   2
 Used for log messages that indicate a serious failure. More...
 
#define DS_LOG_DEBUG   7
 Used for tracing messages. More...
 
#define DS_LOG_ERROR   3
 Used for log messages that indicate a problem. More...
 
#define DS_LOG_FINER   8
 Used for fairly detailed tracing messages. More...
 
#define DS_LOG_FINEST   9
 Used for the most finely detailed tracing messages. More...
 
#define DS_LOG_INFO   6
 Used for informational messages. More...
 
#define DS_LOG_MONITOR   128
 A modifier that will send the log message to the monitoring system in addition to the event log, even if the log level is below the monitoring threshold value. More...
 
#define DS_LOG_NOTIFY   4
 Used for messages of greater importance than DS_LOG_WARN that may not indicate problems. More...
 
#define DS_LOG_SYSLOG   512
 A modifier which will write the log message to the system log in addition to the event log. More...
 
#define DS_LOG_TERMINAL   256
 A modifier which will write the log message to the terminal in addition to the event log. More...
 
#define DS_LOG_WARN   5
 Used for messages that indicate a potential problem. More...
 
#define DS_MAX_PEERS
 Maximum number of peers. More...
 
#define DS_MIN_PEER
 Minimum index for configured peer. More...
 
#define DS_MSG_CONNECT   0x0100
 Defines the connect message type. More...
 
#define DS_MSG_DISCONNECT   0x0200
 Defines the disconnect message type. More...
 
#define DS_NEWS_TYPE   223
 Define the news headline data type. More...
 
#define DS_NONZERO(p)
 Sets all peers in peerset p. More...
 
#define DS_OFFSET(t, m)
 
#define DS_OR(p1, p2, o)
 Combine two peersets using bitwise or. More...
 
#define DS_PAGE_TYPE   221
 Define the page data type. More...
 
#define DS_PERMISSION_TYPE   230
 Define the permission data type. More...
 
#define DS_RECORD_TYPE   222
 Define the record data type. More...
 
#define DS_RECORD_TYPE2   225
 Define the type 2 record (market depth) data type. More...
 
#define DS_RECORD_TYPE3   226
 Define the type 3 record (history) data type. More...
 
#define DS_REQUEST_CACHE
 Flag indicating that this request is a result of a request from the active cache. More...
 
#define DS_REQUEST_FAILOVER
 Flag indicated that this request is as a result of a failover between peers. More...
 
#define DS_SET(n, p)
 Sets peer n in peerset p. More...
 
#define DS_SIGNATURE_ALREADY_USED
 KeyMaster token has already been used. More...
 
#define DS_SIGNATURE_INVALID_TOKEN
 KeyMaster token was invalid. More...
 
#define DS_SIGNATURE_OK
 KeyMaster token was validated correctly. More...
 
#define DS_SIGNATURE_UNKNOWN_KEYID
 Unknown key-id supplied to function. More...
 
#define DS_STORY_TYPE   224
 Define the news story data type. More...
 
#define DS_T_ACTIVE
 Defines the active source peer type, which can accept requests for objects. This flag could be set on the DataSource initialisation object ds_init_t or set in the add-peer sections of a configuration file. More...
 
#define DS_T_CONTRIB
 Defines the contribution peer type. This source should automatically receive data updates for objects that it has updated itself. This flag could be set on the DataSource initialisation object ds_init_t or set in the add-peer sections of a configuration file. More...
 
#define DS_ZERO(p)
 Unsets all peers in peerset p. More...
 
#define F_AUTHGLOBAL   0x0100
 Indicates that this update for an object (initially permission objects only) should be passed up to the auth module. More...
 
#define F_AUTHUPDATE   0x4000
 This news update contains permissioning information. More...
 
#define F_CHANGE_HEADLINE   0x0200
 Change the headline associated with the story code in this update to the headline contained in this update. More...
 
#define F_CHANGEDFIELDS   0x8000
 Tells the liberator to only send on any changed fields. This tells the liberator compare this update with the cached data and only send on any changed fields to any subscribers. See the Liberator Admin Guide for details. More...
 
#define F_CLEAR_PERM   0x0400
 Clear all permission keys for this update's symbolname. More...
 
#define F_CLEAR_TYPE2   0x0400
 Clear all record type 2 entries for this update's symbolname. More...
 
#define F_CLEAR_TYPE3   0x0100
 Clear all record type 3 entries this update's symbolname. More...
 
#define F_CONSTITUENT_NOAUTH   0x4000
 The constituents in this container should noe be subject to permissioning. More...
 
#define F_CREATEOBJECT   0x0010
 Create this object if it doesn't exist. More...
 
#define F_CREATEPARENT   0x0020
 Create the parent directory if it doesn't exist. More...
 
#define F_DELETE_HEADLINE   0x0100
 Delete the headline associated with the story code in this update. More...
 
#define F_DELETEOBJECT   0x0004
 Instruction to delete this object. More...
 
#define F_FILTER_PERM   0x0800
 Clears a permission key with the same value as the key fields present within this update. More...
 
#define F_FILTER_TYPE2   0x0800
 Clears type 2 entries with the same value as the first field in this update. More...
 
#define F_FILTER_TYPE3   0x0200
 Clears a type 3 entries with the same value as the first field in this update. More...
 
#define F_IGNOREREQTIMEOUT   0x0008
 Allow nodata to be propagated. More...
 
#define F_IMAGE   0x1000
 This update is an image not a live update. All fields will be replaced by this update. More...
 
#define F_NOCACHE   0x0400
 Do not cache this update - pass directly through to client. More...
 
#define F_NOCONNECT
 Suppresses the automatic connection to DataSource peers on startup. The connection can then be made later using ds_set_status_up(). More...
 
#define F_NONACTIVE   0x2000
 This object is not active, even if the DataSource is. For information on active data sources,. More...
 
#define F_NOTFOUND   0x0001
 The object is not found. More...
 
#define F_READDENY   0x0002
 You do not have permission to read this object. More...
 
#define F_RECVAUTOREPLAY
 Defines the Receive Auto Replay peer flag (indicating that, when restarting, this peer should accept replay updates). More...
 
#define F_SENDFROMSEQ
 Defines the Send From Sequence peer flag (indicating that, when reconnecting, missed packets should be requested based on the last sequence number). More...
 
#define F_UNAVAILABLE   0x0005
 The object is unavailable at this time. More...
 
#define F_WRITEDENY   0x0003
 You do not have permission to write to this object. More...
 
#define INVALID_SOCKET   -1
 A constant representing an invalid socket. More...
 
#define NEWS_AUTHSTR_FIELDNUM   5
 Definition of the authorisation string field number. More...
 
#define NEWS_COMPANY_CODE_FIELDNUM   102
 Definition of the company code field number. More...
 
#define NEWS_DATETIME_FIELDNUM   2
 Definition of the date time field number. More...
 
#define NEWS_HEADLINE_FIELDNUM   0
 Definition of the headline field number. More...
 
#define NEWS_PRODUCT_CODE_FIELDNUM   100
 Definition of the product code field number. More...
 
#define NEWS_STORYCODE_FIELDNUM   1
 Definition of the storycode field number. More...
 
#define NEWS_TOPIC_CODE_FIELDNUM   101
 Definition of the topic code field number. More...
 
#define NEWS_USER_CODE_FIELDNUM   200
 Definition of the user code starting field number. More...
 
#define NEWS_USER_CODE_MAX   10
 Maximum number of user codes. More...
 
#define OBJ_STATUS_INFO   0x0000
 Status information message only. More...
 
#define OBJ_STATUS_LIMITED   0x0008
 The status of an object is limited. More...
 
#define OBJ_STATUS_OK   0x0001
 The status of an object is OK. More...
 
#define OBJ_STATUS_STALE   0x0002
 The status of an object is Stale. More...
 
#define S_FAILOVER   0x1101 /* Failover implies S_STALE|S_UPDCLR */
 Indicates the object may not be receiving updates any more. More...
 
#define S_INFO   0x0000
 This is an information only status message. More...
 
#define S_NOTSTALE   0x0004
 This indicates that an object is no longer stale and is receiving updates again. More...
 
#define S_STALE   0x0001
 This indicates the object may not be receiving updates any more. More...
 
#define S_UPDCLR   0x0100
 This indicates an update to this object should clear the previously-sent S_STALE or S_NOTSTALE message. More...
 
#define SOCKET_ERROR   -1
 A constant representing an error on a socket. More...
 
#define SVC_STATUS_DOWN   0x0002
 The status of a data service is down. More...
 
#define SVC_STATUS_LIMITED   0x0008
 The status of a data service is limited. More...
 
#define SVC_STATUS_OK   0x0001
 The status of a data service is OK. More...
 
#define TYPE_ACTIVE   64
 Indicates whether the datatype is "active". More...
 
#define TYPE_ACTIVE2   128
 Indicates whether the active type isn't a callback. More...
 
#define TYPE_ARRAY   32
 Indicates whether the datatype is an array. More...
 
#define TYPE_BINARY   1
 Binary property type. More...
 
#define TYPE_BOOLEAN   11
 Boolean property type. More...
 
#define TYPE_DOUBLE   9
 Double property type. More...
 
#define TYPE_HIERARCHY   1024
 Indicates whether this data forms part of a heirarchy. More...
 
#define TYPE_KEY   512
 Indicates whether this datatype forms part of the primary key. More...
 
#define TYPE_LLONG   7
 Long long property type. More...
 
#define TYPE_LONG   5
 Long property type. More...
 
#define TYPE_METHOD   256
 Indicates whether this datatype is a method. More...
 
#define TYPE_NONE   0
 A place marker. More...
 
#define TYPE_OPTIONAL   2048
 
#define TYPE_PRIMITIVE_MASK   31
 Mask to isolate the primitive data type. More...
 
#define TYPE_RELATION   20
 Indicates that the property is a relation. More...
 
#define TYPE_SHORT   3
 Short property type. More...
 
#define TYPE_STRING   2
 String property type. More...
 
#define TYPE_SUBSCRIPTION   21
 Indicates that the property is a subscription list. More...
 
#define TYPE_TIMESTAMP   10
 Timestamp property type. More...
 
#define TYPE_ULLONG   8
 Unsigned long long property type. More...
 
#define TYPE_ULONG   6
 Unsigned long property type. More...
 
#define TYPE_USHORT   4
 Unsigned short property type. More...
 

Typedefs

typedef struct _ds5_namespace_s ds5_namespace_t
 Typedef to the definition of the interface for defining DataSource namespaces. More...
 
typedef struct _ds5_publisher_s ds5_publisher_t
 Represents a data publisher that publishers to remote DataSource peers on behalf of a ds5_dataprovider_t. More...
 
typedef struct _ds5_subscription_s ds5_subscription_t
 Represents a subscription to a DataSource subject (see ds_create_active_subscription()) or to a namespace of DataSource subjects (See ds_create_broadcast_subscription()). More...
 
typedef struct _config_ctx ds_config_ctx_t
 The configuration context data type. More...
 
typedef void(* ds_config_func) (char *name, int num, char **values)
 Definition of function type used for configuration callbacks. More...
 
typedef void(* ds_delay_send_cb) (void *context, ds_data_t *dsdata)
 Definition of the callback for sending delayed data. More...
 
typedef struct _ds_delay ds_delay_t
 The delay channel object type. More...
 
typedef struct _ds_io_event ds_except_event_t
 Opaque type defining an exception event. More...
 
typedef struct _ds_io_event ds_generic_event_t
 Opaque type defining a generic read/write event. More...
 
typedef int(* ds_io_event_cb) (sock_t sock, int val, void *data)
 Definition of the callback for use with read and write events. More...
 
typedef struct _ds_log ds_log_t
 The log file object. More...
 
typedef void(* ds_logcycled_t) (ds_log_t *log)
 Callback used when the log has cycled. More...
 
typedef void(* ds_loglevelchange_t) (ds_log_t *log, int new_level)
 Callback used when the logging level of a log file is changed. More...
 
typedef ds_monitor_t *(* ds_monitor_active_cb) (char *templatename, char *key, char *propertyname)
 Definition of the function type used for active request callbacks. More...
 
typedef int(* ds_monitor_authenticator_t) (ds_monauth_t *credentials)
 Definition of the function type used for monitoring authentication callback. More...
 
typedef ds_monitor_t *(* ds_monitor_method_cb) (char *templatename, char *key, char *property, int argc, char *argv[])
 Definition of the function type used for method calls. More...
 
typedef struct _ds_io_event ds_read_event_t
 Opaque type defining a read event. More...
 
typedef struct _ds_peer_set ds_set_t
 Defines a set of DataSource peers. More...
 
typedef int(* ds_timed_event_cb) (int id, int val, void *data)
 Definition of the callback for use with timed events. More...
 
typedef struct _ds_timed_event ds_timed_event_t
 Opaque type defining a timed event. More...
 
typedef int(* ds_udp_event_cb) (int argc, char *argv[], int val, void *data)
 Definition of the callback for use with udp events. More...
 
typedef struct _ds_udp_event ds_udp_event_t
 Opaque type defining a udp event. More...
 
typedef struct _ds_io_event ds_write_event_t
 Opaque type defining a write event. More...
 
typedef void(* recv_discard_t) (int peer, int count, char **subjects, unsigned short flags)
 Definition of the function type used for handling data discard requests. More...
 
typedef void(* recv_map_t) (int peer, char *from, char *to)
 Definition of the function type used for handling map messages. More...
 
typedef void(* recv_nodata_t) (int peer, char *subject, unsigned short flags)
 Definition of the function type used for receiving "nodata" messages. More...
 
typedef void(* recv_object_status_t) (int peer, char *subject, int status, unsigned short code, char *msgstr)
 Definition of the function type used for handling objectstatus messages. More...
 
typedef void(* recv_peer_status_t) (int peer, int status, int val, void *data)
 Definition of the function type used for receiving peer status messages. More...
 
typedef void(* recv_replay_t) (int peer, ds_data_t *pkt, time_t tm)
 Definition of the function type used for receiving updates from a the DataSource library when calling the various replay functions. More...
 
typedef void(* recv_request_t) (int peer, int count, char **subjects, unsigned short flags)
 Definition of the function type used for handling data requests. More...
 
typedef void(* recv_service_status_t) (char *service, int status)
 Definition of the function type used for handling service status messages. More...
 
typedef void(* recv_update_t) (int peer, ds_data_t *pkt)
 Definition of the function type used for receiving updates from a DataSource peer. More...
 
typedef int sock_t
 The network socket datatype. More...
 

Functions

DATASRCAPI void ds5_add_connectionlistener (ds5_connectionlistener_t *connection_listener, void *context)
 Adds a connection listener. The listener receives status events about the state of the DataSource application's connection to other peers. More...
 
DATASRCAPI void ds5_config_init (const char *configfile, int argc, char **argv)
 Sets up the configuration of the DataSource. More...
 
DATASRCAPI ds5_publisher_tds5_create_active_publisher (ds5_namespace_t *nspace, ds5_dataprovider_t *provider, void *context)
 Creates a data publisher that for a given subject sends multiple subscription requests and a single subscription discard to a ds5_dataprovider_t. More...
 
DATASRCAPI ds5_subscription_tds5_create_active_subscription (const char *subject, ds5_subscriptionlistener_t *listener, void *context)
 Create a subscription that matches a single subject. More...
 
DATASRCAPI ds5_publisher_tds5_create_broadcast_publisher (ds5_namespace_t *nspace)
 Creates a data publisher that allows a DataSource application to broadcast updates to remote DataSource peers regardless of whether they have requested (subscribed to) the subject. More...
 
DATASRCAPI ds5_subscription_tds5_create_broadcast_subscription (ds5_namespace_t *nspace, ds5_subscriptionlistener_t *listener, void *context)
 Create a subscription that matches multiple subjects. More...
 
DATASRCAPI ds5_publisher_tds5_create_compatibility_publisher (ds5_namespace_t *nspace, ds5_dataprovider_t *provider, void *context)
 Creates a data publisher that, for a given subject sends multiple subscription requests and multiple subscription discards to a ds5_dataprovider_t. More...
 
DATASRCAPI ds5_namespace_tds5_create_globbed_namespace (const char *globbed)
 Creates a DataSource namespace which will match subject names using globbing. More...
 
DATASRCAPI ds5_namespace_tds5_create_prefix_namespace (const char *prefix)
 Creates a DataSource namespace which will match subject names based on their prefix. More...
 
DATASRCAPI ds5_namespace_tds5_create_regex_namespace (const char *expr)
 Creates a DataSource namespace which will match subject names using a regular expression. More...
 
DATASRCAPI int ds5_init (int argc, char **argv)
 Parses the DataSource configuration files and initialises the DataSource library. The configuration is that supplied in the configuration file passed to ds5_config_init() with the addition of any configureation items supplied within argv. More...
 
DATASRCAPI void ds5_publish_response (ds5_publisher_t *pub, ds_data_t *dsdata)
 Publish an initial response (for example, an image of the subject's data) following a request for a subscription request from a peer. More...
 
DATASRCAPI void ds5_publish_response_no_free (ds5_publisher_t *pub, ds_data_t *dsdata)
 Publish an initial response (for example, an image of the subject's data) following a request for a subscription request from a peer. The response will not be freed. More...
 
DATASRCAPI void ds5_publish_status (ds5_publisher_t *pub, const char *subject, int status, const char *message)
 Publishes a subscription status event for a subject. More...
 
DATASRCAPI void ds5_publish_subject_error (ds5_publisher_t *publisher, const char *subject, int flags)
 Publishes a subscription error event for a subject. More...
 
DATASRCAPI void ds5_publish_subject_map (ds5_publisher_t *publisher, const char *subject, const char *mapped_to, int flags)
 Publishes a subscription map event for a subject. More...
 
DATASRCAPI void ds5_publish_to_peer (ds5_publisher_t *publisher, int peernum, ds_data_t *dsdata)
 Publish an update for a subject to the specified peer. More...
 
DATASRCAPI void ds5_publish_to_peer_no_free (ds5_publisher_t *publisher, int peernum, ds_data_t *dsdata)
 Publish an update for a subject to the specified peer. The update will not be freed. More...
 
DATASRCAPI void ds5_publish_to_subscribed_peers (ds5_publisher_t *pub, ds_data_t *dsdata)
 Publish an update for a subject to all peers that have subscribed. More...
 
DATASRCAPI void ds5_publish_to_subscribed_peers_no_free (ds5_publisher_t *pub, ds_data_t *dsdata)
 Publish an update for a subject to all peers that have subscribed. The update will not be freed. More...
 
DATASRCAPI int ds5_regex_namespace_add_expr (ds5_namespace_t *nspace, const char *expr, int exclude)
 Adds a regular expression to a namespace. More...
 
DATASRCAPI void ds5_unsubscribe (ds5_subscription_t *sub)
 Unsubscribe from the DataSource subject or namespace of DataSource subjects. More...
 
DATASRCAPI sock_t ds_accept_socket (sock_t fd)
 Accepts a connection from a listen socket. More...
 
DATASRCAPI void ds_add_binary (ds_data_t *data, int32_t fieldnum, char *value, int len, char type)
 Adds a binary value to a data object. More...
 
DATASRCAPI void ds_add_binary_float32 (ds_data_t *data, int32_t fieldnum, float value)
 Add a value to a data object in the form of a floating point number. More...
 
DATASRCAPI void ds_add_binary_float64 (ds_data_t *data, int32_t fieldnum, double value)
 Add a value to a data object in the form of a floating point number. More...
 
DATASRCAPI void ds_add_binary_int16 (ds_data_t *data, int32_t fieldnum, int16_t value)
 Add a value to a data object in the form of a 16 bit integer. More...
 
DATASRCAPI void ds_add_binary_int32 (ds_data_t *data, int32_t fieldnum, int32_t value)
 Add a value to a data object in the form of a 32 bit integer. More...
 
DATASRCAPI void ds_add_binary_int64 (ds_data_t *data, int32_t fieldnum, int64_t value)
 Add a value to a data object in the form of a 64 bit integer. More...
 
DATASRCAPI void ds_add_binary_int8 (ds_data_t *data, int32_t fieldnum, int8_t value)
 Add a value to a data object in the form of an 8 bit integer. More...
 
DATASRCAPI void ds_add_binary_opaque (ds_data_t *data, int32_t fieldnum, char *value, int len)
 Add a value to a data object in the form of an opaque value. More...
 
DATASRCAPI void ds_add_binary_string (ds_data_t *data, int32_t fieldnum, char *value)
 Add a value to a data object in the form of a string. More...
 
DATASRCAPI void ds_add_binary_time (ds_data_t *data, int32_t fieldnum, time_t value)
 Add a value to a data object in the form of a timestamp. More...
 
DATASRCAPI void ds_add_binary_time_millis (ds_data_t *data, int32_t fieldnum, int64_t value)
 Add a value to a data object in the form of a timestamp. More...
 
DATASRCAPI void ds_add_binary_timeval (ds_data_t *data, int32_t fieldnum, struct timeval value)
 Add a value to a data object in the form of a timestamp. More...
 
DATASRCAPI void ds_add_binary_uint16 (ds_data_t *data, int32_t fieldnum, uint16_t value)
 Add a value to a data object in the form of an unsigned 16 bit integer. More...
 
DATASRCAPI void ds_add_binary_uint32 (ds_data_t *data, int32_t fieldnum, uint32_t value)
 Add a value to a data object in the form of an unsigned 32 bit integer. More...
 
DATASRCAPI void ds_add_binary_uint64 (ds_data_t *data, int32_t fieldnum, uint64_t value)
 Add a value to a data object in the form of an unsigned 64 bit integer. More...
 
DATASRCAPI void ds_add_binary_uint8 (ds_data_t *data, int32_t fieldnum, uint8_t value)
 Add a value to a data object in the form of an unsigned 8 bit integer. More...
 
DATASRCAPI void ds_add_container_symbol (ds_data_t *data, const char *symbol)
 Add an object to the container. More...
 
DATASRCAPI void ds_add_container_symbol_and_request (ds_data_t *data, const char *symbol, const int request)
 Add an object to the container, indicating whether it should then be requested. More...
 
DATASRCAPI void ds_add_container_symbol_at_position (ds_data_t *data, int position, const char *symbol)
 Insert an object within a container at a particular position. More...
 
DATASRCAPI void ds_add_data (ds_data_t *data, int32_t fieldnum, const char *value)
 Adds a string value to a data object. More...
 
DATASRCAPI void ds_add_data_char (ds_data_t *data, int32_t fieldnum, char value)
 Add a value to a data object in the form of a character. More...
 
DATASRCAPI void ds_add_data_float32 (ds_data_t *data, int32_t fieldnum, float value)
 Add a value to a data object in the form of a floating point number. More...
 
DATASRCAPI void ds_add_data_float64 (ds_data_t *data, int32_t fieldnum, double value)
 Add a value to a data object in the form of a floating point number. More...
 
DATASRCAPI void ds_add_data_fmt (ds_data_t *data, int32_t fieldnum, const char *fmt,...)
 Add a sprintf style format string to a data object. More...
 
DATASRCAPI void ds_add_data_int16 (ds_data_t *data, int32_t fieldnum, int16_t value)
 Add a value to a data object in the form of a 16 bit integer. More...
 
DATASRCAPI void ds_add_data_int32 (ds_data_t *data, int32_t fieldnum, int32_t value)
 Add a value to a data object in the form of a 32 bit integer. More...
 
DATASRCAPI void ds_add_data_int64 (ds_data_t *data, int32_t fieldnum, int64_t value)
 Add a value to a data object in the form of a 64 bit integer. More...
 
DATASRCAPI void ds_add_data_int8 (ds_data_t *data, int32_t fieldnum, int8_t value)
 Add a value to a data object in the form of an 8 bit integer. More...
 
DATASRCAPI void ds_add_data_str (ds_data_t *data, int32_t fieldnum, const char *value)
 Adds a string value to a data object. More...
 
DATASRCAPI ds_except_event_tds_add_except_event (sock_t fd, ds_io_event_cb cb, int val, void *data)
 Add a socket exception event. More...
 
DATASRCAPI void ds_add_latency_chain (ds_data_t *dsdata, char suffix, int64_t millis)
 function used to add a measurement point to latency chain data More...
 
DATASRCAPI void ds_add_latency_chain2 (ds_data_t *dsdata, char suffix, int64_t millis, char suffix2, int64_t millis2)
 function used to add two measurement points to latency chain data More...
 
DATASRCAPI void ds_add_news_authstr (ds_data_t *data, const char *authstr)
 Add an authorisation string to the news headline message. More...
 
DATASRCAPI void ds_add_news_company_code (ds_data_t *data, const char *code)
 Add a company code to the news headline message. More...
 
DATASRCAPI void ds_add_news_datetime (ds_data_t *data, const char *datestr)
 Add a date stamp to the news headline message. More...
 
DATASRCAPI void ds_add_news_field (ds_data_t *dsdata, const char *fieldname, const char *value)
 Add a custom field to a news headline message. More...
 
DATASRCAPI void ds_add_news_headline (ds_data_t *data, const char *headline)
 Add a news headline to the news headline message. More...
 
DATASRCAPI void ds_add_news_product_code (ds_data_t *data, const char *code)
 Add a product code to the news headline message. More...
 
DATASRCAPI void ds_add_news_storycode (ds_data_t *data, const char *story)
 Add a story code to the news object. More...
 
DATASRCAPI void ds_add_news_topic_code (ds_data_t *data, const char *code)
 Add a topic code to the news headline message. More...
 
DATASRCAPI void ds_add_news_user_code (ds_data_t *data, int codenum, const char *code)
 Add a user defined code to the news headline message. More...
 
DATASRCAPI void ds_add_page_field (ds_data_t *data, int32_t fieldnum, const char *value)
 Add an arbitrary field to a page. More...
 
DATASRCAPI void ds_add_page_field_by_name (ds_data_t *data, const char *field, const char *value)
 Add an arbitrary field to a page. More...
 
DATASRCAPI void ds_add_page_row (ds_data_t *data, int row, int col, const char *str)
 Add a row of data to a page data object. More...
 
DATASRCAPI ds_timed_event_tds_add_periodic_event (int starttime, int period, int id, ds_timed_event_cb cb, int val, void *data)
 Add a timed event, starting at a particular time. More...
 
DATASRCAPI ds_timed_event_tds_add_periodic_event_from_time (time_t then, int starttime, int period, int id, ds_timed_event_cb cb, int val, void *data)
 Add a timed event, starting at a particular offset from a given time. More...
 
DATASRCAPI void ds_add_permission_key (ds_data_t *data, const char *key)
 Set the key for a permission object. Must be called either first, or immediately after inserting a seperator. More...
 
DATASRCAPI ds_read_event_tds_add_read_event (sock_t fd, ds_io_event_cb cb, int val, void *data)
 Add a socket read event. More...
 
DATASRCAPI int32_t ds_add_record_char (ds_data_t *data, const char *field, char value)
 Add a character value to a record object. More...
 
DATASRCAPI int32_t ds_add_record_float (ds_data_t *data, const char *field, double value)
 Add a floating point value to a record object. More...
 
DATASRCAPI int32_t ds_add_record_fmt (ds_data_t *data, const char *field, const char *fmt,...)
 Add a formatted string to a record object. More...
 
DATASRCAPI int32_t ds_add_record_int (ds_data_t *data, const char *field, int value)
 Add an integer value to a record object. More...
 
DATASRCAPI int32_t ds_add_record_str (ds_data_t *data, const char *field, const char *value)
 Add a string value to a record object. More...
 
DATASRCAPI ds_timed_event_tds_add_timed_event (int id, double delay, ds_timed_event_cb cb, int val, void *data)
 Add a timed event. More...
 
DATASRCAPI ds_udp_event_tds_add_udp_event (const char *command, ds_udp_event_cb cb, int val, void *data)
 Add a udp event. More...
 
DATASRCAPI ds_write_event_tds_add_write_event (sock_t fd, ds_io_event_cb cb, int val, void *data)
 Add a socket write event. More...
 
DATASRCAPI void ds_and (ds_set_t *p1, ds_set_t *p2, ds_set_t *a)
 Combine 2 peersets using bitwise and. More...
 
DATASRCAPI int ds_and3_iszero (ds_set_t *p1, ds_set_t *p2, ds_set_t *p3)
 Check if the bitwise and of 3 peer sets is 0. More...
 
DATASRCAPI int ds_and_iszero (ds_set_t *p1, ds_set_t *p2)
 Check if the bitwise and of 2 peer sets is 0. More...
 
DATASRCAPI void ds_cache_add_object (char *subject)
 Add a new object to the cache. More...
 
DATASRCAPI int ds_check_periodic_event (int period, ds_timed_event_t **tev)
 Check a periodic to ensure that it runs at the appropriate time regardless of summertime. More...
 
DATASRCAPI int ds_check_subnet (const char *s_address, const char *s_network, const char *s_netmask)
 Check whether an address falls into a given network and netmask. More...
 
DATASRCAPI void ds_cleardown_container_with_prefix (ds_data_t *data, const char *prefix)
 Remove a set of symbols from the container. More...
 
DATASRCAPI sock_t ds_client_socket (const char *serv, unsigned short port)
 Creates a client socket with which to connect to a host. More...
 
DATASRCAPI sock_t ds_client_socket_nonblocking (const char *serv, unsigned short port)
 Creates a client socket with which to connect to a host. More...
 
DATASRCAPI ds_data_tds_clone_data (ds_data_t *data)
 Create a clone of a data object. More...
 
DATASRCAPI void ds_config_add_array_option (const char *longopt, const char *help, int type, void *value, int *num)
 Adds a configuration option to the current configuration context. More...
 
DATASRCAPI void ds_config_add_array_option_enum (const char *longopt, const char *help, int type, void *value, int *num, ds_config_enum_t *enums)
 Add an enumerated option to the configuration context. More...
 
DATASRCAPI void ds_config_add_bounded_array_option (const char *longopt, const char *help, int type, void *value, int *num, void *min, void *max)
 Adds a configuration option to the current configuration context. More...
 
DATASRCAPI void ds_config_add_bounded_array_option_enum (const char *longopt, const char *help, int type, void *value, int *num, ds_config_enum_t *enums, void *min, void *max)
 Add an enumerated option to the configuration context. More...
 
DATASRCAPI void ds_config_add_bounded_option (char sopt, const char *longopt, const char *help, int type, void *value, void *min, void *max)
 Add a bounded configuration option to the current configuration context. More...
 
DATASRCAPI void ds_config_add_bounded_option_enum (char sopt, const char *longopt, const char *help, int type, void *value, ds_config_enum_t *enums, void *min, void *max)
 Add an enumerated option to the configuration context. More...
 
DATASRCAPI void DATASRCAPI void DATASRCAPI void ds_config_add_error_message (const char *msg)
 Add a configuration error to the logfile. More...
 
DATASRCAPI void ds_config_add_file (const char *file)
 Add a mandatory configuration file to the current configuration context. More...
 
DATASRCAPI void ds_config_add_group (const char *longopt, const char *help, void *base, void *def, size_t size, int *num)
 Add a configuration group to the current configuration context. More...
 
DATASRCAPI void ds_config_add_group_with_info (const char *longopt, const char *help, void *base, void *def, size_t size, int *num, int file_offset, int line_offset)
 Add a configuration group to the current configuration context. More...
 
DATASRCAPI void ds_config_add_option (char opt, const char *longopt, const char *help, int type, void *value)
 Add a configuration option to the current configuration context. More...
 
DATASRCAPI void ds_config_add_option_enum (char opt, const char *longopt, const char *help, int type, void *value, ds_config_enum_t *enums)
 Add an enumerated option to the configuration context. More...
 
DATASRCAPI void ds_config_add_optional_file (const char *file)
 Add an optional configuration file to the current configuration context. More...
 
DATASRCAPI void ds_config_add_search (const char *path)
 Add a directory in which to search for configuration files. More...
 
DATASRCAPI void ds_config_add_section (const char *longopt, const char *help)
 Adds a new configuration section to the current configuration context. More...
 
DATASRCAPI void ds_config_del_option (const char *longopt)
 Remove an option from the current configuration context. More...
 
DATASRCAPI void ds_config_del_test (const char *tag)
 Delete a conditional test. More...
 
DATASRCAPI void ds_config_end_group (const char *longopt, const char *help)
 Ends a configuration group. More...
 
DATASRCAPI void ds_config_end_section (const char *longopt, const char *help)
 Ends a configuration section. More...
 
DATASRCAPI void ds_config_free_ctx (ds_config_ctx_t *ctx)
 Free a configuration context. More...
 
DATASRCAPI int ds_config_get_enum (const char *value, ds_config_enum_t *enums)
 Get the value of an enumerated member. More...
 
DATASRCAPI char * ds_config_get_filename ()
 Return the current line number being parsed in the configuration file. More...
 
DATASRCAPI int ds_config_get_linenumber ()
 Return the name of current configuration file being parsed. More...
 
DATASRCAPI void ds_config_init (const char *file, int argc, char **argv)
 Set up the configuration of the DataSource. More...
 
DATASRCAPI void ds_config_list_options ()
 Print the options in the current configuration context to standard output. More...
 
DATASRCAPI void ds_config_list_values ()
 Print the options and values in the current configuration context to standard output. More...
 
DATASRCAPI ds_config_ctx_tds_config_new_ctx ()
 Create a new configuration context. More...
 
DATASRCAPI void ds_config_parse_args (int argc, char **argv, int *retargc)
 Parse the configuration options from the command line arguments given. More...
 
DATASRCAPI int ds_config_parse_file (const char *unresolved_filename)
 Parse a single configuration file within the configuration context. More...
 
DATASRCAPI void ds_config_parse_files ()
 Parse all configuration files within the current configuration context. More...
 
DATASRCAPI ds_config_ctx_tds_config_set_ctx (ds_config_ctx_t *ctx)
 Sets a configuration context as the current one. More...
 
DATASRCAPI void ds_config_set_option (const char *name, const char *value)
 Set a particular configuration option. More...
 
DATASRCAPI void ds_config_set_test (const char *tag, char **value)
 Adds a conditional test to the configuration file. More...
 
DATASRCAPI void DATASRCAPI void ds_cycle_all_logs (const char *suffix, long maxsize)
 Cycle all log files in the application. More...
 
DATASRCAPI int ds_cycle_log (ds_log_t *log, const char *suffix, long maxsize)
 Cycle a specific log file. More...
 
DATASRCAPI int ds_daemon_disabled ()
 Check whether the application is running in daemon mode. More...
 
DATASRCAPI void ds_daemon_redirect ()
 Redirects the std* streams. More...
 
DATASRCAPI char * ds_debug_config_string (int level)
 This function will convert a debug level into an appropriate string. More...
 
DATASRCAPI int ds_debug_level (const char *text)
 This function will convert a string into an appropriate debug level. More...
 
DATASRCAPI char * ds_debug_string (int level)
 This function will convert a debug level into an appropriate string. More...
 
DATASRCAPI int ds_del_except_event (ds_except_event_t *ev)
 Remove a socket except event. More...
 
DATASRCAPI int ds_del_except_event_free_data (ds_except_event_t *ev, void(*free_data)(int, void *))
 Remove a socket except event. More...
 
DATASRCAPI int ds_del_read_event (ds_read_event_t *ev)
 Remove a socket read event. More...
 
DATASRCAPI int ds_del_read_event_free_data (ds_read_event_t *ev, void(*free_data)(int, void *))
 Remove a socket read event. More...
 
DATASRCAPI int ds_del_timed_event (ds_timed_event_t *ev)
 Remove a timed event. More...
 
DATASRCAPI int ds_del_timed_event_free_data (ds_timed_event_t *ev, void(*free_data)(int, void *))
 Remove a timed event. More...
 
DATASRCAPI void ds_del_udp_event (ds_udp_event_t *event)
 Remove a timed event. More...
 
DATASRCAPI int ds_del_write_event (ds_write_event_t *ev)
 Remove a socket write event. More...
 
DATASRCAPI int ds_del_write_event_free_data (ds_write_event_t *ev, void(*free_data)(int, void *))
 Remove a socket write event. More...
 
DATASRCAPI void ds_delay_data (ds_delay_t *delay, ds_data_t *dsdata)
 Add a data object to a delay channel. More...
 
DATASRCAPI void ds_discard_object (const char *name)
 Discard an object. More...
 
DATASRCAPI void ds_discard_objects (int count, char **obs)
 Discard a number of objects. More...
 
DATASRCAPI int ds_fields_add (int num, const char *name, int flags, int dp, const char *fmt)
 Add a new field to the field list. More...
 
DATASRCAPI int ds_fields_getdp (int index)
 Return the decimal precision of this index. More...
 
DATASRCAPI int ds_fields_getflags (int index)
 Return the field flags of this index. More...
 
DATASRCAPI int ds_fields_indexbyname (const char *name)
 Return the index of this field. More...
 
DATASRCAPI int ds_fields_indexbynum (int num)
 Return the index of this field. More...
 
DATASRCAPI int ds_fields_max ()
 Return the number of fields that have been defined. More...
 
DATASRCAPI char * ds_fields_namebyindex (int index)
 Return the field name of this index. More...
 
DATASRCAPI char * ds_fields_namebynum (int num)
 Return the field name of this field number. More...
 
DATASRCAPI int ds_fields_numbyindex (int index)
 Return the field number of this index. More...
 
DATASRCAPI int ds_fields_numbyname (const char *name)
 Return the field number of this field. More...
 
DATASRCAPI char * ds_filename_expand (const char *format, char *buffer, size_t bufsize)
 Expand a filename pattern into a fully qualified filename. More...
 
DATASRCAPI void ds_free_data (ds_data_t *data)
 Deallocates the memory used by a data object. More...
 
DATASRCAPI void ds_free_log (ds_log_t *log)
 Destroy a log object. More...
 
DATASRCAPI ds_log_tds_get_event_log (void)
 Returns a handle to the event log used by Datasource for C. More...
 
DATASRCAPI int ds_get_gmt_offset (time_t t)
 Calculate offset between local time and gmt. More...
 
DATASRCAPI int ds_get_num_services ()
 Return the number of services. More...
 
DATASRCAPI void * ds_get_object_data (const char *name)
 Get an objects user data. More...
 
DATASRCAPI char ** ds_get_request_hints (const char *name, int *ret)
 Return an objects request hints. More...
 
DATASRCAPI char * ds_get_service (const char *name)
 Return the service for an object. More...
 
DATASRCAPI int ds_get_service_by_index (int index, char **name_ptr)
 Return the name/state of a service by index. More...
 
DATASRCAPI time_t ds_get_time ()
 Gets the current time in seconds. More...
 
DATASRCAPI int ds_getaddr (const char *name, struct in_addr *addr)
 Gets a network address. More...
 
DATASRCAPI struct sockaddr * ds_gethostsockaddr (const char *name, struct sockaddr *populate)
 Return the socket address for a given hostname. More...
 
DATASRCAPI struct tm * ds_gmtime ()
 Get the current time in GMT. More...
 
DATASRCAPI int ds_inet_aton (const char *cp, struct in_addr *inp)
 Converts an IP address in string format into binary data. More...
 
DATASRCAPI int ds_init (ds_init_t *init, int argc, char **argv)
 Parse the configuration files and initialise the DataSource library. More...
 
DATASRCAPI ds_data_tds_init_container (const char *subject, const unsigned short flags)
 Initialise a container object. More...
 
DATASRCAPI ds_data_tds_init_data (const char *subject, unsigned short type, unsigned short flags)
 Initialise a data object for use. More...
 
DATASRCAPI ds_data_tds_init_news (const char *subject, unsigned short flags)
 Create a news headline message. More...
 
DATASRCAPI ds_data_tds_init_page (const char *subject, int rows, int cols, const char *type, unsigned short flags)
 Initialise a data object as a page. More...
 
DATASRCAPI ds_data_tds_init_permission (const char *subject, const char *key, unsigned short flags)
 Initialise a data object as a permission object. More...
 
DATASRCAPI char * ds_interface_address (const char *ifname)
 Get the local IP address for the specified interface name. More...
 
DATASRCAPI int ds_isequal (ds_set_t *p1, ds_set_t *p2)
 Check 2 peersets are equal. More...
 
DATASRCAPI int ds_iszero (ds_set_t *p)
 Check if any peer is set. More...
 
DATASRCAPI sock_t ds_listen_socket (struct in_addr *addr, int port, int backlog)
 Creates a listen socket on the specified local address and TCP port. More...
 
DATASRCAPI struct tm * ds_localtime ()
 Get the current time in the local timezone. More...
 
DATASRCAPI void ds_log_change_level_callback (ds_log_t *log, ds_loglevelchange_t change_cb)
 Set the level change callback for a given logfile. More...
 
DATASRCAPI ds_logcycled_t ds_log_cycled_callback (ds_log_t *log, ds_logcycled_t cycle_cb)
 Set the cycle callback for a given logfile. More...
 
DATASRCAPI int ds_log_get_level (ds_log_t *log)
 Get the current loglevel for the given logfile. More...
 
DATASRCAPI char * ds_log_getfilename (ds_log_t *log)
 Get the filename of a log object. More...
 
DATASRCAPI void DATASRCAPI int ds_log_set_log_level (ds_log_t *log, const char *level)
 Set the log level for a particular logfile. More...
 
DATASRCAPI void ds_loop ()
 Start the DataSource event loop. More...
 
DATASRCAPI void ds_monitor_add_data (ds_monitor_t *data, const void *datum)
 Add an element to an array within a ds_monitor_t. More...
 
DATASRCAPI void ds_monitor_add_relation (const char *templatename, const char *key, const char *propertyname, const char *targetkey)
 Add a relationship between two groups. More...
 
DATASRCAPI void ds_monitor_add_server_type (const char *type, const char *root)
 Define The Server Type. More...
 
DATASRCAPI void ds_monitor_add_subscription (const char *templatename, const char *key, const char *propertyname, const char *value)
 Add a subscription between two groups. More...
 
DATASRCAPI void ds_monitor_add_template_member (const char *templatename, const char *propertyname, const char *description, int typeflags, ds_arguments_t *args, void *ptr)
 Add a memeber to a template. More...
 
DATASRCAPI void ds_monitor_add_template_relation (const char *templatename, const char *propertyname, const char *targettemplate, const char *description, int thisend_multiple, int thatend_multiple)
 Add a relationship to a template. More...
 
DATASRCAPI void ds_monitor_add_template_subscription (const char *templatename, const char *propertyname, const char *targettemplate, const char *description, const char *singleton, ds_monitor_active_cb callback_fn)
 Add a subscription info into the template. More...
 
DATASRCAPI void ds_monitor_create_group (const char *templatename, const char *key, const char *brief, const char *description)
 Create a new monitoring group. More...
 
DATASRCAPI void ds_monitor_del_relation (const char *templatename, const char *key, const char *propertyname, const char *targetkey)
 Delete a relationship between two groups. More...
 
DATASRCAPI void ds_monitor_del_subscription (const char *templatename, const char *key, const char *propertyname, const char *value)
 Delete a subscription between two groups. More...
 
DATASRCAPI void ds_monitor_delete_group (const char *templatename, const char *key)
 Delete a group from the monitoring system. More...
 
DATASRCAPI void ds_monitor_end_template (const char *templatename)
 End the definition of a template. More...
 
DATASRCAPI void ds_monitor_free (ds_monitor_t *data)
 Deallocate memory used by a ds_monitor_t object. More...
 
DATASRCAPI void ds_monitor_free_data (ds_monitor_t *data)
 Deallocate memory used by the contents of a ds_monitor_t object. More...
 
DATASRCAPI ds_monitor_tds_monitor_new (const char *propertyname, int type, int datasize, const void *datum)
 Create a new ds_monitor_t object from input parameters. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_array (const char *propertyname, int type)
 Create a new ds_monitor_t of an array type. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_double (const char *templatename, const char *key, const char *propertyname, double value)
 Create a new ds_monitor_t object from an input double. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_llong (const char *templatename, const char *key, const char *propertyname, int64_t value)
 Create a new ds_monitor_t object from an input long long. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_long (const char *templatename, const char *key, const char *propertyname, int32_t value)
 Create a new ds_monitor_t object from an input long. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_short (const char *templatename, const char *key, const char *propertyname, int16_t value)
 Create a new ds_monitor_t object from an input short. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_string (const char *templatename, const char *key, const char *propertyname, const char *value)
 Create a new ds_monitor_t object from an input string. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_timestamp (const char *templatename, const char *key, const char *propertyname, int64_t value)
 Create a new ds_monitor_t object from an input timestamp. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_ullong (const char *templatename, const char *key, const char *propertyname, uint64_t value)
 Create a new ds_monitor_t object from an input unsigned long long. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_ulong (const char *templatename, const char *key, const char *propertyname, uint32_t value)
 Create a new ds_monitor_t object from an input unsigned long. More...
 
DATASRCAPI ds_monitor_tds_monitor_new_ushort (const char *templatename, const char *key, const char *propertyname, uint16_t value)
 Create a new ds_monitor_t object from an input unsigned short. More...
 
DATASRCAPI ds_monitor_authenticator_t ds_monitor_set_auth (ds_monitor_authenticator_t authenticator)
 Register a new authentication handler. More...
 
DATASRCAPI void ds_monitor_start_template (const char *templatename, const char *description)
 Start the defintion of a template. More...
 
DATASRCAPI void ds_monitor_update (const char *templatename, const char *key, ds_monitor_t *mondata)
 Post an update to the monitoring system for a string value. More...
 
DATASRCAPI void ds_monitor_update_double (const char *templatename, const char *key, const char *propertyname, double value)
 Post an update to the monitoring system for a double value. More...
 
DATASRCAPI void ds_monitor_update_llong (const char *templatename, const char *key, const char *propertyname, int64_t value)
 Post an update to the monitoring system for a long long value. More...
 
DATASRCAPI void ds_monitor_update_long (const char *templatename, const char *key, const char *propertyname, int32_t value)
 Post an update to the monitoring system for a long value. More...
 
DATASRCAPI void ds_monitor_update_short (const char *templatename, const char *key, const char *propertyname, int16_t value)
 Post an update to the monitoring system for a short value. More...
 
DATASRCAPI void ds_monitor_update_string (const char *templatename, const char *key, const char *propertyname, const char *value)
 Post an update to the monitoring system for a string value. More...
 
DATASRCAPI void ds_monitor_update_timestamp (const char *templatename, const char *key, const char *propertyname, int64_t value)
 Post an update to the monitoring system for a timestamp value. More...
 
DATASRCAPI void ds_monitor_update_ullong (const char *templatename, const char *key, const char *propertyname, uint64_t value)
 Post an update to the monitoring system for an unsigned long long value. More...
 
DATASRCAPI void ds_monitor_update_ulong (const char *templatename, const char *key, const char *propertyname, uint32_t value)
 Post an update to the monitoring system for an unsigned long value. More...
 
DATASRCAPI void ds_monitor_update_ushort (const char *templatename, const char *key, const char *propertyname, uint16_t)
 Post an update to the monitoring system for an unsigned short value. More...
 
DATASRCAPI sock_t ds_multicast_listen_socket (const char *p_interface, const char *addr, int port)
 Creates a multicast listen socket. More...
 
DATASRCAPI ds_delay_tds_new_delay (double delay_time, char *prefix, double batch_time)
 Create a new delay channel. More...
 
DATASRCAPI ds_delay_tds_new_delay_with_callback (double delay_time, char *prefix, double batch_time, void *callback_param, ds_delay_send_cb callback_func)
 Create a new delay channel. More...
 
DATASRCAPI ds_log_tds_new_headed_log (const char *name, const char *logname, const char *header)
 Create a new log object with a header. More...
 
DATASRCAPI ds_log_tds_new_level_log (const char *name, const char *logname, ds_loglevelchange_t change_cb)
 Create a new log object. More...
 
DATASRCAPI ds_log_tds_new_log (const char *name, const char *logname)
 Create a new log object. More...
 
DATASRCAPI int ds_object_available (const char *name)
 Determine whether this object can theoretically be requested. More...
 
DATASRCAPI int ds_object_can_contrib (const char *name)
 Determine whether contributions can be sent for this object. More...
 
DATASRCAPI void ds_or (ds_set_t *p1, ds_set_t *p2, ds_set_t *o)
 Combine 2 peersets using bitwise or. More...
 
DATASRCAPI int ds_peer_all_type (int flag)
 Checks if a DataSource peer of the given type is in your configuration file. More...
 
DATASRCAPI int ds_peer_by_label (const char *label)
 Return the peer index for a label. More...
 
DATASRCAPI int ds_peer_details (int peer, char **name)
 Gets the ID and name of a peer. More...
 
DATASRCAPI int ds_peer_enabled_state (int peer)
 Gets the enabled/disabled state of a DataSource peer. More...
 
DATASRCAPI int ds_peer_flags (int peer)
 Gets the flags of a peer. More...
 
DATASRCAPI int ds_peer_host_details (int peer, char **addr)
 Gets details of the remote side of a peer. More...
 
DATASRCAPI int ds_peer_id (int peer)
 Gets the ID of a peer. More...
 
DATASRCAPI char * ds_peer_label_byindex (int index)
 Return the peer label for a peer index. More...
 
DATASRCAPI int ds_peer_local_type (int peer)
 Gets the local type of a DataSource peer. More...
 
DATASRCAPI char * ds_peer_name (int peer)
 Gets the name of a peer. More...
 
DATASRCAPI int ds_peer_type (int peer)
 Gets the type of a DataSource peer. More...
 
DATASRCAPI int ds_peer_up (int peer)
 Check to see if a peer is up. More...
 
DATASRCAPI int ds_pipe (sock_t fds[2])
 Creates a UNIX-style pipe. More...
 
DATASRCAPI void DATASRCAPI void DATASRCAPI void ds_printf_time_ap (ds_log_t *log, const char *extra, const char *fmt, va_list ap)
 Write a formatted string prefixed with a timestamp string to a log object. More...
 
DATASRCAPI void ds_purge_object (const char *name)
 Purge an object from our cache. More...
 
DATASRCAPI void ds_read_event_set_callback (ds_read_event_t *ev, ds_io_event_cb cb, int val, void *data)
 Change the callback and callback values for a socket read event. More...
 
DATASRCAPI void ds_remove_container_symbol (ds_data_t *data, const char *symbol)
 Remove an object from the container. More...
 
DATASRCAPI void ds_replay (recv_replay_t callback)
 Replays all data in the current packet log file. More...
 
DATASRCAPI void ds_replay_by_field (int fieldnum, char *value, recv_replay_t callback)
 Replays all data in the current packet log file that arrived after an update with the specified value for the specified field. More...
 
DATASRCAPI int ds_replay_by_field_from_file (int fieldnum, char *value, recv_replay_t callback, char *filename)
 Replays all data in a file that arrived after an update with the specified value for the specified field. More...
 
DATASRCAPI void ds_replay_by_field_from_log (int fieldnum, char *value, recv_replay_t callback, ds_log_t *log)
 Replays all data in the log object that arrived after an update with the specified value for the specified field. More...
 
DATASRCAPI void ds_replay_by_time (time_t t, recv_replay_t callback)
 Replays all data in the current packet log file that arrived after a specified time. More...
 
DATASRCAPI int ds_replay_by_time_from_file (time_t t, recv_replay_t callback, char *filename)
 Replays all data in a file that arrived after a specified time. More...
 
DATASRCAPI void ds_replay_by_time_from_log (time_t t, recv_replay_t callback, ds_log_t *log)
 Replays all data in a log object that arrived after a specified time. More...
 
DATASRCAPI int ds_replay_from_file (recv_replay_t callback, char *filename)
 Replays all data in a file. More...
 
DATASRCAPI void ds_replay_from_log (recv_replay_t callback, ds_log_t *log)
 Replays all data in a packet log file. More...
 
DATASRCAPI char * ds_request_object (const char *name)
 Request an object. More...
 
DATASRCAPI char * ds_request_object_with_flags (const char *name, int flags)
 Request an object. More...
 
DATASRCAPI int ds_request_objects (int count, char **obs, char ***services)
 Request a number of objects in one go. More...
 
DATASRCAPI int ds_request_objects_with_flags (int count, char **obs, int flags, char ***services)
 Request a number of objects in one go. More...
 
DATASRCAPI int ds_required_services_status (char *buf, size_t buflen)
 Return whether all required services are ready. More...
 
DATASRCAPI void ds_reserve_std_fds ()
 Reserves the standard sockets for the std streams. More...
 
DATASRCAPI int ds_send_contribution (ds_data_t *dsdata)
 Contribute an object back to the peers that supplied it and support it. More...
 
DATASRCAPI void ds_send_data (ds_data_t *data)
 Send the data object to all connected DataSource peers. More...
 
DATASRCAPI void ds_send_data_direct (ds_data_t *data)
 Send the data object to all connected DataSource peers. More...
 
DATASRCAPI void ds_send_data_no_free (ds_data_t *data)
 Send the data object to all connected DataSource peers. More...
 
DATASRCAPI void ds_send_data_to_peer (int peer, ds_data_t *data)
 Send the data object to a specific peer. More...
 
DATASRCAPI void ds_send_data_to_peer_no_free (int peer, ds_data_t *data)
 Send the data object to a specific peer. More...
 
DATASRCAPI void ds_send_nodata (const char *subject, unsigned short flags)
 Send a "no data" message to all connected DataSource peers. More...
 
DATASRCAPI void ds_send_nodata_direct (const char *subject, unsigned short flags)
 Send a "no data" message to all connected DataSource peers. More...
 
DATASRCAPI void ds_send_nodata_to_peer (int peer, const char *subject, unsigned short flags)
 Send a "no data" message to a specific DataSource pper. More...
 
DATASRCAPI void ds_send_status (const char *subject, unsigned short flags, unsigned short code, const char *msgstr)
 Sends a user defined status message about a particular object. More...
 
DATASRCAPI void ds_send_status_direct (const char *subject, unsigned short flags, unsigned short code, const char *msgstr)
 Sends a user defined status message about a particular object. More...
 
DATASRCAPI void ds_send_status_to_peer (int peer, const char *subject, unsigned short flags, unsigned short code, const char *msgstr)
 Sends a user defined status message about a particular object. More...
 
DATASRCAPI void ds_set_object_data (const char *name, void *data)
 Set an objects user data. More...
 
DATASRCAPI int ds_set_request_hint (const char *name, int num, char **hints)
 Set the objects hint peers. More...
 
DATASRCAPI void ds_set_status_down ()
 Causes the DataSource to disconnect and stop listening for connections. More...
 
DATASRCAPI void ds_set_status_down_to_peer (int peer)
 Causes the DataSource to disconnect and not accept connections for this peer. More...
 
DATASRCAPI void ds_set_status_msg (unsigned short msgid, const char *msgstr)
 Send a user-defined status message to all connected peers. More...
 
DATASRCAPI void ds_set_status_msg_to_peer (int peer, unsigned short msgid, const char *msgstr)
 Send a user-defined status message to peer. More...
 
DATASRCAPI void ds_set_status_up ()
 Causes the DataSource to connect and listen for connections. More...
 
DATASRCAPI void ds_set_status_up_to_peer (int peer)
 Causes the DataSource to connect and accept connections. More...
 
DATASRCAPI void ds_set_subject (ds_data_t *data, const char *subject)
 Sets a new name for the data object. More...
 
DATASRCAPI void ds_set_timed_delay (ds_timed_event_t *ev, double delay)
 Alter the delay for an existing timed event. More...
 
DATASRCAPI void ds_set_timed_delay_next (ds_timed_event_t *ev, double delay)
 Alter the next fire time for an existing timed event. More...
 
DATASRCAPI void ds_setnonblocking (sock_t fd)
 Set a socket to be non-blocking. More...
 
DATASRCAPI int ds_signature_check (char *key_id, char *token)
 Provides a mechanism for validating a KeyMaster-generated encrypted single-use token. More...
 
DATASRCAPI int ds_signature_verify_username (char *expected_username, char *token)
 Verify that the supplied token is for the expected username. More...
 
DATASRCAPI void ds_stop ()
 
DATASRCAPI void ds_thread_init (int event_module, int flags)
 Initialise the event loop for this thread. More...
 
DATASRCAPI void ds_timed_event_set_callback (ds_timed_event_t *ev, ds_timed_event_cb cb, int val, void *data)
 Change the callback and callback values for a timed eent. More...
 
DATASRCAPI int ds_udp_bind_client_socket (sock_t sock, const char *addr, int port)
 Binds a UDP socket to a local address. More...
 
DATASRCAPI sock_t ds_udp_client_socket (const char *addr, int port, struct sockaddr_in *serv_addr)
 Creates a UDP client socket. More...
 
DATASRCAPI sock_t ds_udp_listen_socket (const char *p_interface, int port)
 Creates a UDP listen socket. More...
 
DATASRCAPI int ds_udp_send (const char *data, int len, const char *addr, int port)
 Sends data to a UDP address. More...
 
DATASRCAPI int ds_udp_sendto (const char *data, int len, struct sockaddr_in *serv_addr)
 Sends data to a UDP address. More...
 
DATASRCAPI void ds_udpsignal_send (const char *message)
 Send a udp message. More...
 
DATASRCAPI void ds_udpsignal_send_argv (const char *message, char *argv[])
 Send a UDP message. More...
 
DATASRCAPI void ds_write (ds_log_t *log, void *data, size_t len)
 Write binary data to a log object. More...
 
DATASRCAPI void ds_write_event_set_callback (ds_write_event_t *ev, ds_io_event_cb cb, int val, void *data)
 Change the callback and callback values for a socket write event. More...
 
DATASRCAPI void ds_writev (ds_log_t *log, struct iovec *vector, int count)
 Write binary data to a log object. More...
 

Variables

DATASRCAPI int ds_num_peers
 The number of DataSource peers in your configuration. More...
 

Detailed Description

Main DataSource include file

Macro Definition Documentation

#define TYPE_SUBSCRIPTION   21

Indicates that the property is a subscription list.

Function Documentation

DATASRCAPI void ds_add_latency_chain ( ds_data_t dsdata,
char  suffix,
int64_t  millis 
)

function used to add a measurement point to latency chain data

Parameters
dsdata- ds_data_t object to be modified. The object needs to have the initial timestamp field set.
suffix- server name suffix for the timestamp to be used for the generated hop name.
millis- millisecond timestamp to be added or 0 for current time.
DATASRCAPI void ds_add_latency_chain2 ( ds_data_t dsdata,
char  suffix,
int64_t  millis,
char  suffix2,
int64_t  millis2 
)

function used to add two measurement points to latency chain data

Parameters
dsdata- ds_data_t object to be modified. The object needs to have the initial timestamp field set.
suffix- server name suffix for the first timestamp to be used for the generated hop name
millis- millisecond timestamp to be added. Must be a valid timestamp and cannot be 0.
suffix2- server name suffix for the second timestamp to be used for the generated hop name.
millis2- millisecond timestamp to be added or 0 for current time.
DATASRCAPI void ds_and ( ds_set_t p1,
ds_set_t p2,
ds_set_t a 
)

Combine 2 peersets using bitwise and.

Parameters
p1- Pointer to 1st set to combine
p2- Pointer to 2nd set to combine
a- Pointer to set to store combined result
DATASRCAPI int ds_and3_iszero ( ds_set_t p1,
ds_set_t p2,
ds_set_t p3 
)

Check if the bitwise and of 3 peer sets is 0.

Parameters
p1- Pointer to 1st set to combine
p2- Pointer to 2nd set to combine
p3- Pointer to 3rd set to combine
Return values
0- One or more peers set
1- No peers set
DATASRCAPI int ds_and_iszero ( ds_set_t p1,
ds_set_t p2 
)

Check if the bitwise and of 2 peer sets is 0.

Parameters
p1- Pointer to 1st set to combine
p2- Pointer to 2nd set to combine
Return values
0- One or more peers set
1- No peers set
DATASRCAPI int ds_check_subnet ( const char *  s_address,
const char *  s_network,
const char *  s_netmask 
)

Check whether an address falls into a given network and netmask.

Parameters
s_address- Address to check
s_network- Network to check against
s_netmask- Netmask to apply
Return values
0- Address falls out of range
1- Address is in range
-1- Parameter error
DATASRCAPI int ds_daemon_disabled ( )

Check whether the application is running in daemon mode.

DATASRCAPI void ds_daemon_redirect ( )

Redirects the std* streams.

This function redirects the standard input, output and error streams to /dev/null

DATASRCAPI int ds_isequal ( ds_set_t p1,
ds_set_t p2 
)

Check 2 peersets are equal.

Parameters
p1- Pointer to 1st set to compare
p2- Pointer to 2nd set to compare
Return values
0- Sets are the same
1- Sets are not the same
DATASRCAPI int ds_iszero ( ds_set_t set)

Check if any peer is set.

Parameters
set- Pointer to peer set
Return values
0- One or more peers set
1- No peers set
DATASRCAPI void ds_or ( ds_set_t p1,
ds_set_t p2,
ds_set_t o 
)

Combine 2 peersets using bitwise or.

Parameters
p1- Pointer to 1st set to combine
p2- Pointer to 2nd set to combine
o- Pointer to set to store combined result
DATASRCAPI int ds_peer_by_label ( const char *  label)

Return the peer index for a label.

Parameters
labelLabel to search for
Returns
The peer index (-1 if not known)
DATASRCAPI char* ds_peer_label_byindex ( int  index)

Return the peer label for a peer index.

Parameters
indexPeer index
Returns
peer label or NULL

Generated on Wed Jan 24 2018 12:22:46 for DataSource for C SDK