summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
Commit message (Collapse)AuthorAgeFilesLines
* build, lib, ipcpd, irmd: Add support for libgcryptdimitri staessens2017-08-091-21/+8
| | | | | | | | | | | | | | | | 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.
* Merge branch 'testing' into beSander Vrijders2017-08-041-8/+16
|\
| * irmd: Release lock before ipcp_querydimitri staessens2017-08-041-8/+16
| | | | | | | | | | | | The blocking ipcp_query call was called under reg_lock, causing flow_allocs over the shim-eth-llc to block the irmd for prolonged timespans.
* | lib: Add threadpool managerdimitri staessens2017-07-261-183/+26
| | | | | | | | | | | | | | | | This adds a threadpool manager component in the library that is used in the IRMd and IPCPs. The threadpool manager now doesn't detach threads but does a join when they exit. This solves a data race in the previous implementation where some threads were not completely finished upon release of some resources.
* | irmd: Fix order of IPCPsSander Vrijders2017-07-181-1/+1
|/ | | | | This fixes the order of the IPCPs in the IRMd, so that the right type is queried first on flow allocation.
* ipcpd, lib, irmd: Hardcode shim hash algorithmsSander Vrijders2017-07-121-2/+16
| | | | | | | This will hardcode the shim hash algorithms as they don't have an enrollment phase. Fixes #44
* irmd: Shutdown sanitizer without cancellationdimitri staessens2017-07-121-6/+3
|
* Merged in dstaesse/ouroboros/be-macro (pull request #514)dimitri staessens2017-06-051-1/+1
|\ | | | | | | include: Fix macro for printing hash
| * include: Fix macro for printing hashdimitri staessens2017-06-041-1/+1
| |
* | lib, irmd: Handle case fallthrough in gcc 7dimitri staessens2017-06-041-0/+1
|/
* ipcpd: Allow specifying fixed syntaxdimitri staessens2017-05-151-4/+4
| | | | | | This commits adds the functions and messages to specify a fixed protocol syntax during CACEP. It also revises the messages for specifying the DT protocol syntax from the irm tool.
* irmd: Fix unbinding AP and AP-Is from a namedimitri staessens2017-05-091-2/+14
| | | | | | | APs and AP-Is were not removed from the registry entry for that name. Reported by: [email protected] Tested by: [email protected]
* irmd: Remove some debug logsdimitri staessens2017-04-281-6/+0
|
* ipcpd: Add capability reportingdimitri staessens2017-04-271-27/+37
| | | | | | | | The IPCP will now report the DIF name and the hash value to the IRMd as a dif_info struct. This can later be extended to add further capability reporting. Some bugfixes in normal. Fixes #24
* Merged in dstaesse/ouroboros/be-hashing (pull request #484)dimitri staessens2017-04-161-20/+23
|\ | | | | | | Be hashing
| * ipcpd: Allow specifying the hash algorithm to usedimitri staessens2017-04-161-20/+23
| | | | | | | | Currently CRC32, MD5, and SHA3 (224, 256, 384 and 512 bit) are supported.
* | irmd, ipcpd: Include socket in select() for FreeBSDdimitri staessens2017-04-161-1/+1
|/ | | | Fixes #41
* include, lib: Rename ap_init/ap_finidimitri staessens2017-04-131-1/+1
| | | | Fixes #35
* Merged in dstaesse/ouroboros/be-hashes (pull request #479)dimitri staessens2017-04-131-74/+114
|\ | | | | | | lib, ipcpd, irmd: Register hash instead of name
| * lib, ipcpd, irmd: Register hash instead of namedimitri staessens2017-04-131-74/+114
| | | | | | | | | | | | | | | | | | All information passed over the IRMd/IPCP boundary for using IPC services (flow allocation, registration) is now hashed. This effectively fixes the shared namespace between DIFs and the IRMDs. This PR also fixes some API issues (adding const identifiers), shuffles the include headers a bit and some small bugs.
* | irmd: Fix mixed declarationdimitri staessens2017-04-111-2/+2
|/
* irmd: Remove unnecessary state locksdimitri staessens2017-04-061-207/+36
|
* irmd: Prevent impatient user deadlock on shutdowndimitri staessens2017-04-061-0/+18
|
* lib, irmd: Implement flow allocation timeoutdimitri staessens2017-04-061-67/+115
| | | | | | Setting the timeouts on flow_alloc and flow_accept will now work. This makes some changes to the UNIX sockets used for management communication between the APs, IRMd and IPCPs.
* irmd: Initialize in stack memorydimitri staessens2017-04-041-482/+485
|
* ipcpd, irmd: Fix cleanup of thread resourcesdimitri staessens2017-04-041-23/+17
|
* lib, irmd, ipcpd: Stabilize flow allocationdimitri staessens2017-04-041-27/+42
|
* irmd: Fix thread creation orderdimitri staessens2017-04-021-1/+1
|
* irmd: Add dynamic threadpooldimitri staessens2017-04-011-31/+196
| | | | | | | | | | | This makes the IRMd add/remove worker threads dynamically. IRMD_TPM_TIMEOUT sets a timer in the threadpool manager for checking idle threads. Each time this timer expires, it will reduce the threadpool by one. IRMD_MIN_AV_THREADS is the minimum number of available worker threads. If the number of active threads goes under this threshold, the threadpool manager will create threads to get the number of threads to IRMD_MAX_AV_THREADS, unless IRMD_MAX_THREADS is reached.
* irmd: Keep track of qos in irm_flowdimitri staessens2017-03-311-10/+6
| | | | This fixes the bug in handling multiple concurrent flow allocations.
* irmd: Fix assignment bugdimitri staessens2017-03-311-2/+2
|
* lib: Revise flow allocation APIdimitri staessens2017-03-311-145/+58
| | | | | | The flow_alloc_res and flow_alloc_resp calls have been removed. The flow_alloc and flow_accept calls are now both blocking and take an additional timeout argument.
* irmd: Exit blocking threads from irm_sanitizerdimitri staessens2017-03-291-21/+25
| | | | | | Some blocking calls caused mainloops to never exit. The irm_sanitizer will now clean up those structs before exiting. This will speed up regular exit and avoids non-cancelling threads.
* irmd: Set failed flows to FLOW_NULL before destroydimitri staessens2017-03-291-0/+1
|
* irmd: Fix some missing locksdimitri staessens2017-03-221-0/+3
|
* Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into beSander Vrijders2017-03-211-15/+6
|\
| * Change email addresses to ugent.beSander Vrijders2017-03-031-2/+2
| | | | | | | | | | | | | | Our mailserver was migrated from intec.ugent.be to the central ugent.be emailserver. This PR updates the header files to reflect this change as well. Some header files were also homogenized if the parameters within the functions were badly aligned.
| * lib: Remove application entity nameSander Vrijders2017-02-241-13/+4
| | | | | | | | | | The AE name should not be passed over the layer boundaries. If an application has more than one AE it should exchange this in CACEP.
* | Merge branch 'testing' into beSander Vrijders2017-03-211-1/+1
|\ \ | |/ |/|
| * irmd: Fix timeouts in reg_entrydimitri staessens2017-03-211-1/+1
| | | | | | | | | | This fixes bad timedwaits for the state of the reg_entry. Also slightly revised timedwaits throughout the prototype.
* | Merge branch 'testing' into beSander Vrijders2017-02-241-1/+1
|\|
| * irmd: Fix bug in name comparison of IPCPsdimitri staessens2017-02-241-1/+1
| |
* | Merge branch 'testing' into beSander Vrijders2017-02-231-3/+32
|\|
| * irmd: Check IPCP name when creating an IPCPdimitri staessens2017-02-231-3/+25
| |
| * irmd: Check IPCP type before bootstrapdimitri staessens2017-02-221-0/+7
| | | | | | | | | | This prevents assertion failures in the IPCP in some cases. IPCPs can now safely assert the type.
* | irmd: Fix detection of IRMddimitri staessens2017-02-211-22/+22
|/ | | | | | | When starting two IRMds, the second one exits, but applications can't contact the first because the second instance took the UNIX socket. Now the lockfile is checked for running IRMd instances before opening the UNIX socket.
* irmd: Fix bad lockdimitri staessens2017-02-161-4/+4
|
* irmd: Allow time for AP to call flow_accept()dimitri staessens2017-02-121-16/+29
| | | | | | | | When there is a burst of successive flow allocations for a certain name, each such request will block a thread in the IRMD for IRMD_REQ_ARR_TIMEOUT ms to allow the application some time to respond. This refactors some parts of the IRMd.