summaryrefslogtreecommitdiff
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: Provide first implementation of revised CDAPSander Vrijders2016-07-057-8/+464
| | | | | | | | This commit introduces a first version of the revised CDAP specification. CACEP (for authentication purposes) has been separated from CDAP. Application developers may use CDAP if they find it useful. Within Ouroboros CDAP will be used to perform operations on the RIB of an IPCP.
* tools, irm: move binary check to librarydimitri staessens2016-07-031-0/+8
| | | | | | | This will make the library check if the user has permissions to execute the binary when auto is set. This prevents writing malicious software that would use the irmd to execute other applications to which the user has no access.
* lib: shm_du_map full multi-block supportdimitri staessens2016-07-031-103/+79
| | | | | | | shm_du_map now fully supports multi-block SDU's when the SHM_DU_MAP_MULTI_BLOCK compilation flag is set (enabled by default). Fixes #11.
* lib: robust locking in shared memory and crash recoverydimitri staessens2016-07-023-90/+279
| | | | | | | | | | | | | | This PR enhances the shared memory providing recovery if a process crashes. It adds a SHM_DU_TIMEOUT_MICROS variable, setting an expiration time for SDU's when shared memory is full. If an application doesn't read a blocking SDU within this time, the shared memory will be cleansed of all SDU's for this application and the application's rbuff will be cleared. Some refactoring of the API's. Fixed wrong pthread checks in IRMd. Fixes #13 Fixes #14
* lib, ipcpd: removed du_buff and pcidimitri staessens2016-06-294-452/+0
| | | | Fixes #3
* lib, irmd, ipcpd: Change pid to apiSander Vrijders2016-06-288-83/+82
| | | | Changes the variable name as well to API instead of PID.
* lib, irmd, ipcpd: Change of IRM APISander Vrijders2016-06-286-354/+169
| | | | | | | | | | | | | | This changes the IRM API after discussions with Dimitri. The register operation is now split into a bind and register operation. The same for unregister; unbind and unregister. PIDs are now used as the application instance name. A name for a PID is only provided for scriptability in bash. It is therefore also no longer passed down to the IPCP. Every operation on an IPCP through the IRM API has to use the PID. Quering of the PIDs by name is possible. The IRM tool has been updated to use this new API as well. A subcommand 'ipcp' has been added for operations that take effect on IPCPs only. Fixes #12
* build: correct sandboxingdimitri staessens2016-06-271-1/+1
| | | | | paths cannot start with "/" or PREFIX will be omitted. PREFIX must be set before the project() call.
* build: Fix installation prefixSander Vrijders2016-06-272-4/+4
| | | | | | The installation prefix was taking a trailing backslash, while it is common not to do so. Fixed it so that any trailing backslash is removed by the compilation and installation scripts.
* lib: Change DA header to NSMSander Vrijders2016-06-224-17/+25
| | | | | | Functionality that was previously thought to be part of the DIF Allocator is actually namespace management. Hence the file has been renamed and the API updated.
* lib: Remove implementation specific errnosSander Vrijders2016-06-222-16/+16
| | | | | This removes any implementation specific error numbers. Only errors that are implementation independent should be returned.
* lib: Add errnos specific for OuroborosSander Vrijders2016-06-223-36/+69
| | | | | | | This adds error numbers specificly for Ouroboros. It also refactors some of the header files that are installed. Fixes #2
* lib, irmd, ipcp: robust mutexesdimitri staessens2016-06-214-206/+95
| | | | | | | | Update to POSIX 200112L to allow use of robust mutexes in the shm_du_map. Removed the implementation of the rw_lock in favor of pthread_rwlock_t. Placeholder for the shm_du_map_sanitize function.
* lib, irmd: Change sockets and shm pathSander Vrijders2016-06-201-1/+1
| | | | | | Reverting from previous commit. Even when running Ouroboros sandboxed, the sockets and shared memory should be created in the default system paths.
* build: Change install directories and set correct permissionsSander Vrijders2016-06-205-7/+26
| | | | | | | | | This sets the correct install directories for all the binaries, library and header files. It also sets the right permissions on the sockets and shared memory so that regular users can also use the ouroboros library. Root privileges are required to run the irmd. Fixes #7
* irmd, lib: use shm_du_map as lockfile.dimitri staessens2016-06-171-9/+15
| | | | | | | | | | | | Added the pid of the irmd to the shm_du_map. The IRMd will check for an existing shm_du_map. If there is an existing file, it will exit if the owner IRMd is running or remove it if the owner IRMd is not running. Also simplifies calculation of the shm_du_map pointers and corrects exiting calls for the IRMd. Fixes #8.
* Merge remote-tracking branch 'upstream/be' into be-llcSander Vrijders2016-06-145-169/+91
|\
| * lib, irmd, tools, ipcpd: updates to dev API.dimitri staessens2016-06-135-169/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registration function has been moved to the irm tool, applications now need to be registered by an administrator. Currently only supports one instance per registered name, and an AP can be registered under only one name. The irmd can now start a registered server application on demand. For the full functionality of the tool, execute "irm register". AP name removed from flow allocation. Flow allocation does not send the source ap name as it is quite useless. The accept() call now only returns the AE name.
* | ipcpd: Adds a shim over IEEE 802.2 over IEEE 802.3Sander Vrijders2016-06-143-0/+7
|/ | | | | This adds a shim over LLC over Ethernet. It uses the raw socket API to send messages directly over an interface.
* ipcpd: fixes shutdown lockup in local and shim-udpdimitri staessens2016-05-291-2/+2
|
* lib: small tweaks for shm_ap_rbuffdimitri staessens2016-05-291-7/+5
|
* lib: shm_ap_rbuff: sleep when read on empty rbuffdimitri staessens2016-05-281-9/+23
| | | | | When the ring buffer is empty, a read call will sleep. A write call on an empty ring buffer will wake up sleeping readers.
* lib: fixed empty line in irm.cdimitri staessens2016-05-281-1/+0
|
* ipcpd: IPCP over local memorydimitri staessens2016-05-282-2/+5
| | | | | | | | | | | | | This introduces an IPC process that relays data between two local AP's over the shm_du_map. Only configuration it has is a DIF name. It required small modification elsewhere: lib: added support for the IPCP_LOCAL type irm: added support for the IPCP_LOCAL type dif_config: added the IPCP_LOCAL type tools: added support for the IPCP_LOCAL type
* lib: fixed SHM_DU_BUFF_BLOCK_SIZE in shm_du_mapdimitri staessens2016-05-261-1/+1
|
* lib: fixed blocking/non-blocking writedimitri staessens2016-05-261-16/+43
| | | | | non-blocking write would return when the buffer was full functions in dev now check validity of input file descripters
* Merged in dstaesse/ouroboros/be-shm-single-block (pull request #111)Sander Vrijders2016-05-251-6/+31
|\ | | | | | | lib: allow running shm_du_map in single block mode
| * lib: allow running shm_du_map in single block modedimitri staessens2016-05-251-6/+31
| | | | | | | | | | this allows disabling support for SDU's that are larger than a block in the DU MAP by defining the variable SHM_MAP_SINGLE_BLOCK
* | tools, lib: cbr tool for bandwidth testingdimitri staessens2016-05-242-0/+142
| | | | | | | | | | | | | | | | The tool sends constant bandwidth traffic between a client and a server. cbr --help for more info. Adds time_utils.h to the library containing useful functions for arithmetic with timespec and timeval structures.
* | lib: Fix memleaks in dev.cSander Vrijders2016-05-241-23/+30
|/ | | | Fixes some memleaks in dev.c in the case of error conditions.
* lib, ipcpd, irmd: fixes deallocation and fast pathdimitri staessens2016-05-222-31/+42
| | | | | | The fast path has been rewritten to have certainty to read the correct flow. Deallocation will not release port_id's or fd's until they are explicitly released locally.
* lib: removed fd cleaning functiondimitri staessens2016-05-221-27/+10
|
* lib, irmd, ipcpd: Flow deallocation over shim UDPdimitri staessens2016-05-212-0/+29
| | | | | | The shim UDP now supports deallocating a flow end-to-end. Contains some stability fixes for flow allocation and some missing close() calls in lib/sockets.
* lib, ipcpd: fixes segfaults in dev.c and shim-udpdimitri staessens2016-05-201-2/+1
|
* lib: allow parallel connectionsdimitri staessens2016-05-202-11/+30
| | | | | | dev.c: read now only reads an SDU if is is for the correct port_id shm_ap_rbuff: added a function peek() that returns the port_id of the tail.
* lib: Add missing check upon garbage collectionSander Vrijders2016-05-171-2/+3
| | | | | | | There was a check missing upon garbage collection. If the whole DU map has been used once, all DUs will have their garbage bit set to one. This meant that the garbage collector would keep moving the tail indefinitely.
* lib: Fixed incorrect initializationSander Vrijders2016-05-171-3/+4
| | | | | When moving the tail pointer in the DU map, blocks was never reset to zero. This caused it to sometimes clean up too many DUs.
* lib: Add missing modulo calculationSander Vrijders2016-05-162-11/+11
| | | | | | Adds a missing modulo calculation that would result in index -1 being returned instead of zero when the ringbuffer skipped back to the beginning.
* lib: dev: small locking improvementsdimitri staessens2016-05-161-28/+33
| | | | | | This avoids holding the long locks during accept() and alloc_res() calls. Small reduction of time of other locks held. No changes in locking logic.
* lib: dev.c: Revised lockingdimitri staessens2016-05-151-69/+65
| | | | | fd and flows are now all protected by the flows_lock while the overall state of the AP is protected by the data_lock.
* lib: allow accepting any flowsdimitri staessens2016-05-151-7/+7
| | | | The application can call accept(fd, NULL, NULL);
* lib: cleanup file descriptors for shared memorydimitri staessens2016-05-153-2/+21
| | | | | cleanup of file descriptors for the shared memory. also adds a missing NULL check and some invalidation in dev.c
* lib: shm_ap_rbuff: simplified file offsetsdimitri staessens2016-05-151-13/+9
| | | | Used simpler pointer arithmetic to calculate the file offset pointers.
* lib: irmd: fixed flow deallocationdimitri staessens2016-05-151-7/+10
| | | | | Port_id's weren't correctly released. Also removes remaining debug logs from the library.
* Merged in sandervrijders/ouroboros/be (pull request #84)dimitri staessens2016-05-143-23/+23
|\ | | | | | | lib, ipcpd, irmd: Add QoS cube definition
| * Merge remote-tracking branch 'upstream/be' into beSander Vrijders2016-05-142-0/+128
| |\
| * | lib, ipcpd, irmd: Add QoS cube definitionSander Vrijders2016-05-143-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the QoS cube definition, which is an enum to select which QoS is needed in the IPCP. An application has to use the qos_spec in qos.h to define what it needs. The IRMd will map this unto a qos cube definition. Some headers are now also no longer installed on the system, since they are only to be used within the irmd and ipcps.
* | | lib: dev.c: added lockingdimitri staessens2016-05-142-37/+179
| |/ |/| | | | | | | Locking is required for multi-threaded applications. Flows are locked separately. Read/Write locks are used for concurrent reads.
* | Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be-rw_lockdimitri staessens2016-05-141-5/+4
|\|
| * lib: shm_ap_rbuff: removed bad memory allocationdimitri staessens2016-05-141-5/+4
| | | | | | | | | | moved a malloc so there is no malloc/free when there is no data to be read from the shm_ap_rbuff.