| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Fixes a typo in the fccntl manpage.
Signed-off-by: Thijs Paelman <thijs@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
| |
Since config files are meant to be read, use long-form arguments where
possible.
Also fixed autostart behaviour for oecho.
Signed-off-by: Thijs Paelman <thijs@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The application was generating its public keypair for its ECDHE key
exchange. This is now done by the IRMd, which will check the requested
qosspec and then apply what is needed. The flow_alloc and flow_accept
calls will just return the symmetric key to the application.
This makes it easier when we add configurations with given public key
pairs and other encryption algorithms, which can then all be
configured globally in the IRMd instead of having all the options
replicated and implemented in each and every application.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
The irm_create_ipcp leaked the ipcp_info protobuf message.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The irm ipcp create tool had the ipcpd-eth-dix missing in the help.
Updated the help text
where PARAM = {options list}
to
where PARAM in {options list}
and some other small fixes.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
The revision of the IRMd caused it to log an error when an application
terminates and closes the unix socket (EPIPE) or the IRMd shutds down
(EIRMD). These are expected and correct behaviour. Replaced the error
logs with debug logs.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The information for an IPCP is now stored in an ipcp_info struct,
containing name and type. The IRM public API is not changed.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The layer_info had a member layer_name which is a bit
redundant.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
| |
The ipcp_info struct / message contains information only used for
listing IPCPs, and I will reuse the ipcp_info name for general IPCP
information common to all IPCPs such as name and type.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
The ipcpd-eth-* reserve a packet buffer slot for the N+1 data
packets whenever receiving a frame. For management frames, that
slot is not needed and it was not released, thus blocking the
rdrbuff.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patch only fixed listing the contents on the fuse
filesystem. Apparently files with st_blocks = 0 as seen as empty on
Raspbian, and the FUSE read() function isn't invoked for such
files. Setting st_blocks to 1 fixes that, but st_blksize is ignored
for fuse. So, on raspbian the filesize is now a huge number, but at
least reading the fuse filesystem works.
Corrected the filesystem attributes for the IPCP output for systems
that don't rely on st_blocks to assess filesize.
Also set the file mode to 0644 as these are not executables.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
The stderr lines had no newline. Fixed.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
Config files that had service names without the args option specified
would cause the IRMd to segfault.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason, 'ls' on raspbian invoked the fuse readdir() in a loop
where the first call had fuse_file_info * info set to NULL and
subsequent calls had info->nonseekable set to 1. Since we don't check
the value the info struct, this caused an infinite loop when trying to
list the contents of the fuse filesystem subdirectories of
/tmp/ouroboros/.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
We were building on an Ubuntu1804. Probably best to change to newer
versions.
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
The timeout comparison for keepalives could overflow on 32-bit
systems, as times were converted to nanoseconds and be limited to a
bit over 4 seconds. This caused flow reads to fail miserably with
EFLOWPEER errors when keepalives were set higher on these systems.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The value for 'ret' was not initialized when comparing to -ETIMEDOUT in
reg_name_leave_state().
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
The dst was printed as a string instead of using hash-formatting.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
| |
The pid of the N-1 IPCP process was needlessly stored in the flow
struct. We only need it to open the right shared memory maps, which is
done when the flow is created.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
The irmd was automatically loading the default configfile (usually
/etc/ouroboros/irmd.conf) if present. Now the --config parameter has
to be set for the irmd to load a config. The service is adapted to
have the --config command line parameter set at install.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
| |
We often have the pattern where we NULL-check abstime for
pthread_cond_timedwait to call pthread_cond_wait if it is.
Added a __timedwait function to wrap this.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
Modifications for flows were made under a different rwlock
(flows_lock) than the rwlock used for names, etc (reg_lock). This has
little value and unnecessarily complicates things. This removes the
flows_lock and uses the reg_lock for all registry objects.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
Printed some more info on a few errors using strerror.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
This moves the command parsing function out of the mainloop
implementation to make it a bit less unwieldy.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
| |
The cryptography functions were in a C source that was directly
imported into dev.c, enabling ECDHE+AES256 symmetric key encryption on
flows. Now crypt.c is an independent source file with associated
crypt.h header, to prepare for security management and configuration
in the IRMd.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
When a request is cancelled/destroyed, all blocking threads should
exit. Noticed some hangs on the DHT, this seems to fix/reduce it.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The application had a port construct, which is a leftover from the
early days implementing RINA specs, which had a "port_id" to access
flows. O7s doesn't really have a "port" concept, only flows. The
port_wait_assign function was used in the IPCP to wait for the IRMd to
assign the flow_id and return so the flow object could be created.
This renames things a bit, and also simplifies the locking to us a
single lock/condvar for managing flows. This should be further
improved to move the flow state into the flow object, maintain a
double mapping of to flow objects (id_to_flow and fd_to_flow) and
malloc flow objects at flow allocation, instead of keeping the full
table in memory at init to further reduce memory footprint.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The event handler was dereferencing the pointer to a connection, but
the pointer type is not known yet.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
| |
The event handler was registered before the scheduler was
started. Which could in theory cause addition of fds to an
uninitialized scheduler. The event handler is now registered after the
scheduler is created as part of dt_start. Likewise it now unregisters
as part of dt_stop.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The init will now print more useful errors if a process fails to
initialize. Also rearranged these procedures a little bit.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
Doesn't make any sense to call it a port event...
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The IRMd will now print a stylized logo at startup:
▄▄█████▄▄▄
▄█▀▀ ▀▀███▄ █
██ ▄▄▄ ▄███▄ ▄ ▄ ▄ ▄▄ ▄▄ █ ▄▄ ▄▄ ▄ ▄▄ ▄▄ ▄▄
██ █ █ █████ █ █ █▀ ▀ █ █ █▀ █ █ █ █▀ ▀ █ █ ▀▄ ▀
██ ▀▄▄▄▀ ▀█▀ █ █ █ █ █ █▄ █ █ █ █ █ █ ▄ ▀▄
█▄ █ ▀▀▀ ▀ ▀ ▀▀ ▀ ▀▀ ▀▀ ▀ ▀▀ ▀▀
▀█▄▄▄▄▄▄▄▄▀
▀▀▀▀▀▀
All credits to Zen for providing the ASCII art!
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
This revises the logging in the IPCPs to be a more consistent and
reduce duplicate messages in nested functions.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
This moves the protobuf definition in the library to a pb/
directory. Also renames the protobuf files and does a quick review of
the #define guards in the include library to specify _LIB_ for
internal/non-public library headers.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
| |
All flow allocator code was duplicating the mitigation for a race
where the IRMd response for the flow allocation with a new flow fd was
arriving before the response to the flow_req_arr. This is now moved to
the ipcp common source.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
| |
The flow allocator fa_alloc_resp would release the packet buffer (sdb)
before writing if the response was a failure. Also sets the IPCP
allocation timeout in nanoseconds as per the comment.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The state of the IPCP was set and checked in the main files, but it's
more convenient to do it in the common source.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
| |
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The common enrollment code between the unicast and broadcast IPCP
included the same C source from a source file in the unicast and
broadcast directories. Now it's handled by defining COMMON_SOURCES for
the unicast and broadcast IPCP.
For now, only the enrollment component is common. Two things are
needed for the connection manager:
* Routing to be fixed to use a supporting broadcast layer. Then
management flows can be removed from the unicast IPCP (as
they are in fact data transfer flows of the broadcast layer
that supports the routing dissemination traffic).
* DHT to enroll as part of IPCP enrollment. Now it enrolls when
a data transfer flow is established to be more akin to how
Kademlia nodes join a Kademlia DHT, but this should be
revised to adhere more to O7s enrollment concepts.
After that, the connection manager code will also be completely shared
between the unicast and broadcast layer and the connmgr will also be
common code.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The enrollment messages now have a 64-bit ID to easier track
enrollments in the logs in larger scale tests.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the log_xxx_id() macros to print a logline prefixed with a
64-bit identifier in hex format, for instance:
[2a92d78c2f52b76a] Hello ouroboros!
The ID is assumed to be 8 bytes in big endian format (it uses the
HASH_FMT functions and hashes are stored in big endian byte arrays).
The implementation uses the compiler-specific '##' operator to allow
empty variadics. E.g.
func(arg , ## __VA_ARGS__);
will eat the comma if __VA_ARGS__ is empty and thus allow
func(arg);
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
| |
The code was a bit convoluted to print hashes as hex strings. Renamed
to HASH_FMT32 and HASH_VAL32 to make clear we are printing the first
32 bits only, and added options to print 64 up to 512 bits as well.
This doesn't depend on endianness anymore. Adds a small test for the
hash (printing) functions.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
If there was an error reading the configuration file, the IRMd would
shutdown, but still return EXIT_SUCCESS instead of EXIT_FAILURE.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
Seems like all shared memory objects were truncated to a size that
came up a byte short.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
The IRMd will now check the lockfile before initializing any other
internals.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
Off-by-one error in lockfile file length. Refactor to reduce code
duplication.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
Compilation on raspberry pi revealed some previously undetected
signed/unsigned comparisons in the library.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compatibility with versions of CMake older than 3.5 is deprecated from
CMake 3.27 onwards, and will be removed from a future version. Calls
to cmake_minimum_required() or cmake_policy() that set the policy
version to an older value now issue a deprecation diagnostic.
Fixed by indicating a max tested value for cmake_minimum_required().
Changed linking with OpenSSL to link with libcrypto only, we don't
require libssl.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
|
| |
These functions were too complex. This splits off the creation of the
info messages for each ipcp/name.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|
|
|
|
|
|
|
| |
Found by GCC static analyzer.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
|