summaryrefslogtreecommitdiff
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* | lib: dev: Provide a set of fds to flow_selectdimitri staessens2016-09-062-14/+165
| | | | | | | | | | | | | | The flow_select call now takes as a parameter a flow_set_t, which specifies a set of flow descriptors that will unblock the select call when an SDU for one of them arrives. The select call has been moved to its own header.
* | lib: dev: Add fd lookup tabledimitri staessens2016-09-031-23/+25
| |
* | lib: dev: Refactordimitri staessens2016-09-031-182/+188
| | | | | | | | | | Renamed _ap_instance to ai, adds a char * daf_name (to be set by ipcps in ipcp-dev.h, later to be set when we generalise enrolment to DAFs).
* | Merged in dstaesse/ouroboros/be-split-fp (pull request #239)Sander Vrijders2016-09-021-2/+2
|\ \ | | | | | | | | | src: Fix grammar (SDU's -> SDUs)
| * | src: Fix grammar (SDU's -> SDUs)dimitri staessens2016-09-021-2/+2
| | |
* | | Merged in dstaesse/ouroboros/be-split-fp (pull request #238)Sander Vrijders2016-09-023-12/+49
|\| | | |/ |/| | | lib: Add northbound ringbuffers
| * lib: Add northbound ringbuffersdimitri staessens2016-09-023-12/+49
| | | | | | | | Fast path is split in north and southbound paths.
* | Merged in dstaesse/ouroboros/be-ipcp-dev (pull request #237)Sander Vrijders2016-09-021-33/+35
|\ \ | |/ |/| | | lib: ipcp: Decouple flow_dealloc
| * lib: ipcp: Decouple flow_deallocdimitri staessens2016-09-021-33/+35
| | | | | | | | Sending a dealloc to the irmd moved to its own call.
* | lib: Change rdrbuff API to use correct typesSander Vrijders2016-09-011-8/+8
|/ | | | | | The head and tail alloc and release operations were taking an int to identify the idx instead of a ssize_t. The size was a ssize_t instead of a size_t.
* lib, rdrbuff: Fix fast path lockupdimitri staessens2016-09-011-2/+5
| | | | Adds missing condition signals.
* lib, shm_rdrbuff: Fix preprocessor definedimitri staessens2016-08-311-15/+15
|
* lib, ipcp: Compile on Apple junkdimitri staessens2016-08-304-34/+104
| | | | | | Disables robust mutexes and clock attributes for condition variables for compatibility with OSX (SUSv2). Implements clock_gettime and adds some defines for OSX compatibility in time_utils.
* lib: Refactor shm_du_map to shm_rdrbuffdimitri staessens2016-08-295-785/+850
| | | | | | | | | | The shm_du_map is renamed to shm_rdrbuff to reflect the Random Deletion Ringbuffer used in the implementation. The close_on_exit call is removed and SDUs are cleaned up by the application in the ap_fini() call. This required a non-blocking peek() operation in the shm_ap_rbuff. Some initial implementation for future support of qos cubes has been added to the shm_rdrbuff.
* lib, cdap: Fix message handlerdimitri staessens2016-08-291-1/+1
| | | | When getting a DELETE opcode, create was called instead of delete.
* cdap: Fix destructiondimitri staessens2016-08-271-6/+3
| | | | | Destroying NULL should succeed. Resources need to be freed even if flow_dealloc fails.
* irmd, lib: Rebuild the IRMd data modeldimitri staessens2016-08-214-81/+135
| | | | | | | | | | | | | | | | | | | | | | The complete data model inside the IRMd has been restructured. The bind operation was revised to allow binding of AP and AP instances and register those names with different DIFs (see "irm bind" for details). Server applications require to call ap_init with a server name argument, client application that do not the be reachable over any DIF can call ap_init(NULL). Calling ap_init for a client with a specified name will not have adverse consequences for the application, but will consume unnecessary resources in the IRMd. Application servers can now be started at any point after the IRMd has been started. Starting servers, binding AP names and registering names in DIFs can be performed in any order that does not defy temporal logic. Supports naming instances by their pid. In case of IPCP Instances created with the IRM tool, the name assigned during "irm ipcp create" can be used. All the changes required updates in the tools.
* ipcpd: normal: Handle enrollment repliesSander Vrijders2016-08-192-63/+92
| | | | | | | | This adds a condition variable with a timeout to the CDAP request so that we can respond correctly to the answer from the remote. It also adds a timeout to the condition variable waiting on completion of enrollment. Furthermore, for every CDAP callback a new thread is now spawned, to avoid deadlocking in case a callback is stuck.
* Merged in dstaesse/ouroboros/be-api-bind (pull request #203)Sander Vrijders2016-08-102-24/+61
|\ | | | | | | lib, irmd: Bind AP instances to AP_subsets
| * lib, irmd: Bind AP instances to AP_subsetsdimitri staessens2016-08-102-24/+61
| | | | | | | | | | | | | | This call will allow grouping AP instances of a certain AP together which are configured identically. Adds the bind operation to dev and updates the applications to make use of this call. Flow_alloc is now only called with the pid and doesn't send the apn anymore.
* | lib, irmd, ipcp: Add socket timeoutSander Vrijders2016-08-103-5/+26
|/ | | | | | This will add a timeout to the socket so that a process won't be blocked by the actions of the process with which it is communicating over the socket.
* ipcp, irmd, lib: Notify IRMd upon IPCP initializationSander Vrijders2016-08-102-17/+43
| | | | | | This will notify the IRMd when the IPCP is initialized and ready to receive messages. Previously a bootstrap could fail since the IPCP was not listening to the socket yet.
* lib: Fix cleanup for sending messagesdimitri staessens2016-08-092-35/+8
| | | | Cleanup handlers were not always popped.
* lib: dev.c: Release locks before blocking callsdimitri staessens2016-08-091-8/+23
|
* lib: Various fixesdimitri staessens2016-08-093-22/+5
| | | | | Fix missing set of api upon flow_alloc. Various locking fixes.