Commit graph

21 commits

Author SHA1 Message Date
Erik Boasson
4447fb87ee No reason to prevent rediscovery for 10s by default
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-05-16 11:38:05 +02:00
Erik Boasson
2da100a3c7 Merge remote-tracking branch 'upstream/master' into security 2020-05-11 15:05:46 +02:00
Marcel Jordense
623a5c02bd Correct handshake tokens verification w.r.t. optional fields
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-05-11 15:03:20 +02:00
Erik Boasson
209edf0efb Fix config typos in source and regenerate
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-28 18:44:54 +02:00
Erik Boasson
4f3cbf7a1c Clean up representation of discovery messages
* Remove the "plist" and "rawcdr" abuse of the "serdata_default" sample
  representation.

* Introduce a new "plist" topic type and a new "pserop" topic type.  The
  former represents parameter lists as used in discovery, the second
  arbitrary samples using the serialiser in ddsi_plist.c.

* Introduce sertopics for each of the built-in "topics" used by the DDSI
  discovery protocol using the two new topic types, and reference these
  in the readers/writers used in discovery.

* Construct and deconstruct the discovery message by using the
  conversion routines for these sample types, rather than fiddling with,
  e.g., the baroque interface for adding parameter lists to messages.

* As a consequence, it introduces standardized logging of received and
  transmitted discovery data and eliminates the annoying "(null)/(null)"
  and "(blob)" descriptions in the trace.

* Limits the dumping of octet sequences in discovery data to the first
  100 bytes to make the embedded certificates and permissions
  documents (somewhat) manageable.

* Eliminates the (many) null pointer checks on reader/writer topics.

* Fixes the printing of nested sequences in discovery data (not used
  before) and the formatting of GUIDs.

Various interfaces remain unchanged and so while this removes cruft from
the core code, it moves some of it into the conversion routines for the
new topic types.

It also now allocates some memory when processing incoming discovery
data, whereas before it had no need to do so.  Allowing for aliasing of
data in the new sertopics and adding a way to initialize these specific
types on the stack (both minor changes) suffices for eliminating those
allocations.

Signed-off-by: Erik Boasson <eb@ilities.com>

Check actual topic type before "downcasting"

Signed-off-by: Erik Boasson <eb@ilities.com>

Free the memory we own and is actually allocated

Signed-off-by: Erik Boasson <eb@ilities.com>

Ignore logging newlines if nothing is buffered

Signed-off-by: Erik Boasson <eb@ilities.com>

Suffix data with "(trunc)" one byte earlier

The sample printing code changed over time and now stops as soon as it
can once it has filled up the buffer.  As the return value is simply the
number of bytes written, if that number is equal to buffer size less
one (because of the terminating nul) it may or may not have been
truncated, but the likelihood is that it has been.  So add the "(trunc)"
suffix once that point has been reached.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-03-30 11:13:55 +02:00
Erik Boasson
67c49235db Merge remote-tracking branch 'upstream/master' into master-to-security 2020-03-19 08:18:48 +01:00
Erik Boasson
d1ed8df9f3 Create a separate socket for transmitting data
This is a workaround for interoperability issues, ultimately driven by a
Windows quirk that makes multicast delivery within a machine utterly
unreliable if the transmitting socket is bound to 0.0.0.0 (despite all
sockets having multicast interfaces set correctly) when there are also
sockets transmitting to the same multicast group that have been bound to
non-0.0.0.0.  (Note: there may be other factors at play, but this is
what it looks like after experimentation.)

At least Fast-RTPS in some versions binds the socket it uses for
transmitting multicasts to non-0.0.0.0, so interoperability with
Fast-RTPS on Windows requires us to bind the socket we use for
transmitting multicasts (which was the same as the one we use for
receiving unicast data) also to non-0.0.0.0 or our multicasts get
dropped often.

This would work fine if other implementations honoured the set of
advertised addresses.  However, at least Fast-RTPS and Connext (in some
versions) fail to do this and happily substitute 127.0.0.1 for the
advertised IP address.  If we bind to, e.g., 192.168.1.1, then suddenly
those packets won't arrive anymore, breaking interoperability.

The only work around is to use a separate socket for sending.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-03-09 20:49:47 +01:00
Dennis Potman
754eb4090e Fixed issue that Cyclone does not receive multicast data on Windows when
the destination cache of the network stack is in a certain state. The issue
is resolved by binding unicast sockets (incoming unicast and all outgoing
traffic) to the address of the interface instead of inaddr_any (0.0.0.0).
Set the new configuration option internal/BindUnicastToInterfaceAddr to
false to get the old behavior.

Co-authored-by: Erik Boasson <eb@ilities.com>

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-02-20 16:47:06 +01:00
ChenYing Kuo
af3604dea7
Fix some typos. (#399)
* Fix some typos.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>

* Also update q_config.c, cyclonedds.rnc, cyclonedds.xsd for correct
build.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>

* Remove cdds.md.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
2020-02-19 12:33:39 +01:00
Erik Boasson
ad58db0721 Merge branch 'master' into security
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-02-12 17:30:38 +01:00
Erik Boasson
bb76798492 Default to a single receive thread on Windows
This works around a termination issue on Windows caused by the process
sometimes being unable to send a packet to itself to wake up a thread
stuck in a blocking read on a socket.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-01-23 10:20:47 +01:00
Marcel Jordense
a9b9a65e1b FSM combine event and timeout thread
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-01-20 15:54:08 +01:00
Erik Boasson
9481a75e9d Config file doc generator parsing of RELOFF construct
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-01-20 15:54:08 +01:00
Erik Boasson
37db2dc6c3 Update XSD
Signed-off-by: Erik Boasson <eb@ilities.com>
2020-01-16 16:10:37 +01:00
Martin Bremmer
660d495746 Merge branch 'master' into merge6
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-12-13 12:59:37 +01:00
Erik Boasson
08d9c296f1 Add DOMAIN_ID, DOMAIN_TAG to config, discovery
This commits adds support for the DOMAIN_ID and DOMAIN_TAG parameters in
participant discovery, allowing multiple domains to share a port
number (a feature introduced in DDSI 2.3).  The tag can be configured
via Discovery/Tag.

This commit also introduces a setting Discovery/ExternalDomainId that
makes it possible to override the domain id on the network, both in what
is advertised in the DOMAIN_ID discovery parameter and in the
calculation of port numbers.  This way a single process can create two
independent domains that talk via the network, which is on occassion
useful in writing tests.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-20 12:47:22 +01:00
Erik Boasson
3da21315f2 Improve errors for invalid port numbers (#303)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-18 14:20:55 +01:00
Erik Boasson
c642f5676a Namespace generated XSD and add missing attributes
This adds two things to the XSD (and the RNC file and options.md):
* attributes previously missing because of a bug in the conversion
  script
* a name space (https://cdds.io/config)

Adding the name spacing requires a different set of attributes at the
top of a configuration file, which in turn need to be ignored by the
configuration parser, and which should be reflected in the configuration
example in the README.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 20:39:20 +01:00
Dan Rose
ae1a8130c7 Namespace the schema and add references in xml files
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Erik Boasson
a25b69be7d Exclude network channels from documentation
They are not supported yet.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00
Erik Boasson
d429045255 Add option documentation and add XSD
The ``docs/makernc.pl`` perl script can extract the options from the
source code for the configuration processing and turn these into a
GitHub MarkDown document and a RELAX NG Compact form (RNC) description
of the options.  Standard conversion tools can be used to turn the RNC
file into an XSD.

Although they are generated by a mechanical transformation, it is not
(yet) part of the build process, in no small part because there no
proper generation and publishing system has yet been set up for the
documentation.

Now that there is an XSD and a Markdown file for discovering the
options, there is no need to retain the configuration editing tool.  Any
decent editor will do a better job.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00