summaryrefslogtreecommitdiff
path: root/src/irmd
Commit message (Collapse)AuthorAgeFilesLines
...
* irmd: Remove obsolete layer to name mappingsDimitri Staessens2018-03-213-112/+0
| | | | | | | | The IRMd kept a mapping from layer names to registered names, but this is obsolete since the introduction of the query functionality. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add IPCP over DIX EthernetDimitri Staessens2018-03-102-0/+4
| | | | | | | | | | | | | | | | | | This adds an IPC Process that uses DIX Ethernet with an Ethertype that is configurable at bootstrap. This allows parallel DIX layers over the same Ethernet network with different Ethertypes (and one LLC layer). It allows jumbo frames in the future, and should avoid the problems we have with some routers not handling LLC traffic very well. The destination endpoint ID is sent as a 16 bit integer, so the maximum payload is 1498 bytes in standard Ethernet, and 8998 bytes when Jumbo frames are used. The implementation is very similar to the Ethernet LLC IPCP, so it is implemented using preprocessor macros in the single source instead of duplicating code. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Cleanup flow datastructures on exit0.10.3Dimitri Staessens2018-02-241-5/+12
| | | | | | | | | The irmd was not cleaning up non-deallocated flows upon exit. This bug was probably introduced with the introduction of the threadpool managers. Also fixes a missing rwlock_destroy(). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Remove dead variable assignmentsSander Vrijders2018-02-241-2/+0
| | | | | | | | This removes two useless variable assignments from the IRMd, which were remnants from when the pending flow was being deallocated. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* irmd: Replace fork and execv with posix_spawnSander Vrijders2018-02-232-28/+16
| | | | | | | | | This replaces the fork and execv calls with posix_spawn since it is supported on more platforms, and is more efficient. Also fixes some bad indentation. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Revise Data Transfer component0.10.0Dimitri Staessens2018-02-135-97/+97
| | | | | | | | | | | This makes the TTL non-optional and allows the maximum (initial) value of the TTL to be specified at bootstrap (the default is set to 60). The fd in the DT PCI is now called EID (Endpoint ID). The names "dif" and "ae" have been replaced by "layer" and "component" respectively in all sources. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Use GNUInstallDirs instead of hardcoded values0.9.9Sander Vrijders2018-02-061-1/+1
| | | | | | | | This changes the build to use GNUInstallDirs instead of hardcoded values. Package maintainers can then override these defaults by passing the correct value to cmake on the command line. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Fix lookup of program for autoexecution0.9.8Dimitri Staessens2018-02-051-2/+2
| | | | | | | | Autoexecution failed because the lookup for the program was for the wrong field of the progtable. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* include: Add version header0.9.0Dimitri Staessens2018-01-102-4/+1
| | | | | | | | This moves the version definition for Ouroboros into its own header file, which is generated by CMake and installed on the system. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Add patchlevel to versionDimitri Staessens2018-01-102-2/+4
| | | | | | | This adds a patchlevel to the Ouroboros version. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* include, src: Update copyright to 2018Dimitri Staessens2018-01-0914-14/+14
| | | | | | | Happy New Year, Ouroboros. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Use the term "layer" and deprecate "shim"Dimitri Staessens2017-12-194-10/+10
| | | | | | | | | | | | | | This changes the terminology to use layer instead of DIF and deprecate the word "shim" for the IPCPs that attach to Ethernet LLC and UDP .The terminology has not yet been changed in the variable names etc. This reflects the design choices in Ouroboros to make IPCPs pure resource allocators instead of also providing an "IPC service". The Ouroboros IPCPs that attach to Ethernet and UDP implement the allocator and are thus not really shims. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Integrate raptor into ouroboros 0.8Dimitri Staessens2017-12-152-0/+4
| | | | | | | | | | | The raptor code is refactored to completely remove reduntant code relating to addresses. The dependency on the google protocol buffers is removed. The build system will only build raptor if the relevant kernel module is found on the system. The irm tool and the relevant documentation are updated. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib, tools: Rename application process and instanceDimitri Staessens2017-12-0214-697/+707
| | | | | | | | | | | This refactors ouroboros to use "program" instead of "application process" and "process" instead of "application process instance" to align with current naming in current Operating Systems courses instead of the ISO nomenclature adopted by RINA. This change permeates through the entire implementation. Also contains some minor other refactors. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Don't read commands under lockDimitri Staessens2017-11-301-3/+3
| | | | | | | | | The commands were read under a mutex. Since the cmd struct was just malloc'd, this is not needed. Also fixes closing the socket if the malloc fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Set correct clock for irm_flow condvarDimitri Staessens2017-11-291-21/+31
| | | | | | | | | The irm_flow condition variable was not initialized to the correct clock, resulting in bad timedwaits when a flow was allocated with a timeout. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd, irmd: Bugfix for failed accept() callsDimitri Staessens2017-11-291-3/+0
| | | | | | | | | The ipcp will not have the rx_rb set for a pending flow, so it should not call shm_rbuff_fini. The irmd should not call ipcp_flow_dealloc for flows that are still pending flow allocation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Fix false alarm when registering before bindDimitri Staessens2017-11-271-1/+1
| | | | | | | | When registering a name in a dif before binding a program to it without auto, the IRMd would erroneously log that the binding failed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Add options for debug builds with sanitizerDimitri Staessens2017-11-141-2/+2
| | | | | | | | | This adds three build types, DebugASan, DebugTSan and DebugLSan that enable the Address, Thread and Leak Sanitizer by setting the fsanitize flag to the compiler. This option is supported by both gcc and clang. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Don't access entry after unlockDimitri Staessens2017-11-141-1/+1
| | | | | | | | When bootstrapping an IPCP entry->api variable was accessed after the registry was unlocked for printing and info message. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Deprecate ouroboros_init and ourboros_finidimitri staessens2017-10-142-2/+1
| | | | | | | | | | | | | | This commit deprecates ouroboros_init and ouroboros_fini and adds them as a constructor or destructor, causing these function to be run automatically when a program that links to the library calls and exits main(). For this to fully work, the library had to be split so that we can avoid the irmd calling these functions (the IRMd has to create the shm structures on which these calls depend). The library is split in 3 parts: libouroboros-dev, libouroboros-irm and libouroboros-common. The latter is linked to the other two so that including libouroboros-dev or libouroboros-irm will also link libouroboros-common.
* irmd: Add option to print versiondimitri staessens2017-10-062-27/+37
| | | | | | | | | This adds the --version option to the IRMd. With this option it will print the version of Ouroboros to stdout and exit. Checking the version does not require root privileges. Also fixes calling log functions before log_init() and after log_fini().
* irmd: Don't destroy flows before IPCPsdimitri staessens2017-10-041-22/+1
| | | | | | This allows the IPCPs to call ouroboros_fini() and clean up their buffers and drastically reduce chances of getting an assertion error that some rbuffs are not empty when shutting down the irmd.
* lib: Cancel tpm threads instead of marking exitdimitri staessens2017-09-305-132/+146
| | | | | | | | | This makes the threadpool use pthread_cancel instead of setting an exit flag that threadpool managed threads check periodically. This drastically reduces CPU consumption in the irmd when running a lot of applications. It requires cancellation handlers in the ipcp and irmd to be implemented to ensure safe cancellation during operation and shutdown.
* ipcpd: Add threadpool manager to DHTdimitri staessens2017-09-241-49/+55
| | | | | | | | | | | This adds a threadpool manager to the DHT. This was needed because the detached thread could cause a data race on shutdown. The threadpool manager is revised to allow multiple instances in a single program. The irmd and ipcp now store commands in a buffer (list) instead of a single buffer before passing it to handler threads.
* irmd: Init libgcrypt before using itdimitri staessens2017-09-202-0/+18
|
* lib: Provide RIB API to export internals via fusedimitri staessens2017-09-182-1/+16
| | | | | | | This adds a virtual RIB that is accessible as a filesystem that is accessed through a fuse mountpoint (configurable , default is /tmp/ouroboros). Currently, each IPCP will export its link state database.
* irmd: Add specific timeout for IPCP connectSander Vrijders2017-08-303-0/+7
| | | | | | This adds a specific timeout for IPCP connect, since it may take a lot longer than the regular socket timeout due to flow allocations in the IPCP.
* Merged in sandervrijders/ouroboros/be-corrupt (pull request #581)Sander Vrijders2017-08-291-1/+1
|\ | | | | | | Be corrupt
| * irmd: Fix deleting corrupt shm fileSander Vrijders2017-08-291-1/+1
| | | | | | | | | | This will delete the rdrbuff also when it has been corrupted before. Otherwise the irmd won't start, as experienced on my desktop.
* | irmd: Remove temporary debugging logsdimitri staessens2017-08-291-4/+1
|/
* ipcpd: Fix state in dht lookup at lookup_waitdimitri staessens2017-08-291-24/+48
| | | | | | | | | | | The correct state was returned but not set internally in the lookup_struct, causing lookup_wait to return a lookup in LU_PENDING if the wait timedout. This also unlocks the IRMd during register calls and fixes some cleanup if lookup_wait gets interrupted. Fixes #48
* lib, ipcpd, irmd: Fix bugs reported by static analysisSander Vrijders2017-08-292-19/+42
| | | | This fixes several bugs as reported by the clang static analyzer.
* tools: Add tool to connect IPCP componentsdimitri staessens2017-08-283-0/+151
| | | | | | | | | | | | This enables user-written tools to instruct IPCPs to establish and tear down connections (a.k.a. adjacencies) between its internal components (Management and Data Transfer). For more info, do "irm ipcp connect" or "irm ipcp disconnect" on the command line. This commit exposes a deletion bug in the RIB where FSO's fail to unpack/parse. This will be fixed when the RIB is deprecated.
* irmd: Don't warn on failed write to terminated IPCPdimitri staessens2017-08-251-1/+2
|
* lib, ipcpd, irmd: Fix several memleaksSander Vrijders2017-08-231-4/+2
| | | | | This fixes several memleaks as reported by valgrind. It also fixes some calls to close() with -1.
* Merge branch 'testing' into beSander Vrijders2017-08-231-3/+5
|\
| * irmd: Fix potential data race in irmdSander Vrijders2017-08-231-3/+5
| | | | | | | | | | If the IPCP was not created, the printing of the log may use a variable that was already freed.
* | lib, irmd: Use static buffer for messagesdimitri staessens2017-08-221-17/+9
| |
* | Merged in dstaesse/ouroboros/be-build (pull request #557)dimitri staessens2017-08-219-8/+92
|\ \ | |/ |/| | | build: Revise the build system
| * build: Revise the build systemdimitri staessens2017-08-219-8/+92
| | | | | | | | | | | | | | | | | | | | This revises the build system to have configuration per system component. System settings can now be set using cmake. The standard compliance defines were removed from configuration header and are set in the sources where needed. Also some small code refactors, such as moving the data for shims out of the ipcp structure to the respective shims were performed.
* | ipcpd, irmd: Fix data racesdimitri staessens2017-08-191-16/+32
|/ | | | | | Fixes a data race in the IRMd when IPCPs bail immediately after being created (e.g. due to an error). Fixes a race between the acceptor threads and the threads managed by threadpool manager upon shutdown.
* irmd: Handle IPCP creation fails gracefullydimitri staessens2017-08-172-35/+52
|
* irmd, ipcpd: Signal acceptor onlydimitri staessens2017-08-161-3/+13
| | | | | This adds an extra condvar so the mainloops can signal the acceptor thread without waking up all mainloops.
* irmd, ipcpd: Listen on a dedicated accept() threaddimitri staessens2017-08-161-70/+177
| | | | | | | | | | | The IRMd and IPCPs will now call accept on their command sockets from a single thread that will dispatch work to the other threads. This solves a problem on OS X and FreeBSD where accept() doesn't time out when setting SO_RCVTIMEO on the socket. Calling kqueue or select() on that socket to wait for events before calling accept() didn't solve it since select() or kqueue() might wake up multiple threads, with the non-working threads again blocked on the accept() on shutdown.
* build: Replace fsf snail mail with contact URLdimitri staessens2017-08-1313-13/+13
|
* irmd: Fix mainloop timeout on OS Xdimitri staessens2017-08-111-2/+2
|
* build, lib, ipcpd, irmd: Add support for libgcryptdimitri staessens2017-08-093-25/+27
| | | | | | | | | | | | | | | | This adds support for libgcrypt. If at least version 1.7.0 of libgcrypt is present, it may be used for secure random number generation and is used for hashing in the irmd/ipcp. The hash definitions are moved to the internal hash.h header, and defined independently of the hashes that are defined as part of the directory policy for the normal IPCP. The translation is moved from the IRMd to ipcpd/ipcp.h. The bootstrap call from the IRMd expects the IPCP to return the correct hash algorithm with a dif_info struct, which is in line with the behavior of the enroll call. This also improves how some platform checks in the build system are handled.
* irmd: Don't self-query an IPCPDimitri Staessens2017-08-051-4/+5
| | | | | | Upon flow_allocation, the IRMd queries IPCPs for the destination name. After this commit, when an IPCP allocates a flow, the IRMd won't query that IPCP.
* irmd: Don't call ipcp_flow_dealloc under lockDimitri Staessens2017-08-051-3/+13
| | | | | | | | | | When a process was killed, ipcp_flow_dealloc was called under a lock, causing a deadlock in the IRMd because handling the IPCP response also needs to take the same lock (the IPCP calls flow_dealloc to finalize this). This deadlock also resulted in the IPCP always reporting that it failed to send a reply message as the deadlock effectively blocks the IRMd until its socket timeout expired and thus the IPCP was always responding to an already closed socket.