summaryrefslogtreecommitdiff
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* ouroboros: Correct license statementsdimitri staessens2016-12-2423-69/+46
| | | | | This corrects the license statements on all files. Installed headers are LGPLv2.1, the rest of the code is GPLv2.
* ipcpd, lib, irmd: Update to use qoscube_tdimitri staessens2016-12-241-5/+3
|
* ipcpd, lib: Refactor normal ipcp and cdapdimitri staessens2016-12-244-137/+615
| | | | | Refactors the normal IPCP fmgr and ribmgr, and modifies the API for cdap so that no callbacks are needed.
* lib, ipcpd: Add hashtable and PDU Forwarding FunctionSander Vrijders2016-12-214-0/+323
| | | | | | | This adds a hash table that takes 64-bit integers as key and uses separate chaining on collision. It also adds the PDU Forwarding Function, which the Flow Manager can use to lookup the fd towards the next hop. Routing policies will add/update/remove entries in the PFF.
* src, tools: Set/get timeout and get qos for flowsdimitri staessens2016-12-122-37/+155
| | | | | | | | | | | | | | | | Receiver timeouts can now be set on a flow using the flow_set_timeout function. Specifying NULL disables the timeout. The flow_get_timeout function gets the value for the timeout. This commit also deprecates fcntl in favor of flow_get_flags and flow_set_flags functions. struct qos_spec is typedef'd as a qosspec_t. The tools and cdap.c are updated to use the new API. Fixes a bug in operf client where the client's writer thread wouldn't cancel on SIGINT.
* lib: Fix indentation in shm_rdrbuff.cdimitri staessens2016-12-121-4/+4
|
* lib: Simplify shm_rbuff_read_bdimitri staessens2016-12-121-12/+6
|
* lib: Remove logs from stable sourcesdimitri staessens2016-12-035-273/+123
| | | | | This removes log output in applications and some size_t printf errors when compiling on 32 bit machines.
* lib, irmd: Ensure rbuffs are empty upon destructiondimitri staessens2016-11-301-2/+8
| | | | Also cleans up the flow_set if an AP-I dies abruptly.
* ipcpd, lib: Fix timerwheel issues / time_utilsdimitri staessens2016-11-251-2/+2
| | | | | | | Timerwheel would skip some additions due to a missed wakeup signal. Addition of timespecs and timevals in the time utilities would overflow tv_nsec/tv_usec if the sum is an integer number of seconds.
* lib: Deprecate shm_rbuff_resetdimitri staessens2016-11-251-10/+0
|
* ipcpd, lib: Add syntax version to protobuf filesSander Vrijders2016-11-224-2/+80
| | | | | | This adds a syntax version to the protobuf files. The latest version of protobuf otherwise complains that it is missing. The GPL license is also added on files where it was missing.
* lib: Remove dst_api field from rdrbuff blocksdimitri staessens2016-11-173-188/+95
| | | | | | Now that we have an rbuff per flow per AP, there is no more need to keep the dst_api in the rdrbuff. This also simplifies the sanitizer in the irmd.
* lib: Simplify CDAP APISander Vrijders2016-11-011-125/+68
| | | | | | This will simplify the CDAP API. Now the opcode has to be given when sending a CDAP request. Before a separate operation was provided since some of the function parameters are unused for certain commands.
* Merged in sandervrijders/ouroboros/be-addr-auth (pull request #296)dimitri staessens2016-11-012-3/+6
|\ | | | | | | ipcpd: normal: Add policy for obtaining a flat address
| * ipcpd: normal: Add policy for obtaining a flat addressSander Vrijders2016-11-012-3/+6
| | | | | | | | | | | | This adds a policy for obtaining a flat address, and thus also the infrastructure for policies in the IPCP. The IPCP should check if the address is available; this is currently not there yet.
* | lib, ipcpd: Improve flow allocationdimitri staessens2016-10-311-91/+94
| | | | | | | | | | | | | | All calls for opening rbuffs are now concentrated on the dev side. This allows some simplifications in the np1 calls. The ipcp_fini call will not destroy the mutex associated with the state, since the final state needs to be checked before shutting down an IPCP.
* | lib: Have flow_event_wait return non-zero valuedimitri staessens2016-10-302-12/+26
|/ | | | | | Flow_event_wait will either return -EINVAL, -ETIMEDOUT or a positive integer indicating the number of SDUs in the fqueue. This allows to call the function as the condition for a non-terminating while loop.
* lib: Free fd when deallocating a flowdimitri staessens2016-10-301-0/+1
| | | | Fixes a little bug that sneaked in with the revised deallocation.
* lib: Clean up flow if alloc_res failsdimitri staessens2016-10-271-44/+65
| | | | | | | | | If alloc_res fails all resources will be cleaned, except for the assigned flow_descriptor, which must be released with a dealloc call. Calling dealloc after a failed flow_alloc will not try to destroy the already cleaned up flow in the IRMd and IPCPs. Also fixes some memleaks in the oping client.
* lib, ipcpd: Further stabilization of flowsdimitri staessens2016-10-262-33/+69
| | | | | | | | | | | The steps for flow deallocation have been further refined. An operation ipcp_flow_fini() which wait for all SDUs to be read from a flow has been added. The shim IPCPs and the local IPCP have been adapted to this new API. Deallocation messages have been removed from the shim IPCPs, since there is insufficient state synchronisation between them to make this work reliably.
* Merged in sandervrijders/ouroboros/be-ipcp-threads (pull request #283)dimitri staessens2016-10-261-2/+1
|\ | | | | | | ipcpd: Add threadpool for main loop
| * ipcpd: Add threadpool for main loopSander Vrijders2016-10-261-2/+1
| | | | | | | | | | | | | | This adds a threadpool for the main loop of the IPCPs. Before there was a single thread handling each request, which could result in starvation since performing name queries at the same time as enrolling a normal IPCP was impossible.
* | Merged in dstaesse/ouroboros/be-qos (pull request #279)Sander Vrijders2016-10-261-1/+4
|\ \ | |/ |/| | | lib: API for accepting flows with QoS
| * lib: API for accepting flows with QoSdimitri staessens2016-10-251-1/+4
| |
* | lib, irmd, ipcpd: Add name querying to IPCPsSander Vrijders2016-10-261-4/+5
|/ | | | | | | | | This adds the ability to query IPCPs if a name can be reached through them, e.g. if a name is available in a DIF. This means that in the shim-udp a DNS query is performed, in the shim-eth-llc an ARP-like query has been added, in the local a check is done to see if the name is registered, and in the normal currently no application is reachable through it.
* lib: Stabilise flow allocationdimitri staessens2016-10-232-38/+22
| | | | | | | Deallocation was reverted to a synchronoous operation between the AP, IRMd and IPCP in order to avoid inconsistent states of the port_id. Fixes some memory leaks, particularly the shm_flow_set is now closed upon deallocation.
* dev, ipcp: Fix setting default flow optionsdimitri staessens2016-10-231-0/+1
| | | | | The default flow options were not set when a flow allocation request arrives remotely. This went unnoticed due to a previous bug.
* lib: Fix closing applications with active flowsdimitri staessens2016-10-221-1/+2
| | | | The rdrbuff was previously closed before the remaining SDUs were removed.
* lib: Revert bad fqueue modificationdimitri staessens2016-10-222-2/+5
| | | | | An untested (and wrong) modification to the fqueue was mistakenly added to a previous commit. This corrects the bad code.
* lib: Fix wrong comparisondimitri staessens2016-10-221-2/+2
| | | | FLOW_O_RDONLY is 0, so the previous statement would always be false.
* build: Compile with strict conversiondimitri staessens2016-10-228-132/+123
| | | | | This has the code checked with -Wcast-qual and -Wconversion flags. These flags were removed because SWIG generated code fails.
* build: Comply with -Wextra compiler flagdimitri staessens2016-10-215-5/+21
| | | | | This reduces the risk for some bugs, for instance due to signed/unsigned mismatches and unused variables.
* lib: Move rbuff creation/destruction to IRMddimitri staessens2016-10-213-61/+37
| | | | | This stabilises flow allocation now that the rbuffs are created upon flow allocation. Only the IRMd can sync this process sufficiently.
* lib: Demultiplex the fast pathdimitri staessens2016-10-217-877/+1187
| | | | | | | | The fast path will now use an incoming ring buffer per flow per process. This necessitated the development of a new method for the asynchronous io call, which is now based on an event queue system for scalability (fqueue). The ipcpd's and tools have been updated to this API.
* lib, dev: Implement read/write options for flowsdimitri staessens2016-10-161-0/+17
| | | | | | | Added the missing implementation of setting read/write options for flows. This allows applications to block the fast path for remotes. IPCPs can use this to block the fast path for the N + 1 flow when receiving remote deallocation requests.
* lib: Stabilize fast flow deallocation over local IPCPdimitri staessens2016-10-152-33/+30
|
* lib: Fix initialisation of flow_setdimitri staessens2016-10-151-2/+3
| | | | The safe copy was not correctly initialised.
* lib: Fix flow deallocation logicdimitri staessens2016-10-131-18/+1
| | | | | Both the N and N-1 entity must now call flow_dealloc for the port_id to be released.
* lib: Track SDUs in the fast pathdimitri staessens2016-10-113-88/+174
| | | | | | This will allow to finalize deallocating flows until all SDUs have been processed. Read and write calls will now block when a flow was deallocated. Replaces NULL checks in the fast path with asserts.
* lib: Add non-copy reading from fd for IPCPsdimitri staessens2016-10-071-8/+43
|
* lib, dev: Add asynchronous deallocationdimitri staessens2016-10-072-24/+47
| | | | | Flow deallocation from the application will immediately return (void call). The IRMd will not send a reply message.
* lib: Fix shutdown with pending SDUsdimitri staessens2016-10-062-2/+4
| | | | | The SDU's were not correctly removed upon shutdown, peek should be pop.
* lib, ipcpd: Fix bad lockingSander Vrijders2016-10-051-2/+2
| | | | | | Some locks were taken at an inappropriate time, causing the shim-eth-llc to block indefinitely upon shutdown and causing flow allocation to halt since a response could never be given.
* lib, ipcp: Revise fast path and flow interfacesdimitri staessens2016-10-049-790/+678
| | | | | | | | | | | | IPCPs can now use ap_init() to initialize the memory. All flows are accessed using flow descriptors, this greatly simplifies IPCP development. Reverts the fast path to a single ap_rbuff per process. Splits lib/ipcp into irmd/ipcp and lib/ipcp-dev. Adds a lib/shim-dev holding tailored functions for shims. Moves the buffer_t to utils.h. Fixes the shim-eth-llc length field. Removes the flow from shared.h. Fixes #4 Fixes #5
* lib: Fix shm for evil devicesdimitri staessens2016-09-083-6/+6
| | | | | | Cupertino's finest don't seem to support a write call with a filedescriptor that points to a shared memory file. ENOTSUP is not mentioned in their manpage either. Classic.
* Merged in sandervrijders/ouroboros/be-shm-pci (pull request #247)dimitri staessens2016-09-073-94/+35
|\ | | | | | | ipcpd: normal: Add operations to get and set the PCI
| * ipcpd: normal: Add operations to get and set the PCISander Vrijders2016-09-073-94/+35
| | | | | | | | | | | | | | | | | | This adds the operations needed in the normal IPCP to get and set the Protocol Control Information. It allows to allocate or release space in the current DU. The struct pci can be serialized into newly allocate space. Vice versa, a struct pci can be deserialized given a DU. It allows for decreasing the TTL in the DU and for calculating the CRC32. The TTL and CRC32 can now be selected when creating a new DIF.
* | lib: Set umask for file creation permissionsdimitri staessens2016-09-073-16/+12
| | | | | | | | | | Permissions are now set correctly upon creation, removing the need to call fchmod.
* | lib: Add lazy copy of flow_setdimitri staessens2016-09-071-8/+16
| | | | | | | | | | | | The flow_set now has a safe copy which is threadsafe for the select call without needing a lock. This greatly speeds up consecutive select calls.