Commit graph

16 commits

Author SHA1 Message Date
Erik Boasson
9cf4b97f1a Reorganize repository
* Move the project top-level CMakeLists.txt to the root of the project;
  this allows building Cyclone as part of ROS2 without any special
  tricks;

* Clean up the build options:

  ENABLE_SSL:    whether to check for and include OpenSSL support if a
                 library can be found (default = ON); this used to be
                 called DDSC_ENABLE_OPENSSL, the old name is deprecated
                 but still works
  BUILD_DOCS:    whether to build docs (default = OFF)
  BUILD_TESTING: whether to build test (default = OFF)

* Collect all documentation into top-level "docs" directory;

* Move the examples to the top-level directory;

* Remove the unused and somewhat misleading pseudo-default
  cyclonedds.xml;

* Remove unused cmake files

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-07-30 10:52:44 +02:00
Jeroen Koekkoek
aa2715f4fe Add support for FreeRTOS and lwIP (#166)
Add support for FreeRTOS and lwIP

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-05-23 14:27:56 +02:00
Erik Boasson
6c171a890d move util library into ddsrt
As was the plan with the introduction of ddsrt; this includes renaming
the identifiers to match the capitalization style and removes old junk.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-04-24 14:09:30 +02:00
Erik Boasson
9b3a71e1ab lift limits on handle allocation and reuse (#95)
The old entity handle mechanism suffered from a number of problems, the
most terrible one being that it would only ever allocate 1000 handles
(not even have at most 1000 in use at the same time).  Secondarily, it
was protected by a single mutex that actually does show up as a limiting
factor in, say, a polling-based throughput test with small messages.
Thirdly, it tried to provide for various use cases that don't exist in
practice but add complexity and overhead.

This commit totally rewrites the mechanism, by replacing the old array
with a hash table and allowing a near-arbitrary number of handles as
well as reuse of handles.  It also removes the entity "kind" bits in the
most significant bits of the handles, because they only resulted in
incorrect checking of argument validity.  All that is taken out, but
there is still more cleaning up to be done.  It furthermore removes an
indirection in the handle-to-entity lookup by embedding the
"dds_handle_link" structure in the entity.

Handle allocation is randomized to avoid the have a high probability of
quickly finding an available handle (the total number of handles is
limited to a number much smaller than the domain from which they are
allocated).  The likelihood of handle reuse is still dependent on the
number of allocated handles -- the fewer handles there are, the longer
the expected time to reuse.  Non-randomized handles would give a few
guarantees more, though.

It moreover moves the code from the "util" to the "core/ddsc" component,
because it really is only used for entities, and besides the new
implementation relies on the deferred freeing (a.k.a. garbage collection
mechanism) implemented in the core.

The actual handle management has two variants, selectable with a macro:
the preferred embodiment uses a concurrent hash table, the actually used
one performs all operations inside a single mutex and uses a
non-concurrent version of the hash table.  The reason the
less-predeferred embodiment is used is that the concurrent version
requires the freeing of entity objects to be deferred (much like the
GUID-to-entity hash tables in DDSI function, or indeed the key value to
instance handle mapping).  That is a fair bit of work, and the
non-concurrent version is a reasonable intermediate step.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-04-21 16:05:06 +02:00
Erik Boasson
6f35d88d54 install core/ddsi and util header files
Some of the former are required to implement alternative serialisation
methods; the latter is just generally useful. For the time being these
are not part of the formal API and not subject to backwards
compatibility. Still, they have value for quickly building tools on that
use Cyclone and happen to need any of these functions.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-04-21 16:05:06 +02:00
Jeroen Koekkoek
63a5c87baf Fix format strings and signatures for fixed size integers
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-04-11 10:04:06 +02:00
Jeroen Koekkoek
cd6742ee12 Rearrange and fixup abstraction layer
- Replace os_result by dds_retcode_t and move DDS return code defines down.
  Eliminates the need to convert between different return code types.

- Move dds_time_t down and remove os_time.
  Eliminates the need to convert between different time representations and
  reduces code duplication.

- Remove use of Microsoft source-code annotation language (SAL).
  SAL annotations are Microsoft specific and not very well documented. This
  makes it very difficult for contributers to write.

- Rearrange the abstraction layer to be feature-based. The previous layout
  falsely assumed that the operating system dictates which implementation is
  best suited. For general purpose operating systems this is mostly true, but
  embedded targets require a slightly different approach and may not even offer
  all features. The new layout makes it possible to mix-and-match feature
  implementations and allows for features to not be implemented at all.

- Replace the os prefix by ddsrt to avoid name collisions.

- Remove various portions of unused and unwanted code.

- Export thread names on all supported platforms.

- Return native thread identifier on POSIX compatible platforms.

- Add timed wait for condition variables that takes an absolute time.

- Remove system abstraction for errno. The os_getErrno and os_setErrno were
  incorrect. Functions that might fail now simply return a DDS return code
  instead.

- Remove thread-specific memory abstraction. os_threadMemGet and accompanying
  functions were a mess and their use has been eliminated by other changes in
  this commit.

- Replace attribute (re)defines by ddsrt_ prefixed equivalents to avoid name
  collisions and problems with faulty __nonnull__ attributes.

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-03-22 15:19:09 +01:00
Erik Boasson
1c963b5c3b add torture test for read, query conditions
The "rhc" test runs a random sequence of operations (writes, reads, &c.)
through an RHC with conditions attached to it.  All possible state masks
are used, and query conditions are tried with a condition that only
tests the key value, and one that tests attribute values.  It depends on
the internal checking logic of the RHC, which is currently enabled only
in Debug builds because of the associated run-time overhead.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-12 14:22:06 +01:00
Erik Boasson
b8329ce206 Require OpenSSL by default and add list it as a dependency for Conan
OpenSSL support remains optional, but instead of including it or not solely depending on whether cmake manages to find it, there is now a DDSC_ENABLE_OPENSSL option that defaults to "ON". Setting to OFF removes the dependency. The Conan configuration has been updated to automatically provide openssl 1.1.1a.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-01 10:39:49 +01:00
Jeroen Koekkoek
334a85e0f1 Make usage of Conan provided OpenSSL transparent
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-01-31 17:09:05 +01:00
Erik Boasson
f31fba8766 fix and enable SSL support when OpenSSL is available
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-01-30 15:27:35 +01:00
Jeroen Koekkoek
e25656a4c5 Remove unnecessary CMake modules and fixup os/CMakeLists.txt
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-01-07 18:15:07 +01:00
Erik Boasson
b13bbcc358 Remove unused DDS Security-related files
The removed files are merely the machine-readable part of the DDS Security specification; the clutter they cause in the installation directory is unwarranted, especially when installing to the default /usr/local

Signed-off-by: Erik Boasson <eb@ilities.com>
2018-07-09 13:16:56 +02:00
Erik Boasson
e1a797f73c enable SSM support
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-06-13 15:52:43 +02:00
Erik Boasson
2ee9e9de02 enable support for network partitions
Signed-off-by: Erik Boasson <eb@ilities.com>
2018-06-07 16:39:39 +02:00
Michiel Beemster
11d9ce37aa Initial contribution 2018-04-10 17:03:59 +02:00