summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* dev: Split nonblocking read and writeDimitri Staessens2017-10-301-1/+4
| | | | | | | | | | The FLOWFNONBLOCK flag now has two subflags FLOWFRNOBLOCK and FLOWFWNOBLOCK which allows setting the behavior of read and write independently. The default behavior is unchanged (blocking read and write). 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-143-7/+4
| | | | | | | | | | | | | | 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.
* lib: Cancel tpm threads instead of marking exitdimitri staessens2017-09-301-4/+0
| | | | | | | | | 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: normal: Add Loop-Free Alternates routingSander Vrijders2017-09-291-1/+2
| | | | | | This adds the Loop-Free Alternates (LFA) policy. In case a link goes down a LFA may be selected to route the SDUs on without causing loops instead of the main hop that just went down.
* ipcpd: Add threadpool manager to DHTdimitri staessens2017-09-241-10/+13
| | | | | | | | | | | 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.
* lib: Clean up bitmap implementationdimitri staessens2017-09-231-5/+5
| | | | | | There was a return -1 in the allocate call which is unsafe since -1 may be a valid id in the bitmap. Since it's a data structure for internal use, I replaced the NULL checks with assertions.
* ipcpd: normal: Add alternate hop PFFSander Vrijders2017-09-212-6/+10
| | | | | This adds a PFF that returns an alternate hop as next hop in case the hop that would have been returned is down.
* ipcpd: normal: Make PFF policy-basedSander Vrijders2017-09-201-0/+5
| | | | | This turns the PDU Forwarding Function of the IPCP into a policy. For now only the simple PFF policy is available.
* ipcpd: Enroll DHT when creating dt connectiondimitri staessens2017-09-191-2/+4
| | | | | | | | | The DHT will now enroll or sync when a data transfer connection is added. This avoids the need to create a temporary data transfer connection during enrollment (and speeds it up considerably). The notifier system was modified to take an opaque pointer to the object that registers as a parameter.
* ipcpd, lib: Add flow down eventsSander Vrijders2017-09-193-2/+12
| | | | | | | | This adds the flow down event to Ouroboros. In the shim-eth-llc, a netlink socket is opened which listens to device up/down events. For each event the flow is then adjusted with fccntl to notify the user the flow is down or back up again. In the normal IPCP an event is thrown if a write reports that the flow is down.
* lib: Provide RIB API to export internals via fusedimitri staessens2017-09-181-0/+46
| | | | | | | 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.
* lib: Add reordering queue to FRCTSander Vrijders2017-09-151-0/+47
| | | | | This adds a reordering queue to FRCT so that SDUs can be delivered in-order when requested.
* build: Fix DDNS tool detection for shim-udpdimitri staessens2017-09-131-3/+5
| | | | | | This fixes output when detecting DDNS tools and homogenizes output and the APIs used to pass variables between the build system and the sources. Fixes some minor issues and typos).
* ipcpd: Revise internals of normal IPCPdimitri staessens2017-09-126-265/+12
| | | | | | | | This removes the RIB as a datastructure and CDAP as the protocol between IPCPs. CDAP, the rib and related sources are deprecated. The link-state protocol policy is udpated to use its own protocol based on a simple broadcast strategy along a tree. The neighbors struct is deprecated and moved to the library as a generic notifier component.
* lib: Add fccntl configuration commanddimitri staessens2017-08-317-78/+79
| | | | | | | This replaces the flow_set_* commands with a single fccntl command that can configure flows and the FRCT instance. For more details, see "man 3 fccntl".
* irmd: Fix deleting corrupt shm fileSander Vrijders2017-08-291-0/+2
| | | | | This will delete the rdrbuff also when it has been corrupted before. Otherwise the irmd won't start, as experienced on my desktop.
* dev: Revise fqueue API and add man pagesdimitri staessens2017-08-291-16/+16
|
* Merged in dstaesse/ouroboros/be-deprecate-gam (pull request #572)dimitri staessens2017-08-283-14/+21
|\ | | | | | | Be deprecate gam
| * tools: Add tool to connect IPCP componentsdimitri staessens2017-08-282-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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-281-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add configuration message to FRCTSander Vrijders2017-08-261-0/+6
|/ | | | | This adds the configuration message to FRCT, which allows for configuring the connection.
* lib: Fix CRC check and add frct_clearSander Vrijders2017-08-221-0/+2
| | | | | | This adds the CRC check by default on outgoing SDUs. It fixes some errors in the serialization and deserialization of the SDU. frct_clear was added to avoid bad initialization of the array of FRCT instances.
* lib: Make timerwheel a passive componentSander Vrijders2017-08-221-0/+2
| | | | | | This turns the timerwheel into a passive component since it is used by application using the library. The user of the timerwheel now has to call timerwheel_move to advance the timerwheel.
* build: Revise the build systemdimitri staessens2017-08-214-133/+19
| | | | | | | | | | 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.
* lib: Add basic FRCT mechanismsSander Vrijders2017-08-175-3/+123
| | | | | | | | | | 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-171-1/+10
| | | | | This adds support reading Ethernet frames using the Berkeley Packet Filter (BPF). Ouroboros now fully runs on OS X Sierra.
* build: Replace fsf snail mail with contact URLdimitri staessens2017-08-1340-80/+40
|
* build: Fix compilation on OS X Sierradimitri staessens2017-08-113-25/+3
|
* lib, ipcpd, tools: Fix enum assignmentsSander Vrijders2017-08-101-2/+2
| | | | This fixes several assignments to the wrong enum type.
* build, lib, ipcpd, irmd: Add support for libgcryptdimitri staessens2017-08-093-14/+34
| | | | | | | | | | | | | | | | 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: Specify timeout per commandDimitri Staessens2017-08-051-2/+5
| | | | | | | The commands towards the IPCPs have different time requirements, but the irmd had only a single timeout value to wait for a response. This commit allows setting different timeouts for the IRMd based on the command, configurable globally.
* build: Add check for robust mutexesSander Vrijders2017-08-032-1/+2
| | | | | | 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-012-5/+5
| | | | | This refactors dev.c to have a common function called init_flow that is called whenever a flow is allocated in dev.c
* ipcpd: Add multithreading to schedulerdimitri staessens2017-07-291-1/+1
| | | | | | | | 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.
* lib: Add threadpool managerdimitri staessens2017-07-262-8/+51
| | | | | | | | 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.
* ipcpd: Add DHT as directory in normal IPCPdimitri staessens2017-07-181-2/+3
| | | | | | | | | This implements a Distributed Hash Table (DHT) based on the Kademlia protocol, with default parameters set as used in the BitTorrent Mainline DHT. This initial implementation is almost feature complete, except for some things to be done after a testing period: caching and stale peer bumping, and setting the expiration timeout via the IRM tool.
* ipcpd, lib, irmd: Hardcode shim hash algorithmsSander Vrijders2017-07-121-2/+5
| | | | | | | 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-1/+3
|
* include: Use offsetof in list.hdimitri staessens2017-07-121-1/+2
|
* include: Fix formatting in list.hdimitri staessens2017-07-092-11/+14
|
* lib: Add secure random generatordimitri staessens2017-07-091-0/+32
| | | | | This adds a secure random number generator. It will use OS specific calls with a fallback to OpenSSL if available.
* lib, ipcpd, irmd: Add full-fledged QoSSander Vrijders2017-06-214-12/+28
| | | | | | | This adds more Quality of Service support to Ouroboros. One part is the network specific characteristics such as bandwidth, delay, ... The other part is end-to-end QoS like reliability, window based flow control, ...
* include: Fix macro for printing hashdimitri staessens2017-06-042-5/+12
|
* build: Fix bad if checkSander Vrijders2017-05-181-2/+1
| | | | This fixes a bad if check for the version of cmake.
* Merged in sandervrijders/ouroboros/be-swig (pull request #507)Sander Vrijders2017-05-181-1/+11
|\ | | | | | | build: Fix deprecation warning
| * build: Fix deprecation warningSander Vrijders2017-05-161-1/+11
| | | | | | | | | | | | This fixes a deprecation warning for CMake 3.8 and higher. swig_add_module has been deprecated in favor of swig_add_library.
* | ipcpd: normal: Make routing a policySander Vrijders2017-05-151-0/+5
|/ | | | | | This makes the routing component into a policy since different approaches may exist to do this, depending on how high the rank of the DIF is.
* ipcpd: Allow specifying fixed syntaxdimitri staessens2017-05-155-26/+62
| | | | | | 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.
* ipcpd: Remove FRCT from normal IPCPdimitri staessens2017-05-101-0/+1
| | | | | | | In order to ensure 100% reliable transfer, the protocol state machine that takes care of retransmission and SDU ordering has to be in the application. Flow allocation in the normal now uses fds. The PDU_type field was deprecated and AE's within the DIF can use reserved fds.
* ipcpd: Add capability reportingdimitri staessens2017-04-271-0/+8
| | | | | | | | 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