diff --git a/src/core/ddsc/src/dds_writer.c b/src/core/ddsc/src/dds_writer.c index b36bfc9..f144e35 100644 --- a/src/core/ddsc/src/dds_writer.c +++ b/src/core/ddsc/src/dds_writer.c @@ -313,38 +313,13 @@ dds_writer_qos_set( static struct whc *make_whc(const dds_qos_t *qos) { - bool startup_mode; bool handle_as_transient_local; unsigned hdepth, tldepth; - /* Startup mode causes the writer to treat data in its WHC as if - transient-local, for the first few seconds after startup of the - DDSI service. It is done for volatile reliable writers only - (which automatically excludes all builtin writers) or for all - writers except volatile best-effort & transient-local ones. - - Which one to use depends on whether merge policies are in effect - in durability. If yes, then durability will take care of all - transient & persistent data; if no, DDSI discovery usually takes - too long and this'll save you. - - Note: may still be cleared, if it turns out we are not maintaining - an index at all (e.g., volatile KEEP_ALL) */ - if (config.startup_mode_full) { - startup_mode = gv.startup_mode && - (qos->durability.kind >= NN_TRANSIENT_DURABILITY_QOS || - (qos->durability.kind == NN_VOLATILE_DURABILITY_QOS && - qos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS)); - } else { - startup_mode = gv.startup_mode && - (qos->durability.kind == NN_VOLATILE_DURABILITY_QOS && - qos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS); - } - /* Construct WHC -- if aggressive_keep_last1 is set, the WHC will drop all samples for which a later update is available. This forces it to maintain a tlidx. */ handle_as_transient_local = (qos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS); - if (!config.aggressive_keep_last_whc || qos->history.kind == NN_KEEP_ALL_HISTORY_QOS) + if (qos->history.kind == NN_KEEP_ALL_HISTORY_QOS) hdepth = 0; else hdepth = (unsigned)qos->history.depth; @@ -353,8 +328,6 @@ static struct whc *make_whc(const dds_qos_t *qos) tldepth = 0; else tldepth = (unsigned)qos->durability_service.history.depth; - } else if (startup_mode) { - tldepth = (hdepth == 0) ? 1 : hdepth; } else { tldepth = 0; } diff --git a/src/core/ddsi/include/dds/ddsi/q_config.h b/src/core/ddsi/include/dds/ddsi/q_config.h index c313682..50ceb51 100644 --- a/src/core/ddsi/include/dds/ddsi/q_config.h +++ b/src/core/ddsi/include/dds/ddsi/q_config.h @@ -237,7 +237,6 @@ struct config FILE *tracingOutputFile; char *tracingOutputFileName; int tracingTimestamps; - int tracingRelativeTimestamps; int tracingAppendToFile; unsigned allowMulticast; enum transport_selector transport_selector; @@ -254,7 +253,6 @@ struct config char *assumeMulticastCapable; int64_t spdp_interval; int64_t spdp_response_delay_max; - int64_t startup_mode_duration; int64_t lease_duration; int64_t const_hb_intv_sched; int64_t const_hb_intv_sched_min; @@ -263,8 +261,6 @@ struct config enum retransmit_merging retransmit_merging; int64_t retransmit_merging_period; int squash_participants; - int startup_mode_full; - int forward_all_messages; int liveliness_monitoring; int noprogress_log_stacktraces; int64_t liveliness_monitoring_interval; @@ -278,10 +274,6 @@ struct config unsigned delivery_queue_maxsamples; - int enableLoopback; - enum durability_cdr durability_cdr; - - int buggy_datafrag_flags_mode; int do_topic_discovery; uint32_t max_msg_size; @@ -298,9 +290,7 @@ struct config int tcp_use_peeraddr_for_unicast; #ifdef DDSI_INCLUDE_SSL - /* SSL support for TCP */ - int ssl_enable; int ssl_verify; int ssl_verify_client; @@ -310,17 +300,13 @@ struct config char * ssl_key_pass; char * ssl_ciphers; struct ssl_min_version ssl_min_version; - #endif /* Thread pool configuration */ - int tp_enable; uint32_t tp_threads; uint32_t tp_max_threads; - int advertise_builtin_topic_writers; - #ifdef DDSI_INCLUDE_NETWORK_CHANNELS struct config_channel_listelem *channels; struct config_channel_listelem *max_channel; /* channel with highest prio; always computed */ @@ -343,7 +329,6 @@ struct config uint32_t rmsg_chunk_size; /**<< size of a chunk in the receive buffer */ uint32_t rbuf_size; /* << size of a single receiver buffer */ enum besmode besmode; - int aggressive_keep_last_whc; int conservative_builtin_reader_startup; int meas_hb_to_ack_latency; int suppress_spdp_multicast; @@ -389,8 +374,6 @@ struct config int explicitly_publish_qos_set_to_default; enum many_sockets_mode many_sockets_mode; int arrival_of_data_asserts_pp_and_ep_liveliness; - int acknack_numbits_emptyset; - int respond_to_rti_init_zero_ack_with_invalid_heartbeat; int assume_rti_has_pmd_endpoints; int port_dg; @@ -406,14 +389,9 @@ struct config int initial_deaf; int initial_mute; int64_t initial_deaf_mute_reset; + int use_multicast_if_mreqn; struct prune_deleted_ppant prune_deleted_ppant; - - /* not used by ddsi2, only validated; user layer directly accesses - the configuration tree */ - ddsrt_sched_t watchdog_sched_class; - int32_t watchdog_sched_priority; - q__schedPrioClass watchdog_sched_priority_class; }; struct ddsi_plugin diff --git a/src/core/ddsi/include/dds/ddsi/q_entity.h b/src/core/ddsi/include/dds/ddsi/q_entity.h index f606786..4c0c4bd 100644 --- a/src/core/ddsi/include/dds/ddsi/q_entity.h +++ b/src/core/ddsi/include/dds/ddsi/q_entity.h @@ -233,8 +233,6 @@ struct writer enum writer_state state; unsigned reliable: 1; /* iff 1, writer is reliable <=> heartbeat_xevent != NULL */ unsigned handle_as_transient_local: 1; /* controls whether data is retained in WHC */ - unsigned aggressive_keep_last: 1; /* controls whether KEEP_LAST will overwrite samples that haven't been ACK'd yet */ - unsigned startup_mode: 1; /* causes data to be treated as T-L for a while */ unsigned include_keyhash: 1; /* iff 1, this writer includes a keyhash; keyless topics => include_keyhash = 0 */ unsigned retransmitting: 1; /* iff 1, this writer is currently retransmitting */ #ifdef DDSI_INCLUDE_SSM @@ -570,7 +568,6 @@ void update_proxy_writer (struct proxy_writer * pwr, struct addrset *as); int new_proxy_group (const struct nn_guid *guid, const char *name, const struct nn_xqos *xqos, nn_wctime_t timestamp); void delete_proxy_group (const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit); -void writer_exit_startup_mode (struct writer *wr); uint64_t writer_instance_id (const struct nn_guid *guid); /* Call this to empty all address sets of all writers to stop all outgoing traffic, or to diff --git a/src/core/ddsi/include/dds/ddsi/q_globals.h b/src/core/ddsi/include/dds/ddsi/q_globals.h index 517b699..857bd4c 100644 --- a/src/core/ddsi/include/dds/ddsi/q_globals.h +++ b/src/core/ddsi/include/dds/ddsi/q_globals.h @@ -223,13 +223,6 @@ struct q_globals { /* Flag cleared when stopping (receive threads). FIXME. */ int rtps_keepgoing; - /* Startup mode causes data to be treated as transient-local with - depth 1 (i.e., stored in the WHCs and regurgitated on request) to - cover the start-up delay of the discovery protocols. Because all - discovery data is shared, this is strictly a start-up issue of the - service. */ - int startup_mode; - /* Start time of the DDSI2 service, for logging relative time stamps, should I ever so desire. */ nn_wctime_t tstart; diff --git a/src/core/ddsi/include/dds/ddsi/q_misc.h b/src/core/ddsi/include/dds/ddsi/q_misc.h index dcc4224..f410ebb 100644 --- a/src/core/ddsi/include/dds/ddsi/q_misc.h +++ b/src/core/ddsi/include/dds/ddsi/q_misc.h @@ -29,7 +29,7 @@ inline nn_sequence_number_t toSN (seqno_t n) { return x; } -unsigned char normalize_data_datafrag_flags (const SubmessageHeader_t *smhdr, int datafrag_as_data); +unsigned char normalize_data_datafrag_flags (const SubmessageHeader_t *smhdr); #ifdef DDSI_INCLUDE_NETWORK_PARTITIONS int WildcardOverlap(char * p1, char * p2); diff --git a/src/core/ddsi/include/dds/ddsi/q_xevent.h b/src/core/ddsi/include/dds/ddsi/q_xevent.h index 3ab7242..ef356f4 100644 --- a/src/core/ddsi/include/dds/ddsi/q_xevent.h +++ b/src/core/ddsi/include/dds/ddsi/q_xevent.h @@ -61,7 +61,6 @@ DDS_EXPORT struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched DDS_EXPORT struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pwr_guid, const nn_guid_t *rd_guid); DDS_EXPORT struct xevent *qxev_spdp (nn_mtime_t tsched, const nn_guid_t *pp_guid, const nn_guid_t *proxypp_guid); DDS_EXPORT struct xevent *qxev_pmd_update (nn_mtime_t tsched, const nn_guid_t *pp_guid); -DDS_EXPORT struct xevent *qxev_end_startup_mode (nn_mtime_t tsched); DDS_EXPORT struct xevent *qxev_delete_writer (nn_mtime_t tsched, const nn_guid_t *guid); /* cb will be called with now = T_NEVER if the event is still enqueued when when xeventq_free starts cleaning up */ diff --git a/src/core/ddsi/src/q_config.c b/src/core/ddsi/src/q_config.c index f3ea0a7..6c22b64 100644 --- a/src/core/ddsi/src/q_config.c +++ b/src/core/ddsi/src/q_config.c @@ -53,57 +53,57 @@ struct q_security_plugins q_security_plugin = { NULL, NULL, NULL, NULL, NULL, NU #endif struct unit { - const char *name; - int64_t multiplier; + const char *name; + int64_t multiplier; }; struct cfgelem { - const char *name; - const struct cfgelem *children; - const struct cfgelem *attributes; - int multiplicity; - const char *defvalue; /* NULL -> no default */ - int relative_offset; - int elem_offset; - init_fun_t init; - update_fun_t update; - free_fun_t free; - print_fun_t print; - const char *description; + const char *name; + const struct cfgelem *children; + const struct cfgelem *attributes; + int multiplicity; + const char *defvalue; /* NULL -> no default */ + int relative_offset; + int elem_offset; + init_fun_t init; + update_fun_t update; + free_fun_t free; + print_fun_t print; + const char *description; }; struct cfgst_nodekey { - const struct cfgelem *e; + const struct cfgelem *e; }; struct cfgst_node { - ddsrt_avl_node_t avlnode; - struct cfgst_nodekey key; - int count; - int failed; - int is_default; + ddsrt_avl_node_t avlnode; + struct cfgst_nodekey key; + int count; + int failed; + int is_default; }; struct cfgst { - ddsrt_avl_tree_t found; - struct config *cfg; - /* error flag set so that we can continue parsing for some errors and still fail properly */ - int error; + ddsrt_avl_tree_t found; + struct config *cfg; + /* error flag set so that we can continue parsing for some errors and still fail properly */ + int error; - /* path_depth, isattr and path together control the formatting of - error messages by cfg_error() */ - int path_depth; - int isattr[MAX_PATH_DEPTH]; - const struct cfgelem *path[MAX_PATH_DEPTH]; - void *parent[MAX_PATH_DEPTH]; + /* path_depth, isattr and path together control the formatting of + error messages by cfg_error() */ + int path_depth; + int isattr[MAX_PATH_DEPTH]; + const struct cfgelem *path[MAX_PATH_DEPTH]; + void *parent[MAX_PATH_DEPTH]; }; /* "trace" is special: it enables (nearly) everything */ static const char *logcat_names[] = { - "fatal", "error", "warning", "info", "config", "discovery", "data", "radmin", "timing", "traffic", "topic", "tcp", "plist", "whc", "throttle", "rhc", "trace", NULL + "fatal", "error", "warning", "info", "config", "discovery", "data", "radmin", "timing", "traffic", "topic", "tcp", "plist", "whc", "throttle", "rhc", "trace", NULL }; static const uint32_t logcat_codes[] = { - DDS_LC_FATAL, DDS_LC_ERROR, DDS_LC_WARNING, DDS_LC_INFO, DDS_LC_CONFIG, DDS_LC_DISCOVERY, DDS_LC_DATA, DDS_LC_RADMIN, DDS_LC_TIMING, DDS_LC_TRAFFIC, DDS_LC_TOPIC, DDS_LC_TCP, DDS_LC_PLIST, DDS_LC_WHC, DDS_LC_THROTTLE, DDS_LC_RHC, DDS_LC_ALL + DDS_LC_FATAL, DDS_LC_ERROR, DDS_LC_WARNING, DDS_LC_INFO, DDS_LC_CONFIG, DDS_LC_DISCOVERY, DDS_LC_DATA, DDS_LC_RADMIN, DDS_LC_TIMING, DDS_LC_TRAFFIC, DDS_LC_TOPIC, DDS_LC_TCP, DDS_LC_PLIST, DDS_LC_WHC, DDS_LC_THROTTLE, DDS_LC_RHC, DDS_LC_ALL }; /* "trace" is special: it enables (nearly) everything */ @@ -115,12 +115,12 @@ static const uint32_t xcheck_codes[] = { }; /* We want the tracing/verbosity settings to be fixed while parsing -the configuration, so we update this variable instead. */ + the configuration, so we update this variable instead. */ static uint32_t enabled_logcats; static int cfgst_node_cmp(const void *va, const void *vb); static const ddsrt_avl_treedef_t cfgst_found_treedef = -DDSRT_AVL_TREEDEF_INITIALIZER(offsetof(struct cfgst_node, avlnode), offsetof(struct cfgst_node, key), cfgst_node_cmp, 0); + DDSRT_AVL_TREEDEF_INITIALIZER(offsetof(struct cfgst_node, avlnode), offsetof(struct cfgst_node, key), cfgst_node_cmp, 0); #define DU(fname) static int uf_##fname (struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) #define PF(fname) static void pf_##fname (struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) @@ -135,7 +135,6 @@ DU(boolean_default); #if 0 PF(boolean_default); #endif -DUPF(negated_boolean); DUPF(string); DU(tracingOutputFileName); DU(verbosity); @@ -143,8 +142,8 @@ DUPF(logcat); DUPF(xcheck); DUPF(int); DUPF(uint); -DUPF(int32); #if 0 +DUPF(int32); DUPF(uint32); #endif DU(natint); @@ -162,7 +161,6 @@ PF(duration); DUPF(standards_conformance); DUPF(besmode); DUPF(retransmit_merging); -DUPF(sched_prio_class); DUPF(sched_class); DUPF(maybe_memsize); DUPF(maybe_int32); @@ -173,7 +171,6 @@ DUPF(cipher); DUPF(bandwidth); #endif DUPF(domainId); -DUPF(durability_cdr); DUPF(transport_selector); DUPF(many_sockets_mode); DU(deaf_mute); @@ -221,17 +218,16 @@ DI(if_thread_properties); #define DEPRECATED_ATTR(name) "|" name, NULL, NULL /* MOVED: whereto must be a path relative to DDSI2Service, may not be used in/for lists and only for elements, may not be chained */ #define MOVED(name, whereto) ">" name, NULL, NULL, 0, whereto, 0, 0, 0, 0, 0, 0, NULL -static const struct cfgelem timestamp_cfgattrs[] = { - { ATTR("absolute"), 1, "false", ABSOFF(tracingRelativeTimestamps), 0, uf_negated_boolean, 0, pf_negated_boolean, - "
This option has no effect
" }, - END_MARKER -}; - +#if 0 +#define BLURB(text) text +#else +#define BLURB(text) NULL +#endif static const struct cfgelem general_cfgelems[] = { - { LEAF("NetworkInterfaceAddress"), 1, "auto", ABSOFF(networkAddressString), 0, uf_networkAddress, ff_free, pf_networkAddress, - "This element specifies the preferred network interface for use by DDSI2E. The preferred network interface determines the IP address that DDSI2E advertises in the discovery protocol (but see also General/ExternalNetworkAddress), and is also the only interface over which multicasts are transmitted. The interface can be identified by its IP address, network interface name or network portion of the address. If the value \"auto\" is entered here, DDSI2E will select what it considers the most suitable interface.
" }, - { LEAF("MulticastRecvNetworkInterfaceAddresses"), 1, "preferred", ABSOFF(networkRecvAddressStrings), 0, uf_networkAddresses, ff_networkAddresses, pf_networkAddresses, - "This element specifies on which network interfaces DDSI2E listens to multicasts. The following options are available:
\n\ + { LEAF("NetworkInterfaceAddress"), 1, "auto", ABSOFF(networkAddressString), 0, uf_networkAddress, ff_free, pf_networkAddress, + BLURB("This element specifies the preferred network interface for use by DDSI2E. The preferred network interface determines the IP address that DDSI2E advertises in the discovery protocol (but see also General/ExternalNetworkAddress), and is also the only interface over which multicasts are transmitted. The interface can be identified by its IP address, network interface name or network portion of the address. If the value \"auto\" is entered here, DDSI2E will select what it considers the most suitable interface.
") }, + { LEAF("MulticastRecvNetworkInterfaceAddresses"), 1, "preferred", ABSOFF(networkRecvAddressStrings), 0, uf_networkAddresses, ff_networkAddresses, pf_networkAddresses, + BLURB("This element specifies on which network interfaces DDSI2E listens to multicasts. The following options are available:
\n\If DDSI2E is in IPv6 mode and the address of the preferred network interface is a link-local address, \"all\" is treated as a synonym for \"preferred\" and a comma-separated list is treated as \"preferred\" if it contains the preferred interface and as \"none\" if not.
" }, -{ LEAF("ExternalNetworkAddress"), 1, "auto", ABSOFF(externalAddressString), 0, uf_networkAddress, ff_free, pf_networkAddress, -"This element allows explicitly overruling the network address DDSI2E advertises in the discovery protocol, which by default is the address of the preferred network interface (General/NetworkInterfaceAddress), to allow DDSI2E to communicate across a Network Address Translation (NAT) device.
" }, -{ LEAF("ExternalNetworkMask"), 1, "0.0.0.0", ABSOFF(externalMaskString), 0, uf_string, ff_free, pf_string, -"This element specifies the network mask of the external network address. This element is relevant only when an external network address (General/ExternalNetworkAddress) is explicitly configured. In this case locators received via the discovery protocol that are within the same external subnet (as defined by this mask) will be translated to an internal address by replacing the network portion of the external address with the corresponding portion of the preferred network interface address. This option is IPv4-only.
" }, -{ LEAF("AllowMulticast"), 1, "true", ABSOFF(allowMulticast), 0, uf_allow_multicast, 0, pf_allow_multicast, -"This element controls whether DDSI2E uses multicasts for data traffic.
\n\ +If DDSI2E is in IPv6 mode and the address of the preferred network interface is a link-local address, \"all\" is treated as a synonym for \"preferred\" and a comma-separated list is treated as \"preferred\" if it contains the preferred interface and as \"none\" if not.
") }, + { LEAF("ExternalNetworkAddress"), 1, "auto", ABSOFF(externalAddressString), 0, uf_networkAddress, ff_free, pf_networkAddress, + BLURB("This element allows explicitly overruling the network address DDSI2E advertises in the discovery protocol, which by default is the address of the preferred network interface (General/NetworkInterfaceAddress), to allow DDSI2E to communicate across a Network Address Translation (NAT) device.
") }, + { LEAF("ExternalNetworkMask"), 1, "0.0.0.0", ABSOFF(externalMaskString), 0, uf_string, ff_free, pf_string, + BLURB("This element specifies the network mask of the external network address. This element is relevant only when an external network address (General/ExternalNetworkAddress) is explicitly configured. In this case locators received via the discovery protocol that are within the same external subnet (as defined by this mask) will be translated to an internal address by replacing the network portion of the external address with the corresponding portion of the preferred network interface address. This option is IPv4-only.
") }, + { LEAF("AllowMulticast"), 1, "true", ABSOFF(allowMulticast), 0, uf_allow_multicast, 0, pf_allow_multicast, + BLURB("This element controls whether DDSI2E uses multicasts for data traffic.
\n\It is a comma-separated list of some of the following keywords: \"spdp\", \"asm\", \"ssm\", or either of \"false\" or \"true\".
\n\When set to \"false\" all multicasting is disabled. The default, \"true\" enables full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.
" }, -{ LEAF("MulticastTimeToLive"), 1, "32", ABSOFF(multicast_ttl), 0, uf_natint_255, 0, pf_int, -"This element specifies the time-to-live setting for outgoing multicast packets.
" }, -{ LEAF("DontRoute"), 1, "false", ABSOFF(dontRoute), 0, uf_boolean, 0, pf_boolean, -"This element allows setting the SO_DONTROUTE option for outgoing packets, to bypass the local routing tables. This is generally useful only when the routing tables cannot be trusted, which is highly unusual.
" }, -{ LEAF ("UseIPv6"), 1, "default", ABSOFF (compat_use_ipv6), 0, uf_boolean_default, 0, pf_nop, -"Deprecated (use Transport instead)
" }, -{ LEAF ("Transport"), 1, "default", ABSOFF (transport_selector), 0, uf_transport_selector, 0, pf_transport_selector, -"This element allows selecting the transport to be used (udp, udp6, tcp, tcp6, raweth)
" }, -{ LEAF("EnableMulticastLoopback"), 1, "true", ABSOFF(enableMulticastLoopback), 0, uf_boolean, 0, pf_boolean, -"This element specifies whether DDSI2E allows IP multicast packets to be visible to all DDSI participants in the same node, including itself. It must be \"true\" for intra-node multicast communications, but if a node runs only a single DDSI2E service and does not host any other DDSI-capable programs, it should be set to \"false\" for improved performance.
" }, -{ DEPRECATED_LEAF("EnableLoopback"), 1, "false", ABSOFF(enableLoopback), 0, uf_boolean, 0, pf_boolean, -"This element specifies whether DDSI packets are visible to all DDSI participants in the same process. It must be \"true\" for intra-process communications, i.e. a reader and writer communicating in the same address space. If enabled and using multicast then EnableMulticastLoopback must also be enabled.
" }, -{ LEAF("StartupModeDuration"), 1, "2 s", ABSOFF(startup_mode_duration), 0, uf_duration_ms_1hr, 0, pf_duration, -"This element specifies how long the DDSI2E remains in its \"startup\" mode. While in \"startup\" mode all volatile reliable data published on the local node is retained as-if it were transient-local data, allowing existing readers on remote nodes to obtain the data even though discovering them takes some time. Best-effort data by definition need not arrive, and transient and persistent data are covered by the durability service.
\n\ -Once the system is stable, DDSI2E keeps track of the existence of remote readers whether or not matching writers exist locally, avoiding this discovery delay and ensuring this is merely a node startup issue.
\n\ -Setting General/StartupModeDuration to 0s will disable it.
" }, -{ LEAF("StartupModeCoversTransient"), 1, "true", ABSOFF(startup_mode_full), 0, uf_boolean, 0, pf_boolean, -"This element configures whether startup-mode should also cover transient and persistent data, for configurations where the durability service does not take care of it. Configurations without defined merge policies best leave this enabled.
" }, -{ LEAF("MaxMessageSize"), 1, "4096 B", ABSOFF(max_msg_size), 0, uf_memsize, 0, pf_memsize, -"This element specifies the maximum size of the UDP payload that DDSI2E will generate. DDSI2E will try to maintain this limit within the bounds of the DDSI specification, which means that in some cases (especially for very low values of MaxMessageSize) larger payloads may sporadically be observed (currently up to 1192 B).
\n\ -On some networks it may be necessary to set this item to keep the packetsize below the MTU to prevent IP fragmentation. In those cases, it is generally advisable to also consider reducing Internal/FragmentSize.
" }, -{ LEAF("FragmentSize"), 1, "1280 B", ABSOFF(fragment_size), 0, uf_memsize, 0, pf_memsize, -"This element specifies the size of DDSI sample fragments generated by DDSI2E. Samples larger than FragmentSize are fragmented into fragments of FragmentSize bytes each, except the last one, which may be smaller. The DDSI spec mandates a minimum fragment size of 1025 bytes, but DDSI2E will do whatever size is requested, accepting fragments of which the size is at least the minimum of 1025 and FragmentSize.
" }, -END_MARKER +When set to \"false\" all multicasting is disabled. The default, \"true\" enables full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.
") }, + { LEAF("MulticastTimeToLive"), 1, "32", ABSOFF(multicast_ttl), 0, uf_natint_255, 0, pf_int, + BLURB("This element specifies the time-to-live setting for outgoing multicast packets.
") }, + { LEAF("DontRoute"), 1, "false", ABSOFF(dontRoute), 0, uf_boolean, 0, pf_boolean, + BLURB("This element allows setting the SO_DONTROUTE option for outgoing packets, to bypass the local routing tables. This is generally useful only when the routing tables cannot be trusted, which is highly unusual.
") }, + { LEAF ("UseIPv6"), 1, "default", ABSOFF (compat_use_ipv6), 0, uf_boolean_default, 0, pf_nop, + BLURB("Deprecated (use Transport instead)
") }, + { LEAF ("Transport"), 1, "default", ABSOFF (transport_selector), 0, uf_transport_selector, 0, pf_transport_selector, + BLURB("This element allows selecting the transport to be used (udp, udp6, tcp, tcp6, raweth)
") }, + { LEAF("EnableMulticastLoopback"), 1, "true", ABSOFF(enableMulticastLoopback), 0, uf_boolean, 0, pf_boolean, + BLURB("This element specifies whether DDSI2E allows IP multicast packets to be visible to all DDSI participants in the same node, including itself. It must be \"true\" for intra-node multicast communications, but if a node runs only a single DDSI2E service and does not host any other DDSI-capable programs, it should be set to \"false\" for improved performance.
") }, + { LEAF("MaxMessageSize"), 1, "4096 B", ABSOFF(max_msg_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This element specifies the maximum size of the UDP payload that DDSI2E will generate. DDSI2E will try to maintain this limit within the bounds of the DDSI specification, which means that in some cases (especially for very low values of MaxMessageSize) larger payloads may sporadically be observed (currently up to 1192 B).
\n\ +On some networks it may be necessary to set this item to keep the packetsize below the MTU to prevent IP fragmentation. In those cases, it is generally advisable to also consider reducing Internal/FragmentSize.
") }, + { LEAF("FragmentSize"), 1, "1280 B", ABSOFF(fragment_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This element specifies the size of DDSI sample fragments generated by DDSI2E. Samples larger than FragmentSize are fragmented into fragments of FragmentSize bytes each, except the last one, which may be smaller. The DDSI spec mandates a minimum fragment size of 1025 bytes, but DDSI2E will do whatever size is requested, accepting fragments of which the size is at least the minimum of 1025 and FragmentSize.
") }, + END_MARKER }; #ifdef DDSI_INCLUDE_ENCRYPTION static const struct cfgelem securityprofile_cfgattrs[] = { - { ATTR("Name"), 1, NULL, RELOFF(config_securityprofile_listelem, name), 0, uf_string, ff_free, pf_string, - "This attribute specifies the name of this DDSI2E security profile. Two security profiles cannot have the same name.
" }, - { ATTR("Cipher"), 1, "null", RELOFF(config_securityprofile_listelem, cipher), 0, uf_cipher, 0, pf_cipher, - "This attribute specifies the cipher to be used for encrypting traffic over network partitions secured by this security profile. The possible ciphers are:
\n\ + { ATTR("Name"), 1, NULL, RELOFF(config_securityprofile_listelem, name), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies the name of this DDSI2E security profile. Two security profiles cannot have the same name.
") }, + { ATTR("Cipher"), 1, "null", RELOFF(config_securityprofile_listelem, cipher), 0, uf_cipher, 0, pf_cipher, + BLURB("This attribute specifies the cipher to be used for encrypting traffic over network partitions secured by this security profile. The possible ciphers are:
\n\SHA1 is used on conjunction with all ciphers except \"null\" to ensure data integrity.
" }, -{ ATTR("CipherKey"), 1, "", RELOFF(config_securityprofile_listelem, key), 0, uf_string, ff_free, pf_key, -"The CipherKey attribute is used to define the secret key required by the cipher selected using the Cipher attribute. The value can be a URI referencing an external file containing the secret key, or the secret key can be defined in-place as a string value.
\n\ +SHA1 is used on conjunction with all ciphers except \"null\" to ensure data integrity.
") }, + { ATTR("CipherKey"), 1, "", RELOFF(config_securityprofile_listelem, key), 0, uf_string, ff_free, pf_key, + BLURB("The CipherKey attribute is used to define the secret key required by the cipher selected using the Cipher attribute. The value can be a URI referencing an external file containing the secret key, or the secret key can be defined in-place as a string value.
\n\The key must be specified as a hexadecimal string with each character representing 4 bits of the key. E.g., 1ABC represents the 16-bit key 0001 1010 1011 1100. The key should not follow a well-known pattern and must exactly match the key length of the selected cipher.
\n\A malformed key will cause the security profile to be marked as invalid, and disable all network partitions secured by the (invalid) security profile to prevent information leaks.
\n\ -As all DDS applications require read access to the XML configuration file, for security reasons it is recommended to store the secret key in an external file in the file system, referenced by its URI. The file should be protected against read and write access from other users on the host.
" }, -END_MARKER +As all DDS applications require read access to the XML configuration file, for security reasons it is recommended to store the secret key in an external file in the file system, referenced by its URI. The file should be protected against read and write access from other users on the host.
") }, + END_MARKER }; static const struct cfgelem security_cfgelems[] = { - { LEAF_W_ATTRS("SecurityProfile", securityprofile_cfgattrs), 0, 0, ABSOFF(securityProfiles), if_security_profile, 0, 0, 0, - "This element defines a DDSI2E security profile.
" }, - END_MARKER + { LEAF_W_ATTRS("SecurityProfile", securityprofile_cfgattrs), 0, 0, ABSOFF(securityProfiles), if_security_profile, 0, 0, 0, + BLURB("This element defines a DDSI2E security profile.
") }, + END_MARKER }; #endif /* DDSI_INCLUDE_ENCRYPTION */ #ifdef DDSI_INCLUDE_NETWORK_PARTITIONS static const struct cfgelem networkpartition_cfgattrs[] = { - { ATTR("Name"), 1, NULL, RELOFF(config_networkpartition_listelem, name), 0, uf_string, ff_free, pf_string, - "This attribute specifies the name of this DDSI2E network partition. Two network partitions cannot have the same name.
" }, - { ATTR("Address"), 1, NULL, RELOFF(config_networkpartition_listelem, address_string), 0, uf_string, ff_free, pf_string, - "This attribute specifies the multicast addresses associated with the network partition as a comma-separated list. Readers matching this network partition (cf. Partitioning/PartitionMappings) will listen for multicasts on all of these addresses and advertise them in the discovery protocol. The writers will select the most suitable address from the addresses advertised by the readers.
" }, - { ATTR("Connected"), 1, "true", RELOFF(config_networkpartition_listelem, connected), 0, uf_boolean, 0, pf_boolean, - "This attribute is a placeholder.
" }, + { ATTR("Name"), 1, NULL, RELOFF(config_networkpartition_listelem, name), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies the name of this DDSI2E network partition. Two network partitions cannot have the same name.
") }, + { ATTR("Address"), 1, NULL, RELOFF(config_networkpartition_listelem, address_string), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies the multicast addresses associated with the network partition as a comma-separated list. Readers matching this network partition (cf. Partitioning/PartitionMappings) will listen for multicasts on all of these addresses and advertise them in the discovery protocol. The writers will select the most suitable address from the addresses advertised by the readers.
") }, + { ATTR("Connected"), 1, "true", RELOFF(config_networkpartition_listelem, connected), 0, uf_boolean, 0, pf_boolean, + BLURB("This attribute is a placeholder.
") }, #ifdef DDSI_INCLUDE_ENCRYPTION - { ATTR("SecurityProfile"), 1, "null", RELOFF(config_networkpartition_listelem, profileName), 0, uf_string, ff_free, pf_string, - "This attribute selects the DDSI2E security profile for encrypting the traffic mapped to this DDSI2E network partition. The default \"null\" means the network partition is unsecured; any other name refers to a security profile defined using the Security/SecurityProfile elements.
" }, + { ATTR("SecurityProfile"), 1, "null", RELOFF(config_networkpartition_listelem, profileName), 0, uf_string, ff_free, pf_string, + BLURB("This attribute selects the DDSI2E security profile for encrypting the traffic mapped to this DDSI2E network partition. The default \"null\" means the network partition is unsecured; any other name refers to a security profile defined using the Security/SecurityProfile elements.
") }, #endif /* DDSI_INCLUDE_ENCRYPTION */ - END_MARKER + END_MARKER }; static const struct cfgelem networkpartitions_cfgelems[] = { - { LEAF_W_ATTRS("NetworkPartition", networkpartition_cfgattrs), 0, 0, ABSOFF(networkPartitions), if_network_partition, 0, 0, 0, - "This element defines a DDSI2E network partition.
" }, - END_MARKER + { LEAF_W_ATTRS("NetworkPartition", networkpartition_cfgattrs), 0, 0, ABSOFF(networkPartitions), if_network_partition, 0, 0, 0, + BLURB("This element defines a DDSI2E network partition.
") }, + END_MARKER }; static const struct cfgelem ignoredpartitions_cfgattrs[] = { - { ATTR("DCPSPartitionTopic"), 1, NULL, RELOFF(config_ignoredpartition_listelem, DCPSPartitionTopic), 0, uf_string, ff_free, pf_string, - "This attribute specifies a partition and a topic expression, separated by a single '.', that are used to determine if a given partition and topic will be ignored or not. The expressions may use the usual wildcards '*' and '?'. DDSI2E will consider an wildcard DCPS partition to match an expression iff there exists a string that satisfies both expressions.
" }, - END_MARKER + { ATTR("DCPSPartitionTopic"), 1, NULL, RELOFF(config_ignoredpartition_listelem, DCPSPartitionTopic), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies a partition and a topic expression, separated by a single '.', that are used to determine if a given partition and topic will be ignored or not. The expressions may use the usual wildcards '*' and '?'. DDSI2E will consider an wildcard DCPS partition to match an expression iff there exists a string that satisfies both expressions.
") }, + END_MARKER }; static const struct cfgelem ignoredpartitions_cfgelems[] = { - { LEAF_W_ATTRS("IgnoredPartition", ignoredpartitions_cfgattrs), 0, 0, ABSOFF(ignoredPartitions), if_ignored_partition, 0, 0, 0, - "This element can be used to prevent certain combinations of DCPS partition and topic from being transmitted over the network. DDSI2E will complete ignore readers and writers for which all DCPS partitions as well as their topic is ignored, not even creating DDSI readers and writers to mirror the DCPS ones.
" }, - END_MARKER + { LEAF_W_ATTRS("IgnoredPartition", ignoredpartitions_cfgattrs), 0, 0, ABSOFF(ignoredPartitions), if_ignored_partition, 0, 0, 0, + BLURB("This element can be used to prevent certain combinations of DCPS partition and topic from being transmitted over the network. DDSI2E will complete ignore readers and writers for which all DCPS partitions as well as their topic is ignored, not even creating DDSI readers and writers to mirror the DCPS ones.
") }, + END_MARKER }; static const struct cfgelem partitionmappings_cfgattrs[] = { - { ATTR("NetworkPartition"), 1, NULL, RELOFF(config_partitionmapping_listelem, networkPartition), 0, uf_string, ff_free, pf_string, - "This attribute specifies which DDSI2E network partition is to be used for DCPS partition/topic combinations matching the DCPSPartitionTopic attribute within this PartitionMapping element.
" }, - { ATTR("DCPSPartitionTopic"), 1, NULL, RELOFF(config_partitionmapping_listelem, DCPSPartitionTopic), 0, uf_string, ff_free, pf_string, - "This attribute specifies a partition and a topic expression, separated by a single '.', that are used to determine if a given partition and topic maps to the DDSI2E network partition named by the NetworkPartition attribute in this PartitionMapping element. The expressions may use the usual wildcards '*' and '?'. DDSI2E will consider a wildcard DCPS partition to match an expression if there exists a string that satisfies both expressions.
" }, - END_MARKER + { ATTR("NetworkPartition"), 1, NULL, RELOFF(config_partitionmapping_listelem, networkPartition), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies which DDSI2E network partition is to be used for DCPS partition/topic combinations matching the DCPSPartitionTopic attribute within this PartitionMapping element.
") }, + { ATTR("DCPSPartitionTopic"), 1, NULL, RELOFF(config_partitionmapping_listelem, DCPSPartitionTopic), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies a partition and a topic expression, separated by a single '.', that are used to determine if a given partition and topic maps to the DDSI2E network partition named by the NetworkPartition attribute in this PartitionMapping element. The expressions may use the usual wildcards '*' and '?'. DDSI2E will consider a wildcard DCPS partition to match an expression if there exists a string that satisfies both expressions.
") }, + END_MARKER }; static const struct cfgelem partitionmappings_cfgelems[] = { - { LEAF_W_ATTRS("PartitionMapping", partitionmappings_cfgattrs), 0, 0, ABSOFF(partitionMappings), if_partition_mapping, 0, 0, 0, - "This element defines a mapping from a DCPS partition/topic combination to a DDSI2E network partition. This allows partitioning data flows by using special multicast addresses for part of the data and possibly also encrypting the data flow.
" }, - END_MARKER + { LEAF_W_ATTRS("PartitionMapping", partitionmappings_cfgattrs), 0, 0, ABSOFF(partitionMappings), if_partition_mapping, 0, 0, 0, + BLURB("This element defines a mapping from a DCPS partition/topic combination to a DDSI2E network partition. This allows partitioning data flows by using special multicast addresses for part of the data and possibly also encrypting the data flow.
") }, + END_MARKER }; static const struct cfgelem partitioning_cfgelems[] = { - { GROUP("NetworkPartitions", networkpartitions_cfgelems), - "The NetworkPartitions element specifies the DDSI2E network partitions.
" }, - { GROUP("IgnoredPartitions", ignoredpartitions_cfgelems), - "The IgnoredPartitions element specifies DCPS partition/topic combinations that are not distributed over the network.
" }, - { GROUP("PartitionMappings", partitionmappings_cfgelems), - "The PartitionMappings element specifies the mapping from DCPS partition/topic combinations to DDSI2E network partitions.
" }, - END_MARKER + { GROUP("NetworkPartitions", networkpartitions_cfgelems), + BLURB("The NetworkPartitions element specifies the DDSI2E network partitions.
") }, + { GROUP("IgnoredPartitions", ignoredpartitions_cfgelems), + BLURB("The IgnoredPartitions element specifies DCPS partition/topic combinations that are not distributed over the network.
") }, + { GROUP("PartitionMappings", partitionmappings_cfgelems), + BLURB("The PartitionMappings element specifies the mapping from DCPS partition/topic combinations to DDSI2E network partitions.
") }, + END_MARKER }; #endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */ #ifdef DDSI_INCLUDE_NETWORK_CHANNELS static const struct cfgelem channel_cfgelems[] = { #ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING - { LEAF("DataBandwidthLimit"), 1, "inf", RELOFF(config_channel_listelem, data_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, - "This element specifies the maximum transmit rate of new samples and directly related data, for this channel. Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
" }, - { LEAF("AuxiliaryBandwidthLimit"), 1, "inf", RELOFF(config_channel_listelem, auxiliary_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, - "This element specifies the maximum transmit rate of auxiliary traffic on this channel (e.g. retransmits, heartbeats, etc). Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
" }, + { LEAF("DataBandwidthLimit"), 1, "inf", RELOFF(config_channel_listelem, data_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, + BLURB("This element specifies the maximum transmit rate of new samples and directly related data, for this channel. Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
") }, + { LEAF("AuxiliaryBandwidthLimit"), 1, "inf", RELOFF(config_channel_listelem, auxiliary_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, + BLURB("This element specifies the maximum transmit rate of auxiliary traffic on this channel (e.g. retransmits, heartbeats, etc). Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
") }, #endif - { LEAF("DiffServField"), 1, "0", RELOFF(config_channel_listelem, diffserv_field), 0, uf_natint, 0, pf_int, - "This element describes the DiffServ setting the channel will apply to the networking messages. This parameter determines the value of the diffserv field of the IP version 4 packets sent on this channel which allows QoS setting to be applied to the network traffic send on this channel.
\n\
+ { LEAF("DiffServField"), 1, "0", RELOFF(config_channel_listelem, diffserv_field), 0, uf_natint, 0, pf_int,
+ BLURB("
This element describes the DiffServ setting the channel will apply to the networking messages. This parameter determines the value of the diffserv field of the IP version 4 packets sent on this channel which allows QoS setting to be applied to the network traffic send on this channel.
\n\
Windows platform support for setting the diffserv field is dependent on the OS version.
\n\
For Windows versions XP SP2 and 2003 to use the diffserv field the following parameter should be added to the register:
\n\
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TcpIp\\Parameters\\DisableUserTOSSetting
\n\
The type of this parameter is a DWORD and its value should be set to 0 to allow setting of the diffserv field.
\n\
For Windows version 7 or higher a new API (qWAVE) has been introduced. For these platforms the specified diffserv value is mapped to one of the support traffic types.\n\
The mapping is as follows: 1-8 background traffic; 9-40 excellent traffic; 41-55 audio/video traffic; 56 voice traffic; 57-63 control traffic.\n\
-When an application is run without Administrative priveleges then only the diffserv value of 0, 8, 40 or 56 is allowed.
This attribute specifies name of this channel. The name should uniquely identify the channel.
" }, - { ATTR("TransportPriority"), 1, "0", RELOFF(config_channel_listelem, priority), 0, uf_natint, 0, pf_int, - "This attribute sets the transport priority threshold for the channel. Each DCPS data writer has a \"transport_priority\" QoS and this QoS is used to select a channel for use by this writer. The selected channel is the one with the largest threshold not greater than the writer's transport priority, and if no such channel exists, the channel with the lowest threshold.
" }, - END_MARKER + { ATTR("Name"), 1, NULL, RELOFF(config_channel_listelem, name), 0, uf_string, ff_free, pf_string, + BLURB("This attribute specifies name of this channel. The name should uniquely identify the channel.
") }, + { ATTR("TransportPriority"), 1, "0", RELOFF(config_channel_listelem, priority), 0, uf_natint, 0, pf_int, + BLURB("This attribute sets the transport priority threshold for the channel. Each DCPS data writer has a \"transport_priority\" QoS and this QoS is used to select a channel for use by this writer. The selected channel is the one with the largest threshold not greater than the writer's transport priority, and if no such channel exists, the channel with the lowest threshold.
") }, + END_MARKER }; static const struct cfgelem channels_cfgelems[] = { - { MGROUP("Channel", channel_cfgelems, channel_cfgattrs), 42, 0, ABSOFF(channels), if_channel, 0, 0, 0, - "This element defines a channel.
" }, - END_MARKER + { MGROUP("Channel", channel_cfgelems, channel_cfgattrs), 42, 0, ABSOFF(channels), if_channel, 0, 0, 0, + BLURB("This element defines a channel.
") }, + END_MARKER }; #endif /* DDSI_INCLUDE_NETWORK_CHANNELS */ static const struct cfgelem thread_properties_sched_cfgelems[] = { - { LEAF("Class"), 1, "default", RELOFF(config_thread_properties_listelem, sched_class), 0, uf_sched_class, 0, pf_sched_class, - "This element specifies the thread scheduling class (realtime, timeshare or default). The user may need special privileges from the underlying operating system to be able to assign some of the privileged scheduling classes.
" }, - { LEAF("Priority"), 1, "default", RELOFF(config_thread_properties_listelem, sched_priority), 0, uf_maybe_int32, 0, pf_maybe_int32, - "This element specifies the thread priority (decimal integer or default). Only priorities that are supported by the underlying operating system can be assigned to this element. The user may need special privileges from the underlying operating system to be able to assign some of the privileged priorities.
" }, - END_MARKER + { LEAF("Class"), 1, "default", RELOFF(config_thread_properties_listelem, sched_class), 0, uf_sched_class, 0, pf_sched_class, + BLURB("This element specifies the thread scheduling class (realtime, timeshare or default). The user may need special privileges from the underlying operating system to be able to assign some of the privileged scheduling classes.
") }, + { LEAF("Priority"), 1, "default", RELOFF(config_thread_properties_listelem, sched_priority), 0, uf_maybe_int32, 0, pf_maybe_int32, + BLURB("This element specifies the thread priority (decimal integer or default). Only priorities that are supported by the underlying operating system can be assigned to this element. The user may need special privileges from the underlying operating system to be able to assign some of the privileged priorities.
") }, + END_MARKER }; static const struct cfgelem thread_properties_cfgattrs[] = { - { ATTR("Name"), 1, NULL, RELOFF(config_thread_properties_listelem, name), 0, uf_string, ff_free, pf_string, - "The Name of the thread for which properties are being set. The following threads exist:
\n\ + { ATTR("Name"), 1, NULL, RELOFF(config_thread_properties_listelem, name), 0, uf_string, ff_free, pf_string, + BLURB("The Name of the thread for which properties are being set. The following threads exist:
\n\This element configures the scheduling properties of the thread.
" }, - { LEAF("StackSize"), 1, "default", RELOFF(config_thread_properties_listelem, stack_size), 0, uf_maybe_memsize, 0, pf_maybe_memsize, - "This element configures the stack size for this thread. The default value default leaves the stack size at the operating system default.
" }, - END_MARKER + { GROUP("Scheduling", thread_properties_sched_cfgelems), + BLURB("This element configures the scheduling properties of the thread.
") }, + { LEAF("StackSize"), 1, "default", RELOFF(config_thread_properties_listelem, stack_size), 0, uf_maybe_memsize, 0, pf_maybe_memsize, + BLURB("This element configures the stack size for this thread. The default value default leaves the stack size at the operating system default.
") }, + END_MARKER }; static const struct cfgelem threads_cfgelems[] = { - { MGROUP("Thread", thread_properties_cfgelems, thread_properties_cfgattrs), 1000, 0, ABSOFF(thread_properties), if_thread_properties, 0, 0, 0, - "This element is used to set thread properties.
" }, - END_MARKER + { MGROUP("Thread", thread_properties_cfgelems, thread_properties_cfgattrs), 1000, 0, ABSOFF(thread_properties), if_thread_properties, 0, 0, 0, + BLURB("This element is used to set thread properties.
") }, + END_MARKER }; static const struct cfgelem compatibility_cfgelems[] = { - { LEAF("StandardsConformance"), 1, "lax", ABSOFF(standards_conformance), 0, uf_standards_conformance, 0, pf_standards_conformance, - "This element sets the level of standards conformance of this instance of the DDSI2E Service. Stricter conformance typically means less interoperability with other implementations. Currently three modes are defined:
\n\ + { LEAF("StandardsConformance"), 1, "lax", ABSOFF(standards_conformance), 0, uf_standards_conformance, 0, pf_standards_conformance, + BLURB("This element sets the level of standards conformance of this instance of the DDSI2E Service. Stricter conformance typically means less interoperability with other implementations. Currently three modes are defined:
\n\The default setting is \"lax\".
" }, -{ LEAF("ExplicitlyPublishQosSetToDefault"), 1, "false", ABSOFF(explicitly_publish_qos_set_to_default), 0, uf_boolean, 0, pf_boolean, -"This element specifies whether QoS settings set to default values are explicitly published in the discovery protocol. Implementations are to use the default value for QoS settings not published, which allows a significant reduction of the amount of data that needs to be exchanged for the discovery protocol, but this requires all implementations to adhere to the default values specified by the specifications.
\n\ -When interoperability is required with an implementation that does not follow the specifications in this regard, setting this option to true will help.
" }, -{ LEAF ("ManySocketsMode"), 1, "single", ABSOFF (many_sockets_mode), 0, uf_many_sockets_mode, 0, pf_many_sockets_mode, -"This option specifies whether a network socket will be created for each domain participant on a host. The specification seems to assume that each participant has a unique address, and setting this option will ensure this to be the case. This is not the defeault.
\n\ -Disabling it slightly improves performance and reduces network traffic somewhat. It also causes the set of port numbers needed by DDSI2E to become predictable, which may be useful for firewall and NAT configuration.
" }, -{ LEAF("ArrivalOfDataAssertsPpAndEpLiveliness"), 1, "true", ABSOFF(arrival_of_data_asserts_pp_and_ep_liveliness), 0, uf_boolean, 0, pf_boolean, -"When set to true, arrival of a message from a peer asserts liveliness of that peer. When set to false, only SPDP and explicit lease renewals have this effect.
" }, -{ LEAF("AckNackNumbitsEmptySet"), 1, "0", ABSOFF(acknack_numbits_emptyset), 0, uf_natint, 0, pf_int, -"This element governs the representation of an acknowledgement message that does not also negatively-acknowledge some samples. If set to 0, the generated acknowledgements have an invalid form and will be reject by the strict and pedantic conformance modes, but several other implementation require this setting for smooth interoperation.
\n\ -If set to 1, all acknowledgements sent by DDSI2E adhere the form of acknowledgement messages allowed by the standard, but this causes problems when interoperating with these other implementations. The strict and pedantic standards conformance modes always overrule an AckNackNumbitsEmptySet=0 to prevent the transmitting of invalid messages.
" }, -{ LEAF("RespondToRtiInitZeroAckWithInvalidHeartbeat"), 1, "false", ABSOFF(respond_to_rti_init_zero_ack_with_invalid_heartbeat), 0, uf_boolean, 0, pf_boolean, -"This element allows a closer mimicking of the behaviour of some other DDSI implementations, albeit at the cost of generating even more invalid messages. Setting it to true ensures a Heartbeat can be sent at any time when a remote node requests one, setting it to false delays it until a valid one can be sent.
\n\ -The latter is fully compliant with the specification, and no adverse effects have been observed. It is the default.
" }, -{ LEAF("AssumeRtiHasPmdEndpoints"), 1, "false", ABSOFF(assume_rti_has_pmd_endpoints), 0, uf_boolean, 0, pf_boolean, -"This option assumes ParticipantMessageData endpoints required by the liveliness protocol are present in RTI participants even when not properly advertised by the participant discovery protocol.
" }, -END_MARKER +The default setting is \"lax\".
") }, + { LEAF("ExplicitlyPublishQosSetToDefault"), 1, "false", ABSOFF(explicitly_publish_qos_set_to_default), 0, uf_boolean, 0, pf_boolean, + BLURB("This element specifies whether QoS settings set to default values are explicitly published in the discovery protocol. Implementations are to use the default value for QoS settings not published, which allows a significant reduction of the amount of data that needs to be exchanged for the discovery protocol, but this requires all implementations to adhere to the default values specified by the specifications.
\n\ +When interoperability is required with an implementation that does not follow the specifications in this regard, setting this option to true will help.
") }, + { LEAF ("ManySocketsMode"), 1, "single", ABSOFF (many_sockets_mode), 0, uf_many_sockets_mode, 0, pf_many_sockets_mode, + BLURB("This option specifies whether a network socket will be created for each domain participant on a host. The specification seems to assume that each participant has a unique address, and setting this option will ensure this to be the case. This is not the defeault.
\n\ +Disabling it slightly improves performance and reduces network traffic somewhat. It also causes the set of port numbers needed by DDSI2E to become predictable, which may be useful for firewall and NAT configuration.
") }, + { LEAF("ArrivalOfDataAssertsPpAndEpLiveliness"), 1, "true", ABSOFF(arrival_of_data_asserts_pp_and_ep_liveliness), 0, uf_boolean, 0, pf_boolean, + BLURB("When set to true, arrival of a message from a peer asserts liveliness of that peer. When set to false, only SPDP and explicit lease renewals have this effect.
") }, + { LEAF("AssumeRtiHasPmdEndpoints"), 1, "false", ABSOFF(assume_rti_has_pmd_endpoints), 0, uf_boolean, 0, pf_boolean, + BLURB("This option assumes ParticipantMessageData endpoints required by the liveliness protocol are present in RTI participants even when not properly advertised by the participant discovery protocol.
") }, + END_MARKER }; static const struct cfgelem unsupp_test_cfgelems[] = { - { LEAF("XmitLossiness"), 1, "0", ABSOFF(xmit_lossiness), 0, uf_int, 0, pf_int, - "This element controls the fraction of outgoing packets to drop, specified as samples per thousand.
" }, - END_MARKER + { LEAF("XmitLossiness"), 1, "0", ABSOFF(xmit_lossiness), 0, uf_int, 0, pf_int, + BLURB("This element controls the fraction of outgoing packets to drop, specified as samples per thousand.
") }, + END_MARKER }; static const struct cfgelem unsupp_watermarks_cfgelems[] = { - { LEAF("WhcLow"), 1, "1 kB", ABSOFF(whc_lowwater_mark), 0, uf_memsize, 0, pf_memsize, - "This element sets the low-water mark for the DDSI2E WHCs, expressed in bytes. A suspended writer resumes transmitting when its DDSI2E WHC shrinks to this size.
" }, - { LEAF("WhcHigh"), 1, "100 kB", ABSOFF(whc_highwater_mark), 0, uf_memsize, 0, pf_memsize, - "This element sets the maximum allowed high-water mark for the DDSI2E WHCs, expressed in bytes. A writer is suspended when the WHC reaches this size.
" }, - { LEAF("WhcHighInit"), 1, "30 kB", ABSOFF(whc_init_highwater_mark), 0, uf_maybe_memsize, 0, pf_maybe_memsize, - "This element sets the initial level of the high-water mark for the DDSI2E WHCs, expressed in bytes.
" }, - { LEAF("WhcAdaptive|WhcAdaptative"), 1, "true", ABSOFF(whc_adaptive), 0, uf_boolean, 0, pf_boolean, - "This element controls whether DDSI2E will adapt the high-water mark to current traffic conditions, based on retransmit requests and transmit pressure.
" }, - END_MARKER + { LEAF("WhcLow"), 1, "1 kB", ABSOFF(whc_lowwater_mark), 0, uf_memsize, 0, pf_memsize, + BLURB("This element sets the low-water mark for the DDSI2E WHCs, expressed in bytes. A suspended writer resumes transmitting when its DDSI2E WHC shrinks to this size.
") }, + { LEAF("WhcHigh"), 1, "100 kB", ABSOFF(whc_highwater_mark), 0, uf_memsize, 0, pf_memsize, + BLURB("This element sets the maximum allowed high-water mark for the DDSI2E WHCs, expressed in bytes. A writer is suspended when the WHC reaches this size.
") }, + { LEAF("WhcHighInit"), 1, "30 kB", ABSOFF(whc_init_highwater_mark), 0, uf_maybe_memsize, 0, pf_maybe_memsize, + BLURB("This element sets the initial level of the high-water mark for the DDSI2E WHCs, expressed in bytes.
") }, + { LEAF("WhcAdaptive|WhcAdaptative"), 1, "true", ABSOFF(whc_adaptive), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether DDSI2E will adapt the high-water mark to current traffic conditions, based on retransmit requests and transmit pressure.
") }, + END_MARKER }; static const struct cfgelem control_topic_cfgattrs[] = { - { DEPRECATED_ATTR("Enable"), 1, "false", ABSOFF(enable_control_topic), 0, uf_boolean, 0, pf_boolean, - "This element controls whether DDSI2E should create a topic to control DDSI2E's behaviour dynamically.
" - }, - { DEPRECATED_ATTR("InitialReset"), 1, "inf", ABSOFF(initial_deaf_mute_reset), 0, uf_duration_inf, 0, pf_duration, - "
This element controls after how much time an initial deaf/mute state will automatically reset.
" - }, - END_MARKER + { DEPRECATED_ATTR("Enable"), 1, "false", ABSOFF(enable_control_topic), 0, uf_boolean, 0, pf_boolean, + BLURB("
This element controls whether DDSI2E should create a topic to control DDSI2E's behaviour dynamically.
") }, + { DEPRECATED_ATTR("InitialReset"), 1, "inf", ABSOFF(initial_deaf_mute_reset), 0, uf_duration_inf, 0, pf_duration, + BLURB("
This element controls after how much time an initial deaf/mute state will automatically reset.
") }, + END_MARKER }; static const struct cfgelem control_topic_cfgelems[] = { - { DEPRECATED_LEAF ("Deaf"), 1, "false", ABSOFF (initial_deaf), 0, uf_deaf_mute, 0, pf_boolean, - "
This element controls whether DDSI2E defaults to deaf mode or to normal mode. This controls both the initial behaviour and what behaviour it auto-reverts to.
" }, - { DEPRECATED_LEAF ("Mute"), 1, "false", ABSOFF (initial_mute), 0, uf_deaf_mute, 0, pf_boolean, - "This element controls whether DDSI2E defaults to mute mode or to normal mode. This controls both the initial behaviour and what behaviour it auto-reverts to.
" }, - END_MARKER + { DEPRECATED_LEAF ("Deaf"), 1, "false", ABSOFF (initial_deaf), 0, uf_deaf_mute, 0, pf_boolean, + BLURB("This element controls whether DDSI2E defaults to deaf mode or to normal mode. This controls both the initial behaviour and what behaviour it auto-reverts to.
") }, + { DEPRECATED_LEAF ("Mute"), 1, "false", ABSOFF (initial_mute), 0, uf_deaf_mute, 0, pf_boolean, + BLURB("This element controls whether DDSI2E defaults to mute mode or to normal mode. This controls both the initial behaviour and what behaviour it auto-reverts to.
") }, + END_MARKER }; static const struct cfgelem rediscovery_blacklist_duration_attrs[] = { - { ATTR("enforce"), 1, "false", ABSOFF(prune_deleted_ppant.enforce_delay), 0, uf_boolean, 0, pf_boolean, - "This attribute controls whether the configured time during which recently deleted participants will not be rediscovered (i.e., \"black listed\") is enforced and following complete removal of the participant in DDSI2E, or whether it can be rediscovered earlier provided all traces of that participant have been removed already.
" }, - END_MARKER + { ATTR("enforce"), 1, "false", ABSOFF(prune_deleted_ppant.enforce_delay), 0, uf_boolean, 0, pf_boolean, + BLURB("This attribute controls whether the configured time during which recently deleted participants will not be rediscovered (i.e., \"black listed\") is enforced and following complete removal of the participant in DDSI2E, or whether it can be rediscovered earlier provided all traces of that participant have been removed already.
") }, + END_MARKER }; static const struct cfgelem heartbeat_interval_attrs[] = { - { ATTR ("min"), 1, "5 ms", ABSOFF (const_hb_intv_min), 0, uf_duration_inf, 0, pf_duration, - "This attribute sets the minimum interval that must have passed since the most recent heartbeat from a writer, before another asynchronous (not directly related to writing) will be sent.
" }, - { ATTR ("minsched"), 1, "20 ms", ABSOFF (const_hb_intv_sched_min), 0, uf_duration_inf, 0, pf_duration, - "This attribute sets the minimum interval for periodic heartbeats. Other events may still cause heartbeats to go out.
" }, - { ATTR ("max"), 1, "8 s", ABSOFF (const_hb_intv_sched_max), 0, uf_duration_inf, 0, pf_duration, - "This attribute sets the maximum interval for periodic heartbeats.
" }, - END_MARKER + { ATTR ("min"), 1, "5 ms", ABSOFF (const_hb_intv_min), 0, uf_duration_inf, 0, pf_duration, + BLURB("This attribute sets the minimum interval that must have passed since the most recent heartbeat from a writer, before another asynchronous (not directly related to writing) will be sent.
") }, + { ATTR ("minsched"), 1, "20 ms", ABSOFF (const_hb_intv_sched_min), 0, uf_duration_inf, 0, pf_duration, + BLURB("This attribute sets the minimum interval for periodic heartbeats. Other events may still cause heartbeats to go out.
") }, + { ATTR ("max"), 1, "8 s", ABSOFF (const_hb_intv_sched_max), 0, uf_duration_inf, 0, pf_duration, + BLURB("This attribute sets the maximum interval for periodic heartbeats.
") }, + END_MARKER }; static const struct cfgelem liveliness_monitoring_attrs[] = { { ATTR("StackTraces"), 1, "true", ABSOFF(noprogress_log_stacktraces), 0, uf_boolean, 0, pf_boolean, - "This element controls whether or not to write stack traces to the DDSI2 trace when a thread fails to make progress (on select platforms only).
" }, + BLURB("This element controls whether or not to write stack traces to the DDSI2 trace when a thread fails to make progress (on select platforms only).
") }, { ATTR("Interval"), 1, "1s", ABSOFF(liveliness_monitoring_interval), 0, uf_duration_100ms_1hr, 0, pf_duration, - "This element controls the interval at which to check whether threads have been making progress.
" }, + BLURB("This element controls the interval at which to check whether threads have been making progress.
") }, END_MARKER }; static const struct cfgelem multiple_recv_threads_attrs[] = { { ATTR("maxretries"), 1, "4294967295", ABSOFF(recv_thread_stop_maxretries), 0, uf_uint, 0, pf_uint, - "Receive threads dedicated to a single socket can only be triggered for termination by sending a packet. Reception of any packet will do, so termination failure due to packet loss is exceedingly unlikely, but to eliminate all risks, it will retry as many times as specified by this attribute before aborting.
" }, + BLURB("Receive threads dedicated to a single socket can only be triggered for termination by sending a packet. Reception of any packet will do, so termination failure due to packet loss is exceedingly unlikely, but to eliminate all risks, it will retry as many times as specified by this attribute before aborting.
") }, END_MARKER }; static const struct cfgelem unsupp_cfgelems[] = { - { MOVED("MaxMessageSize", "General/MaxMessageSize") }, - { MOVED("FragmentSize", "General/FragmentSize") }, - { LEAF("DeliveryQueueMaxSamples"), 1, "256", ABSOFF(delivery_queue_maxsamples), 0, uf_uint, 0, pf_uint, - "This element controls the Maximum size of a delivery queue, expressed in samples. Once a delivery queue is full, incoming samples destined for that queue are dropped until space becomes available again.
" }, - { LEAF("PrimaryReorderMaxSamples"), 1, "64", ABSOFF(primary_reorder_maxsamples), 0, uf_uint, 0, pf_uint, - "This element sets the maximum size in samples of a primary re-order administration. Each proxy writer has one primary re-order administration to buffer the packet flow in case some packets arrive out of order. Old samples are forwarded to secondary re-order administrations associated with readers in need of historical data.
" }, - { LEAF("SecondaryReorderMaxSamples"), 1, "16", ABSOFF(secondary_reorder_maxsamples), 0, uf_uint, 0, pf_uint, - "This element sets the maximum size in samples of a secondary re-order administration. The secondary re-order administration is per reader in need of historical data.
" }, - { LEAF("DefragUnreliableMaxSamples"), 1, "4", ABSOFF(defrag_unreliable_maxsamples), 0, uf_uint, 0, pf_uint, - "This element sets the maximum number of samples that can be defragmented simultaneously for a best-effort writers.
" }, - { LEAF("DefragReliableMaxSamples"), 1, "16", ABSOFF(defrag_reliable_maxsamples), 0, uf_uint, 0, pf_uint, - "This element sets the maximum number of samples that can be defragmented simultaneously for a reliable writer. This has to be large enough to handle retransmissions of historical data in addition to new samples.
" }, - { LEAF("BuiltinEndpointSet"), 1, "writers", ABSOFF(besmode), 0, uf_besmode, 0, pf_besmode, - "This element controls which participants will have which built-in endpoints for the discovery and liveliness protocols. Valid values are:
\n\ + { MOVED("MaxMessageSize", "General/MaxMessageSize") }, + { MOVED("FragmentSize", "General/FragmentSize") }, + { LEAF("DeliveryQueueMaxSamples"), 1, "256", ABSOFF(delivery_queue_maxsamples), 0, uf_uint, 0, pf_uint, + BLURB("This element controls the Maximum size of a delivery queue, expressed in samples. Once a delivery queue is full, incoming samples destined for that queue are dropped until space becomes available again.
") }, + { LEAF("PrimaryReorderMaxSamples"), 1, "64", ABSOFF(primary_reorder_maxsamples), 0, uf_uint, 0, pf_uint, + BLURB("This element sets the maximum size in samples of a primary re-order administration. Each proxy writer has one primary re-order administration to buffer the packet flow in case some packets arrive out of order. Old samples are forwarded to secondary re-order administrations associated with readers in need of historical data.
") }, + { LEAF("SecondaryReorderMaxSamples"), 1, "16", ABSOFF(secondary_reorder_maxsamples), 0, uf_uint, 0, pf_uint, + BLURB("This element sets the maximum size in samples of a secondary re-order administration. The secondary re-order administration is per reader in need of historical data.
") }, + { LEAF("DefragUnreliableMaxSamples"), 1, "4", ABSOFF(defrag_unreliable_maxsamples), 0, uf_uint, 0, pf_uint, + BLURB("This element sets the maximum number of samples that can be defragmented simultaneously for a best-effort writers.
") }, + { LEAF("DefragReliableMaxSamples"), 1, "16", ABSOFF(defrag_reliable_maxsamples), 0, uf_uint, 0, pf_uint, + BLURB("This element sets the maximum number of samples that can be defragmented simultaneously for a reliable writer. This has to be large enough to handle retransmissions of historical data in addition to new samples.
") }, + { LEAF("BuiltinEndpointSet"), 1, "writers", ABSOFF(besmode), 0, uf_besmode, 0, pf_besmode, + BLURB("This element controls which participants will have which built-in endpoints for the discovery and liveliness protocols. Valid values are:
\n\The default is writers, as this is thought to be compliant and reasonably efficient. Minimal may or may not be compliant but is most efficient, and full is inefficient but certain to be compliant. See also Internal/ConservativeBuiltinReaderStartup.
" }, -{ LEAF("AggressiveKeepLastWhc|AggressiveKeepLast1Whc"), 1, "true", ABSOFF(aggressive_keep_last_whc), 0, uf_boolean, 0, pf_boolean, -"This element controls whether to drop a reliable sample from a DDSI2E WHC before all readers have acknowledged it as soon as a later sample becomes available. It only affects DCPS data writers with a history QoS setting of KEEP_LAST with depth 1. The default setting, false, mimics the behaviour of the OpenSplice RT networking and is necessary to make the behaviour of wait_for_acknowledgements() consistent across the networking services.
" }, -{ LEAF("ConservativeBuiltinReaderStartup"), 1, "false", ABSOFF(conservative_builtin_reader_startup), 0, uf_boolean, 0, pf_boolean, -"This element forces all DDSI2E built-in discovery-related readers to request all historical data, instead of just one for each \"topic\". There is no indication that any of the current DDSI implementations requires changing of this setting, but it is conceivable that an implementation might track which participants have been informed of the existence of endpoints and which have not been, refusing communication with those that have \"can't\" know.
\n\ -Should it be necessary to hide DDSI2E's shared discovery behaviour, set this to true and Internal/BuiltinEndpointSet to full.
" }, -{ LEAF("MeasureHbToAckLatency"), 1, "false", ABSOFF(meas_hb_to_ack_latency), 0, uf_boolean, 0, pf_boolean, -"This element enables heartbeat-to-ack latency among DDSI2E services by prepending timestamps to Heartbeat and AckNack messages and calculating round trip times. This is non-standard behaviour. The measured latencies are quite noisy and are currently not used anywhere.
" }, -{ LEAF("SuppressSPDPMulticast"), 1, "false", ABSOFF(suppress_spdp_multicast), 0, uf_boolean, 0, pf_boolean, -"The element controls whether the mandatory multicasting of the participant discovery packets occurs. Completely disabling multicasting requires this element be set to true, and generally requires explicitly listing peers to ping for unicast discovery.
\n\ -See also General/AllowMulticast.
" }, -{ LEAF("UnicastResponseToSPDPMessages"), 1, "true", ABSOFF(unicast_response_to_spdp_messages), 0, uf_boolean, 0, pf_boolean, -"This element controls whether the response to a newly discovered participant is sent as a unicasted SPDP packet, instead of rescheduling the periodic multicasted one. There is no known benefit to setting this to false.
" }, -{ LEAF("SynchronousDeliveryPriorityThreshold"), 1, "0", ABSOFF(synchronous_delivery_priority_threshold), 0, uf_int, 0, pf_int, -"This element controls whether samples sent by a writer with QoS settings latency_budget <= SynchronousDeliveryLatencyBound and transport_priority greater than or equal to this element's value will be delivered synchronously from the \"recv\" thread, all others will be delivered asynchronously through delivery queues. This reduces latency at the expense of aggregate bandwidth.
" }, -{ LEAF("SynchronousDeliveryLatencyBound"), 1, "inf", ABSOFF(synchronous_delivery_latency_bound), 0, uf_duration_inf, 0, pf_duration, -"This element controls whether samples sent by a writer with QoS settings transport_priority >= SynchronousDeliveryPriorityThreshold and a latency_budget at most this element's value will be delivered synchronously from the \"recv\" thread, all others will be delivered asynchronously through delivery queues. This reduces latency at the expense of aggregate bandwidth.
" }, -{ LEAF("MaxParticipants"), 1, "0", ABSOFF(max_participants), 0, uf_natint, 0, pf_int, -"This elements configures the maximum number of DCPS domain participants this DDSI2E instance is willing to service. 0 is unlimited.
" }, -{ LEAF("AccelerateRexmitBlockSize"), 1, "0", ABSOFF(accelerate_rexmit_block_size), 0, uf_uint, 0, pf_uint, -"Proxy readers that are assumed to sill be retrieving historical data get this many samples retransmitted when they NACK something, even if some of these samples have sequence numbers outside the set covered by the NACK.
" }, -{ LEAF("RetransmitMerging"), 1, "adaptive", ABSOFF(retransmit_merging), 0, uf_retransmit_merging, 0, pf_retransmit_merging, -"This elements controls the addressing and timing of retransmits. Possible values are:
\n\ +The default is writers, as this is thought to be compliant and reasonably efficient. Minimal may or may not be compliant but is most efficient, and full is inefficient but certain to be compliant. See also Internal/ConservativeBuiltinReaderStartup.
") }, + { LEAF("ConservativeBuiltinReaderStartup"), 1, "false", ABSOFF(conservative_builtin_reader_startup), 0, uf_boolean, 0, pf_boolean, + BLURB("This element forces all DDSI2E built-in discovery-related readers to request all historical data, instead of just one for each \"topic\". There is no indication that any of the current DDSI implementations requires changing of this setting, but it is conceivable that an implementation might track which participants have been informed of the existence of endpoints and which have not been, refusing communication with those that have \"can't\" know.
\n\ +Should it be necessary to hide DDSI2E's shared discovery behaviour, set this to true and Internal/BuiltinEndpointSet to full.
") }, + { LEAF("MeasureHbToAckLatency"), 1, "false", ABSOFF(meas_hb_to_ack_latency), 0, uf_boolean, 0, pf_boolean, + BLURB("This element enables heartbeat-to-ack latency among DDSI2E services by prepending timestamps to Heartbeat and AckNack messages and calculating round trip times. This is non-standard behaviour. The measured latencies are quite noisy and are currently not used anywhere.
") }, + { LEAF("SuppressSPDPMulticast"), 1, "false", ABSOFF(suppress_spdp_multicast), 0, uf_boolean, 0, pf_boolean, + BLURB("The element controls whether the mandatory multicasting of the participant discovery packets occurs. Completely disabling multicasting requires this element be set to true, and generally requires explicitly listing peers to ping for unicast discovery.
\n\ +See also General/AllowMulticast.
") }, + { LEAF("UnicastResponseToSPDPMessages"), 1, "true", ABSOFF(unicast_response_to_spdp_messages), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether the response to a newly discovered participant is sent as a unicasted SPDP packet, instead of rescheduling the periodic multicasted one. There is no known benefit to setting this to false.
") }, + { LEAF("SynchronousDeliveryPriorityThreshold"), 1, "0", ABSOFF(synchronous_delivery_priority_threshold), 0, uf_int, 0, pf_int, + BLURB("This element controls whether samples sent by a writer with QoS settings latency_budget <= SynchronousDeliveryLatencyBound and transport_priority greater than or equal to this element's value will be delivered synchronously from the \"recv\" thread, all others will be delivered asynchronously through delivery queues. This reduces latency at the expense of aggregate bandwidth.
") }, + { LEAF("SynchronousDeliveryLatencyBound"), 1, "inf", ABSOFF(synchronous_delivery_latency_bound), 0, uf_duration_inf, 0, pf_duration, + BLURB("This element controls whether samples sent by a writer with QoS settings transport_priority >= SynchronousDeliveryPriorityThreshold and a latency_budget at most this element's value will be delivered synchronously from the \"recv\" thread, all others will be delivered asynchronously through delivery queues. This reduces latency at the expense of aggregate bandwidth.
") }, + { LEAF("MaxParticipants"), 1, "0", ABSOFF(max_participants), 0, uf_natint, 0, pf_int, + BLURB("This elements configures the maximum number of DCPS domain participants this DDSI2E instance is willing to service. 0 is unlimited.
") }, + { LEAF("AccelerateRexmitBlockSize"), 1, "0", ABSOFF(accelerate_rexmit_block_size), 0, uf_uint, 0, pf_uint, + BLURB("Proxy readers that are assumed to sill be retrieving historical data get this many samples retransmitted when they NACK something, even if some of these samples have sequence numbers outside the set covered by the NACK.
") }, + { LEAF("RetransmitMerging"), 1, "adaptive", ABSOFF(retransmit_merging), 0, uf_retransmit_merging, 0, pf_retransmit_merging, + BLURB("This elements controls the addressing and timing of retransmits. Possible values are:
\n\The default is adaptive. See also Internal/RetransmitMergingPeriod.
" }, -{ LEAF("RetransmitMergingPeriod"), 1, "5 ms", ABSOFF(retransmit_merging_period), 0, uf_duration_us_1s, 0, pf_duration, -"This setting determines the size of the time window in which a NACK of some sample is ignored because a retransmit of that sample has been multicasted too recently. This setting has no effect on unicasted retransmits.
\n\ -See also Internal/RetransmitMerging.
" }, -{ LEAF_W_ATTRS("HeartbeatInterval", heartbeat_interval_attrs), 1, "100 ms", ABSOFF(const_hb_intv_sched), 0, uf_duration_inf, 0, pf_duration, - "This elemnents allows configuring the base interval for sending writer heartbeats and the bounds within it can vary.
" }, -{ LEAF("MaxQueuedRexmitBytes"), 1, "50 kB", ABSOFF(max_queued_rexmit_bytes), 0, uf_memsize, 0, pf_memsize, -"This setting limits the maximum number of bytes queued for retransmission. The default value of 0 is unlimited unless an AuxiliaryBandwidthLimit has been set, in which case it becomes NackDelay * AuxiliaryBandwidthLimit. It must be large enough to contain the largest sample that may need to be retransmitted.
" }, -{ LEAF("MaxQueuedRexmitMessages"), 1, "200", ABSOFF(max_queued_rexmit_msgs), 0, uf_uint, 0, pf_uint, -"This settings limits the maximum number of samples queued for retransmission.
" }, -{ LEAF("LeaseDuration"), 1, "10 s", ABSOFF(lease_duration), 0, uf_duration_ms_1hr, 0, pf_duration, -"This setting controls the default participant lease duration.
" }, -{ LEAF("WriterLingerDuration"), 1, "1 s", ABSOFF(writer_linger_duration), 0, uf_duration_ms_1hr, 0, pf_duration, -"
This setting controls the maximum duration for which actual deletion of a reliable writer with unacknowledged data in its history will be postponed to provide proper reliable transmission.
" }, -{ LEAF("MinimumSocketReceiveBufferSize"), 1, "default", ABSOFF(socket_min_rcvbuf_size), 0, uf_maybe_memsize, 0, pf_maybe_memsize, -"
This setting controls the minimum size of socket receive buffers. The operating system provides some size receive buffer upon creation of the socket, this option can be used to increase the size of the buffer beyond that initially provided by the operating system. If the buffer size cannot be increased to the specified size, an error is reported.
\n\ -The default setting is the word \"default\", which means DDSI2E will attempt to increase the buffer size to 1MB, but will silently accept a smaller buffer should that attempt fail.
" }, -{ LEAF("MinimumSocketSendBufferSize"), 1, "64 KiB", ABSOFF(socket_min_sndbuf_size), 0, uf_memsize, 0, pf_memsize, -"This setting controls the minimum size of socket send buffers. This setting can only increase the size of the send buffer, if the operating system by default creates a larger buffer, it is left unchanged.
" }, -{ LEAF("NackDelay"), 1, "10 ms", ABSOFF(nack_delay), 0, uf_duration_ms_1hr, 0, pf_duration, -"This setting controls the delay between receipt of a HEARTBEAT indicating missing samples and a NACK (ignored when the HEARTBEAT requires an answer). However, no NACK is sent if a NACK had been scheduled already for a response earlier than the delay requests: then that NACK will incorporate the latest information.
" }, -{ LEAF("AutoReschedNackDelay"), 1, "1 s", ABSOFF(auto_resched_nack_delay), 0, uf_duration_inf, 0, pf_duration, -"This setting controls the interval with which a reader will continue NACK'ing missing samples in the absence of a response from the writer, as a protection mechanism against writers incorrectly stopping the sending of HEARTBEAT messages.
" }, -{ LEAF("PreEmptiveAckDelay"), 1, "10 ms", ABSOFF(preemptive_ack_delay), 0, uf_duration_ms_1hr, 0, pf_duration, -"This setting controls the delay between the discovering a remote writer and sending a pre-emptive AckNack to discover the range of data available.
" }, -{ LEAF("ScheduleTimeRounding"), 1, "0 ms", ABSOFF(schedule_time_rounding), 0, uf_duration_ms_1hr, 0, pf_duration, -"This setting allows the timing of scheduled events to be rounded up so that more events can be handled in a single cycle of the event queue. The default is 0 and causes no rounding at all, i.e. are scheduled exactly, whereas a value of 10ms would mean that events are rounded up to the nearest 10 milliseconds.
" }, +The default is adaptive. See also Internal/RetransmitMergingPeriod.
") }, + { LEAF("RetransmitMergingPeriod"), 1, "5 ms", ABSOFF(retransmit_merging_period), 0, uf_duration_us_1s, 0, pf_duration, + BLURB("This setting determines the size of the time window in which a NACK of some sample is ignored because a retransmit of that sample has been multicasted too recently. This setting has no effect on unicasted retransmits.
\n\ +See also Internal/RetransmitMerging.
") }, + { LEAF_W_ATTRS("HeartbeatInterval", heartbeat_interval_attrs), 1, "100 ms", ABSOFF(const_hb_intv_sched), 0, uf_duration_inf, 0, pf_duration, + BLURB("This elemnents allows configuring the base interval for sending writer heartbeats and the bounds within it can vary.
") }, + { LEAF("MaxQueuedRexmitBytes"), 1, "50 kB", ABSOFF(max_queued_rexmit_bytes), 0, uf_memsize, 0, pf_memsize, + BLURB("This setting limits the maximum number of bytes queued for retransmission. The default value of 0 is unlimited unless an AuxiliaryBandwidthLimit has been set, in which case it becomes NackDelay * AuxiliaryBandwidthLimit. It must be large enough to contain the largest sample that may need to be retransmitted.
") }, + { LEAF("MaxQueuedRexmitMessages"), 1, "200", ABSOFF(max_queued_rexmit_msgs), 0, uf_uint, 0, pf_uint, + BLURB("This settings limits the maximum number of samples queued for retransmission.
") }, + { LEAF("LeaseDuration"), 1, "10 s", ABSOFF(lease_duration), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This setting controls the default participant lease duration.
") }, + { LEAF("WriterLingerDuration"), 1, "1 s", ABSOFF(writer_linger_duration), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("
This setting controls the maximum duration for which actual deletion of a reliable writer with unacknowledged data in its history will be postponed to provide proper reliable transmission.
") }, + { LEAF("MinimumSocketReceiveBufferSize"), 1, "default", ABSOFF(socket_min_rcvbuf_size), 0, uf_maybe_memsize, 0, pf_maybe_memsize, + BLURB("
This setting controls the minimum size of socket receive buffers. The operating system provides some size receive buffer upon creation of the socket, this option can be used to increase the size of the buffer beyond that initially provided by the operating system. If the buffer size cannot be increased to the specified size, an error is reported.
\n\ +The default setting is the word \"default\", which means DDSI2E will attempt to increase the buffer size to 1MB, but will silently accept a smaller buffer should that attempt fail.
") }, + { LEAF("MinimumSocketSendBufferSize"), 1, "64 KiB", ABSOFF(socket_min_sndbuf_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This setting controls the minimum size of socket send buffers. This setting can only increase the size of the send buffer, if the operating system by default creates a larger buffer, it is left unchanged.
") }, + { LEAF("NackDelay"), 1, "10 ms", ABSOFF(nack_delay), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This setting controls the delay between receipt of a HEARTBEAT indicating missing samples and a NACK (ignored when the HEARTBEAT requires an answer). However, no NACK is sent if a NACK had been scheduled already for a response earlier than the delay requests: then that NACK will incorporate the latest information.
") }, + { LEAF("AutoReschedNackDelay"), 1, "1 s", ABSOFF(auto_resched_nack_delay), 0, uf_duration_inf, 0, pf_duration, + BLURB("This setting controls the interval with which a reader will continue NACK'ing missing samples in the absence of a response from the writer, as a protection mechanism against writers incorrectly stopping the sending of HEARTBEAT messages.
") }, + { LEAF("PreEmptiveAckDelay"), 1, "10 ms", ABSOFF(preemptive_ack_delay), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This setting controls the delay between the discovering a remote writer and sending a pre-emptive AckNack to discover the range of data available.
") }, + { LEAF("ScheduleTimeRounding"), 1, "0 ms", ABSOFF(schedule_time_rounding), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This setting allows the timing of scheduled events to be rounded up so that more events can be handled in a single cycle of the event queue. The default is 0 and causes no rounding at all, i.e. are scheduled exactly, whereas a value of 10ms would mean that events are rounded up to the nearest 10 milliseconds.
") }, #ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING -{ LEAF("AuxiliaryBandwidthLimit"), 1, "inf", ABSOFF(auxiliary_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, -"This element specifies the maximum transmit rate of auxiliary traffic not bound to a specific channel, such as discovery traffic, as well as auxiliary traffic related to a certain channel if that channel has elected to share this global AuxiliaryBandwidthLimit. Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
" }, + { LEAF("AuxiliaryBandwidthLimit"), 1, "inf", ABSOFF(auxiliary_bandwidth_limit), 0, uf_bandwidth, 0, pf_bandwidth, + BLURB("This element specifies the maximum transmit rate of auxiliary traffic not bound to a specific channel, such as discovery traffic, as well as auxiliary traffic related to a certain channel if that channel has elected to share this global AuxiliaryBandwidthLimit. Bandwidth limiting uses a leaky bucket scheme. The default value \"inf\" means DDSI2E imposes no limitation, the underlying operating system and hardware will likely limit the maimum transmit rate.
") }, #endif -{ LEAF("DDSI2DirectMaxThreads"), 1, "1", ABSOFF(ddsi2direct_max_threads), 0, uf_uint, 0, pf_uint, -"This element sets the maximum number of extra threads for an experimental, undocumented and unsupported direct mode.
" }, -{ LEAF("SquashParticipants"), 1, "false", ABSOFF(squash_participants), 0, uf_boolean, 0, pf_boolean, -"This element controls whether DDSI2E advertises all the domain participants it serves in DDSI (when set to false), or rather only one domain participant (the one corresponding to the DDSI2E process; when set to true). In the latter case DDSI2E becomes the virtual owner of all readers and writers of all domain participants, dramatically reducing discovery traffic (a similar effect can be obtained by setting Internal/BuiltinEndpointSet to \"minimal\" but with less loss of information).
" }, -{ LEAF("LegacyFragmentation"), 1, "false", ABSOFF(buggy_datafrag_flags_mode), 0, uf_boolean, 0, pf_boolean, -"This option enables a backwards-compatible, non-compliant setting and interpretation of the control flags in fragmented data messages. To be enabled only when requiring interoperability between compliant and non-compliant versions of DDSI2E for large messages.
" }, -{ LEAF("SPDPResponseMaxDelay"), 1, "0 ms", ABSOFF(spdp_response_delay_max), 0, uf_duration_ms_1s, 0, pf_duration, -"Maximum pseudo-random delay in milliseconds between discovering a remote participant and responding to it.
" }, -{ LEAF("LateAckMode"), 1, "false", ABSOFF(late_ack_mode), 0, uf_boolean, 0, pf_boolean, -"Ack a sample only when it has been delivered, instead of when committed to delivering it.
" }, -{ LEAF("ForwardAllMessages"), 1, "false", ABSOFF(forward_all_messages), 0, uf_boolean, 0, pf_boolean, -"Forward all messages from a writer, rather than trying to forward each sample only once. The default of trying to forward each sample only once filters out duplicates for writers in multiple partitions under nearly all circumstances, but may still publish the odd duplicate. Note: the current implementation also can lose in contrived test cases, that publish more than 2**32 samples using a single data writer in conjunction with carefully controlled management of the writer history via cooperating local readers.
" }, -{ LEAF("RetryOnRejectBestEffort"), 1, "false", ABSOFF(retry_on_reject_besteffort), 0, uf_boolean, 0, pf_boolean, -"Whether or not to locally retry pushing a received best-effort sample into the reader caches when resource limits are reached.
" }, -{ LEAF("GenerateKeyhash"), 1, "false", ABSOFF(generate_keyhash), 0, uf_boolean, 0, pf_boolean, -"When true, include keyhashes in outgoing data for topics with keys.
" }, -{ LEAF("MaxSampleSize"), 1, "2147483647 B", ABSOFF(max_sample_size), 0, uf_memsize, 0, pf_memsize, -"This setting controls the maximum (CDR) serialised size of samples that DDSI2E will forward in either direction. Samples larger than this are discarded with a warning.
" }, -{ LEAF("WriteBatch"), 1, "false", ABSOFF(whc_batch), 0, uf_boolean, 0, pf_boolean, -"This element enables the batching of write operations. By default each write operation writes through the write cache and out onto the transport. Enabling write batching causes multiple small write operations to be aggregated within the write cache into a single larger write. This gives greater throughput at the expense of latency. Currently there is no mechanism for the write cache to automatically flush itself, so that if write batching is enabled, the application may havee to use the dds_write_flush function to ensure thta all samples are written.
" }, -{ LEAF_W_ATTRS("LivelinessMonitoring", liveliness_monitoring_attrs), 1, "false", ABSOFF(liveliness_monitoring), 0, uf_boolean, 0, pf_boolean, -"This element controls whether or not implementation should internally monitor its own liveliness. If liveliness monitoring is enabled, stack traces can be dumped automatically when some thread appears to have stopped making progress.
" }, -{ LEAF("MonitorPort"), 1, "-1", ABSOFF(monitor_port), 0, uf_int, 0, pf_int, -"This element allows configuring a service that dumps a text description of part the internal state to TCP clients. By default (-1), this is disabled; specifying 0 means a kernel-allocated port is used; a positive number is used as the TCP port number.
" }, -{ LEAF("AssumeMulticastCapable"), 1, "", ABSOFF(assumeMulticastCapable), 0, uf_string, ff_free, pf_string, -"This element controls which network interfaces are assumed to be capable of multicasting even when the interface flags returned by the operating system state it is not (this provides a workaround for some platforms). It is a comma-separated lists of patterns (with ? and * wildcards) against which the interface names are matched.
" }, -{ LEAF("PrioritizeRetransmit"), 1, "true", ABSOFF(prioritize_retransmit), 0, uf_boolean, 0, pf_boolean, -"This element controls whether retransmits are prioritized over new data, speeding up recovery.
" }, -{ LEAF("UseMulticastIfMreqn"), 1, "0", ABSOFF(use_multicast_if_mreqn), 0, uf_int, 0, pf_int, -"Do not use.
" }, -{ LEAF("SendAsync"), 1, "false", ABSOFF(xpack_send_async), 0, uf_boolean, 0, pf_boolean, -"This element controls whether the actual sending of packets occurs on the same thread that prepares them, or is done asynchronously by another thread.
" }, -{ LEAF_W_ATTRS("RediscoveryBlacklistDuration", rediscovery_blacklist_duration_attrs), 1, "10s", ABSOFF(prune_deleted_ppant.delay), 0, uf_duration_inf, 0, pf_duration, -"This element controls for how long a remote participant that was previously deleted will remain on a blacklist to prevent rediscovery, giving the software on a node time to perform any cleanup actions it needs to do. To some extent this delay is required internally by DDSI2E, but in the default configuration with the 'enforce' attribute set to false, DDSI2E will reallow rediscovery as soon as it has cleared its internal administration. Setting it to too small a value may result in the entry being pruned from the blacklist before DDSI2E is ready, it is therefore recommended to set it to at least several seconds.
" }, + { LEAF("DDSI2DirectMaxThreads"), 1, "1", ABSOFF(ddsi2direct_max_threads), 0, uf_uint, 0, pf_uint, + BLURB("This element sets the maximum number of extra threads for an experimental, undocumented and unsupported direct mode.
") }, + { LEAF("SquashParticipants"), 1, "false", ABSOFF(squash_participants), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether DDSI2E advertises all the domain participants it serves in DDSI (when set to false), or rather only one domain participant (the one corresponding to the DDSI2E process; when set to true). In the latter case DDSI2E becomes the virtual owner of all readers and writers of all domain participants, dramatically reducing discovery traffic (a similar effect can be obtained by setting Internal/BuiltinEndpointSet to \"minimal\" but with less loss of information).
") }, + { LEAF("SPDPResponseMaxDelay"), 1, "0 ms", ABSOFF(spdp_response_delay_max), 0, uf_duration_ms_1s, 0, pf_duration, + BLURB("Maximum pseudo-random delay in milliseconds between discovering a remote participant and responding to it.
") }, + { LEAF("LateAckMode"), 1, "false", ABSOFF(late_ack_mode), 0, uf_boolean, 0, pf_boolean, + BLURB("Ack a sample only when it has been delivered, instead of when committed to delivering it.
") }, + { LEAF("RetryOnRejectBestEffort"), 1, "false", ABSOFF(retry_on_reject_besteffort), 0, uf_boolean, 0, pf_boolean, + BLURB("Whether or not to locally retry pushing a received best-effort sample into the reader caches when resource limits are reached.
") }, + { LEAF("GenerateKeyhash"), 1, "false", ABSOFF(generate_keyhash), 0, uf_boolean, 0, pf_boolean, + BLURB("When true, include keyhashes in outgoing data for topics with keys.
") }, + { LEAF("MaxSampleSize"), 1, "2147483647 B", ABSOFF(max_sample_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This setting controls the maximum (CDR) serialised size of samples that DDSI2E will forward in either direction. Samples larger than this are discarded with a warning.
") }, + { LEAF("WriteBatch"), 1, "false", ABSOFF(whc_batch), 0, uf_boolean, 0, pf_boolean, + BLURB("This element enables the batching of write operations. By default each write operation writes through the write cache and out onto the transport. Enabling write batching causes multiple small write operations to be aggregated within the write cache into a single larger write. This gives greater throughput at the expense of latency. Currently there is no mechanism for the write cache to automatically flush itself, so that if write batching is enabled, the application may havee to use the dds_write_flush function to ensure thta all samples are written.
") }, + { LEAF_W_ATTRS("LivelinessMonitoring", liveliness_monitoring_attrs), 1, "false", ABSOFF(liveliness_monitoring), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether or not implementation should internally monitor its own liveliness. If liveliness monitoring is enabled, stack traces can be dumped automatically when some thread appears to have stopped making progress.
") }, + { LEAF("MonitorPort"), 1, "-1", ABSOFF(monitor_port), 0, uf_int, 0, pf_int, + BLURB("This element allows configuring a service that dumps a text description of part the internal state to TCP clients. By default (-1), this is disabled; specifying 0 means a kernel-allocated port is used; a positive number is used as the TCP port number.
") }, + { LEAF("AssumeMulticastCapable"), 1, "", ABSOFF(assumeMulticastCapable), 0, uf_string, ff_free, pf_string, + BLURB("This element controls which network interfaces are assumed to be capable of multicasting even when the interface flags returned by the operating system state it is not (this provides a workaround for some platforms). It is a comma-separated lists of patterns (with ? and * wildcards) against which the interface names are matched.
") }, + { LEAF("PrioritizeRetransmit"), 1, "true", ABSOFF(prioritize_retransmit), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether retransmits are prioritized over new data, speeding up recovery.
") }, + { LEAF("UseMulticastIfMreqn"), 1, "0", ABSOFF(use_multicast_if_mreqn), 0, uf_int, 0, pf_int, + BLURB("Do not use.
") }, + { LEAF("SendAsync"), 1, "false", ABSOFF(xpack_send_async), 0, uf_boolean, 0, pf_boolean, + BLURB("This element controls whether the actual sending of packets occurs on the same thread that prepares them, or is done asynchronously by another thread.
") }, + { LEAF_W_ATTRS("RediscoveryBlacklistDuration", rediscovery_blacklist_duration_attrs), 1, "10s", ABSOFF(prune_deleted_ppant.delay), 0, uf_duration_inf, 0, pf_duration, + BLURB("This element controls for how long a remote participant that was previously deleted will remain on a blacklist to prevent rediscovery, giving the software on a node time to perform any cleanup actions it needs to do. To some extent this delay is required internally by DDSI2E, but in the default configuration with the 'enforce' attribute set to false, DDSI2E will reallow rediscovery as soon as it has cleared its internal administration. Setting it to too small a value may result in the entry being pruned from the blacklist before DDSI2E is ready, it is therefore recommended to set it to at least several seconds.
") }, { LEAF_W_ATTRS("MultipleReceiveThreads", multiple_recv_threads_attrs), 1, "true", ABSOFF(multiple_recv_threads), 0, uf_boolean, 0, pf_boolean, - "This element controls whether all traffic is handled by a single receive thread or whether multiple receive threads may be used to improve latency. Currently multiple receive threads are only used for connectionless transport (e.g., UDP) and ManySocketsMode not set to single (the default).
" }, -{ MGROUP("ControlTopic", control_topic_cfgelems, control_topic_cfgattrs), 1, 0, 0, 0, 0, 0, 0, 0, -"The ControlTopic element allows configured whether DDSI2E provides a special control interface via a predefined topic or not.
" }, -{ GROUP("Test", unsupp_test_cfgelems), -"
Testing options.
" }, -{ GROUP("Watermarks", unsupp_watermarks_cfgelems), -"Watermarks for flow-control.
" }, -{ LEAF("EnableExpensiveChecks"), 1, "", ABSOFF(enabled_xchecks), 0, uf_xcheck, 0, pf_xcheck, - "This element enables expensive checks in builds with assertions enabled and is ignored otherwise. Recognised categories are:
\n\ + BLURB("This element controls whether all traffic is handled by a single receive thread or whether multiple receive threads may be used to improve latency. Currently multiple receive threads are only used for connectionless transport (e.g., UDP) and ManySocketsMode not set to single (the default).
") }, + { MGROUP("ControlTopic", control_topic_cfgelems, control_topic_cfgattrs), 1, 0, 0, 0, 0, 0, 0, 0, + BLURB("The ControlTopic element allows configured whether DDSI2E provides a special control interface via a predefined topic or not.
") }, + { GROUP("Test", unsupp_test_cfgelems), + BLURB("
Testing options.
") }, + { GROUP("Watermarks", unsupp_watermarks_cfgelems), + BLURB("Watermarks for flow-control.
") }, + { LEAF("EnableExpensiveChecks"), 1, "", ABSOFF(enabled_xchecks), 0, uf_xcheck, 0, pf_xcheck, + BLURB("This element enables expensive checks in builds with assertions enabled and is ignored otherwise. Recognised categories are:
\n\In addition, there is the keyword all that enables all checks.
" }, - -END_MARKER +In addition, there is the keyword all that enables all checks.
") }, + END_MARKER }; -static const struct cfgelem sizing_cfgelems[] = -{ - { LEAF("ReceiveBufferSize"), 1, "1 MiB", ABSOFF(rbuf_size), 0, uf_memsize, 0, pf_memsize, - "This element sets the size of a single receive buffer. Many receive buffers may be needed. The minimum workable size a little bit larger than Sizing/ReceiveBufferChunkSize, and the value used is taken as the configured value and the actual minimum workable size.
" }, - { LEAF("ReceiveBufferChunkSize"), 1, "128 KiB", ABSOFF(rmsg_chunk_size), 0, uf_memsize, 0, pf_memsize, - "This element specifies the size of one allocation unit in the receive buffer. Must be greater than the maximum packet size by a modest amount (too large packets are dropped). Each allocation is shrunk immediately after processing a message, or freed straightaway.
" }, - END_MARKER +static const struct cfgelem sizing_cfgelems[] = { + { LEAF("ReceiveBufferSize"), 1, "1 MiB", ABSOFF(rbuf_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This element sets the size of a single receive buffer. Many receive buffers may be needed. The minimum workable size a little bit larger than Sizing/ReceiveBufferChunkSize, and the value used is taken as the configured value and the actual minimum workable size.
") }, + { LEAF("ReceiveBufferChunkSize"), 1, "128 KiB", ABSOFF(rmsg_chunk_size), 0, uf_memsize, 0, pf_memsize, + BLURB("This element specifies the size of one allocation unit in the receive buffer. Must be greater than the maximum packet size by a modest amount (too large packets are dropped). Each allocation is shrunk immediately after processing a message, or freed straightaway.
") }, + END_MARKER }; static const struct cfgelem discovery_ports_cfgelems[] = { - { LEAF("Base"), 1, "7400", ABSOFF(port_base), 0, uf_port, 0, pf_int, - "This element specifies the base port number (refer to the DDSI 2.1 specification, section 9.6.1, constant PB).
" }, - { LEAF("DomainGain"), 1, "250", ABSOFF(port_dg), 0, uf_int, 0, pf_int, - "This element specifies the domain gain, relating domain ids to sets of port numbers (refer to the DDSI 2.1 specification, section 9.6.1, constant DG).
" }, - { LEAF("ParticipantGain"), 1, "2", ABSOFF(port_pg), 0, uf_int, 0, pf_int, - "This element specifies the participant gain, relating p0, articipant index to sets of port numbers (refer to the DDSI 2.1 specification, section 9.6.1, constant PG).
" }, - { LEAF("MulticastMetaOffset"), 1, "0", ABSOFF(port_d0), 0, uf_int, 0, pf_int, - "This element specifies the port number for multicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d0).
" }, - { LEAF("UnicastMetaOffset"), 1, "10", ABSOFF(port_d1), 0, uf_int, 0, pf_int, - "This element specifies the port number for unicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d1).
" }, - { LEAF("MulticastDataOffset"), 1, "1", ABSOFF(port_d2), 0, uf_int, 0, pf_int, - "This element specifies the port number for multicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d2).
" }, - { LEAF("UnicastDataOffset"), 1, "11", ABSOFF(port_d3), 0, uf_int, 0, pf_int, - "This element specifies the port number for unicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d3).
" }, - END_MARKER + { LEAF("Base"), 1, "7400", ABSOFF(port_base), 0, uf_port, 0, pf_int, + BLURB("This element specifies the base port number (refer to the DDSI 2.1 specification, section 9.6.1, constant PB).
") }, + { LEAF("DomainGain"), 1, "250", ABSOFF(port_dg), 0, uf_int, 0, pf_int, + BLURB("This element specifies the domain gain, relating domain ids to sets of port numbers (refer to the DDSI 2.1 specification, section 9.6.1, constant DG).
") }, + { LEAF("ParticipantGain"), 1, "2", ABSOFF(port_pg), 0, uf_int, 0, pf_int, + BLURB("This element specifies the participant gain, relating p0, articipant index to sets of port numbers (refer to the DDSI 2.1 specification, section 9.6.1, constant PG).
") }, + { LEAF("MulticastMetaOffset"), 1, "0", ABSOFF(port_d0), 0, uf_int, 0, pf_int, + BLURB("This element specifies the port number for multicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d0).
") }, + { LEAF("UnicastMetaOffset"), 1, "10", ABSOFF(port_d1), 0, uf_int, 0, pf_int, + BLURB("This element specifies the port number for unicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d1).
") }, + { LEAF("MulticastDataOffset"), 1, "1", ABSOFF(port_d2), 0, uf_int, 0, pf_int, + BLURB("This element specifies the port number for multicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d2).
") }, + { LEAF("UnicastDataOffset"), 1, "11", ABSOFF(port_d3), 0, uf_int, 0, pf_int, + BLURB("This element specifies the port number for unicast meta traffic (refer to the DDSI 2.1 specification, section 9.6.1, constant d3).
") }, + END_MARKER }; static const struct cfgelem tcp_cfgelems[] = { - { LEAF ("Enable"), 1, "default", ABSOFF (compat_tcp_enable), 0, uf_boolean_default, 0, pf_nop, - "This element enables the optional TCP transport - deprecated, use General/Transport instead.
" }, - { LEAF("NoDelay"), 1, "true", ABSOFF(tcp_nodelay), 0, uf_boolean, 0, pf_boolean, - "This element enables the TCP_NODELAY socket option, preventing multiple DDSI messages being sent in the same TCP request. Setting this option typically optimises latency over throughput.
" }, - { LEAF("Port"), 1, "-1", ABSOFF(tcp_port), 0, uf_dyn_port, 0, pf_int, - "This element specifies the TCP port number on which DDSI2E accepts connections. If the port is set it is used in entity locators, published with DDSI discovery. Dynamically allocated if zero. Disabled if -1 or not configured. If disabled other DDSI services will not be able to establish connections with the service, the service can only communicate by establishing connections to other services.
" }, - { LEAF("ReadTimeout"), 1, "2 s", ABSOFF(tcp_read_timeout), 0, uf_duration_ms_1hr, 0, pf_duration, - "This element specifies the timeout for blocking TCP read operations. If this timeout expires then the connection is closed.
" }, - { LEAF("WriteTimeout"), 1, "2 s", ABSOFF(tcp_write_timeout), 0, uf_duration_ms_1hr, 0, pf_duration, - "This element specifies the timeout for blocking TCP write operations. If this timeout expires then the connection is closed.
" }, - { LEAF ("AlwaysUsePeeraddrForUnicast"), 1, "false", ABSOFF (tcp_use_peeraddr_for_unicast), 0, uf_boolean, 0, pf_boolean, - "Setting this to true means the unicast addresses in SPDP packets will be ignored and the peer address from the TCP connection will be used instead. This may help work around incorrectly advertised addresses when using TCP.
" }, - END_MARKER + { LEAF ("Enable"), 1, "default", ABSOFF (compat_tcp_enable), 0, uf_boolean_default, 0, pf_nop, + BLURB("This element enables the optional TCP transport - deprecated, use General/Transport instead.
") }, + { LEAF("NoDelay"), 1, "true", ABSOFF(tcp_nodelay), 0, uf_boolean, 0, pf_boolean, + BLURB("This element enables the TCP_NODELAY socket option, preventing multiple DDSI messages being sent in the same TCP request. Setting this option typically optimises latency over throughput.
") }, + { LEAF("Port"), 1, "-1", ABSOFF(tcp_port), 0, uf_dyn_port, 0, pf_int, + BLURB("This element specifies the TCP port number on which DDSI2E accepts connections. If the port is set it is used in entity locators, published with DDSI discovery. Dynamically allocated if zero. Disabled if -1 or not configured. If disabled other DDSI services will not be able to establish connections with the service, the service can only communicate by establishing connections to other services.
") }, + { LEAF("ReadTimeout"), 1, "2 s", ABSOFF(tcp_read_timeout), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This element specifies the timeout for blocking TCP read operations. If this timeout expires then the connection is closed.
") }, + { LEAF("WriteTimeout"), 1, "2 s", ABSOFF(tcp_write_timeout), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This element specifies the timeout for blocking TCP write operations. If this timeout expires then the connection is closed.
") }, + { LEAF ("AlwaysUsePeeraddrForUnicast"), 1, "false", ABSOFF (tcp_use_peeraddr_for_unicast), 0, uf_boolean, 0, pf_boolean, + BLURB("Setting this to true means the unicast addresses in SPDP packets will be ignored and the peer address from the TCP connection will be used instead. This may help work around incorrectly advertised addresses when using TCP.
") }, + END_MARKER }; #ifdef DDSI_INCLUDE_SSL static const struct cfgelem ssl_cfgelems[] = { - { LEAF("Enable"), 1, "false", ABSOFF(ssl_enable), 0, uf_boolean, 0, pf_boolean, - "This enables SSL/TLS for TCP.
" }, - { LEAF("CertificateVerification"), 1, "true", ABSOFF(ssl_verify), 0, uf_boolean, 0, pf_boolean, - "If disabled this allows SSL connections to occur even if an X509 certificate fails verification.
" }, - { LEAF("VerifyClient"), 1, "true", ABSOFF(ssl_verify_client), 0, uf_boolean, 0, pf_boolean, - "This enables an SSL server checking the X509 certificate of a connecting client.
" }, - { LEAF("SelfSignedCertificates"), 1, "false", ABSOFF(ssl_self_signed), 0, uf_boolean, 0, pf_boolean, - "This enables the use of self signed X509 certificates.
" }, - { LEAF("KeystoreFile"), 1, "keystore", ABSOFF(ssl_keystore), 0, uf_string, ff_free, pf_string, - "The SSL/TLS key and certificate store file name. The keystore must be in PEM format.
" }, - { LEAF("KeyPassphrase"), 1, "secret", ABSOFF(ssl_key_pass), 0, uf_string, ff_free, pf_string, - "The SSL/TLS key pass phrase for encrypted keys.
" }, - { LEAF("Ciphers"), 1, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH", ABSOFF(ssl_ciphers), 0, uf_string, ff_free, pf_string, - "The set of ciphers used by SSL/TLS
" }, - { LEAF("EntropyFile"), 1, "", ABSOFF(ssl_rand_file), 0, uf_string, ff_free, pf_string, - "The SSL/TLS random entropy file name.
" }, - { LEAF("MinimumTLSVersion"), 1, "1.3", ABSOFF(ssl_min_version), 0, uf_min_tls_version, 0, pf_min_tls_version, - "The minimum TLS version that may be negotiated, valid values are 1.2 and 1.3.
" }, - END_MARKER + { LEAF("Enable"), 1, "false", ABSOFF(ssl_enable), 0, uf_boolean, 0, pf_boolean, + BLURB("This enables SSL/TLS for TCP.
") }, + { LEAF("CertificateVerification"), 1, "true", ABSOFF(ssl_verify), 0, uf_boolean, 0, pf_boolean, + BLURB("If disabled this allows SSL connections to occur even if an X509 certificate fails verification.
") }, + { LEAF("VerifyClient"), 1, "true", ABSOFF(ssl_verify_client), 0, uf_boolean, 0, pf_boolean, + BLURB("This enables an SSL server checking the X509 certificate of a connecting client.
") }, + { LEAF("SelfSignedCertificates"), 1, "false", ABSOFF(ssl_self_signed), 0, uf_boolean, 0, pf_boolean, + BLURB("This enables the use of self signed X509 certificates.
") }, + { LEAF("KeystoreFile"), 1, "keystore", ABSOFF(ssl_keystore), 0, uf_string, ff_free, pf_string, + BLURB("The SSL/TLS key and certificate store file name. The keystore must be in PEM format.
") }, + { LEAF("KeyPassphrase"), 1, "secret", ABSOFF(ssl_key_pass), 0, uf_string, ff_free, pf_string, + BLURB("The SSL/TLS key pass phrase for encrypted keys.
") }, + { LEAF("Ciphers"), 1, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH", ABSOFF(ssl_ciphers), 0, uf_string, ff_free, pf_string, + BLURB("The set of ciphers used by SSL/TLS
") }, + { LEAF("EntropyFile"), 1, "", ABSOFF(ssl_rand_file), 0, uf_string, ff_free, pf_string, + BLURB("The SSL/TLS random entropy file name.
") }, + { LEAF("MinimumTLSVersion"), 1, "1.3", ABSOFF(ssl_min_version), 0, uf_min_tls_version, 0, pf_min_tls_version, + BLURB("The minimum TLS version that may be negotiated, valid values are 1.2 and 1.3.
") }, + END_MARKER }; #endif static const struct cfgelem tp_cfgelems[] = { - { LEAF("Enable"), 1, "false", ABSOFF(tp_enable), 0, uf_boolean, 0, pf_boolean, - "This element enables the optional thread pool.
" }, - { LEAF("Threads"), 1, "4", ABSOFF(tp_threads), 0, uf_natint, 0, pf_int, - "This elements configures the initial number of threads in the thread pool.
" }, - { LEAF("ThreadMax"), 1, "8", ABSOFF(tp_max_threads), 0, uf_natint, 0, pf_int, - "This elements configures the maximum number of threads in the thread pool.
" }, - END_MARKER + { LEAF("Enable"), 1, "false", ABSOFF(tp_enable), 0, uf_boolean, 0, pf_boolean, + BLURB("This element enables the optional thread pool.
") }, + { LEAF("Threads"), 1, "4", ABSOFF(tp_threads), 0, uf_natint, 0, pf_int, + BLURB("This elements configures the initial number of threads in the thread pool.
") }, + { LEAF("ThreadMax"), 1, "8", ABSOFF(tp_max_threads), 0, uf_natint, 0, pf_int, + BLURB("This elements configures the maximum number of threads in the thread pool.
") }, + END_MARKER }; static const struct cfgelem discovery_peer_cfgattrs[] = { - { ATTR("Address"), 1, NULL, RELOFF(config_peer_listelem, peer), 0, uf_ipv4, ff_free, pf_string, - "This element specifies an IP address to which discovery packets must be sent, in addition to the default multicast address (see also General/AllowMulticast). Both a hostnames and a numerical IP address is accepted; the hostname or IP address may be suffixed with :PORT to explicitly set the port to which it must be sent. Multiple Peers may be specified.
" }, - END_MARKER + { ATTR("Address"), 1, NULL, RELOFF(config_peer_listelem, peer), 0, uf_ipv4, ff_free, pf_string, + BLURB("This element specifies an IP address to which discovery packets must be sent, in addition to the default multicast address (see also General/AllowMulticast). Both a hostnames and a numerical IP address is accepted; the hostname or IP address may be suffixed with :PORT to explicitly set the port to which it must be sent. Multiple Peers may be specified.
") }, + END_MARKER }; static const struct cfgelem discovery_peers_group_cfgelems[] = { - { MGROUP("Peer", NULL, discovery_peer_cfgattrs), 0, NULL, ABSOFF(peers_group), if_peer, 0, 0, 0, - "This element statically configures an addresses for discovery.
" }, - END_MARKER + { MGROUP("Peer", NULL, discovery_peer_cfgattrs), 0, NULL, ABSOFF(peers_group), if_peer, 0, 0, 0, + BLURB("This element statically configures an addresses for discovery.
") }, + END_MARKER }; static const struct cfgelem discovery_peers_cfgelems[] = { - { MGROUP("Peer", NULL, discovery_peer_cfgattrs), 0, NULL, ABSOFF(peers), if_peer, 0, 0, 0, - "This element statically configures an addresses for discovery.
" }, - { GROUP("Group", discovery_peers_group_cfgelems), - "This element statically configures a fault tolerant group of addresses for discovery. Each member of the group is tried in sequence until one succeeds.
" }, - END_MARKER + { MGROUP("Peer", NULL, discovery_peer_cfgattrs), 0, NULL, ABSOFF(peers), if_peer, 0, 0, 0, + BLURB("This element statically configures an addresses for discovery.
") }, + { GROUP("Group", discovery_peers_group_cfgelems), + BLURB("This element statically configures a fault tolerant group of addresses for discovery. Each member of the group is tried in sequence until one succeeds.
") }, + END_MARKER }; static const struct cfgelem discovery_cfgelems[] = { - { LEAF("AdvertiseBuiltinTopicWriters"), 1, "true", ABSOFF(advertise_builtin_topic_writers), 0, uf_boolean, 0, pf_boolean, - "This element controls whether or not DDSI2E advertises writers for the built-in topics from its discovery for backwards compatibility with older OpenSplice versions.
" }, - { LEAF("DSGracePeriod"), 1, "30 s", ABSOFF(ds_grace_period), 0, uf_duration_inf, 0, pf_duration, - "This setting controls for how long endpoints discovered via a Cloud discovery service will survive after the discovery service disappeared, allowing reconnect without loss of data when the discovery service restarts (or another instance takes over).
" }, - { GROUP("Peers", discovery_peers_cfgelems), - "This element statically configures addresses for discovery.
" }, - { LEAF("ParticipantIndex"), 1, "none", ABSOFF(participantIndex), 0, uf_participantIndex, 0, pf_participantIndex, - "This element specifies the DDSI participant index used by this instance of the DDSI2E service for discovery purposes. Only one such participant id is used, independent of the number of actual DomainParticipants on the node. It is either:
\n\ + { LEAF("DSGracePeriod"), 1, "30 s", ABSOFF(ds_grace_period), 0, uf_duration_inf, 0, pf_duration, + BLURB("This setting controls for how long endpoints discovered via a Cloud discovery service will survive after the discovery service disappeared, allowing reconnect without loss of data when the discovery service restarts (or another instance takes over).
") }, + { GROUP("Peers", discovery_peers_cfgelems), + BLURB("This element statically configures addresses for discovery.
") }, + { LEAF("ParticipantIndex"), 1, "none", ABSOFF(participantIndex), 0, uf_participantIndex, 0, pf_participantIndex, + BLURB("This element specifies the DDSI participant index used by this instance of the DDSI2E service for discovery purposes. Only one such participant id is used, independent of the number of actual DomainParticipants on the node. It is either:
\n\The default is auto. The participant index is part of the port number calculation and if predictable port numbers are needed and fixing the participant index has no adverse effects, it is recommended that the second be option be used.
" }, -{ LEAF("MaxAutoParticipantIndex"), 1, "9", ABSOFF(maxAutoParticipantIndex), 0, uf_natint, 0, pf_int, -"This element specifies the maximum DDSI participant index selected by this instance of the DDSI2E service if the Discovery/ParticipantIndex is \"auto\".
" }, -{ LEAF("SPDPMulticastAddress"), 1, "239.255.0.1", ABSOFF(spdpMulticastAddressString), 0, uf_ipv4, ff_free, pf_string, -"This element specifies the multicast address that is used as the destination for the participant discovery packets. In IPv4 mode the default is the (standardised) 239.255.0.1, in IPv6 mode it becomes ff02::ffff:239.255.0.1, which is a non-standardised link-local multicast address.
" }, -{ LEAF("SPDPInterval"), 1, "30 s", ABSOFF(spdp_interval), 0, uf_duration_ms_1hr, 0, pf_duration, -"This element specifies the interval between spontaneous transmissions of participant discovery packets.
" }, -{ LEAF("DefaultMulticastAddress"), 1, "auto", ABSOFF(defaultMulticastAddressString), 0, uf_networkAddress, 0, pf_networkAddress, -"This element specifies the default multicast address for all traffic other than participant discovery packets. It defaults to Discovery/SPDPMulticastAddress.
" }, -{ LEAF("EnableTopicDiscovery"), 1, "true", ABSOFF(do_topic_discovery), 0, uf_boolean, 0, pf_boolean, -"Do not use.
" }, -{ GROUP("Ports", discovery_ports_cfgelems), -"The Ports element allows specifying various parameters related to the port numbers used for discovery. These all have default values specified by the DDSI 2.1 specification and rarely need to be changed.
" }, -END_MARKER +The default is auto. The participant index is part of the port number calculation and if predictable port numbers are needed and fixing the participant index has no adverse effects, it is recommended that the second be option be used.
") }, + { LEAF("MaxAutoParticipantIndex"), 1, "9", ABSOFF(maxAutoParticipantIndex), 0, uf_natint, 0, pf_int, + BLURB("This element specifies the maximum DDSI participant index selected by this instance of the DDSI2E service if the Discovery/ParticipantIndex is \"auto\".
") }, + { LEAF("SPDPMulticastAddress"), 1, "239.255.0.1", ABSOFF(spdpMulticastAddressString), 0, uf_ipv4, ff_free, pf_string, + BLURB("This element specifies the multicast address that is used as the destination for the participant discovery packets. In IPv4 mode the default is the (standardised) 239.255.0.1, in IPv6 mode it becomes ff02::ffff:239.255.0.1, which is a non-standardised link-local multicast address.
") }, + { LEAF("SPDPInterval"), 1, "30 s", ABSOFF(spdp_interval), 0, uf_duration_ms_1hr, 0, pf_duration, + BLURB("This element specifies the interval between spontaneous transmissions of participant discovery packets.
") }, + { LEAF("DefaultMulticastAddress"), 1, "auto", ABSOFF(defaultMulticastAddressString), 0, uf_networkAddress, 0, pf_networkAddress, + BLURB("This element specifies the default multicast address for all traffic other than participant discovery packets. It defaults to Discovery/SPDPMulticastAddress.
") }, + { LEAF("EnableTopicDiscovery"), 1, "true", ABSOFF(do_topic_discovery), 0, uf_boolean, 0, pf_boolean, + BLURB("Do not use.
") }, + { GROUP("Ports", discovery_ports_cfgelems), + BLURB("The Ports element allows specifying various parameters related to the port numbers used for discovery. These all have default values specified by the DDSI 2.1 specification and rarely need to be changed.
") }, + END_MARKER }; static const struct cfgelem tracing_cfgelems[] = { - { LEAF("EnableCategory"), 1, "", 0, 0, 0, uf_logcat, 0, pf_logcat, - "This element enables individual logging categories. These are enabled in addition to those enabled by Tracing/Verbosity. Recognised categories are:
\n\ + { LEAF("EnableCategory"), 1, "", 0, 0, 0, uf_logcat, 0, pf_logcat, + BLURB("This element enables individual logging categories. These are enabled in addition to those enabled by Tracing/Verbosity. Recognised categories are:
\n\In addition, there is the keyword trace that enables all but radmin, topic, plist and whc
.\n\ -The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful is trace.
" }, -{ LEAF("Verbosity"), 1, "none", 0, 0, 0, uf_verbosity, 0, pf_nop, -"This element enables standard groups of categories, based on a desired verbosity level. This is in addition to the categories enabled by the Tracing/EnableCategory setting. Recognised verbosity levels and the categories they map to are:
\n\ +The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful is trace.
") }, + { LEAF("Verbosity"), 1, "none", 0, 0, 0, uf_verbosity, 0, pf_nop, + BLURB("This element enables standard groups of categories, based on a desired verbosity level. This is in addition to the categories enabled by the Tracing/EnableCategory setting. Recognised verbosity levels and the categories they map to are:
\n\While none prevents any message from being written to a DDSI2 log file.
\n\ -The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful verbosity levels are config, fine and finest.
" }, -{ LEAF("OutputFile"), 1, DDS_PROJECT_NAME_NOSPACE_SMALL".log", ABSOFF(tracingOutputFileName), 0, uf_tracingOutputFileName, ff_free, pf_string, -"This option specifies where the logging is printed to. Note that stdout and stderr are treated as special values, representing \"standard out\" and \"standard error\" respectively. No file is created unless logging categories are enabled using the Tracing/Verbosity or Tracing/EnabledCategory settings.
" }, -{ LEAF_W_ATTRS("Timestamps", timestamp_cfgattrs), 1, "true", ABSOFF(tracingTimestamps), 0, uf_boolean, 0, pf_boolean, -"This option has no effect.
" }, -{ LEAF("AppendToFile"), 1, "false", ABSOFF(tracingAppendToFile), 0, uf_boolean, 0, pf_boolean, -"This option specifies whether the output is to be appended to an existing log file. The default is to create a new log file each time, which is generally the best option if a detailed log is generated.
" }, -{ LEAF("PacketCaptureFile"), 1, "", ABSOFF(pcap_file), 0, uf_string, ff_free, pf_string, -"This option specifies the file to which received and sent packets will be logged in the \"pcap\" format suitable for analysis using common networking tools, such as WireShark. IP and UDP headers are ficitious, in particular the destination address of received packets. The TTL may be used to distinguish between sent and received packets: it is 255 for sent packets and 128 for received ones. Currently IPv4 only.
" }, -END_MARKER -}; - -static const struct cfgelem sched_prio_cfgattrs[] = { - { ATTR("priority_kind"), 1, "relative", ABSOFF(watchdog_sched_priority_class), 0, uf_sched_prio_class, 0, pf_sched_prio_class, - "This attribute specifies whether the specified Priority is a relative or absolute priority.
" }, - END_MARKER -}; - -static const struct cfgelem sched_cfgelems[] = { - { LEAF("Class"), 1, "default", ABSOFF(watchdog_sched_class), 0, uf_sched_class, 0, pf_sched_class, - "This element specifies the thread scheduling class that will be used by the watchdog thread. The user may need the appropriate privileges from the underlying operating system to be able to assign some of the privileged scheduling classes.
" }, - { LEAF_W_ATTRS("Priority", sched_prio_cfgattrs), 1, "0", ABSOFF(watchdog_sched_priority), 0, uf_int32, 0, pf_int32, - "This element specifies the thread priority. Only priorities that are supported by the underlying operating system can be assigned to this element. The user may need special privileges from the underlying operating system to be able to assign some of the privileged priorities.
" }, - END_MARKER -}; - -static const struct cfgelem watchdog_cfgelems[] = { - { GROUP("Scheduling", sched_cfgelems), - "This element specifies the type of OS scheduling class will be used by the thread that announces its liveliness periodically.
" }, - END_MARKER +The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful verbosity levels are config, fine and finest.
") }, + { LEAF("OutputFile"), 1, DDS_PROJECT_NAME_NOSPACE_SMALL".log", ABSOFF(tracingOutputFileName), 0, uf_tracingOutputFileName, ff_free, pf_string, + BLURB("This option specifies where the logging is printed to. Note that stdout and stderr are treated as special values, representing \"standard out\" and \"standard error\" respectively. No file is created unless logging categories are enabled using the Tracing/Verbosity or Tracing/EnabledCategory settings.
") }, + { LEAF("AppendToFile"), 1, "false", ABSOFF(tracingAppendToFile), 0, uf_boolean, 0, pf_boolean, + BLURB("This option specifies whether the output is to be appended to an existing log file. The default is to create a new log file each time, which is generally the best option if a detailed log is generated.
") }, + { LEAF("PacketCaptureFile"), 1, "", ABSOFF(pcap_file), 0, uf_string, ff_free, pf_string, + BLURB("This option specifies the file to which received and sent packets will be logged in the \"pcap\" format suitable for analysis using common networking tools, such as WireShark. IP and UDP headers are ficitious, in particular the destination address of received packets. The TTL may be used to distinguish between sent and received packets: it is 255 for sent packets and 128 for received ones. Currently IPv4 only.
") }, + END_MARKER }; static const struct cfgelem ddsi2_cfgelems[] = { - { GROUP("General", general_cfgelems), - "The General element specifies overall DDSI2E service settings.
" }, + { GROUP("General", general_cfgelems), + BLURB("The General element specifies overall DDSI2E service settings.
") }, #ifdef DDSI_INCLUDE_ENCRYPTION - { GROUP("Security", security_cfgelems), - "The Security element specifies DDSI2E security profiles that can be used to encrypt traffic mapped to DDSI2E network partitions.
" }, + { GROUP("Security", security_cfgelems), + BLURB("The Security element specifies DDSI2E security profiles that can be used to encrypt traffic mapped to DDSI2E network partitions.
") }, #endif #ifdef DDSI_INCLUDE_NETWORK_PARTITIONS - { GROUP("Partitioning", partitioning_cfgelems), - "The Partitioning element specifies DDSI2E network partitions and how DCPS partition/topic combinations are mapped onto the network partitions.
" }, + { GROUP("Partitioning", partitioning_cfgelems), + BLURB("The Partitioning element specifies DDSI2E network partitions and how DCPS partition/topic combinations are mapped onto the network partitions.
") }, #endif #ifdef DDSI_INCLUDE_NETWORK_CHANNELS - { GROUP("Channels", channels_cfgelems), - "This element is used to group a set of channels. The channels are independent data paths through DDSI2E and by using separate threads and setting their priorities appropriately, chanenls can be used to map transport priorities to operating system scheduler priorities, ensuring system-wide end-to-end priority preservation.
" }, + { GROUP("Channels", channels_cfgelems), + BLURB("This element is used to group a set of channels. The channels are independent data paths through DDSI2E and by using separate threads and setting their priorities appropriately, chanenls can be used to map transport priorities to operating system scheduler priorities, ensuring system-wide end-to-end priority preservation.
") }, #endif - { GROUP("Threads", threads_cfgelems), - "This element is used to set thread properties.
" }, - { GROUP("Sizing", sizing_cfgelems), - "The Sizing element specifies a variety of configuration settings dealing with expected system sizes, buffer sizes, &c.
" }, - { GROUP("Compatibility", compatibility_cfgelems), - "The Compatibility elements allows specifying various settings related to compatability with standards and with other DDSI implementations.
" }, - { GROUP("Discovery", discovery_cfgelems), - "The Discovery element allows specifying various parameters related to the discovery of peers.
" }, - { GROUP("Tracing", tracing_cfgelems), - "The Tracing element controls the amount and type of information that is written into the tracing log by the DDSI service. This is useful to track the DDSI service during application development.
" }, - { GROUP("Internal|Unsupported", unsupp_cfgelems), - "The Internal elements deal with a variety of settings that evolving and that are not necessarily fully supported. For the vast majority of the Internal settings, the functionality per-se is supported, but the right to change the way the options control the functionality is reserved. This includes renaming or moving options.
" }, - { GROUP("Watchdog", watchdog_cfgelems), - "This element specifies the type of OS scheduling class will be used by the thread that announces its liveliness periodically.
" }, - { GROUP("TCP", tcp_cfgelems), - "The TCP element allows specifying various parameters related to running DDSI over TCP.
" }, - { GROUP("ThreadPool", tp_cfgelems), - "The ThreadPool element allows specifying various parameters related to using a thread pool to send DDSI messages to multiple unicast addresses (TCP or UDP).
" }, + { GROUP("Threads", threads_cfgelems), + BLURB("This element is used to set thread properties.
") }, + { GROUP("Sizing", sizing_cfgelems), + BLURB("The Sizing element specifies a variety of configuration settings dealing with expected system sizes, buffer sizes, &c.
") }, + { GROUP("Compatibility", compatibility_cfgelems), + BLURB("The Compatibility elements allows specifying various settings related to compatability with standards and with other DDSI implementations.
") }, + { GROUP("Discovery", discovery_cfgelems), + BLURB("The Discovery element allows specifying various parameters related to the discovery of peers.
") }, + { GROUP("Tracing", tracing_cfgelems), + BLURB("The Tracing element controls the amount and type of information that is written into the tracing log by the DDSI service. This is useful to track the DDSI service during application development.
") }, + { GROUP("Internal|Unsupported", unsupp_cfgelems), + BLURB("The Internal elements deal with a variety of settings that evolving and that are not necessarily fully supported. For the vast majority of the Internal settings, the functionality per-se is supported, but the right to change the way the options control the functionality is reserved. This includes renaming or moving options.
") }, + { GROUP("TCP", tcp_cfgelems), + BLURB("The TCP element allows specifying various parameters related to running DDSI over TCP.
") }, + { GROUP("ThreadPool", tp_cfgelems), + BLURB("The ThreadPool element allows specifying various parameters related to using a thread pool to send DDSI messages to multiple unicast addresses (TCP or UDP).
") }, #ifdef DDSI_INCLUDE_SSL - { GROUP("SSL", ssl_cfgelems), - "The SSL element allows specifying various parameters related to using SSL/TLS for DDSI over TCP.
" }, + { GROUP("SSL", ssl_cfgelems), + BLURB("The SSL element allows specifying various parameters related to using SSL/TLS for DDSI over TCP.
") }, #endif - END_MARKER -}; - -static const struct cfgelem deprecated_lease_cfgelems[] = { - WILDCARD, END_MARKER }; static const struct cfgelem domain_cfgelems[] = { - { LEAF("Id"), 1, "any", ABSOFF(domainId), 0, uf_domainId, 0, pf_domainId, NULL }, - { GROUP("|Lease", deprecated_lease_cfgelems), NULL }, - END_MARKER -}; - -static const struct cfgelem durability_cfgelems[] = { - { LEAF("Encoding"), 1, "CDR_CLIENT", ABSOFF(durability_cdr), 0, uf_durability_cdr, 0, pf_durability_cdr, NULL }, - END_MARKER + { LEAF("Id"), 1, "any", ABSOFF(domainId), 0, uf_domainId, 0, pf_domainId, NULL }, + END_MARKER }; static const struct cfgelem root_cfgelems[] = { - { "Domain", domain_cfgelems, NULL, NODATA, NULL }, - { "DDSI2E|DDSI2", ddsi2_cfgelems, NULL, NODATA, - "DDSI2 settings ...
" }, - { "Durability", durability_cfgelems, NULL, NODATA, NULL }, - { GROUP("|Lease", deprecated_lease_cfgelems), NULL }, - END_MARKER + { "Domain", domain_cfgelems, NULL, NODATA, NULL }, + { "DDSI2E|DDSI2", ddsi2_cfgelems, NULL, NODATA, + BLURB("DDSI2 settings ...
") }, + END_MARKER }; -static const struct cfgelem cyclonedds_root_cfgelems[] = -{ - { DDS_PROJECT_NAME_NOSPACE, root_cfgelems, NULL, NODATA, NULL }, - END_MARKER +static const struct cfgelem cyclonedds_root_cfgelems[] = { + { DDS_PROJECT_NAME_NOSPACE, root_cfgelems, NULL, NODATA, NULL }, + END_MARKER }; -static const struct cfgelem root_cfgelem = -{ "root", cyclonedds_root_cfgelems, NULL, NODATA, NULL }; - +static const struct cfgelem root_cfgelem = { + "root", cyclonedds_root_cfgelems, NULL, NODATA, NULL +}; #undef ATTR #undef GROUP @@ -930,401 +862,390 @@ struct config config; struct ddsi_plugin ddsi_plugin; static const struct unit unittab_duration[] = { - { "ns", 1 }, - { "us", 1000 }, - { "ms", T_MILLISECOND }, - { "s", T_SECOND }, - { "min", 60 * T_SECOND }, - { "hr", 3600 * T_SECOND }, - { "day", 24 * 3600 * T_SECOND }, - { NULL, 0 } + { "ns", 1 }, + { "us", 1000 }, + { "ms", T_MILLISECOND }, + { "s", T_SECOND }, + { "min", 60 * T_SECOND }, + { "hr", 3600 * T_SECOND }, + { "day", 24 * 3600 * T_SECOND }, + { NULL, 0 } }; /* note: order affects whether printed as KiB or kB, for consistency -with bandwidths and pedanticness, favour KiB. */ + with bandwidths and pedanticness, favour KiB. */ static const struct unit unittab_memsize[] = { - { "B", 1 }, - { "KiB", 1024 }, - { "kB", 1024 }, - { "MiB", 1048576 }, - { "MB", 1048576 }, - { "GiB", 1073741824 }, - { "GB", 1073741824 }, - { NULL, 0 } + { "B", 1 }, + { "KiB", 1024 }, + { "kB", 1024 }, + { "MiB", 1048576 }, + { "MB", 1048576 }, + { "GiB", 1073741824 }, + { "GB", 1073741824 }, + { NULL, 0 } }; #ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING static const struct unit unittab_bandwidth_bps[] = { - { "b/s", 1 },{ "bps", 1 }, - { "Kib/s", 1024 },{ "Kibps", 1024 }, - { "kb/s", 1000 },{ "kbps", 1000 }, - { "Mib/s", 1048576 },{ "Mibps", 1000 }, - { "Mb/s", 1000000 },{ "Mbps", 1000000 }, - { "Gib/s", 1073741824 },{ "Gibps", 1073741824 }, - { "Gb/s", 1000000000 },{ "Gbps", 1000000000 }, - { "B/s", 8 },{ "Bps", 8 }, - { "KiB/s", 8 * 1024 },{ "KiBps", 8 * 1024 }, - { "kB/s", 8 * 1000 },{ "kBps", 8 * 1000 }, - { "MiB/s", 8 * 1048576 },{ "MiBps", 8 * 1048576 }, - { "MB/s", 8 * 1000000 },{ "MBps", 8 * 1000000 }, - { "GiB/s", 8 * (int64_t) 1073741824 },{ "GiBps", 8 * (int64_t) 1073741824 }, - { "GB/s", 8 * (int64_t) 1000000000 },{ "GBps", 8 * (int64_t) 1000000000 }, - { NULL, 0 } + { "b/s", 1 },{ "bps", 1 }, + { "Kib/s", 1024 },{ "Kibps", 1024 }, + { "kb/s", 1000 },{ "kbps", 1000 }, + { "Mib/s", 1048576 },{ "Mibps", 1000 }, + { "Mb/s", 1000000 },{ "Mbps", 1000000 }, + { "Gib/s", 1073741824 },{ "Gibps", 1073741824 }, + { "Gb/s", 1000000000 },{ "Gbps", 1000000000 }, + { "B/s", 8 },{ "Bps", 8 }, + { "KiB/s", 8 * 1024 },{ "KiBps", 8 * 1024 }, + { "kB/s", 8 * 1000 },{ "kBps", 8 * 1000 }, + { "MiB/s", 8 * 1048576 },{ "MiBps", 8 * 1048576 }, + { "MB/s", 8 * 1000000 },{ "MBps", 8 * 1000000 }, + { "GiB/s", 8 * (int64_t) 1073741824 },{ "GiBps", 8 * (int64_t) 1073741824 }, + { "GB/s", 8 * (int64_t) 1000000000 },{ "GBps", 8 * (int64_t) 1000000000 }, + { NULL, 0 } }; static const struct unit unittab_bandwidth_Bps[] = { - { "B/s", 1 },{ "Bps", 1 }, - { "KiB/s", 1024 },{ "KiBps", 1024 }, - { "kB/s", 1000 },{ "kBps", 1000 }, - { "MiB/s", 1048576 },{ "MiBps", 1048576 }, - { "MB/s", 1000000 },{ "MBps", 1000000 }, - { "GiB/s", 1073741824 },{ "GiBps", 1073741824 }, - { "GB/s", 1000000000 },{ "GBps", 1000000000 }, - { NULL, 0 } + { "B/s", 1 },{ "Bps", 1 }, + { "KiB/s", 1024 },{ "KiBps", 1024 }, + { "kB/s", 1000 },{ "kBps", 1000 }, + { "MiB/s", 1048576 },{ "MiBps", 1048576 }, + { "MB/s", 1000000 },{ "MBps", 1000000 }, + { "GiB/s", 1073741824 },{ "GiBps", 1073741824 }, + { "GB/s", 1000000000 },{ "GBps", 1000000000 }, + { NULL, 0 } }; #endif static void cfgst_push(struct cfgst *cfgst, int isattr, const struct cfgelem *elem, void *parent) { - assert(cfgst->path_depth < MAX_PATH_DEPTH); - assert(isattr == 0 || isattr == 1); - cfgst->isattr[cfgst->path_depth] = isattr; - cfgst->path[cfgst->path_depth] = elem; - cfgst->parent[cfgst->path_depth] = parent; - cfgst->path_depth++; + assert(cfgst->path_depth < MAX_PATH_DEPTH); + assert(isattr == 0 || isattr == 1); + cfgst->isattr[cfgst->path_depth] = isattr; + cfgst->path[cfgst->path_depth] = elem; + cfgst->parent[cfgst->path_depth] = parent; + cfgst->path_depth++; } static void cfgst_pop(struct cfgst *cfgst) { - assert(cfgst->path_depth > 0); - cfgst->path_depth--; + assert(cfgst->path_depth > 0); + cfgst->path_depth--; } static const struct cfgelem *cfgst_tos(const struct cfgst *cfgst) { - assert(cfgst->path_depth > 0); - return cfgst->path[cfgst->path_depth - 1]; + assert(cfgst->path_depth > 0); + return cfgst->path[cfgst->path_depth - 1]; } static void *cfgst_parent(const struct cfgst *cfgst) { - assert(cfgst->path_depth > 0); - return cfgst->parent[cfgst->path_depth - 1]; + assert(cfgst->path_depth > 0); + return cfgst->parent[cfgst->path_depth - 1]; } struct cfg_note_buf { - size_t bufpos; - size_t bufsize; - char *buf; + size_t bufpos; + size_t bufsize; + char *buf; }; static size_t cfg_note_vsnprintf(struct cfg_note_buf *bb, const char *fmt, va_list ap) { - int x; - x = vsnprintf(bb->buf + bb->bufpos, bb->bufsize - bb->bufpos, fmt, ap); - if ( x >= 0 && (size_t) x >= bb->bufsize - bb->bufpos ) { - size_t nbufsize = ((bb->bufsize + (size_t) x + 1) + 1023) & (size_t) (-1024); - char *nbuf = ddsrt_realloc(bb->buf, nbufsize); - bb->buf = nbuf; - bb->bufsize = nbufsize; - return nbufsize; - } - if ( x < 0 ) - DDS_FATAL("cfg_note_vsnprintf: vsnprintf failed\n"); - else - bb->bufpos += (size_t) x; - return 0; + int x; + x = vsnprintf(bb->buf + bb->bufpos, bb->bufsize - bb->bufpos, fmt, ap); + if ( x >= 0 && (size_t) x >= bb->bufsize - bb->bufpos ) { + size_t nbufsize = ((bb->bufsize + (size_t) x + 1) + 1023) & (size_t) (-1024); + char *nbuf = ddsrt_realloc(bb->buf, nbufsize); + bb->buf = nbuf; + bb->bufsize = nbufsize; + return nbufsize; + } + if ( x < 0 ) + DDS_FATAL("cfg_note_vsnprintf: vsnprintf failed\n"); + else + bb->bufpos += (size_t) x; + return 0; } static void cfg_note_snprintf(struct cfg_note_buf *bb, const char *fmt, ...) { - /* The reason the 2nd call to os_vsnprintf is here and not inside - cfg_note_vsnprintf is because I somehow doubt that all platforms - implement va_copy() */ - va_list ap; - size_t r; + /* The reason the 2nd call to os_vsnprintf is here and not inside + cfg_note_vsnprintf is because I somehow doubt that all platforms + implement va_copy() */ + va_list ap; + size_t r; + va_start(ap, fmt); + r = cfg_note_vsnprintf(bb, fmt, ap); + va_end(ap); + if ( r > 0 ) { + int s; va_start(ap, fmt); - r = cfg_note_vsnprintf(bb, fmt, ap); + s = vsnprintf(bb->buf + bb->bufpos, bb->bufsize - bb->bufpos, fmt, ap); + if ( s < 0 || (size_t) s >= bb->bufsize - bb->bufpos ) + DDS_FATAL("cfg_note_snprintf: vsnprintf failed\n"); va_end(ap); - if ( r > 0 ) { - int s; - va_start(ap, fmt); - s = vsnprintf(bb->buf + bb->bufpos, bb->bufsize - bb->bufpos, fmt, ap); - if ( s < 0 || (size_t) s >= bb->bufsize - bb->bufpos ) - DDS_FATAL("cfg_note_snprintf: vsnprintf failed\n"); - va_end(ap); - bb->bufpos += (size_t) s; - } + bb->bufpos += (size_t) s; + } } static size_t cfg_note(struct cfgst *cfgst, uint32_t cat, size_t bsz, const char *fmt, va_list ap) { - /* Have to snprintf our way to a single string so we can OS_REPORT - as well as nn_log. Otherwise configuration errors will be lost - completely on platforms where stderr doesn't actually work for - outputting error messages (this includes Windows because of the - way "ospl start" does its thing). */ - struct cfg_note_buf bb; - int i, sidx; - size_t r; + /* Have to snprintf our way to a single string so we can OS_REPORT + as well as nn_log. Otherwise configuration errors will be lost + completely on platforms where stderr doesn't actually work for + outputting error messages (this includes Windows because of the + way "ospl start" does its thing). */ + struct cfg_note_buf bb; + int i, sidx; + size_t r; - if (cat & DDS_LC_ERROR) { - cfgst->error = 1; - } - - bb.bufpos = 0; - bb.bufsize = (bsz == 0) ? 1024 : bsz; - if ( (bb.buf = ddsrt_malloc(bb.bufsize)) == NULL ) - DDS_FATAL("cfg_note: out of memory\n"); - - cfg_note_snprintf(&bb, "config: "); - - /* Path to element/attribute causing the error. Have to stop once an - attribute is reached: a NULL marker may have been pushed onto the - stack afterward in the default handling. */ - sidx = 0; - while ( sidx < cfgst->path_depth && cfgst->path[sidx]->name == NULL ) - sidx++; - for ( i = sidx; i < cfgst->path_depth && (i == sidx || !cfgst->isattr[i - 1]); i++ ) { - if ( cfgst->path[i] == NULL ) { - assert(i > sidx); - cfg_note_snprintf(&bb, "/#text"); - } else if ( cfgst->isattr[i] ) { - cfg_note_snprintf(&bb, "[@%s]", cfgst->path[i]->name); - } else { - const char *p = strchr(cfgst->path[i]->name, '|'); - int n = p ? (int) (p - cfgst->path[i]->name) : (int) strlen(cfgst->path[i]->name); - cfg_note_snprintf(&bb, "%s%*.*s", (i == sidx) ? "" : "/", n, n, cfgst->path[i]->name); - } - } - - cfg_note_snprintf(&bb, ": "); - if ( (r = cfg_note_vsnprintf(&bb, fmt, ap)) > 0 ) { - /* Can't reset ap ... and va_copy isn't widely available - so - instead abort and hope the caller tries again with a larger - initial buffer */ - ddsrt_free(bb.buf); - return r; - } - - switch ( cat ) { - case DDS_LC_CONFIG: - DDS_LOG(cat, "%s\n", bb.buf); - break; - case DDS_LC_WARNING: - DDS_WARNING("%s\n", bb.buf); - break; - case DDS_LC_ERROR: - DDS_ERROR("%s\n", bb.buf); - break; - default: - DDS_FATAL("cfg_note unhandled category %u for message %s\n", (unsigned) cat, bb.buf); - break; + if (cat & DDS_LC_ERROR) { + cfgst->error = 1; + } + + bb.bufpos = 0; + bb.bufsize = (bsz == 0) ? 1024 : bsz; + if ( (bb.buf = ddsrt_malloc(bb.bufsize)) == NULL ) + DDS_FATAL("cfg_note: out of memory\n"); + + cfg_note_snprintf(&bb, "config: "); + + /* Path to element/attribute causing the error. Have to stop once an + attribute is reached: a NULL marker may have been pushed onto the + stack afterward in the default handling. */ + sidx = 0; + while ( sidx < cfgst->path_depth && cfgst->path[sidx]->name == NULL ) + sidx++; + for ( i = sidx; i < cfgst->path_depth && (i == sidx || !cfgst->isattr[i - 1]); i++ ) { + if ( cfgst->path[i] == NULL ) { + assert(i > sidx); + cfg_note_snprintf(&bb, "/#text"); + } else if ( cfgst->isattr[i] ) { + cfg_note_snprintf(&bb, "[@%s]", cfgst->path[i]->name); + } else { + const char *p = strchr(cfgst->path[i]->name, '|'); + int n = p ? (int) (p - cfgst->path[i]->name) : (int) strlen(cfgst->path[i]->name); + cfg_note_snprintf(&bb, "%s%*.*s", (i == sidx) ? "" : "/", n, n, cfgst->path[i]->name); } + } + cfg_note_snprintf(&bb, ": "); + if ( (r = cfg_note_vsnprintf(&bb, fmt, ap)) > 0 ) { + /* Can't reset ap ... and va_copy isn't widely available - so + instead abort and hope the caller tries again with a larger + initial buffer */ ddsrt_free(bb.buf); - return 0; + return r; + } + + switch ( cat ) { + case DDS_LC_CONFIG: + DDS_LOG(cat, "%s\n", bb.buf); + break; + case DDS_LC_WARNING: + DDS_WARNING("%s\n", bb.buf); + break; + case DDS_LC_ERROR: + DDS_ERROR("%s\n", bb.buf); + break; + default: + DDS_FATAL("cfg_note unhandled category %u for message %s\n", (unsigned) cat, bb.buf); + break; + } + + ddsrt_free(bb.buf); + return 0; } #if WARN_DEPRECATED_ALIAS || WARN_DEPRECATED_UNIT static void cfg_warning(struct cfgst *cfgst, const char *fmt, ...) { - va_list ap; - size_t bsz = 0; - do { - va_start(ap, fmt); - bsz = cfg_note(cfgst, DDS_LC_WARNING, bsz, fmt, ap); - va_end(ap); - } while ( bsz > 0 ); + va_list ap; + size_t bsz = 0; + do { + va_start(ap, fmt); + bsz = cfg_note(cfgst, DDS_LC_WARNING, bsz, fmt, ap); + va_end(ap); + } while ( bsz > 0 ); } #endif static int cfg_error(struct cfgst *cfgst, const char *fmt, ...) { - va_list ap; - size_t bsz = 0; - do { - va_start(ap, fmt); - bsz = cfg_note(cfgst, DDS_LC_ERROR, bsz, fmt, ap); - va_end(ap); - } while ( bsz > 0 ); - return 0; + va_list ap; + size_t bsz = 0; + do { + va_start(ap, fmt); + bsz = cfg_note(cfgst, DDS_LC_ERROR, bsz, fmt, ap); + va_end(ap); + } while ( bsz > 0 ); + return 0; } static int cfg_log(struct cfgst *cfgst, const char *fmt, ...) { - va_list ap; - size_t bsz = 0; - do { - va_start(ap, fmt); - bsz = cfg_note(cfgst, DDS_LC_CONFIG, bsz, fmt, ap); - va_end(ap); - } while ( bsz > 0 ); - return 0; + va_list ap; + size_t bsz = 0; + do { + va_start(ap, fmt); + bsz = cfg_note(cfgst, DDS_LC_CONFIG, bsz, fmt, ap); + va_end(ap); + } while ( bsz > 0 ); + return 0; } static int list_index(const char *list[], const char *elem) { - int i; - for ( i = 0; list[i] != NULL; i++ ) { - if ( ddsrt_strcasecmp(list[i], elem) == 0 ) - return i; - } - return -1; + int i; + for ( i = 0; list[i] != NULL; i++ ) { + if ( ddsrt_strcasecmp(list[i], elem) == 0 ) + return i; + } + return -1; } static int64_t lookup_multiplier(struct cfgst *cfgst, const struct unit *unittab, const char *value, int unit_pos, int value_is_zero, int64_t def_mult, int err_on_unrecognised) { - assert(0 <= unit_pos && (size_t) unit_pos <= strlen(value)); - while ( value[unit_pos] == ' ' ) - unit_pos++; - if ( value[unit_pos] == 0 ) { - if ( value_is_zero ) { - /* No matter what unit, 0 remains just that. For convenience, - always allow 0 to be specified without a unit */ - return 1; - } else if ( def_mult == 0 && err_on_unrecognised ) { - cfg_error(cfgst, "%s: unit is required", value); - return 0; - } else { -#if WARN_DEPRECATED_UNIT - cfg_warning(cfgst, "%s: use of default unit is deprecated", value); -#endif - return def_mult; - } + assert(0 <= unit_pos && (size_t) unit_pos <= strlen(value)); + while ( value[unit_pos] == ' ' ) + unit_pos++; + if ( value[unit_pos] == 0 ) { + if ( value_is_zero ) { + /* No matter what unit, 0 remains just that. For convenience, + always allow 0 to be specified without a unit */ + return 1; + } else if ( def_mult == 0 && err_on_unrecognised ) { + cfg_error(cfgst, "%s: unit is required", value); + return 0; } else { - int i; - for ( i = 0; unittab[i].name != NULL; i++ ) { - if ( strcmp(unittab[i].name, value + unit_pos) == 0 ) - return unittab[i].multiplier; - } - if ( err_on_unrecognised ) - cfg_error(cfgst, "%s: unrecognised unit", value + unit_pos); - return 0; +#if WARN_DEPRECATED_UNIT + cfg_warning(cfgst, "%s: use of default unit is deprecated", value); +#endif + return def_mult; } + } else { + int i; + for ( i = 0; unittab[i].name != NULL; i++ ) { + if ( strcmp(unittab[i].name, value + unit_pos) == 0 ) + return unittab[i].multiplier; + } + if ( err_on_unrecognised ) + cfg_error(cfgst, "%s: unrecognised unit", value + unit_pos); + return 0; + } } static void *cfg_address(UNUSED_ARG(struct cfgst *cfgst), void *parent, struct cfgelem const * const cfgelem) { - assert(cfgelem->multiplicity == 1); - return (char *) parent + cfgelem->elem_offset; + assert(cfgelem->multiplicity == 1); + return (char *) parent + cfgelem->elem_offset; } static void *cfg_deref_address(UNUSED_ARG(struct cfgst *cfgst), void *parent, struct cfgelem const * const cfgelem) { - assert(cfgelem->multiplicity != 1); - return *((void **) ((char *) parent + cfgelem->elem_offset)); + assert(cfgelem->multiplicity != 1); + return *((void **) ((char *) parent + cfgelem->elem_offset)); } static void *if_common(UNUSED_ARG(struct cfgst *cfgst), void *parent, struct cfgelem const * const cfgelem, unsigned size) { - struct config_listelem **current = (struct config_listelem **) ((char *) parent + cfgelem->elem_offset); - struct config_listelem *new = ddsrt_malloc(size); - new->next = *current; - *current = new; - return new; + struct config_listelem **current = (struct config_listelem **) ((char *) parent + cfgelem->elem_offset); + struct config_listelem *new = ddsrt_malloc(size); + new->next = *current; + *current = new; + return new; } static int if_thread_properties(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - struct config_thread_properties_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); - if ( new == NULL ) - return -1; - new->name = NULL; - return 0; + struct config_thread_properties_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); + if ( new == NULL ) + return -1; + new->name = NULL; + return 0; } #ifdef DDSI_INCLUDE_NETWORK_CHANNELS static int if_channel(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - struct config_channel_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); - if ( new == NULL ) - return -1; - new->name = NULL; - new->channel_reader_ts = NULL; - new->dqueue = NULL; - new->queueId = 0; - new->evq = NULL; - new->transmit_conn = NULL; - return 0; + struct config_channel_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); + if ( new == NULL ) + return -1; + new->name = NULL; + new->channel_reader_ts = NULL; + new->dqueue = NULL; + new->queueId = 0; + new->evq = NULL; + new->transmit_conn = NULL; + return 0; } #endif /* DDSI_INCLUDE_NETWORK_CHANNELS */ #ifdef DDSI_INCLUDE_ENCRYPTION static int if_security_profile(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_securityprofile_listelem)) == NULL ) - return -1; - return 0; + if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_securityprofile_listelem)) == NULL ) + return -1; + return 0; } #endif /* DDSI_INCLUDE_ENCRYPTION */ #ifdef DDSI_INCLUDE_NETWORK_PARTITIONS static int if_network_partition(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - struct config_networkpartition_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); - if ( new == NULL ) - return -1; - new->address_string = NULL; + struct config_networkpartition_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(*new)); + if ( new == NULL ) + return -1; + new->address_string = NULL; #ifdef DDSI_INCLUDE_ENCRYPTION - new->profileName = NULL; - new->securityProfile = NULL; + new->profileName = NULL; + new->securityProfile = NULL; #endif /* DDSI_INCLUDE_ENCRYPTION */ - return 0; + return 0; } static int if_ignored_partition(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_ignoredpartition_listelem)) == NULL ) - return -1; - return 0; + if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_ignoredpartition_listelem)) == NULL ) + return -1; + return 0; } static int if_partition_mapping(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_partitionmapping_listelem)) == NULL ) - return -1; - return 0; + if ( if_common(cfgst, parent, cfgelem, sizeof(struct config_partitionmapping_listelem)) == NULL ) + return -1; + return 0; } #endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */ static int if_peer(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - struct config_peer_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(struct config_peer_listelem)); - if ( new == NULL ) - return -1; - new->peer = NULL; - return 0; + struct config_peer_listelem *new = if_common(cfgst, parent, cfgelem, sizeof(struct config_peer_listelem)); + if ( new == NULL ) + return -1; + new->peer = NULL; + return 0; } static void ff_free(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - void **elem = cfg_address(cfgst, parent, cfgelem); - ddsrt_free(*elem); + void **elem = cfg_address(cfgst, parent, cfgelem); + ddsrt_free(*elem); } static int uf_boolean(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - static const char *vs[] = { "false", "true", NULL }; - int *elem = cfg_address(cfgst, parent, cfgelem); - int idx = list_index(vs, value); - if ( idx < 0 ) - return cfg_error(cfgst, "'%s': undefined value", value); - else { - *elem = idx; - return 1; - } -} - -static int uf_negated_boolean(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) -{ - if ( !uf_boolean(cfgst, parent, cfgelem, first, value) ) - return 0; - else { - int *elem = cfg_address(cfgst, parent, cfgelem); - *elem = !*elem; - return 1; - } + static const char *vs[] = { "false", "true", NULL }; + int *elem = cfg_address(cfgst, parent, cfgelem); + int idx = list_index(vs, value); + if ( idx < 0 ) + return cfg_error(cfgst, "'%s': undefined value", value); + else { + *elem = idx; + return 1; + } } static int uf_boolean_default (struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG (int first), const char *value) @@ -1359,78 +1280,78 @@ static void pf_boolean_default (struct cfgst *cfgst, void *parent, struct cfgele static int do_uint32_bitset(struct cfgst *cfgst, uint32_t *cats, const char **names, const uint32_t *codes, const char *value) { - char *copy = ddsrt_strdup(value), *cursor = copy, *tok; - while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { - int idx = list_index(names, tok); - if ( idx < 0 ) { - int ret = cfg_error(cfgst, "'%s' in '%s' undefined", tok, value); - ddsrt_free(copy); - return ret; - } - *cats |= codes[idx]; + char *copy = ddsrt_strdup(value), *cursor = copy, *tok; + while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { + int idx = list_index(names, tok); + if ( idx < 0 ) { + int ret = cfg_error(cfgst, "'%s' in '%s' undefined", tok, value); + ddsrt_free(copy); + return ret; } - ddsrt_free(copy); - return 1; + *cats |= codes[idx]; + } + ddsrt_free(copy); + return 1; } static int uf_logcat(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) { - return do_uint32_bitset (cfgst, &enabled_logcats, logcat_names, logcat_codes, value); + return do_uint32_bitset (cfgst, &enabled_logcats, logcat_names, logcat_codes, value); } static int uf_xcheck(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - uint32_t *elem = cfg_address(cfgst, parent, cfgelem); - return do_uint32_bitset (cfgst, elem, xcheck_names, xcheck_codes, value); + uint32_t *elem = cfg_address(cfgst, parent, cfgelem); + return do_uint32_bitset (cfgst, elem, xcheck_names, xcheck_codes, value); } static int uf_verbosity(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) { - static const char *vs[] = { - "finest", "finer", "fine", "config", "info", "warning", "severe", "none", NULL - }; - static const uint32_t lc[] = { - DDS_LC_ALL, DDS_LC_TRAFFIC | DDS_LC_TIMING, DDS_LC_DISCOVERY | DDS_LC_THROTTLE, DDS_LC_CONFIG, DDS_LC_INFO, DDS_LC_WARNING, DDS_LC_ERROR | DDS_LC_FATAL, 0, 0 - }; - int idx = list_index(vs, value); - assert(sizeof(vs) / sizeof(*vs) == sizeof(lc) / sizeof(*lc)); - if ( idx < 0 ) - return cfg_error(cfgst, "'%s': undefined value", value); - else { - int i; - for ( i = (int) (sizeof(vs) / sizeof(*vs)) - 1; i >= idx; i-- ) - enabled_logcats |= lc[i]; - return 1; - } + static const char *vs[] = { + "finest", "finer", "fine", "config", "info", "warning", "severe", "none", NULL + }; + static const uint32_t lc[] = { + DDS_LC_ALL, DDS_LC_TRAFFIC | DDS_LC_TIMING, DDS_LC_DISCOVERY | DDS_LC_THROTTLE, DDS_LC_CONFIG, DDS_LC_INFO, DDS_LC_WARNING, DDS_LC_ERROR | DDS_LC_FATAL, 0, 0 + }; + int idx = list_index(vs, value); + assert(sizeof(vs) / sizeof(*vs) == sizeof(lc) / sizeof(*lc)); + if ( idx < 0 ) + return cfg_error(cfgst, "'%s': undefined value", value); + else { + int i; + for ( i = (int) (sizeof(vs) / sizeof(*vs)) - 1; i >= idx; i-- ) + enabled_logcats |= lc[i]; + return 1; + } } static int uf_besmode(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) { - static const char *vs[] = { - "full", "writers", "minimal", NULL - }; - static const enum besmode ms[] = { - BESMODE_FULL, BESMODE_WRITERS, BESMODE_MINIMAL, 0, - }; - int idx = list_index(vs, value); - enum besmode *elem = cfg_address(cfgst, parent, cfgelem); - assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); - if ( idx < 0 ) - return cfg_error(cfgst, "'%s': undefined value", value); - *elem = ms[idx]; - return 1; + static const char *vs[] = { + "full", "writers", "minimal", NULL + }; + static const enum besmode ms[] = { + BESMODE_FULL, BESMODE_WRITERS, BESMODE_MINIMAL, 0, + }; + int idx = list_index(vs, value); + enum besmode *elem = cfg_address(cfgst, parent, cfgelem); + assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); + if ( idx < 0 ) + return cfg_error(cfgst, "'%s': undefined value", value); + *elem = ms[idx]; + return 1; } static void pf_besmode(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) { - enum besmode *p = cfg_address(cfgst, parent, cfgelem); - const char *str = "INVALID"; - switch ( *p ) { - case BESMODE_FULL: str = "full"; break; - case BESMODE_WRITERS: str = "writers"; break; - case BESMODE_MINIMAL: str = "minimal"; break; - } - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); + enum besmode *p = cfg_address(cfgst, parent, cfgelem); + const char *str = "INVALID"; + switch ( *p ) { + case BESMODE_FULL: str = "full"; break; + case BESMODE_WRITERS: str = "writers"; break; + case BESMODE_MINIMAL: str = "minimal"; break; + } + cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); } #ifdef DDSI_INCLUDE_SSL @@ -1458,436 +1379,371 @@ static void pf_min_tls_version(struct cfgst *cfgst, void *parent, struct cfgelem } #endif -static int uf_durability_cdr(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) -{ - static const char *vs[] = { "cdr_le", "cdr_be", "cdr_server", "cdr_client", NULL }; - static const enum durability_cdr ms[] = { DUR_CDR_LE, DUR_CDR_BE, DUR_CDR_SERVER, DUR_CDR_CLIENT, 0 }; - int idx = list_index(vs, value); - enum durability_cdr * elem = cfg_address(cfgst, parent, cfgelem); - if ( idx < 0 ) { - return cfg_error(cfgst, "'%s': undefined value", value); - } - *elem = ms[idx]; - return 1; -} - -static void pf_durability_cdr(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) -{ - enum durability_cdr *p = cfg_address(cfgst, parent, cfgelem); - const char *str = "INVALID"; - switch ( *p ) { - case DUR_CDR_LE: str = "cdr_le"; break; - case DUR_CDR_BE: str = "cdr_be"; break; - case DUR_CDR_SERVER: str = "cdr_server"; break; - case DUR_CDR_CLIENT: str = "cdr_client"; break; - } - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); -} - - static int uf_retransmit_merging(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) { - static const char *vs[] = { - "never", "adaptive", "always", NULL - }; - static const enum retransmit_merging ms[] = { - REXMIT_MERGE_NEVER, REXMIT_MERGE_ADAPTIVE, REXMIT_MERGE_ALWAYS, 0, - }; - int idx = list_index(vs, value); - enum retransmit_merging *elem = cfg_address(cfgst, parent, cfgelem); - assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); - if ( idx < 0 ) - return cfg_error(cfgst, "'%s': undefined value", value); - *elem = ms[idx]; - return 1; + static const char *vs[] = { + "never", "adaptive", "always", NULL + }; + static const enum retransmit_merging ms[] = { + REXMIT_MERGE_NEVER, REXMIT_MERGE_ADAPTIVE, REXMIT_MERGE_ALWAYS, 0, + }; + int idx = list_index(vs, value); + enum retransmit_merging *elem = cfg_address(cfgst, parent, cfgelem); + assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); + if ( idx < 0 ) + return cfg_error(cfgst, "'%s': undefined value", value); + *elem = ms[idx]; + return 1; } static void pf_retransmit_merging(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) { - enum retransmit_merging *p = cfg_address(cfgst, parent, cfgelem); - const char *str = "INVALID"; - switch ( *p ) { - case REXMIT_MERGE_NEVER: str = "never"; break; - case REXMIT_MERGE_ADAPTIVE: str = "adaptive"; break; - case REXMIT_MERGE_ALWAYS: str = "always"; break; - } - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); + enum retransmit_merging *p = cfg_address(cfgst, parent, cfgelem); + const char *str = "INVALID"; + switch ( *p ) { + case REXMIT_MERGE_NEVER: str = "never"; break; + case REXMIT_MERGE_ADAPTIVE: str = "adaptive"; break; + case REXMIT_MERGE_ALWAYS: str = "always"; break; + } + cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); } static int uf_string(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - char **elem = cfg_address(cfgst, parent, cfgelem); - *elem = ddsrt_strdup(value); - return 1; + char **elem = cfg_address(cfgst, parent, cfgelem); + *elem = ddsrt_strdup(value); + return 1; } DDSRT_WARNING_MSVC_OFF(4996); static int uf_natint64_unit(struct cfgst *cfgst, int64_t *elem, const char *value, const struct unit *unittab, int64_t def_mult, int64_t min, int64_t max) { - int pos; - double v_dbl; - int64_t v_int; - int64_t mult; - /* try convert as integer + optional unit; if that fails, try - floating point + optional unit (round, not truncate, to integer) */ - if ( *value == 0 ) { - *elem = 0; /* some static analyzers don't "get it" */ - return cfg_error(cfgst, "%s: empty string is not a valid value", value); - } else if ( sscanf(value, "%lld%n", (long long int *) &v_int, &pos) == 1 && (mult = lookup_multiplier(cfgst, unittab, value, pos, v_int == 0, def_mult, 0)) != 0 ) { - assert(mult > 0); - if ( v_int < 0 || v_int > max / mult || mult * v_int < min) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = mult * v_int; - return 1; - } else if ( sscanf(value, "%lf%n", &v_dbl, &pos) == 1 && (mult = lookup_multiplier(cfgst, unittab, value, pos, v_dbl == 0, def_mult, 1)) != 0 ) { - double dmult = (double) mult; - assert(dmult > 0); - if ( (int64_t) (v_dbl * dmult + 0.5) < min || (int64_t) (v_dbl * dmult + 0.5) > max ) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = (int64_t) (v_dbl * dmult + 0.5); - return 1; - } else { - *elem = 0; /* some static analyzers don't "get it" */ - return cfg_error(cfgst, "%s: invalid value", value); - } + int pos; + double v_dbl; + int64_t v_int; + int64_t mult; + /* try convert as integer + optional unit; if that fails, try + floating point + optional unit (round, not truncate, to integer) */ + if ( *value == 0 ) { + *elem = 0; /* some static analyzers don't "get it" */ + return cfg_error(cfgst, "%s: empty string is not a valid value", value); + } else if ( sscanf(value, "%lld%n", (long long int *) &v_int, &pos) == 1 && (mult = lookup_multiplier(cfgst, unittab, value, pos, v_int == 0, def_mult, 0)) != 0 ) { + assert(mult > 0); + if ( v_int < 0 || v_int > max / mult || mult * v_int < min) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = mult * v_int; + return 1; + } else if ( sscanf(value, "%lf%n", &v_dbl, &pos) == 1 && (mult = lookup_multiplier(cfgst, unittab, value, pos, v_dbl == 0, def_mult, 1)) != 0 ) { + double dmult = (double) mult; + assert(dmult > 0); + if ( (int64_t) (v_dbl * dmult + 0.5) < min || (int64_t) (v_dbl * dmult + 0.5) > max ) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = (int64_t) (v_dbl * dmult + 0.5); + return 1; + } else { + *elem = 0; /* some static analyzers don't "get it" */ + return cfg_error(cfgst, "%s: invalid value", value); + } } DDSRT_WARNING_MSVC_ON(4996); #ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING static int uf_bandwidth(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - int64_t bandwidth_bps = 0; - if ( strncmp(value, "inf", 3) == 0 ) { - /* special case: inf needs no unit */ - int *elem = cfg_address(cfgst, parent, cfgelem); - if ( strspn(value + 3, " ") != strlen(value + 3) && - lookup_multiplier(cfgst, unittab_bandwidth_bps, value, 3, 1, 8, 1) == 0 ) - return 0; - *elem = 0; - return 1; - } else if ( !uf_natint64_unit(cfgst, &bandwidth_bps, value, unittab_bandwidth_bps, 8, INT64_MAX) ) { - return 0; - } else if ( bandwidth_bps / 8 > INT_MAX ) { - return cfg_error(cfgst, "%s: value out of range", value); - } else { - uint32_t *elem = cfg_address(cfgst, parent, cfgelem); - *elem = (uint32_t) (bandwidth_bps / 8); - return 1; - } + int64_t bandwidth_bps = 0; + if ( strncmp(value, "inf", 3) == 0 ) { + /* special case: inf needs no unit */ + int *elem = cfg_address(cfgst, parent, cfgelem); + if ( strspn(value + 3, " ") != strlen(value + 3) && + lookup_multiplier(cfgst, unittab_bandwidth_bps, value, 3, 1, 8, 1) == 0 ) + return 0; + *elem = 0; + return 1; + } else if ( !uf_natint64_unit(cfgst, &bandwidth_bps, value, unittab_bandwidth_bps, 8, INT64_MAX) ) { + return 0; + } else if ( bandwidth_bps / 8 > INT_MAX ) { + return cfg_error(cfgst, "%s: value out of range", value); + } else { + uint32_t *elem = cfg_address(cfgst, parent, cfgelem); + *elem = (uint32_t) (bandwidth_bps / 8); + return 1; + } } #endif static int uf_memsize(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - int64_t size = 0; - if ( !uf_natint64_unit(cfgst, &size, value, unittab_memsize, 1, 0, INT32_MAX) ) - return 0; - else { - uint32_t *elem = cfg_address(cfgst, parent, cfgelem); - *elem = (uint32_t) size; - return 1; - } + int64_t size = 0; + if ( !uf_natint64_unit(cfgst, &size, value, unittab_memsize, 1, 0, INT32_MAX) ) + return 0; + else { + uint32_t *elem = cfg_address(cfgst, parent, cfgelem); + *elem = (uint32_t) size; + return 1; + } } #ifdef DDSI_INCLUDE_ENCRYPTION static int uf_cipher(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - if ( q_security_plugin.cipher_type_from_string ) { - q_cipherType *elem = cfg_address(cfgst, parent, cfgelem); - if ( (q_security_plugin.cipher_type_from_string) (value, elem) ) { - return 1; - } else { - return cfg_error(cfgst, "%s: undefined value", value); - } + if ( q_security_plugin.cipher_type_from_string ) { + q_cipherType *elem = cfg_address(cfgst, parent, cfgelem); + if ( (q_security_plugin.cipher_type_from_string) (value, elem) ) { + return 1; + } else { + return cfg_error(cfgst, "%s: undefined value", value); } - return 1; + } + return 1; } #endif /* DDSI_INCLUDE_ENCRYPTION */ static int uf_tracingOutputFileName(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value) { - struct config *cfg = cfgst->cfg; - { - cfg->tracingOutputFileName = ddsrt_strdup(value); - } - return 1; + struct config *cfg = cfgst->cfg; + { + cfg->tracingOutputFileName = ddsrt_strdup(value); + } + return 1; } static int uf_ipv4(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - /* Not actually doing any checking yet */ - return uf_string(cfgst, parent, cfgelem, first, value); + /* Not actually doing any checking yet */ + return uf_string(cfgst, parent, cfgelem, first, value); } static int uf_networkAddress(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - if ( ddsrt_strcasecmp(value, "auto") != 0 ) - return uf_ipv4(cfgst, parent, cfgelem, first, value); - else { - char **elem = cfg_address(cfgst, parent, cfgelem); - *elem = NULL; - return 1; - } + if ( ddsrt_strcasecmp(value, "auto") != 0 ) + return uf_ipv4(cfgst, parent, cfgelem, first, value); + else { + char **elem = cfg_address(cfgst, parent, cfgelem); + *elem = NULL; + return 1; + } } static void ff_networkAddresses(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - char ***elem = cfg_address(cfgst, parent, cfgelem); - int i; - for ( i = 0; (*elem)[i]; i++ ) - ddsrt_free((*elem)[i]); - ddsrt_free(*elem); + char ***elem = cfg_address(cfgst, parent, cfgelem); + int i; + for ( i = 0; (*elem)[i]; i++ ) + ddsrt_free((*elem)[i]); + ddsrt_free(*elem); } static int uf_networkAddresses_simple(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - char ***elem = cfg_address(cfgst, parent, cfgelem); - if ( (*elem = ddsrt_malloc(2 * sizeof(char *))) == NULL ) - return cfg_error(cfgst, "out of memory"); - if ( ((*elem)[0] = ddsrt_strdup(value)) == NULL ) { - ddsrt_free(*elem); - *elem = NULL; - return cfg_error(cfgst, "out of memory"); - } - (*elem)[1] = NULL; - return 1; + char ***elem = cfg_address(cfgst, parent, cfgelem); + if ( (*elem = ddsrt_malloc(2 * sizeof(char *))) == NULL ) + return cfg_error(cfgst, "out of memory"); + if ( ((*elem)[0] = ddsrt_strdup(value)) == NULL ) { + ddsrt_free(*elem); + *elem = NULL; + return cfg_error(cfgst, "out of memory"); + } + (*elem)[1] = NULL; + return 1; } static int uf_networkAddresses(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - /* Check for keywords first */ + /* Check for keywords first */ + { + static const char *keywords[] = { "all", "any", "none" }; + int i; + for ( i = 0; i < (int) (sizeof(keywords) / sizeof(*keywords)); i++ ) { + if ( ddsrt_strcasecmp(value, keywords[i]) == 0 ) + return uf_networkAddresses_simple(cfgst, parent, cfgelem, first, keywords[i]); + } + } + + /* If not keyword, then comma-separated list of addresses */ + { + char ***elem = cfg_address(cfgst, parent, cfgelem); + char *copy; + unsigned count; + + /* First count how many addresses we have - but do it stupidly by + counting commas and adding one (so two commas in a row are both + counted) */ { - static const char *keywords[] = { "all", "any", "none" }; - int i; - for ( i = 0; i < (int) (sizeof(keywords) / sizeof(*keywords)); i++ ) { - if ( ddsrt_strcasecmp(value, keywords[i]) == 0 ) - return uf_networkAddresses_simple(cfgst, parent, cfgelem, first, keywords[i]); - } + const char *scan = value; + count = 1; + while ( *scan ) + count += (*scan++ == ','); } - /* If not keyword, then comma-separated list of addresses */ + copy = ddsrt_strdup(value); + + /* Allocate an array of address strings (which may be oversized a + bit because of the counting of the commas) */ + *elem = ddsrt_malloc((count + 1) * sizeof(char *)); + { - char ***elem = cfg_address(cfgst, parent, cfgelem); - char *copy; - unsigned count; - - /* First count how many addresses we have - but do it stupidly by - counting commas and adding one (so two commas in a row are both - counted) */ - { - const char *scan = value; - count = 1; - while ( *scan ) - count += (*scan++ == ','); - } - - copy = ddsrt_strdup(value); - - /* Allocate an array of address strings (which may be oversized a - bit because of the counting of the commas) */ - *elem = ddsrt_malloc((count + 1) * sizeof(char *)); - - { - char *cursor = copy, *tok; - unsigned idx = 0; - while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { - assert(idx < count); - (*elem)[idx] = ddsrt_strdup(tok); - idx++; - } - (*elem)[idx] = NULL; - } - ddsrt_free(copy); + char *cursor = copy, *tok; + unsigned idx = 0; + while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { + assert(idx < count); + (*elem)[idx] = ddsrt_strdup(tok); + idx++; + } + (*elem)[idx] = NULL; } - return 1; + ddsrt_free(copy); + } + return 1; } static int uf_allow_multicast(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { #ifdef DDSI_INCLUDE_SSM - static const char *vs[] = { "false", "spdp", "asm", "ssm", "true", NULL }; - static const unsigned bs[] = { AMC_FALSE, AMC_SPDP, AMC_ASM, AMC_SSM, AMC_TRUE }; + static const char *vs[] = { "false", "spdp", "asm", "ssm", "true", NULL }; + static const unsigned bs[] = { AMC_FALSE, AMC_SPDP, AMC_ASM, AMC_SSM, AMC_TRUE }; #else - static const char *vs[] = { "false", "spdp", "asm", "true", NULL }; - static const unsigned bs[] = { AMC_FALSE, AMC_SPDP, AMC_ASM, AMC_TRUE }; + static const char *vs[] = { "false", "spdp", "asm", "true", NULL }; + static const unsigned bs[] = { AMC_FALSE, AMC_SPDP, AMC_ASM, AMC_TRUE }; #endif - char *copy = ddsrt_strdup(value), *cursor = copy, *tok; - unsigned *elem = cfg_address(cfgst, parent, cfgelem); - if ( copy == NULL ) - return cfg_error(cfgst, "out of memory"); - *elem = 0; - while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { - int idx = list_index(vs, tok); - if ( idx < 0 ) { - int ret = cfg_error(cfgst, "'%s' in '%s' undefined", tok, value); - ddsrt_free(copy); - return ret; - } - *elem |= bs[idx]; + char *copy = ddsrt_strdup(value), *cursor = copy, *tok; + unsigned *elem = cfg_address(cfgst, parent, cfgelem); + if ( copy == NULL ) + return cfg_error(cfgst, "out of memory"); + *elem = 0; + while ( (tok = ddsrt_strsep(&cursor, ",")) != NULL ) { + int idx = list_index(vs, tok); + if ( idx < 0 ) { + int ret = cfg_error(cfgst, "'%s' in '%s' undefined", tok, value); + ddsrt_free(copy); + return ret; } - ddsrt_free(copy); - return 1; + *elem |= bs[idx]; + } + ddsrt_free(copy); + return 1; } static void pf_allow_multicast(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) { - unsigned *p = cfg_address(cfgst, parent, cfgelem); - const char *str = "INVALID"; - switch ( *p ) { - case AMC_FALSE: str = "false"; break; - case AMC_SPDP: str = "spdp"; break; - case AMC_ASM: str = "asm"; break; + unsigned *p = cfg_address(cfgst, parent, cfgelem); + const char *str = "INVALID"; + switch ( *p ) { + case AMC_FALSE: str = "false"; break; + case AMC_SPDP: str = "spdp"; break; + case AMC_ASM: str = "asm"; break; #ifdef DDSI_INCLUDE_SSM - case AMC_SSM: str = "ssm"; break; - case (AMC_SPDP | AMC_ASM): str = "spdp,asm"; break; - case (AMC_SPDP | AMC_SSM): str = "spdp,ssm"; break; + case AMC_SSM: str = "ssm"; break; + case (AMC_SPDP | AMC_ASM): str = "spdp,asm"; break; + case (AMC_SPDP | AMC_SSM): str = "spdp,ssm"; break; #endif - case AMC_TRUE: str = "true"; break; - } - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); -} - -static int uf_sched_prio_class(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) -{ - int ret; - q__schedPrioClass *prio; - - assert(value != NULL); - - prio = cfg_address(cfgst, parent, cfgelem); - - if ( ddsrt_strcasecmp(value, "relative") == 0 ) { - *prio = Q__SCHED_PRIO_RELATIVE; - ret = 1; - } else if ( ddsrt_strcasecmp(value, "absolute") == 0 ) { - *prio = Q__SCHED_PRIO_ABSOLUTE; - ret = 1; - } else { - ret = cfg_error(cfgst, "'%s': undefined value", value); - } - - return ret; -} - -static void pf_sched_prio_class(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) -{ - char *str; - q__schedPrioClass *prio = cfg_address(cfgst, parent, cfgelem); - - if ( *prio == Q__SCHED_PRIO_RELATIVE ) { - str = "relative"; - } else if ( *prio == Q__SCHED_PRIO_ABSOLUTE ) { - str = "absolute"; - } else { - str = "INVALID"; - } - - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); + case AMC_TRUE: str = "true"; break; + } + cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); } static int uf_sched_class(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - static const char *vs[] = { "realtime", "timeshare", "default" }; - static const ddsrt_sched_t ms[] = { DDSRT_SCHED_REALTIME, DDSRT_SCHED_TIMESHARE, DDSRT_SCHED_DEFAULT }; - int idx = list_index(vs, value); - ddsrt_sched_t *elem = cfg_address(cfgst, parent, cfgelem); - assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); - if ( idx < 0 ) - return cfg_error(cfgst, "'%s': undefined value", value); - *elem = ms[idx]; - return 1; + static const char *vs[] = { "realtime", "timeshare", "default" }; + static const ddsrt_sched_t ms[] = { DDSRT_SCHED_REALTIME, DDSRT_SCHED_TIMESHARE, DDSRT_SCHED_DEFAULT }; + int idx = list_index(vs, value); + ddsrt_sched_t *elem = cfg_address(cfgst, parent, cfgelem); + assert(sizeof(vs) / sizeof(*vs) == sizeof(ms) / sizeof(*ms)); + if ( idx < 0 ) + return cfg_error(cfgst, "'%s': undefined value", value); + *elem = ms[idx]; + return 1; } static void pf_sched_class(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) { - ddsrt_sched_t *p = cfg_address(cfgst, parent, cfgelem); - const char *str = "INVALID"; - switch ( *p ) { - case DDSRT_SCHED_DEFAULT: str = "default"; break; - case DDSRT_SCHED_TIMESHARE: str = "timeshare"; break; - case DDSRT_SCHED_REALTIME: str = "realtime"; break; - } - cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); + ddsrt_sched_t *p = cfg_address(cfgst, parent, cfgelem); + const char *str = "INVALID"; + switch ( *p ) { + case DDSRT_SCHED_DEFAULT: str = "default"; break; + case DDSRT_SCHED_TIMESHARE: str = "timeshare"; break; + case DDSRT_SCHED_REALTIME: str = "realtime"; break; + } + cfg_log(cfgst, "%s%s", str, is_default ? " [def]" : ""); } DDSRT_WARNING_MSVC_OFF(4996); static int uf_maybe_int32(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - struct config_maybe_int32 *elem = cfg_address(cfgst, parent, cfgelem); - int pos; - if ( ddsrt_strcasecmp(value, "default") == 0 ) { - elem->isdefault = 1; - elem->value = 0; - return 1; - } else if ( sscanf(value, "%"PRId32"%n", &elem->value, &pos) == 1 && value[pos] == 0 ) { - elem->isdefault = 0; - return 1; - } else { - return cfg_error(cfgst, "'%s': neither 'default' nor a decimal integer\n", value); - } + struct config_maybe_int32 *elem = cfg_address(cfgst, parent, cfgelem); + int pos; + if ( ddsrt_strcasecmp(value, "default") == 0 ) { + elem->isdefault = 1; + elem->value = 0; + return 1; + } else if ( sscanf(value, "%"PRId32"%n", &elem->value, &pos) == 1 && value[pos] == 0 ) { + elem->isdefault = 0; + return 1; + } else { + return cfg_error(cfgst, "'%s': neither 'default' nor a decimal integer\n", value); + } } DDSRT_WARNING_MSVC_ON(4996); static int uf_maybe_memsize(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - struct config_maybe_uint32 *elem = cfg_address(cfgst, parent, cfgelem); - int64_t size = 0; - if ( ddsrt_strcasecmp(value, "default") == 0 ) { - elem->isdefault = 1; - elem->value = 0; - return 1; - } else if ( !uf_natint64_unit(cfgst, &size, value, unittab_memsize, 1, 0, INT32_MAX) ) { - return 0; - } else { - elem->isdefault = 0; - elem->value = (uint32_t) size; - return 1; - } + struct config_maybe_uint32 *elem = cfg_address(cfgst, parent, cfgelem); + int64_t size = 0; + if ( ddsrt_strcasecmp(value, "default") == 0 ) { + elem->isdefault = 1; + elem->value = 0; + return 1; + } else if ( !uf_natint64_unit(cfgst, &size, value, unittab_memsize, 1, 0, INT32_MAX) ) { + return 0; + } else { + elem->isdefault = 0; + elem->value = (uint32_t) size; + return 1; + } } static int uf_int(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - int *elem = cfg_address(cfgst, parent, cfgelem); - char *endptr; - long v = strtol(value, &endptr, 10); - if ( *value == 0 || *endptr != 0 ) - return cfg_error(cfgst, "%s: not a decimal integer", value); - if ( v != (int) v ) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = (int) v; - return 1; + int *elem = cfg_address(cfgst, parent, cfgelem); + char *endptr; + long v = strtol(value, &endptr, 10); + if ( *value == 0 || *endptr != 0 ) + return cfg_error(cfgst, "%s: not a decimal integer", value); + if ( v != (int) v ) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = (int) v; + return 1; } static int uf_duration_gen(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, const char *value, int64_t def_mult, int64_t min_ns, int64_t max_ns) { - return uf_natint64_unit(cfgst, cfg_address(cfgst, parent, cfgelem), value, unittab_duration, def_mult, min_ns, max_ns); + return uf_natint64_unit(cfgst, cfg_address(cfgst, parent, cfgelem), value, unittab_duration, def_mult, min_ns, max_ns); } static int uf_duration_inf(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - if ( ddsrt_strcasecmp(value, "inf") == 0 ) { - int64_t *elem = cfg_address(cfgst, parent, cfgelem); - *elem = T_NEVER; - return 1; - } else { - return uf_duration_gen(cfgst, parent, cfgelem, value, 0, 0, T_NEVER - 1); - } + if ( ddsrt_strcasecmp(value, "inf") == 0 ) { + int64_t *elem = cfg_address(cfgst, parent, cfgelem); + *elem = T_NEVER; + return 1; + } else { + return uf_duration_gen(cfgst, parent, cfgelem, value, 0, 0, T_NEVER - 1); + } } static int uf_duration_ms_1hr(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - return uf_duration_gen(cfgst, parent, cfgelem, value, T_MILLISECOND, 0, 3600 * T_SECOND); + return uf_duration_gen(cfgst, parent, cfgelem, value, T_MILLISECOND, 0, 3600 * T_SECOND); } static int uf_duration_ms_1s(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - return uf_duration_gen(cfgst, parent, cfgelem, value, T_MILLISECOND, 0, T_SECOND); + return uf_duration_gen(cfgst, parent, cfgelem, value, T_MILLISECOND, 0, T_SECOND); } static int uf_duration_us_1s(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - return uf_duration_gen(cfgst, parent, cfgelem, value, 1000, 0, T_SECOND); + return uf_duration_gen(cfgst, parent, cfgelem, value, 1000, 0, T_SECOND); } static int uf_duration_100ms_1hr(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) @@ -1895,56 +1751,58 @@ static int uf_duration_100ms_1hr(struct cfgst *cfgst, void *parent, struct cfgel return uf_duration_gen(cfgst, parent, cfgelem, value, 0, 100 * T_MILLISECOND, 3600 * T_SECOND); } +#if 0 static int uf_int32(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - int32_t *elem = cfg_address(cfgst, parent, cfgelem); - char *endptr; - long v = strtol(value, &endptr, 10); - if ( *value == 0 || *endptr != 0 ) - return cfg_error(cfgst, "%s: not a decimal integer", value); - if ( v != (int32_t) v ) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = (int32_t) v; - return 1; + int32_t *elem = cfg_address(cfgst, parent, cfgelem); + char *endptr; + long v = strtol(value, &endptr, 10); + if ( *value == 0 || *endptr != 0 ) + return cfg_error(cfgst, "%s: not a decimal integer", value); + if ( v != (int32_t) v ) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = (int32_t) v; + return 1; } +#endif #if 0 static int uf_uint32(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - uint32_t *elem = cfg_address(cfgst, parent, cfgelem); - char *endptr; - unsigned long v = strtoul(value, &endptr, 10); - if ( *value == 0 || *endptr != 0 ) - return cfg_error(cfgst, "%s: not a decimal integer", value); - if ( v != (uint32_t) v ) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = (uint32_t) v; - return 1; + uint32_t *elem = cfg_address(cfgst, parent, cfgelem); + char *endptr; + unsigned long v = strtoul(value, &endptr, 10); + if ( *value == 0 || *endptr != 0 ) + return cfg_error(cfgst, "%s: not a decimal integer", value); + if ( v != (uint32_t) v ) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = (uint32_t) v; + return 1; } #endif static int uf_uint(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG(int first), const char *value) { - unsigned *elem = cfg_address(cfgst, parent, cfgelem); - char *endptr; - unsigned long v = strtoul(value, &endptr, 10); - if ( *value == 0 || *endptr != 0 ) - return cfg_error(cfgst, "%s: not a decimal integer", value); - if ( v != (unsigned) v ) - return cfg_error(cfgst, "%s: value out of range", value); - *elem = (unsigned) v; - return 1; + unsigned *elem = cfg_address(cfgst, parent, cfgelem); + char *endptr; + unsigned long v = strtoul(value, &endptr, 10); + if ( *value == 0 || *endptr != 0 ) + return cfg_error(cfgst, "%s: not a decimal integer", value); + if ( v != (unsigned) v ) + return cfg_error(cfgst, "%s: value out of range", value); + *elem = (unsigned) v; + return 1; } static int uf_int_min_max(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value, int min, int max) { - int *elem = cfg_address(cfgst, parent, cfgelem); - if ( !uf_int(cfgst, parent, cfgelem, first, value) ) - return 0; - else if ( *elem < min || *elem > max ) - return cfg_error(cfgst, "%s: out of range", value); - else - return 1; + int *elem = cfg_address(cfgst, parent, cfgelem); + if ( !uf_int(cfgst, parent, cfgelem, first, value) ) + return 0; + else if ( *elem < min || *elem > max ) + return cfg_error(cfgst, "%s: out of range", value); + else + return 1; } DDSRT_WARNING_MSVC_OFF(4996); @@ -1967,36 +1825,36 @@ DDSRT_WARNING_MSVC_ON(4996); static int uf_participantIndex(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - int *elem = cfg_address(cfgst, parent, cfgelem); - if ( ddsrt_strcasecmp(value, "auto") == 0 ) { - *elem = PARTICIPANT_INDEX_AUTO; - return 1; - } else if ( ddsrt_strcasecmp(value, "none") == 0 ) { - *elem = PARTICIPANT_INDEX_NONE; - return 1; - } else { - return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, 120); - } + int *elem = cfg_address(cfgst, parent, cfgelem); + if ( ddsrt_strcasecmp(value, "auto") == 0 ) { + *elem = PARTICIPANT_INDEX_AUTO; + return 1; + } else if ( ddsrt_strcasecmp(value, "none") == 0 ) { + *elem = PARTICIPANT_INDEX_NONE; + return 1; + } else { + return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, 120); + } } static int uf_port(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - return uf_int_min_max(cfgst, parent, cfgelem, first, value, 1, 65535); + return uf_int_min_max(cfgst, parent, cfgelem, first, value, 1, 65535); } static int uf_dyn_port(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - return uf_int_min_max(cfgst, parent, cfgelem, first, value, -1, 65535); + return uf_int_min_max(cfgst, parent, cfgelem, first, value, -1, 65535); } static int uf_natint(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, INT32_MAX); + return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, INT32_MAX); } static int uf_natint_255(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int first, const char *value) { - return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, 255); + return uf_int_min_max(cfgst, parent, cfgelem, first, value, 0, 255); } static int uf_transport_selector (struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, UNUSED_ARG (int first), const char *value) @@ -2065,76 +1923,76 @@ static int uf_deaf_mute (struct cfgst *cfgst, void *parent, struct cfgelem const static int do_update(struct cfgst *cfgst, update_fun_t upd, void *parent, struct cfgelem const * const cfgelem, const char *value, int is_default) { - struct cfgst_node *n; - struct cfgst_nodekey key; - ddsrt_avl_ipath_t np; - int ok; - key.e = cfgelem; - if ( (n = ddsrt_avl_lookup_ipath(&cfgst_found_treedef, &cfgst->found, &key, &np)) == NULL ) { - if ( (n = ddsrt_malloc(sizeof(*n))) == NULL ) - return cfg_error(cfgst, "out of memory"); + struct cfgst_node *n; + struct cfgst_nodekey key; + ddsrt_avl_ipath_t np; + int ok; + key.e = cfgelem; + if ( (n = ddsrt_avl_lookup_ipath(&cfgst_found_treedef, &cfgst->found, &key, &np)) == NULL ) { + if ( (n = ddsrt_malloc(sizeof(*n))) == NULL ) + return cfg_error(cfgst, "out of memory"); - n->key = key; - n->count = 0; - n->failed = 0; - n->is_default = is_default; - ddsrt_avl_insert_ipath(&cfgst_found_treedef, &cfgst->found, n, &np); - } - if ( cfgelem->multiplicity == 0 || n->count < cfgelem->multiplicity ) - ok = upd(cfgst, parent, cfgelem, (n->count == n->failed), value); - else - ok = cfg_error(cfgst, "only %d instance(s) allowed", cfgelem->multiplicity); - n->count++; - if ( !ok ) { - n->failed++; - } - return ok; + n->key = key; + n->count = 0; + n->failed = 0; + n->is_default = is_default; + ddsrt_avl_insert_ipath(&cfgst_found_treedef, &cfgst->found, n, &np); + } + if ( cfgelem->multiplicity == 0 || n->count < cfgelem->multiplicity ) + ok = upd(cfgst, parent, cfgelem, (n->count == n->failed), value); + else + ok = cfg_error(cfgst, "only %d instance(s) allowed", cfgelem->multiplicity); + n->count++; + if ( !ok ) { + n->failed++; + } + return ok; } static int set_default(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem) { - if ( cfgelem->defvalue == NULL ) - return cfg_error(cfgst, "element missing in configuration"); - return do_update(cfgst, cfgelem->update, parent, cfgelem, cfgelem->defvalue, 1); + if ( cfgelem->defvalue == NULL ) + return cfg_error(cfgst, "element missing in configuration"); + return do_update(cfgst, cfgelem->update, parent, cfgelem, cfgelem->defvalue, 1); } static int set_defaults(struct cfgst *cfgst, void *parent, int isattr, struct cfgelem const * const cfgelem, int clear_found) { - const struct cfgelem *ce; - int ok = 1; - for ( ce = cfgelem; ce && ce->name; ce++ ) { - struct cfgst_node *n; - struct cfgst_nodekey key; - key.e = ce; - cfgst_push(cfgst, isattr, ce, parent); - if ( ce->multiplicity == 1 ) { - if ( ddsrt_avl_lookup(&cfgst_found_treedef, &cfgst->found, &key) == NULL ) { - if ( ce->update ) { - int ok1; - cfgst_push(cfgst, 0, NULL, NULL); - ok1 = set_default(cfgst, parent, ce); - cfgst_pop(cfgst); - ok = ok && ok1; - } - } - if ( (n = ddsrt_avl_lookup(&cfgst_found_treedef, &cfgst->found, &key)) != NULL ) { - if ( clear_found ) { - ddsrt_avl_delete(&cfgst_found_treedef, &cfgst->found, n); - ddsrt_free(n); - } - } - if ( ce->children ) { - int ok1 = set_defaults(cfgst, parent, 0, ce->children, clear_found); - ok = ok && ok1; - } - if ( ce->attributes ) { - int ok1 = set_defaults(cfgst, parent, 1, ce->attributes, clear_found); - ok = ok && ok1; - } + const struct cfgelem *ce; + int ok = 1; + for ( ce = cfgelem; ce && ce->name; ce++ ) { + struct cfgst_node *n; + struct cfgst_nodekey key; + key.e = ce; + cfgst_push(cfgst, isattr, ce, parent); + if ( ce->multiplicity == 1 ) { + if ( ddsrt_avl_lookup(&cfgst_found_treedef, &cfgst->found, &key) == NULL ) { + if ( ce->update ) { + int ok1; + cfgst_push(cfgst, 0, NULL, NULL); + ok1 = set_default(cfgst, parent, ce); + cfgst_pop(cfgst); + ok = ok && ok1; } - cfgst_pop(cfgst); + } + if ( (n = ddsrt_avl_lookup(&cfgst_found_treedef, &cfgst->found, &key)) != NULL ) { + if ( clear_found ) { + ddsrt_avl_delete(&cfgst_found_treedef, &cfgst->found, n); + ddsrt_free(n); + } + } + if ( ce->children ) { + int ok1 = set_defaults(cfgst, parent, 0, ce->children, clear_found); + ok = ok && ok1; + } + if ( ce->attributes ) { + int ok1 = set_defaults(cfgst, parent, 1, ce->attributes, clear_found); + ok = ok && ok1; + } } - return ok; + cfgst_pop(cfgst); + } + return ok; } static void pf_nop(UNUSED_ARG(struct cfgst *cfgst), UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int is_default)) @@ -2143,127 +2001,129 @@ static void pf_nop(UNUSED_ARG(struct cfgst *cfgst), UNUSED_ARG(void *parent), UN static void pf_string(struct cfgst *cfgst, void *parent, struct cfgelem const * const cfgelem, int is_default) { - char **p = cfg_address(cfgst, parent, cfgelem); - cfg_log(cfgst, "%s%s", *p ? *p : "(null)", is_default ? " [def]" : ""); + char **p = cfg_address(cfgst, parent, cfgelem); + cfg_log(cfgst, "%s%s", *p ? *p : "(null)", is_default ? " [def]" : ""); } static void pf_int64_unit(struct cfgst *cfgst, int64_t value, int is_default, const struct unit *unittab, const char *zero_unit) { - if ( value == 0 ) { - /* 0s is a bit of a special case: we don't want to print 0hr (or - whatever unit will have the greatest multiplier), so hard-code - as 0s */ - cfg_log(cfgst, "0 %s%s", zero_unit, is_default ? " [def]" : ""); - } else { - int64_t m = 0; - const char *unit = NULL; - int i; - for ( i = 0; unittab[i].name != NULL; i++ ) { - if ( unittab[i].multiplier > m && (value % unittab[i].multiplier) == 0 ) { - m = unittab[i].multiplier; - unit = unittab[i].name; - } - } - assert(m > 0); - assert(unit != NULL); - cfg_log(cfgst, "%lld %s%s", value / m, unit, is_default ? " [def]" : ""); + if ( value == 0 ) { + /* 0s is a bit of a special case: we don't want to print 0hr (or + whatever unit will have the greatest multiplier), so hard-code + as 0s */ + cfg_log(cfgst, "0 %s%s", zero_unit, is_default ? " [def]" : ""); + } else { + int64_t m = 0; + const char *unit = NULL; + int i; + for ( i = 0; unittab[i].name != NULL; i++ ) { + if ( unittab[i].multiplier > m && (value % unittab[i].multiplier) == 0 ) { + m = unittab[i].multiplier; + unit = unittab[i].name; + } } + assert(m > 0); + assert(unit != NULL); + cfg_log(cfgst, "%lld %s%s", value / m, unit, is_default ? " [def]" : ""); + } } #ifdef DDSI_INCLUDE_ENCRYPTION static void pf_key(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int is_default)) { - cfg_log(cfgst, "