23 #undef DATASRC_MAJOR_VERSION 24 #undef DATASRC_MINOR_VERSION 25 #undef DATASRC_PATCH_VERSION 27 #define DATASRC_MAJOR_VERSION 7 28 #define DATASRC_MINOR_VERSION 0 29 #define DATASRC_PATCH_VERSION 2 40 #include <sys/timeb.h> 49 #include <sys/types.h> 51 #include <netinet/in.h> 52 #include <sys/socket.h> 53 #include <arpa/inet.h> 55 #include <sys/ioctl.h> 58 #include <sys/timeb.h> 72 #define EXIT_CODE_NML 0 73 #define EXIT_CODE_CFG 1 74 #define EXIT_CODE_LOG 2 75 #define EXIT_CODE_NET 3 76 #define EXIT_CODE_SYS 4 77 #define EXIT_CODE_LIC 5 78 #define EXIT_CODE_SIG 6 79 #define EXIT_CODE_SVC 7 80 #define EXIT_CODE_SSL 8 81 #define EXIT_CODE_JVM 9 84 #define EXIT_CODE_BIN_MISSING 10 85 #define EXIT_CODE_BIN_NOT_EXEC 11 86 #define EXIT_CODE_BIN_EXIT AFTER_FORK 12 87 #define EXIT_CODE_BIN_BAD_ARCH 126 90 #define EXIT_CODE_JAVA_DATASOURCE_ERROR 201 99 #ifndef DATASRC_EXPORT 100 #define DATASRCAPI _declspec(dllimport) 102 #define DATASRCAPI _declspec(dllexport) 110 #define PRINTF(fmt,arg) __attribute__ ((__format__ (__printf__, (fmt), (arg)))) 112 #define PRINTF(fmt,arg) 136 #define INVALID_SOCKET -1 143 #define SOCKET_ERROR -1 147 #include <inttypes.h> 155 typedef uint64_t ds_bitfield_t;
229 typedef void (*
recv_nodata_t)(
int peer,
char *subject,
unsigned short flags);
273 typedef void (*
recv_request_t)(
int peer,
int count,
char **subjects,
unsigned short flags);
293 typedef void (*
recv_discard_t)(
int peer,
int count,
char **subjects,
unsigned short flags);
379 void (*exit_func)(
int exit_code,
char *msg);
390 #define DS_INITIALISER \ 414 DATASRCAPI
void ds_config_init(
const char *file,
int argc,
char **argv);
417 DATASRCAPI
char *
ds_filename_expand(
const char *format,
char *buffer,
size_t bufsize);
481 #define ds5_namespace_match(nspace, subject) nspace->match(nspace, subject) 487 #define ds5_namespace_free(nspace) nspace->free(nspace) 539 void (*receive_request)(
void *context,
int peer,
const char *subject);
561 void (*receive_discard)(
void *context,
int peer,
const char *subject);
606 void (*service_status)(
void *context,
const char *service_name,
int state);
619 void (*peer_status)(
void *context,
int peer_index,
const char *peer_name,
int state);
763 void (*subscription_error)(
void *context,
ds5_subscription_t *sub,
int peer,
const char *subject,
short flags);
776 void (*subscription_status)(
void *context,
ds5_subscription_t *sub,
int peer,
const char *subject,
int status,
const char *message);
784 DATASRCAPI
void ds5_config_init(
const char *configfile,
int argc,
char **argv);
785 DATASRCAPI
int ds5_init(
int argc,
char **argv);
808 #define DS_OFFSET(t,m) ((void *)&((t *)0)->m) 813 #define DS_CONFIG_BOOL 0x0001 819 #define DS_CONFIG_INT 0x0002 824 #define DS_CONFIG_FLOAT 0x0003 829 #define DS_CONFIG_STR 0x0004 834 #define DS_CONFIG_CHAR 0x0005 839 #define DS_CONFIG_FUNC 0x0006 844 #define DS_CONFIG_FILE 0x0007 848 #define DS_CONFIG_GROUP 0x0010 849 #define DS_CONFIG_GROUP_END 0x0011 850 #define DS_CONFIG_SECTION 0x0020 851 #define DS_CONFIG_SECTION_END 0x0021 856 #define DS_CONFIG_JAVA 0x0080 861 #define DS_CONFIG_ARRAY 0x0100 867 #define DS_CONFIG_INT_ARRAY (DS_CONFIG_ARRAY|DS_CONFIG_INT) 872 #define DS_CONFIG_FLOAT_ARRAY (DS_CONFIG_ARRAY|DS_CONFIG_FLOAT) 878 #define DS_CONFIG_STR_ARRAY (DS_CONFIG_ARRAY|DS_CONFIG_STR) 883 #define DS_CONFIG_CHAR_ARRAY (DS_CONFIG_ARRAY|DS_CONFIG_CHAR) 888 #define DS_CONFIG_STRICT 0x0200 894 #define DS_CONFIG_DEPRECATED 0x0400 948 DATASRCAPI
void ds_config_add_option(
char opt,
const char *longopt,
const char *help,
int type,
void *value);
949 DATASRCAPI
void ds_config_add_bounded_option(
char sopt,
const char *longopt,
const char *help,
int type,
void *value,
void *min,
void *max);
957 DATASRCAPI
void ds_config_add_group(
const char *longopt,
const char *help,
void *base,
void *def,
size_t size,
int *num);
958 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);
981 typedef
unsigned long ds_reltime_t;
1044 #define DOUBLE_TO_RELTIME(r,d) r = ((int)(d) << 9) + ((int)(((d) - (int)(d)) * 1000000) >> 11); 1045 #define TIMEVAL_TO_RELTIME(r,tv) r = ((tv).tv_sec << 9) + ((tv).tv_usec >> 11); 1073 DATASRCAPI ds_reltime_t ds_get_relative_time();
1078 DATASRCAPI
char *ds_get_timezone(
char *buf,
int len);
1091 #define DS_CACHE_DATASRC -1 1113 #define DS_FIELDS_SEPARATOR -65536 1120 #define DS_FIELDS_NOT_DEFINED (-2147483647 - 1) 1123 DATASRCAPI
int ds_fields_add(
int num,
const char *name,
int flags,
int dp,
const char *fmt);
1130 DATASRCAPI
char *ds_fields_rttpnumbyindex(
int index);
1141 #define DS_LOG_CONFIG 0 1142 #define DS_LOG_ALWAYS 1 1146 #define DS_LOG_CRIT 2 1150 #define DS_LOG_ERROR 3 1154 #define DS_LOG_NOTIFY 4 1158 #define DS_LOG_WARN 5 1162 #define DS_LOG_INFO 6 1166 #define DS_LOG_DEBUG 7 1170 #define DS_LOG_FINER 8 1174 #define DS_LOG_FINEST 9 1178 #define DS_LOG_MONITOR 128 1182 #define DS_LOG_TERMINAL 256 1186 #define DS_LOG_SYSLOG 512 1187 #define DS_LOG_FILEONLY 1024 1188 #define DS_LOG_NO_MONITOR 2048 1221 DATASRCAPI
void ds_syslog(
ds_log_t *log,
int priority, const
char *fmt, ...) PRINTF(3,4);
1228 DATASRCAPI
void ds_log(
ds_log_t *log,
int level, const
char *fmt,...) PRINTF(3,4);
1275 #define TYPE_BINARY 1 1279 #define TYPE_STRING 2 1283 #define TYPE_SHORT 3 1287 #define TYPE_USHORT 4 1295 #define TYPE_ULONG 6 1299 #define TYPE_LLONG 7 1303 #define TYPE_ULLONG 8 1307 #define TYPE_DOUBLE 9 1313 #define TYPE_TIMESTAMP 10 1319 #define TYPE_BOOLEAN 11 1324 #define TYPE_RELATION 20 1329 #define TYPE_SUBSCRIPTION 21 1335 #define TYPE_PRIMITIVE_MASK 31 1340 #define TYPE_ARRAY 32 1344 #define TYPE_ACTIVE 64 1355 #define TYPE_ACTIVE2 128 1359 #define TYPE_METHOD 256 1363 #define TYPE_KEY 512 1367 #define TYPE_HIERARCHY 1024 1374 #define TYPE_OPTIONAL 2048 1384 union _ds_mondata_value {
1407 union _ds_mondata_value2
1452 typedef ds_monitor_t *(*ds_monitor_method_cb)(
char *templatename,
char *key,
char *property,
int argc,
char *argv[]);
1463 typedef ds_monitor_t *(*ds_monitor_active_cb)(
char *templatename,
char *key,
char *propertyname);
1492 DATASRCAPI
char *ds_monitor_module_name();
1498 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);
1502 DATASRCAPI
void ds_monitor_add_relation(
const char *templatename,
const char *key,
const char *propertyname,
const char *targetkey);
1503 DATASRCAPI
void ds_monitor_del_relation(
const char *templatename,
const char *key,
const char *propertyname,
const char *targetkey);
1505 DATASRCAPI
void ds_monitor_add_subscription(
const char *templatename,
const char *key,
const char *propertyname,
const char *value);
1506 DATASRCAPI
void ds_monitor_del_subscription(
const char *templatename,
const char *key,
const char *propertyname,
const char *value);
1510 DATASRCAPI
void ds_monitor_create_group(
const char *templatename,
const char *key,
const char *brief,
const char *description);
1516 DATASRCAPI
void ds_monitor_update_string(
const char *templatename,
const char *key,
const char *propertyname,
const char *value);
1517 DATASRCAPI
void ds_monitor_update_ushort(
const char *templatename,
const char *key,
const char *propertyname, uint16_t);
1518 DATASRCAPI
void ds_monitor_update_short(
const char *templatename,
const char *key,
const char *propertyname, int16_t value);
1519 DATASRCAPI
void ds_monitor_update_ulong(
const char *templatename,
const char *key,
const char *propertyname, uint32_t value);
1520 DATASRCAPI
void ds_monitor_update_long(
const char *templatename,
const char *key,
const char *propertyname, int32_t value);
1521 DATASRCAPI
void ds_monitor_update_ullong(
const char *templatename,
const char *key,
const char *propertyname, uint64_t value);
1522 DATASRCAPI
void ds_monitor_update_llong(
const char *templatename,
const char *key,
const char *propertyname, int64_t value);
1523 DATASRCAPI
void ds_monitor_update_double(
const char *templatename,
const char *key,
const char *propertyname,
double value);
1525 DATASRCAPI
void ds_monitor_update_boolean(
const char *templatename,
const char *key,
const char *propertyname, uint8_t value);
1555 DATASRCAPI sock_t
ds_listen_socket(
const char *addr,
int port,
int backlog);
1561 DATASRCAPI
int ds_udp_send(
const char *data,
int len,
const char *addr,
int port);
1562 DATASRCAPI
int ds_udp_sendto(
const char *data,
int len,
struct sockaddr_storage *serv_addr);
1563 DATASRCAPI sock_t
ds_udp_client_socket(
const char *addr,
int port,
struct sockaddr_storage *serv_addr);
1565 DATASRCAPI
char *ds_interface_address(
const char *ifname);
1567 DATASRCAPI
char *
ds_getnameinfo(
const struct sockaddr_storage *addr,
char *buf,
size_t buflen);
1568 DATASRCAPI
int ds_compare_sockaddr(
struct sockaddr_storage *sa,
struct sockaddr_storage *sb);
1569 DATASRCAPI
int ds_pipe(sock_t fds[2]);
1570 DATASRCAPI
int ds_check_subnet(
const char *s_address,
const char *s_network,
const char *s_netmask);
1571 DATASRCAPI
struct sockaddr_storage *
ds_gethostsockaddr(
const char *name,
struct sockaddr_storage *populate);
1584 #define DS_MSG_CONNECT 0x0100 1593 #define DS_MSG_DISCONNECT 0x0200 1594 #define DS_MSG_STATUS 0x0400 1599 #define DS_T_USERMASK 0x00ff 1610 #define DS_T_ACTIVE 0x0001 1622 #define DS_T_CONTRIB 0x0002 1624 #define DS_T_MSG 0x0100 1629 #define DS_F_USERMASK 0x00ff 1646 #define F_SENDFROMSEQ 0x0001 1648 #define F_SENDFROMFIELD 0x0002 1664 #define F_RECVAUTOREPLAY 0x0004 1681 #define F_NOCONNECT 0x0008 1683 #define F_RECONNECT 0x0100 1684 #define F_FAILOVER 0x0200 1689 #define F_NODATAMASK 0x000f 1700 #define F_NOTFOUND 0x0001 1710 #define F_READDENY 0x0002 1720 #define F_WRITEDENY 0x0003 1730 #define F_DELETEOBJECT 0x0004 1740 #define F_UNAVAILABLE 0x0005 1741 #define F_STATUS 0x0006 1750 #define F_IGNOREREQTIMEOUT 0x0008 1757 #define DS_PAGE_TYPE 221 1761 #define DS_RECORD_TYPE 222 1765 #define DS_RECORD_TYPE2 225 1769 #define DS_RECORD_TYPE3 226 1773 #define DS_NEWS_TYPE 223 1777 #define DS_STORY_TYPE 224 1781 #define DS_CONTAINER_TYPE 228 1785 #define DS_PERMISSION_TYPE 230 1793 #define DS_GENERIC_TYPE 231 1801 #define F_CREATEOBJECT 0x0010 1805 #define F_CREATEPARENT 0x0020 1806 #define F_PERSISTENT 0x0040 1807 #define F_CREATEDATA 0x0080 1812 #define F_CLEAR_PERM 0x0400 1824 #define F_FILTER_PERM 0x0800 1830 #define F_AUTHGLOBAL 0x0100 1835 #define F_CLEAR_TYPE3 0x0100 1840 #define F_FILTER_TYPE3 0x0200 1844 #define F_CLEAR_TYPE2 0x0400 1859 #define F_FILTER_TYPE2 0x0800 1866 #ifdef __DARWIN_NULL 1869 #define F_NOCACHE 0x0400 1877 #define F_DELETE_HEADLINE 0x0100 1886 #define F_CHANGE_HEADLINE 0x0200 1892 #define F_IMAGE 0x1000 1897 #define F_NONACTIVE 0x2000 1901 #define F_AUTHUPDATE 0x4000 1911 #define F_CONSTITUENT_NOAUTH 0x4000 1919 #define F_CHANGEDFIELDS 0x8000 1923 #define FLOAT32_TYPE 1 1924 #define FLOAT64_TYPE 2 1926 #define INT16_TYPE 4 1927 #define INT32_TYPE 5 1928 #define INT64_TYPE 6 1942 #define DS_REQUEST_FAILOVER 1 1952 #define DS_REQUEST_CACHE 4 1967 #define S_INFO 0x0000 1977 #define S_STALE 0x0001 1987 #define S_NOTSTALE 0x0004 2000 #define S_UPDCLR 0x0100 2012 #define S_FAILOVER 0x1101 2027 #define OBJ_STATUS_INFO 0x0000 2041 #define OBJ_STATUS_OK 0x0001 2057 #define OBJ_STATUS_STALE 0x0002 2075 #define OBJ_STATUS_LIMITED 0x0008 2078 #define OBJ_STATUS_NOTMAPPED 0x0010 2088 #define SVC_STATUS_OK 0x0001 2098 #define SVC_STATUS_DOWN 0x0002 2108 #define SVC_STATUS_LIMITED 0x0008 2112 #define DS_MAX_BITFIELD (sizeof(ds_bitfield_t)*8) 2114 #define DS_BITFIELD_SET(n,p) *(p) |= (1ULL << (n)) 2115 #define DS_BITFIELD_CLR(n,p) *(p) &= ~(1ULL << (n)) 2116 #define DS_BITFIELD_ISSET(n,p) (*(p) & (1ULL << (n))) 2117 #define DS_BITFIELD_ZERO(p) *(p) = 0 2118 #define DS_BITFIELD_NONZERO(p) memset((char *)(p), 0xffffffff, sizeof(*(p))) 2133 #define DS_MAX_PEERS 1024 2139 #define DS_MIN_PEER 0 2145 #define DS_INTERNAL_DATASRC 1023 2147 typedef uint32_t dsset_element_t;
2149 #define DS_NUMBITS (sizeof(dsset_element_t) * 8) 2150 #define DS_NUM_ELEMS (DS_MAX_PEERS+DS_NUMBITS-1)/DS_NUMBITS 2151 #define DS_NUM_BYTES (DS_NUM_ELEMS * sizeof(dsset_element_t)) 2155 dsset_element_t bits[DS_NUM_ELEMS];
2162 #define DS_SET(n,p) ((p)->bits[(n)/DS_NUMBITS] |= ((unsigned)1 << ((n) % DS_NUMBITS))) 2168 #define DS_CLR(n,p) ((p)->bits[(n)/DS_NUMBITS] &= ~((unsigned)1 << ((n) % DS_NUMBITS))) 2174 #define DS_ISSET(n,p) ((p)->bits[(n)/DS_NUMBITS] & ((unsigned)1 << ((n) % DS_NUMBITS))) 2180 #define DS_ZERO(p) memset((char *)(p)->bits, 0, DS_NUM_BYTES) 2186 #define DS_NONZERO(p) memset((char *)(p)->bits, 0xff, DS_NUM_BYTES) 2192 #define DS_ISZERO(p) ds_iszero(p) 2198 #define DS_AND(p1, p2, a) ds_and(p1, p2, a) 2204 #define DS_OR(p1, p2, o) ds_or(p1, p2, o) 2210 #define DS_AND_ISZERO(p1, p2) ds_and_iszero(p1, p2) 2216 #define DS_AND3_ISZERO(p1, p2, p3) ds_and3_iszero(p1, p2, p3) 2222 #define DS_ISEQUAL(p1, p2) ds_isequal(p1, p2) 2240 #define ds_add_data_short(d,f,v) ds_add_data_int16(d,f,v) 2241 #define ds_add_data_int(d,f,v) ds_add_data_int32(d,f,v) 2242 #define ds_add_data_long(d,f,v) ds_add_data_int32(d,f,v) 2243 #define ds_add_data_float(d,f,v) ds_add_data_float32(d,f,v) 2244 #define ds_add_data_double(d,f,v) ds_add_data_float64(d,f,v) 2250 DATASRCAPI
void ds_send_nodata(
const char *subject,
unsigned short flags);
2253 DATASRCAPI
void ds_send_status(
const char *subject,
unsigned short flags,
unsigned short code,
const char *msgstr);
2254 DATASRCAPI
void ds_send_status_to_peer(
int peer,
const char *subject,
unsigned short flags,
unsigned short code,
const char *msgstr);
2257 DATASRCAPI
void ds_send_status_direct(
const char *subject,
unsigned short flags,
unsigned short code,
const char *msgstr);
2259 DATASRCAPI
void ds_send_map_to_peer(
int peer,
const char *subject,
const char *mapped,
unsigned short flags);
2260 DATASRCAPI
void ds_send_map(
const char *subject,
const char *mapped,
unsigned short flags);
2285 DATASRCAPI
ds_data_t *
ds_init_page(
const char *subject,
int rows,
int cols,
const char *type,
unsigned short flags);
2328 #define ds_add_binary_char(d,f,v) ds_add_binary_int8(d,f,v); 2329 #define ds_add_binary_short(d,f,v) ds_add_binary_int16(d,f,v); 2330 #define ds_add_binary_int(d,f,v) ds_add_binary_int32(d,f,v); 2331 #define ds_add_binary_long(d,f,v) ds_add_binary_int32(d,f,v); 2332 #define ds_add_binary_float(d,f,v) ds_add_binary_float32(d,f,v); 2333 #define ds_add_binary_double(d,f,v) ds_add_binary_float64(d,f,v); 2334 #define ds_add_binary_time_micros(d,f,v) ds_add_binary_timeval(d,f,v); 2340 #define NEWS_HEADLINE_FIELDNUM 0 2344 #define NEWS_STORYCODE_FIELDNUM 1 2348 #define NEWS_DATETIME_FIELDNUM 2 2352 #define NEWS_AUTHSTR_FIELDNUM 5 2356 #define NEWS_PRODUCT_CODE_FIELDNUM 100 2360 #define NEWS_TOPIC_CODE_FIELDNUM 101 2364 #define NEWS_COMPANY_CODE_FIELDNUM 102 2368 #define NEWS_USER_CODE_FIELDNUM 200 2372 #define NEWS_USER_CODE_MAX 10 2374 #define NEWS_SIZE_FIELDNUM 300 2375 #define NEWS_REASON_FIELDNUM 301 2377 #define NEWS_REQ_SEARCH 1000 2378 #define NEWS_REQ_STORYCODE 1001 2379 #define NEWS_REQ_DATE_TO 1002 2380 #define NEWS_REQ_DATE_FROM 1003 2381 #define NEWS_REQ_FLAGS 1004 2383 #define NEWS_GENERIC_FIELDNUM 1024 2399 DATASRCAPI
void ds_peer_add_extra_handshake_data(
int peer,
const char *data);
2490 DATASRCAPI
int ds_udpsignal_addjob(
const char *cmd,
void (*fn)(
int argc,
char *argv[]),
const char *description);
2491 DATASRCAPI
int ds_udpsignal_deljob(
const char *cmd,
void (*fn)(
int argc,
char *argv[]));
2496 DATASRCAPI
void ds_set_productname(
const char *name);
2514 DATASRCAPI
int ds_get_service_type(
const char *servicename);
2533 #define DS_SIGNATURE_OK 0 2540 #define DS_SIGNATURE_INVALID_TOKEN 1 2547 #define DS_SIGNATURE_UNKNOWN_KEYID 2 2554 #define DS_SIGNATURE_ALREADY_USED 3 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.
Definition: binary.c:592
DATASRCAPI int ds_del_except_event(ds_except_event_t *ev)
Remove a socket except event.
Definition: event.c:693
DATASRCAPI char * ds_log_getfilename(ds_log_t *log)
Get the filename of a log object.
Definition: log.c:1253
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.
Definition: binary.c:546
recv_update_t recv_update
Definition: datasrc.h:366
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.
Definition: monitor.c:1295
DATASRCAPI ds_data_t * ds_init_container(const char *subject, const unsigned short flags)
Initialise a container object.
Definition: container.c:35
char * log_root
Definition: datasrc.h:361
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.
Definition: api.c:173
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.
Definition: page.c:163
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.
Definition: api.c:261
DATASRCAPI sock_t ds_client_socket_nonblocking(const char *serv, unsigned short port)
Creates a client socket with which to connect to a host.
Definition: net.c:825
DATASRCAPI ds5_subscription_t * ds5_create_active_subscription(const char *subject, ds5_subscriptionlistener_t *listener, void *context)
Create a subscription that matches a single subject.
Definition: dsv5_subscription.c:131
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.
Definition: config.c:690
DATASRCAPI int ds_isequal(ds_set_t *p1, ds_set_t *p2)
Check 2 peersets are equal.
Definition: peerset.c:162
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 fi...
Definition: replay.c:593
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.
Definition: dsv5_publisher.c:325
unsigned short flags
Definition: datasrc.h:2442
void ds_printf(ds_log_t *log, const char *fmt,...)
Write a formatted string to a log object.
Definition: log.c:873
Defines the DataSource initialisation object.
Definition: datasrc.h:357
DATASRCAPI void ds_add_container_symbol(ds_data_t *data, const char *symbol)
Add an object to the container.
Definition: container.c:54
DATASRCAPI void ds_write(ds_log_t *log, void *data, size_t len)
Write binary data to a log object.
Definition: log.c:836
DATASRCAPI int ds_and_iszero(ds_set_t *p1, ds_set_t *p2)
Check if the bitwise and of 2 peer sets is 0.
Definition: peerset.c:103
DATASRCAPI int ds_replay_from_file(recv_replay_t callback, char *filename)
Replays all data in a file.
Definition: replay.c:140
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.
Definition: fields.c:333
DATASRCAPI ds_config_ctx_t * ds_config_new_ctx()
Create a new configuration context.
Definition: config.c:198
struct _ds5_publisher_s ds5_publisher_t
Represents a data publisher that publishers to remote DataSource peers on behalf of a ds5_dataprovide...
Definition: datasrc.h:501
void(* recv_request_t)(int peer, int count, char **subjects, unsigned short flags)
Definition of the function type used for handling data requests.
Definition: datasrc.h:273
DATASRCAPI void DATASRCAPI void DATASRCAPI void ds_config_add_error_message(const char *msg)
Add a configuration error to the logfile.
Definition: config.c:3426
DATASRCAPI int ds5_init(int argc, char **argv)
Parses the DataSource configuration files and initialises the DataSource library. The configuration i...
Definition: dsv5.c:108
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.
Definition: monitor.c:1196
DATASRCAPI void ds_monitor_free_data(ds_monitor_t *data)
Deallocate memory used by the contents of a ds_monitor_t object.
Definition: monitor.c:494
DATASRCAPI int32_t ds_add_record_char(ds_data_t *data, const char *field, char value)
Add a character value to a record object.
Definition: record.c:123
DATASRCAPI void ds_config_init(const char *file, int argc, char **argv)
Set up the configuration of the DataSource.
Definition: datasrc.c:217
int(* ds_monitor_authenticator_t)(ds_monauth_t *credentials)
Definition of the function type used for monitoring authentication callback.
Definition: datasrc.h:1488
void(* ds_loglevelchange_t)(ds_log_t *log, int new_level)
Callback used when the logging level of a log file is changed.
Definition: datasrc.h:1197
DATASRCAPI int ds_required_services_status(char *buf, size_t buflen)
Return whether all required services are ready.
Definition: advmap.c:4509
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.
Definition: monitor.c:951
DATASRCAPI char * ds_peer_label_byindex(int index)
Return the peer label for a peer index.
Definition: peer.c:4817
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1599
char * application_root
Definition: datasrc.h:360
DATASRCAPI int ds_fields_max()
Return the number of fields that have been defined.
Definition: fields.c:315
DATASRCAPI void ds_send_data_to_peer(int peer, ds_data_t *data)
Send the data object to a specific peer.
Definition: api.c:469
DATASRCAPI int32_t ds_add_record_int(ds_data_t *data, const char *field, int value)
Add an integer value to a record object.
Definition: record.c:87
DATASRCAPI int ds_pipe(sock_t fds[2])
Creates a UNIX-style pipe.
Definition: net.c:1055
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.
Definition: binary.c:223
DATASRCAPI ds_data_t * ds_clone_data(ds_data_t *data)
Create a clone of a data object.
Definition: api.c:969
DATASRCAPI void ds_setnonblocking(sock_t fd)
Set a socket to be non-blocking.
Definition: net.c:1021
char * subject
Definition: datasrc.h:2425
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.
Definition: monitor.c:872
DATASRCAPI int ds_signature_check(char *key_id, char *token)
Provides a mechanism for validating a KeyMaster-generated encrypted single-use token.
Definition: signature.c:490
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.
Definition: record.c:49
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.
Definition: dsv5_publisher.c:258
DATASRCAPI void ds_set_status_down_to_peer(int peer)
Causes the DataSource to disconnect and not accept connections for this peer.
Definition: peer.c:3541
DATASRCAPI ds_data_t * ds_init_data(const char *subject, unsigned short type, unsigned short flags)
Initialise a data object for use.
Definition: api.c:60
DATASRCAPI void DATASRCAPI int ds_log_set_log_level(ds_log_t *log, const char *level)
Set the log level for a particular logfile.
Definition: log.c:1847
DATASRCAPI void ds_config_add_optional_file(const char *file)
Add an optional configuration file to the current configuration context.
Definition: config.c:353
DATASRCAPI void ds_config_add_section(const char *longopt, const char *help)
Adds a new configuration section to the current configuration context.
Definition: config.c:907
DATASRCAPI sock_t ds_listen_socket(const char *addr, int port, int backlog)
Creates a listen socket on the specified local address and TCP port.
Definition: net.c:402
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.
Definition: config.c:654
unsigned short seq
Definition: datasrc.h:2422
DATASRCAPI ds_write_event_t * ds_add_write_event(sock_t fd, ds_io_event_cb cb, int val, void *data)
Add a socket write event.
Definition: event.c:438
DATASRCAPI ds_timed_event_t * ds_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.
Definition: event.c:1539
DATASRCAPI int ds_del_timed_event(ds_timed_event_t *ev)
Remove a timed event.
Definition: event.c:991
DATASRCAPI ds_read_event_t * ds_add_read_event(sock_t fd, ds_io_event_cb cb, int val, void *data)
Add a socket read event.
Definition: event.c:407
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.
Definition: replay.c:474
DATASRCAPI void ds_and(ds_set_t *p1, ds_set_t *p2, ds_set_t *a)
Combine 2 peersets using bitwise and.
Definition: peerset.c:78
DATASRCAPI void ds_add_news_topic_code(ds_data_t *data, const char *code)
Add a topic code to the news headline message.
Definition: news.c:141
DATASRCAPI char * ds_config_get_filename()
Return the current line number being parsed in the configuration file.
Definition: config.c:3563
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.
Definition: dsv5_publisher.c:276
DATASRCAPI int ds_object_can_contrib(const char *name)
Determine whether contributions can be sent for this object.
Definition: advmap.c:4236
ds_monitor_t *(* ds_monitor_active_cb)(char *templatename, char *key, char *propertyname)
Definition of the function type used for active request callbacks.
Definition: datasrc.h:1463
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.
Definition: container.c:73
DATASRCAPI void ds_config_set_option(const char *name, const char *value)
Set a particular configuration option.
Definition: config.c:2155
DATASRCAPI void ds_config_add_file(const char *file)
Add a mandatory configuration file to the current configuration context.
Definition: config.c:335
DATASRCAPI void ds_free_data(ds_data_t *data)
Deallocates the memory used by a data object.
Definition: api.c:767
void(* recv_update_t)(int peer, ds_data_t *pkt)
Definition of the function type used for receiving updates from a DataSource peer.
Definition: datasrc.h:191
DATASRCAPI ds_except_event_t * ds_add_except_event(sock_t fd, ds_io_event_cb cb, int val, void *data)
Add a socket exception event.
Definition: event.c:475
DATASRCAPI ds_data_t * ds_init_permission(const char *subject, const char *key, unsigned short flags)
Initialise a data object as a permission object.
Definition: permission.c:77
DATASRCAPI ds5_namespace_t * ds5_create_regex_namespace(const char *expr)
Creates a DataSource namespace which will match subject names using a regular expression.
Definition: dsv5_namespace.c:265
DATASRCAPI char * ds_get_service(const char *name)
Return the service for an object.
Definition: advmap.c:4090
DATASRCAPI void ds_udpsignal_send_argv(const char *message, char *argv[])
Send a UDP message.
Definition: udpsignal.c:377
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.
Definition: monitor.c:1376
DATASRCAPI struct tm * ds_gmtime()
Get the current time in GMT.
Definition: event.c:875
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.
Definition: binary.c:293
DATASRCAPI void ds_monitor_end_template(const char *templatename)
End the definition of a template.
Definition: monitor.c:843
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.
Definition: config.c:786
DATASRCAPI int ds_peer_by_label(const char *label)
Return the peer index for a label.
Definition: peer.c:4794
DATASRCAPI void ds_config_free_ctx(ds_config_ctx_t *ctx)
Free a configuration context.
Definition: config.c:224
Enumerated types structure.
Definition: datasrc.h:918
DATASRCAPI void ds5_config_init(const char *configfile, int argc, char **argv)
Sets up the configuration of the DataSource.
Definition: dsv5.c:79
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.
Definition: binary.c:343
DATASRCAPI void ds_send_data_no_free(ds_data_t *data)
Send the data object to all connected DataSource peers.
Definition: api.c:532
DATASRCAPI ds_data_t * ds_init_news(const char *subject, unsigned short flags)
Create a news headline message.
Definition: news.c:35
A field within a data update.
Definition: datasrc.h:2437
DATASRCAPI int ds_config_get_enum(const char *value, ds_config_enum_t *enums)
Get the value of an enumerated member.
Definition: config.c:1471
char * application_name
Definition: datasrc.h:359
DATASRCAPI int ds_peer_flags(int peer)
Gets the flags of a peer.
Definition: peer.c:1026
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.
Definition: event.c:771
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.
Definition: record.c:197
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1509
DATASRCAPI ds5_namespace_t * ds5_create_prefix_namespace(const char *prefix)
Creates a DataSource namespace which will match subject names based on their prefix.
Definition: dsv5_namespace.c:86
DATASRCAPI char * ds_fields_namebyindex(int index)
Return the field name of this index.
Definition: fields.c:578
DATASRCAPI void ds_monitor_create_group(const char *templatename, const char *key, const char *brief, const char *description)
Create a new monitoring group.
Definition: monitor.c:1124
DATASRCAPI void DATASRCAPI void ds_cycle_all_logs(const char *suffix, long maxsize)
Cycle all log files in the application.
Definition: log.c:1126
DATASRCAPI int ds_udp_send(const char *data, int len, const char *addr, int port)
Sends data to a UDP address.
Definition: net.c:872
DATASRCAPI int ds_fields_getflags(int index)
Return the field flags of this index.
Definition: fields.c:618
DATASRCAPI void ds_monitor_start_template(const char *templatename, const char *description)
Start the defintion of a template.
Definition: monitor.c:752
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 se...
Definition: permission.c:101
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.
Definition: config.c:481
DATASRCAPI sock_t ds_udp_listen_socket(const char *p_interface, int port)
Creates a UDP listen socket.
Definition: net.c:640
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.
Definition: config.c:386
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.
Definition: binary.c:408
DATASRCAPI void ds_monitor_del_subscription(const char *templatename, const char *key, const char *propertyname, const char *value)
Delete a subscription between two groups.
Definition: monitor.c:1098
int(* ds_timed_event_cb)(int id, int val, void *data)
Definition of the callback for use with timed events.
Definition: datasrc.h:1041
DATASRCAPI void ds_add_news_datetime(ds_data_t *data, const char *datestr)
Add a date stamp to the news headline message.
Definition: news.c:87
The container object for monitoring array types.
Definition: datasrc.h:1382
DATASRCAPI void ds_monitor_delete_group(const char *templatename, const char *key)
Delete a group from the monitoring system.
Definition: monitor.c:1143
DATASRCAPI void ds_config_parse_args(int argc, char **argv, int *retargc)
Parse the configuration options from the command line arguments given.
Definition: config.c:2249
DATASRCAPI int ds_set_request_hint(const char *name, int num, char **hints)
Set the objects hint peers.
Definition: advmap.c:4316
DATASRCAPI void ds_config_set_test(const char *tag, char **value)
Adds a conditional test to the configuration file.
Definition: config.c:1035
DATASRCAPI void ds_config_list_options()
Print the options in the current configuration context to standard output.
Definition: config.c:3280
DATASRCAPI int ds_peer_local_type(int peer)
Gets the local type of a DataSource peer.
Definition: peer.c:1066
DATASRCAPI ds_udp_event_t * ds_add_udp_event(const char *command, ds_udp_event_cb cb, int val, void *data)
Add a udp event.
Definition: test_license.c:54
void(* recv_nodata_t)(int peer, char *subject, unsigned short flags)
Definition of the function type used for receiving "nodata" messages.
Definition: datasrc.h:229
DATASRCAPI char * ds_peer_name(int peer)
Gets the name of a peer.
Definition: peer.c:983
DATASRCAPI void ds_set_subject(ds_data_t *data, const char *subject)
Sets a new name for the data object.
Definition: api.c:83
DATASRCAPI ds_log_t * ds_new_log(const char *name, const char *logname)
Create a new log object.
Definition: log.c:458
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 app...
Definition: dsv5.c:261
void ds_config_add_config_reading_message_fmt(const char *fmt,...)
Handle a configuration loading message. Add a formatted message to the list of messages to be logged...
Definition: config.c:3376
void(* ds_logcycled_t)(ds_log_t *log)
Callback used when the log has cycled.
Definition: datasrc.h:1205
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.
Definition: net.c:1161
int typeflags
Definition: datasrc.h:1430
DATASRCAPI ds5_namespace_t * ds5_create_globbed_namespace(const char *globbed)
Creates a DataSource namespace which will match subject names using globbing.
Definition: dsv5_namespace.c:138
DATASRCAPI void ds_monitor_del_relation(const char *templatename, const char *key, const char *propertyname, const char *targetkey)
Delete a relationship between two groups.
Definition: monitor.c:1039
void(* recv_peer_status_t)(int peer, int status, int val, void *data)
Definition of the function type used for receiving peer status messages.
Definition: datasrc.h:253
DATASRCAPI int ds_num_peers
The number of DataSource peers in your configuration.
Definition: peer.c:46
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.
Definition: binary.c:431
DATASRCAPI void ds_add_news_company_code(ds_data_t *data, const char *code)
Add a company code to the news headline message.
Definition: news.c:158
DATASRCAPI char * ds_debug_string(int level)
This function will convert a debug level into an appropriate string.
Definition: log.c:1655
DATASRCAPI int ds_udp_sendto(const char *data, int len, struct sockaddr_storage *serv_addr)
Sends data to a UDP address.
Definition: net.c:904
DATASRCAPI int ds_object_available(const char *name)
Determine whether this object can theoretically be requested.
Definition: advmap.c:4180
DATASRCAPI int ds_fields_numbyname(const char *name)
Return the field number of this field.
Definition: fields.c:445
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.
Definition: api.c:127
DATASRCAPI void ds_set_timed_delay_next(ds_timed_event_t *ev, double delay)
Alter the next fire time for an existing timed event.
Definition: event.c:1123
DATASRCAPI int ds_request_objects(int count, char **obs, char ***services)
Request a number of objects in one go.
Definition: advmap.c:3775
DATASRCAPI char * ds_getnameinfo(const struct sockaddr_storage *addr, char *buf, size_t buflen)
return the string representation of the address passed in
Definition: net.c:300
DATASRCAPI int ds_peer_type(int peer)
Gets the type of a DataSource peer.
Definition: peer.c:1046
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.
Definition: monitor.c:1334
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.
Definition: dsv5_publisher.c:341
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.
Definition: api.c:291
Monitoring credentials object.
Definition: datasrc.h:1471
An implementation of this interface allows applications to receive events raised for a ds5_subscripti...
Definition: datasrc.h:648
DATASRCAPI ds_monitor_t * ds_monitor_new(const char *propertyname, int type, int datasize, const void *datum)
Create a new ds_monitor_t object from input parameters.
Definition: monitor.c:544
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.
Definition: binary.c:370
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.
Definition: api.c:819
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.
Definition: binary.c:198
void ds_monitor_update_boolean(const char *templatename, const char *key, const char *propertyname, unsigned char value)
Post an update to the monitoring system for a boolean value.
Definition: monitor.c:1237
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.
Definition: binary.c:316
DATASRCAPI int ds_peer_up(int peer)
Check to see if a peer is up.
Definition: peer.c:1110
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.
Definition: api.c:348
DATASRCAPI void ds_config_end_section(const char *longopt, const char *help)
Ends a configuration section.
Definition: config.c:949
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.
Definition: log.c:1968
unsigned short count
Definition: datasrc.h:2426
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.
Definition: config.c:585
DATASRCAPI char * ds_request_object(const char *name)
Request an object.
Definition: advmap.c:3719
DATASRCAPI void ds_monitor_add_server_type(const char *type, const char *root)
Define The Server Type.
Definition: monitor.c:706
DATASRCAPI int ds_config_get_linenumber()
Return the name of current configuration file being parsed.
Definition: config.c:3593
struct _ds5_subscription_s ds5_subscription_t
Represents a subscription to a DataSource subject (see ds_create_active_subscription()) or to a names...
Definition: datasrc.h:633
DATASRCAPI int ds_udp_bind_client_socket(sock_t sock, const char *addr, int port)
Binds a UDP socket to a local address.
Definition: net.c:979
DATASRCAPI void ds_monitor_add_subscription(const char *templatename, const char *key, const char *propertyname, const char *value)
Add a subscription between two groups.
Definition: monitor.c:1074
DATASRCAPI int ds_signature_verify_username(char *expected_username, char *token)
Verify that the supplied token is for the expected username.
Definition: signature.c:805
recv_object_status_t recv_object_status
Definition: datasrc.h:372
DATASRCAPI void ds_set_status_down()
Causes the DataSource to disconnect and stop listening for connections.
Definition: peer.c:3472
DATASRCAPI void ds_reserve_std_fds()
Reserves the standard sockets for the std streams.
Definition: datasrc.c:171
DATASRCAPI void ds_cache_add_object(char *subject)
Add a new object to the cache.
Definition: cache.c:293
char * name
Definition: datasrc.h:920
char * docstring
Definition: datasrc.h:1433
recv_service_status_t recv_service_status
Definition: datasrc.h:377
DATASRCAPI void ds_send_nodata_direct(const char *subject, unsigned short flags)
Send a "no data" message to all connected DataSource peers.
Definition: api.c:680
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.
Definition: log.c:962
DATASRCAPI int ds_del_timed_event_free_data(ds_timed_event_t *ev, void(*free_data)(int, void *))
Remove a timed event.
Definition: event.c:1032
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.
Definition: binary.c:458
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.
Definition: log.c:1952
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.
Definition: monitor.c:788
char * docstring
Definition: datasrc.h:922
int sock_t
The network socket datatype.
Definition: datasrc.h:128
char * description
Definition: datasrc.h:1432
Implement this interface to receive connection status information when using the DSv5 API...
Definition: datasrc.h:594
DATASRCAPI int ds_fields_indexbynum(int num)
Return the index of this field.
Definition: fields.c:535
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...
Definition: datasrc.h:209
DATASRCAPI void ds_monitor_add_data(ds_monitor_t *data, const void *datum)
Add an element to an array within a ds_monitor_t.
Definition: monitor.c:406
DATASRCAPI sock_t ds_client_socket(const char *serv, unsigned short port)
Creates a client socket with which to connect to a host.
Definition: net.c:856
ds_field_t * fields
Definition: datasrc.h:2427
DATASRCAPI void ds_discard_object(const char *name)
Discard an object.
Definition: advmap.c:3908
unsigned short flags
Definition: datasrc.h:362
DATASRCAPI void ds_replay(recv_replay_t callback)
Replays all data in the current packet log file.
Definition: replay.c:175
DATASRCAPI void ds_set_status_up_to_peer(int peer)
Causes the DataSource to connect and accept connections.
Definition: peer.c:3780
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.
Definition: replay.c:500
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.
Definition: monitor.c:1168
DATASRCAPI void ds_config_end_group(const char *longopt, const char *help)
Ends a configuration group.
Definition: config.c:866
DATASRCAPI char * ds_fields_namebynum(int num)
Return the field name of this field number.
Definition: fields.c:475
DATASRCAPI void ds_send_nodata(const char *subject, unsigned short flags)
Send a "no data" message to all connected DataSource peers.
Definition: api.c:657
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.
Definition: config.c:619
DATASRCAPI void ds_monitor_add_relation(const char *templatename, const char *key, const char *propertyname, const char *targetkey)
Add a relationship between two groups.
Definition: monitor.c:1014
DATASRCAPI void ds_thread_init(int event_module, int flags)
Initialise the event loop for this thread.
Definition: datasrc.c:909
char * name
Definition: datasrc.h:1431
Definition of the interface that you should implement if you require custom subject matching logic...
Definition: datasrc.h:432
DATASRCAPI int ds_del_write_event_free_data(ds_write_event_t *ev, void(*free_data)(int, void *))
Remove a socket write event.
Definition: event.c:668
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.
Definition: monitor.c:1315
DATASRCAPI void ds_set_timed_delay(ds_timed_event_t *ev, double delay)
Alter the delay for an existing timed event.
Definition: event.c:1103
DATASRCAPI void ds_config_del_test(const char *tag)
Delete a conditional test.
Definition: config.c:1069
DATASRCAPI void ds_add_news_headline(ds_data_t *data, const char *headline)
Add a news headline to the news headline message.
Definition: news.c:53
DATASRCAPI ds5_subscription_t * ds5_create_broadcast_subscription(ds5_namespace_t *nspace, ds5_subscriptionlistener_t *listener, void *context)
Create a subscription that matches multiple subjects.
Definition: dsv5_subscription.c:98
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.
Definition: api.c:792
struct _ds_udp_event ds_udp_event_t
Opaque type defining a udp event.
Definition: datasrc.h:2467
DATASRCAPI void ds_delay_data(ds_delay_t *delay, ds_data_t *dsdata)
Add a data object to a delay channel.
Definition: delay.c:290
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.
Definition: datasrc.h:314
DATASRCAPI ds_log_t * ds_new_level_log(const char *name, const char *logname, ds_loglevelchange_t change_cb)
Create a new log object.
Definition: log.c:481
DATASRCAPI void ds_add_news_storycode(ds_data_t *data, const char *story)
Add a story code to the news object.
Definition: news.c:70
DATASRCAPI void ds_send_data_direct(ds_data_t *data)
Send the data object to all connected DataSource peers.
Definition: api.c:404
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.
Definition: api.c:201
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.
Definition: binary.c:569
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1553
DATASRCAPI void ds_config_del_option(const char *longopt)
Remove an option from the current configuration context.
Definition: config.c:727
char * propertyname
Definition: datasrc.h:1405
void(* recv_discard_t)(int peer, int count, char **subjects, unsigned short flags)
Definition of the function type used for handling data discard requests.
Definition: datasrc.h:293
The container object for all monitoring values.
Definition: datasrc.h:1403
DATASRCAPI void * ds_get_object_data(const char *name)
Get an objects user data.
Definition: advmap.c:4483
DATASRCAPI void ds5_publish_subject_error(ds5_publisher_t *publisher, const char *subject, int flags)
Publishes a subscription error event for a subject.
Definition: dsv5_publisher.c:357
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.
Definition: event.c:754
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.
Definition: news.c:200
unsigned short flags
Definition: datasrc.h:2423
DATASRCAPI int ds_peer_host_details(int peer, char **addr)
Gets details of the remote side of a peer.
Definition: peer.c:941
Structure defining the arguments for Monitoring methods.
Definition: datasrc.h:1428
void(* ds_delay_send_cb)(void *context, ds_data_t *dsdata)
Definition of the callback for sending delayed data.
Definition: datasrc.h:2273
DATASRCAPI int ds_cycle_log(ds_log_t *log, const char *suffix, long maxsize)
Cycle a specific log file.
Definition: log.c:1157
struct _ds_log ds_log_t
The log file object.
Definition: datasrc.h:175
unsigned short type
Definition: datasrc.h:363
DATASRCAPI void ds_add_news_authstr(ds_data_t *data, const char *authstr)
Add an authorisation string to the news headline message.
Definition: news.c:107
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1465
DATASRCAPI void ds_add_data_str(ds_data_t *data, int32_t fieldnum, const char *value)
Adds a string value to a data object.
Definition: api.c:154
void(* free)(ds5_namespace_t *nspace)
Invoked when the namespace should be deleted.
Definition: datasrc.h:439
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...
Definition: replay.c:565
DATASRCAPI ds_timed_event_t * ds_add_timed_event(int id, double delay, ds_timed_event_cb cb, int val, void *data)
Add a timed event.
Definition: event.c:922
DATASRCAPI void ds_send_data(ds_data_t *data)
Send the data object to all connected DataSource peers.
Definition: api.c:379
struct _ds_peer_set ds_set_t
Defines a set of DataSource peers.
Definition: datasrc.h:153
DATASRCAPI void ds_writev(ds_log_t *log, struct iovec *vector, int count)
Write binary data to a log object.
Definition: log.c:855
DATASRCAPI void ds_send_data_to_peer_no_free(int peer, ds_data_t *data)
Send the data object to a specific peer.
Definition: api.c:596
DATASRCAPI void ds_stop()
Definition: event.c:819
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.
Definition: config.c:814
ds_monitor_t * ds_monitor_new_boolean(const char *templatename, const char *key, const char *propertyname, unsigned char value)
Create a new ds_monitor_t object from an input boolean value.
Definition: monitor.c:1443
DATASRCAPI int ds_fields_getdp(int index)
Return the decimal precision of this index.
Definition: fields.c:635
DATASRCAPI void ds_set_status_msg_to_peer(int peer, unsigned short msgid, const char *msgstr)
Send a user-defined status message to peer.
Definition: peer.c:3638
struct _ds_timed_event ds_timed_event_t
Opaque type defining a timed event.
Definition: datasrc.h:987
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.
Definition: monitor.c:1256
void ds_config_add_error_message_fmt(const char *fmt,...)
Add a formatted error message to the logfile.
Definition: config.c:3344
DATASRCAPI sock_t ds_udp_client_socket(const char *addr, int port, struct sockaddr_storage *serv_addr)
Creates a UDP client socket.
Definition: net.c:936
DATASRCAPI void ds_monitor_free(ds_monitor_t *data)
Deallocate memory used by a ds_monitor_t object.
Definition: monitor.c:472
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.
Definition: binary.c:626
DATASRCAPI ds_log_t * ds_new_headed_log(const char *name, const char *logname, const char *header)
Create a new log object with a header.
Definition: log.c:733
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.
Definition: api.c:880
DATASRCAPI int ds5_regex_namespace_add_expr(ds5_namespace_t *nspace, const char *expr, int exclude)
Adds a regular expression to a namespace.
Definition: dsv5_namespace.c:230
DATASRCAPI char ** ds_get_request_hints(const char *name, int *ret)
Return an objects request hints.
Definition: advmap.c:4395
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1531
size_t size
Definition: datasrc.h:1383
DATASRCAPI void ds_set_status_up()
Causes the DataSource to connect and listen for connections.
Definition: peer.c:3741
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.
Definition: event.c:1819
DATASRCAPI void ds_loop()
Start the DataSource event loop.
Definition: event.c:792
DATASRCAPI void ds_udpsignal_send(const char *message)
Send a udp message.
Definition: udpsignal.c:359
A data update object.
Definition: datasrc.h:2420
DATASRCAPI void ds_add_news_product_code(ds_data_t *data, const char *code)
Add a product code to the news headline message.
Definition: news.c:124
DATASRCAPI void ds5_unsubscribe(ds5_subscription_t *sub)
Unsubscribe from the DataSource subject or namespace of DataSource subjects.
Definition: dsv5_subscription.c:534
DATASRCAPI int ds_debug_level(const char *text)
This function will convert a string into an appropriate debug level.
Definition: log.c:1620
DATASRCAPI int ds_iszero(ds_set_t *p)
Check if any peer is set.
Definition: peerset.c:28
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...
Definition: dsv5_publisher.c:242
DATASRCAPI ds_delay_t * ds_new_delay(double delay_time, char *prefix, double batch_time)
Create a new delay channel.
Definition: delay.c:200
DATASRCAPI void ds_purge_object(const char *name)
Purge an object from our cache.
Definition: advmap.c:4284
DATASRCAPI int ds_request_objects_with_flags(int count, char **obs, int flags, char ***services)
Request a number of objects in one go.
Definition: advmap.c:3800
void(* recv_map_t)(int peer, char *from, char *to)
Definition of the function type used for handling map messages.
Definition: datasrc.h:337
DATASRCAPI int ds_peer_enabled_state(int peer)
Gets the enabled/disabled state of a DataSource peer.
Definition: peer.c:1084
void(* recv_service_status_t)(char *service, int status)
Definition of the function type used for handling service status messages.
Definition: datasrc.h:325
DATASRCAPI int ds_fields_indexbyname(const char *name)
Return the index of this field.
Definition: fields.c:502
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.
Definition: dsv5_publisher.c:225
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1399
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.
Definition: news.c:178
char * value
Definition: datasrc.h:2441
DATASRCAPI void ds_config_parse_files()
Parse all configuration files within the current configuration context.
Definition: config.c:2084
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.
Definition: config.c:453
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 s...
Definition: dsv5_publisher.c:293
DATASRCAPI void ds_remove_container_symbol(ds_data_t *data, const char *symbol)
Remove an object from the container.
Definition: container.c:100
char * username
Definition: datasrc.h:1473
DATASRCAPI sock_t ds_accept_socket(sock_t fd)
Accepts a connection from a listen socket.
Definition: net.c:503
int(* ds_io_event_cb)(sock_t sock, int val, void *data)
Definition of the callback for use with read and write events.
Definition: datasrc.h:1029
DATASRCAPI ds5_publisher_t * ds5_create_broadcast_publisher(ds5_namespace_t *nspace)
Creates a data publisher that allows a DataSource application to broadcast updates to remote DataSour...
Definition: dsv5_publisher.c:739
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.
Definition: api.c:321
DATASRCAPI ds_monitor_t * ds_monitor_new_array(const char *propertyname, int type)
Create a new ds_monitor_t of an array type.
Definition: monitor.c:384
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 s...
Definition: dsv5_publisher.c:309
DATASRCAPI void ds_config_add_search(const char *path)
Add a directory in which to search for configuration files.
Definition: config.c:278
unsigned short type
Definition: datasrc.h:2424
DATASRCAPI ds5_publisher_t * ds5_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 ...
Definition: dsv5_publisher.c:179
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.
Definition: replay.c:519
DATASRCAPI void ds_replay_from_log(recv_replay_t callback, ds_log_t *log)
Replays all data in a packet log file.
Definition: replay.c:154
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1575
DATASRCAPI void ds_set_status_msg(unsigned short msgid, const char *msgstr)
Send a user-defined status message to all connected peers.
Definition: peer.c:3574
struct _ds_io_event ds_write_event_t
Opaque type defining a write event.
Definition: datasrc.h:1009
DATASRCAPI char * ds_filename_expand(const char *format, char *buffer, size_t bufsize)
Expand a filename pattern into a fully qualified filename.
Definition: datasrc.c:1156
double value
Definition: datasrc.h:921
DATASRCAPI ds_log_t * ds_get_event_log(void)
Returns a handle to the event log used by Datasource for C.
Definition: datasrc.c:1297
recv_request_t recv_request
Definition: datasrc.h:364
DATASRCAPI ds_config_ctx_t * ds_config_set_ctx(ds_config_ctx_t *ctx)
Sets a configuration context as the current one.
Definition: config.c:257
char * password
Definition: datasrc.h:1474
struct _config_ctx ds_config_ctx_t
The configuration context data type.
Definition: datasrc.h:170
DATASRCAPI void ds_del_udp_event(ds_udp_event_t *event)
Remove a timed event.
Definition: udpsignal.c:182
DATASRCAPI int ds_send_contribution(ds_data_t *dsdata)
Contribute an object back to the peers that supplied it and support it.
Definition: advmap.c:4015
recv_map_t recv_map
Definition: datasrc.h:378
DATASRCAPI void ds_config_list_values()
Print the options and values in the current configuration context to standard output.
Definition: config.c:3294
Interface that must be implemented in order to receive subscirption request and subscription discard ...
Definition: datasrc.h:519
DATASRCAPI int ds_peer_all_type(int flag)
Checks if a DataSource peer of the given type is in your configuration file.
Definition: peer.c:1136
int32_t fieldnum
Definition: datasrc.h:2439
recv_peer_status_t recv_peer_status
Definition: datasrc.h:368
char * logfile
Definition: datasrc.h:381
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
Definition: lty_chain.c:246
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.
Definition: monitor.c:1276
ds_log_t * log
Definition: datasrc.h:382
DATASRCAPI ds_monitor_authenticator_t ds_monitor_set_auth(ds_monitor_authenticator_t authenticator)
Register a new authentication handler.
Definition: monitor.c:1620
struct _ds_io_event ds_except_event_t
Opaque type defining an exception event.
Definition: datasrc.h:994
DATASRCAPI char * ds_request_object_with_flags(const char *name, int flags)
Request an object.
Definition: advmap.c:3738
struct _ds_io_event ds_read_event_t
Opaque type defining a read event.
Definition: datasrc.h:1002
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.
Definition: api.c:231
DATASRCAPI ds_timed_event_t * ds_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.
Definition: event.c:1724
DATASRCAPI int ds_daemon_disabled()
Check whether the application is running in daemon mode.
Definition: daemon.c:159
DATASRCAPI void ds_daemon_redirect()
Redirects the std* streams.
Definition: daemon.c:139
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.
Definition: binary.c:520
DATASRCAPI char * ds_debug_config_string(int level)
This function will convert a debug level into an appropriate string.
Definition: log.c:1687
void(* ds_config_func)(char *name, int num, char **values)
Definition of function type used for configuration callbacks.
Definition: datasrc.h:939
DATASRCAPI int ds_config_parse_file(const char *unresolved_filename)
Parse a single configuration file within the configuration context.
Definition: config.c:2480
DATASRCAPI void ds_cleardown_container_with_prefix(ds_data_t *data, const char *prefix)
Remove a set of symbols from the container.
Definition: container.c:139
DATASRCAPI int ds_get_gmt_offset(time_t t)
Calculate offset between local time and gmt.
Definition: event.c:1560
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.
Definition: binary.c:485
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.
Definition: peerset.c:133
DATASRCAPI int ds_del_read_event(ds_read_event_t *ev)
Remove a socket read event.
Definition: event.c:573
int32_t len
Definition: datasrc.h:2440
DATASRCAPI int ds_log_get_level(ds_log_t *log)
Get the current loglevel for the given logfile.
Definition: log.c:1984
DATASRCAPI void ds_or(ds_set_t *p1, ds_set_t *p2, ds_set_t *o)
Combine 2 peersets using bitwise or.
Definition: peerset.c:55
struct _ds_io_event ds_generic_event_t
Opaque type defining a generic read/write event.
Definition: datasrc.h:1016
void ds_log(ds_log_t *log, int level, const char *fmt,...)
Write a formatted string prefixed with log level and timestamp to the log object. ...
Definition: log.c:1756
recv_nodata_t recv_nodata
Definition: datasrc.h:367
DATASRCAPI int ds_init(ds_init_t *init, int argc, char **argv)
Parse the configuration files and initialise the DataSource library.
Definition: datasrc.c:417
DATASRCAPI int ds_peer_details(int peer, char **name)
Gets the ID and name of a peer.
Definition: peer.c:924
char * ipaddress
Definition: datasrc.h:1475
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.
Definition: record.c:160
void ds_printf_time(ds_log_t *log, const char *fmt,...)
Write a formatted string prefixed with a timestamp string to a log object.
Definition: log.c:925
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.
Definition: api.c:728
DATASRCAPI void ds_discard_objects(int count, char **obs)
Discard a number of objects.
Definition: advmap.c:3950
DATASRCAPI int ds_del_write_event(ds_write_event_t *ev)
Remove a socket write event.
Definition: event.c:633
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.
Definition: event.c:1296
DATASRCAPI int ds_get_service_by_index(int index, char **name_ptr)
Return the name/state of a service by index.
Definition: advmap.c:4154
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 spec...
Definition: replay.c:617
struct _ds_delay ds_delay_t
The delay channel object type.
Definition: datasrc.h:164
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1421
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.
Definition: config.c:424
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.
Definition: container.c:119
int(* ds_udp_event_cb)(int argc, char *argv[], int val, void *data)
Definition of the callback for use with udp events.
Definition: datasrc.h:2480
DATASRCAPI struct sockaddr_storage * ds_gethostsockaddr(const char *name, struct sockaddr_storage *populate)
Return the socket address for a given hostname.
Definition: net.c:248
DATASRCAPI time_t ds_get_time()
Gets the current time in seconds.
Definition: event.c:862
void ds_syslog(ds_log_t *log, int level, const char *fmt,...)
Write a formatted string to a log object and to syslog.
Definition: log.c:993
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
Definition: lty_chain.c:303
DATASRCAPI int ds_del_except_event_free_data(ds_except_event_t *ev, void(*free_data)(int, void *))
Remove a socket except event.
Definition: event.c:727
int(* match)(ds5_namespace_t *nspace, const char *subject)
Tests a subject to see if it falls within this namespace.
Definition: datasrc.h:449
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.
Definition: binary.c:255
DATASRCAPI ds5_publisher_t * ds5_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 s...
Definition: dsv5_publisher.c:122
DATASRCAPI ds_delay_t * ds_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.
Definition: delay.c:238
DATASRCAPI ds_data_t * ds_init_page(const char *subject, int rows, int cols, const char *type, unsigned short flags)
Initialise a data object as a page.
Definition: page.c:72
DATASRCAPI void ds_add_page_field(ds_data_t *data, int32_t fieldnum, const char *value)
Add an arbitrary field to a page.
Definition: page.c:136
int datatype
Definition: datasrc.h:1406
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.
Definition: monitor.c:1353
recv_discard_t recv_discard
Definition: datasrc.h:365
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.
Definition: page.c:110
DATASRCAPI sock_t ds_multicast_listen_socket(const char *p_interface, const char *addr, int port)
Creates a multicast listen socket.
Definition: net.c:525
DATASRCAPI int ds_get_num_services()
Return the number of services.
Definition: advmap.c:4137
DATASRCAPI ds_monitor_t * ds_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.
Definition: monitor.c:1487
DATASRCAPI int ds_del_read_event_free_data(ds_read_event_t *ev, void(*free_data)(int, void *))
Remove a socket read event.
Definition: event.c:608
DATASRCAPI int ds_fields_numbyindex(int index)
Return the field number of this index.
Definition: fields.c:560
DATASRCAPI void ds_free_log(ds_log_t *log)
Destroy a log object.
Definition: log.c:763
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.
Definition: monitor.c:1217
DATASRCAPI struct tm * ds_localtime()
Get the current time in the local timezone.
Definition: event.c:888
DATASRCAPI void ds_set_object_data(const char *name, void *data)
Set an objects user data.
Definition: advmap.c:4439
DATASRCAPI int ds_peer_id(int peer)
Gets the ID of a peer.
Definition: peer.c:963
DATASRCAPI void ds_add_data(ds_data_t *data, int32_t fieldnum, const char *value)
Adds a string value to a data object.
Definition: api.c:108