summaryrefslogtreecommitdiff
path: root/src/ipcpd
Commit message (Collapse)AuthorAgeFilesLines
...
| * ipcpd: Shutdown DHT work thread first at destroydimitri staessens2017-09-071-6/+4
| | | | | | | | This prevents a potential deadlock on the wrlock.
* | ipcpd: Fix double finalization after some failuresdimitri staessens2017-09-071-5/+4
|/ | | | | When enroll or bootstrap failed, finalize_components could be called twice, resulting in double frees or use-after-free.
* ipcpd: normal: Avoid redefining a typedefSander Vrijders2017-09-061-2/+1
| | | | | This avoids a redefinition of a typedef which is a C11 feature, and thus not supported by clang when the c89 switch is enabled.
* ipcpd: normal: Simplify enroll APISander Vrijders2017-09-015-12/+10
| | | | | | | This will remove the dst parameter from enroll_boot, since it was only being used in logging. It also turns some other debug logs into info logs, and makes the component names as they are used in logs all lowercase.
* ipcpd: Add check if name was already registeredSander Vrijders2017-08-305-31/+20
| | | | | This adds a check in the shims if a name was already registered, since it should not return an error.
* ipcpd: Fix thread leaks in normal IPCPdimitri staessens2017-08-292-2/+2
|
* ipcpd: Fix missing unlock in dhtdimitri staessens2017-08-291-1/+2
|
* Merged in sandervrijders/ouroboros/be-dir-query (pull request #576)Sander Vrijders2017-08-293-61/+87
|\ | | | | | | shim-eth-llc: Hide directory query locking
| * shim-eth-llc: Hide directory query lockingSander Vrijders2017-08-293-61/+87
| | | | | | | | | | | | | | The locking of the directory queries was happening in the shim-eth-llc, but it should be done within the shim-data functions. Fixes #30
* | Merged in dstaesse/ouroboros/be-dht (pull request #577)dimitri staessens2017-08-291-16/+23
|\ \ | | | | | | | | | ipcpd: Fix state in dht lookup at lookup_wait
| * | ipcpd: Fix state in dht lookup at lookup_waitdimitri staessens2017-08-291-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merged in sandervrijders/ouroboros/be-fix-authors (pull request #575)Sander Vrijders2017-08-295-10/+10
|\ \ \ | |/ / |/| | | | | lib, ipcpd: Fix e-mail addresses in protobuf files
| * | lib, ipcpd: Fix e-mail addresses in protobuf filesSander Vrijders2017-08-295-10/+10
| |/ | | | | | | This fixes the wrong e-mail addresses in the protobuf files.
* / dev: Revise fqueue API and add man pagesdimitri staessens2017-08-294-38/+35
|/
* lib, ipcpd, irmd: Fix bugs reported by static analysisSander Vrijders2017-08-294-9/+11
| | | | This fixes several bugs as reported by the clang static analyzer.
* ipcpd: Address comments on 176698edimitri staessens2017-08-285-10/+4
|
* tools: Add tool to connect IPCP componentsdimitri staessens2017-08-2812-33/+178
| | | | | | | | | | | | 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.
* ipcpd: Deprecate gam as autonomous componentdimitri staessens2017-08-2833-1272/+856
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The graph adjacency manager has been deprecated in favor of providing an external interface into the connectivity manager so that adjacencies can be controlled from the command line, user scripts or user applications. The gam and its associated policies were removed from the normal IPCP and the IRM configuration tools. The "/members" part of the RIB was deprecated. Removal of the gam means that initial connectivity based on changes in the RIB can't be provided, so some changes were required throughout the normal IPCP. The enrollment procedure was revised to establish its own connectivity. First, it gets boot information from a peer by establishing a connection to the remote enrollment component and downloading the IPCP configuratoin. This is now done using its own protocol buffers message in anticipation of deprecation of the RIB and CDAP for communication within a DIF. After the boot information is downloaded, it establishes a data transfer flow for enrolling the directory (DHT). After the DHT has enrolled, it signals the peer to that enrollment is done, and the data transfer connection is torn down. Signaling connections is done via the nbs struct, which is now passed to the connmgr, which enables control of the connectivity graph from external sources.
* lib, ipcpd, irmd: Fix several memleaksSander Vrijders2017-08-233-4/+6
| | | | | This fixes several memleaks as reported by valgrind. It also fixes some calls to close() with -1.
* ipcpd: shim-eth-llc: Fix building LLC shimSander Vrijders2017-08-232-3/+6
| | | | | | | The LLC shim was not being built even though it should be build. This is due to CMake behaviour that when you set a var in the parent scope, it is not set in the local scope. It also adds back THIS_TYPE to the shim-eth-llc.
* ipcpd: Fix data race in connmgrdimitri staessens2017-08-221-0/+5
| | | | The removal of the mutex and signal in 198b709 was a mistake.
* ipcpd: Improve locking in connmgrdimitri staessens2017-08-223-66/+93
|
* Merged in dstaesse/ouroboros/be-build (pull request #557)dimitri staessens2017-08-2136-292/+294
|\ | | | | | | build: Revise the build system
| * build: Revise the build systemdimitri staessens2017-08-2136-292/+294
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'testing' into beSander Vrijders2017-08-201-3/+2
|\ \ | |/ |/|
| * ipcpd, irmd: Fix data racesdimitri staessens2017-08-191-3/+2
| | | | | | | | | | | | 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.
* | lib: Add basic FRCT mechanismsSander Vrijders2017-08-175-547/+0
|/ | | | | | | | | | This adds the basic FRCT mechanisms to the library. Upon flow alloc or accept an FRCT instance is now created and used when reading or writing to the flow. The timerwheel has been refactored to allow recharging timers and removing them and is now part of the library. The first SDU sent over the connection has the DRF set and this initializes the connection. Sender and receiver inactivity timers are added.
* ipcpd: Support Berkeley Packet Filter in LLC shimdimitri staessens2017-08-173-147/+250
| | | | | This adds support reading Ethernet frames using the Berkeley Packet Filter (BPF). Ouroboros now fully runs on OS X Sierra.
* irmd, ipcpd: Signal acceptor onlydimitri staessens2017-08-162-2/+11
| | | | | This adds an extra condvar so the mainloops can signal the acceptor thread without waking up all mainloops.
* ipcpd: Fix missing clock_gettime in flow allocatordimitri staessens2017-08-161-0/+2
|
* ipcpd: Refactor normal IPCP failure handlingdimitri staessens2017-08-161-35/+24
|
* irmd, ipcpd: Listen on a dedicated accept() threaddimitri staessens2017-08-162-61/+146
| | | | | | | | | | | 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-1362-65/+62
|
* Merged in dstaesse/ouroboros/be-tpm (pull request #550)dimitri staessens2017-08-131-7/+28
|\ | | | | | | lib: Fix instability in threadpool manager
| * ipcpd: Fix tracking of outstanding DHT requestsdimitri staessens2017-08-131-7/+28
| | | | | | | | | | | | The DHT failed when receiving multiple responses in a short timeframe. The lookup struct now keeps track of the number of outstanding requests.
* | build: Fix compilation on OS X Sierradimitri staessens2017-08-112-1/+5
|/
* lib, ipcpd, tools: Fix enum assignmentsSander Vrijders2017-08-102-6/+1
| | | | This fixes several assignments to the wrong enum type.
* build, lib, ipcpd, irmd: Add support for libgcryptdimitri staessens2017-08-093-14/+46
| | | | | | | | | | | | | | | | 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.
* ipcpd: Fix assignment of fd's in flow allocatorDimitri Staessens2017-08-081-2/+4
|
* ipcpd: Fix finding values in DHTDimitri Staessens2017-08-051-5/+18
| | | | | | | | | The DHT lookup would stop if a node returned no new useful information (i.e. the value for the key or unknown nodes closer to the key) without waiting for other pending requests that could still return useful information. Now it correctly tracks the number of outstanding requests or returns if it doesn't get a response for KAD_T_RESP seconds. This fixes multi-hop flow allocation over the normal.
* Merge branch 'testing' into beSander Vrijders2017-08-041-1/+1
|\
| * ipcpd: Fix missing space in shim-eth-llcdimitri staessens2017-08-041-1/+1
| |
* | Merge branch 'testing' into beSander Vrijders2017-08-034-16/+54
|\|
| * ipcpd: Fix pthread_cond_timedwait deadlinesdimitri staessens2017-08-034-16/+54
| | | | | | | | | | | | This fixes pthread_condtimedwaits in the flow allocator of all IPCPs that had bad deadlines set (the interval instead of the actual absolute time).
* | build: Add check for robust mutexesSander Vrijders2017-08-031-1/+1
| | | | | | | | | | | | This adds a check for robust mutexes. The constant HAVE_ROBUST_MUTEX is set accordingly in config.h. It also adds some other fixes to make the prototype compile on the Hurd.
* | lib: Simplify initializing flowsSander Vrijders2017-08-011-1/+3
| | | | | | | | | | This refactors dev.c to have a common function called init_flow that is called whenever a flow is allocated in dev.c
* | ipcpd: Fix registration bug in DHTdimitri staessens2017-07-291-2/+2
| |
* | ipcpd: Add multithreading to schedulerdimitri staessens2017-07-291-25/+43
| | | | | | | | | | | | | | | | The scheduler in the normal IPCP is now multithreaded. While useful in itself for scalability, it currently solves thread starvation in case of executing post_sdu operations that may require a response. This could be further revised in the future to split the SDU handling threads from the component tasks.
* | ipcpd: Cleanup sdb after unpackeddimitri staessens2017-07-291-6/+3
| |
* | ipcpd: Harmonize logs in directorydimitri staessens2017-07-291-1/+5
| |