summaryrefslogtreecommitdiff
path: root/src/ipcpd
Commit message (Collapse)AuthorAgeFilesLines
...
* ipcpd: normal: Add main loop to normal IPCPSander Vrijders2016-07-153-10/+261
| | | | | | This adds the main loop to the normal IPCP, just like it is present in the shim IPCPs. So in essence, the normal IPCP now reacts to all operations from ipcp.h.
* ipcpd: normal: Establish N-1 management flowsSander Vrijders2016-07-1410-18/+409
| | | | | | | | | This adds the intial implementation of establishing management N-1 flows between normal IPCPs. On calling fmgr_mgmt_flow, a management flow will be setup to a certain destination IPCP. After flow allocation, the fd is handed to the RIB manager. The flow manager also listens for incoming flow requests. In case they are management flows, they are handed to the RIB manager, otherwise to the FRCT.
* ipcpd: Add initial headers for the normal IPCPSander Vrijders2016-07-123-0/+124
| | | | | | | | | This adds the initial headers for the normal IPCP. The normal IPCP consists of 3 main components: * The flow manager, in charge of managing N and N-1 flows. * The RIB manager, in charge of managing the RIB * FRCT: The flow and retransmission control task
* lib: Remove N-1 DIF param from enroll operationSander Vrijders2016-07-122-4/+2
| | | | | | This removes the parameter N-1 DIF from the enroll operation. IPCPs should just allocate a flow to a DIF name and let the N-1 DIF resolve it.
* ipcpd: Deprecate ipcp_reg/ipcp_unregdimitri staessens2016-07-085-31/+0
|
* ouroboros: Use ouroboros errno.hdimitri staessens2016-07-073-3/+4
| | | | | All includes of <errno.h> within ouroboros are replaced with the ouroboros errno.
* lib: Add lockfiledimitri staessens2016-07-071-0/+1
| | | | | | | | | | | | The pid of the IRMd is stored in a lockfile in shared memory. This makes checking if the IRMd is running independent of the configuration, as previously the IRMd pid was stored at the end of the shm_du_map, which could not be read by an IRMd that would be compiled with different configuration options. Also corrects some unnecessary includes Fixes #21.
* irmd, ipcps: Close logfile on exitdimitri staessens2016-07-073-14/+28
| | | | | | | IRMd and ipcps will now close the logfile upon exit. Also corrects exit(1) to exit(EXIT_FAILURE) and exit(0) to exit(EXIT_SUCCESS).
* Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be-clean-exitdimitri staessens2016-07-065-14/+43
|\
| * lib, irmd, ipcpd: Provide the feature to write to logsSander Vrijders2016-07-065-14/+43
| | | | | | | | | | | | | | | | | | | | Writing output to log files is now enabled by default. Logs are written to <INSTALL_PREFIX>/var/log/ouroboros, which is created on install. There is a log file for the irmd and one per IPCP. To still get (colored) output on stdout, provide the --stdout switch when starting the irmd. Fixes #17
* | lib: shm_du_map: Clean sdus upon exitdimitri staessens2016-07-063-3/+3
|/ | | | | | | | When an application closes the shm_du_map, it will clean all remaining sdu's for that application. Adds a function to clean the shm_du_map on close. Fixes #20.
* lib: Change invalid pid to -1dimitri staessens2016-07-051-2/+2
| | | | | | | | The stack used pid 0 (the scheduler) to indicate an invalid process instance, probably as a leftover from the deprecated application process instance id. Using -1 is a better solution. Fixes #16.
* Merge remote-tracking branch 'upstream/be' into beSander Vrijders2016-07-051-2/+3
|\
| * lib: utils: deprecate strdupdimitri staessens2016-07-051-2/+3
| | | | | | | | | | | | | | | | When introducing robust mutexes, ouroboros moved to POSIX 200809L which includes the strdup function in <string.h>. Including <ouroboros/config.h> will give access to strdup. Fixes #15.
* | lib: Provide first implementation of revised CDAPSander Vrijders2016-07-055-9/+11
|/ | | | | | | | 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.
* lib: robust locking in shared memory and crash recoverydimitri staessens2016-07-024-20/+23
| | | | | | | | | | | | | | 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-293-189/+0
| | | | Fixes #3
* lib, irmd, ipcpd: Change pid to apiSander Vrijders2016-06-286-44/+41
| | | | Changes the variable name as well to API instead of PID.
* lib, irmd, ipcpd: Change of IRM APISander Vrijders2016-06-286-60/+13
| | | | | | | | | | | | | | 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
* Merged in dstaesse/ouroboros/be-udp-dealloc (pull request #143)Sander Vrijders2016-06-281-13/+25
|\ | | | | | | Be udp dealloc
| * ipcpd: fix deadlock in shim-udpdimitri staessens2016-06-281-13/+25
| | | | | | | | | | shim UDP would deadlock upon a dealloc call. fd_clr cannot be called under wrlock.
* | Merged in dstaesse/ouroboros/be-shim-fixes (pull request #142)Sander Vrijders2016-06-281-48/+60
|\| | | | | | | Be shim fixes
| * ipcpd: fixes to shim-udpdimitri staessens2016-06-271-48/+60
| | | | | | | | | | getsockname() can give bad behaviour when haphazardly looping fd's, added check that the fd has a flow. Replaced LOG_DBGF with LOG_DBG.
* | build: addresses comments on cffd94adimitri staessens2016-06-281-1/+1
|/
* build: correct sandboxingdimitri staessens2016-06-273-3/+3
| | | | | paths cannot start with "/" or PREFIX will be omitted. PREFIX must be set before the project() call.
* build: Fix installation prefixSander Vrijders2016-06-274-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-222-2/+2
| | | | | | 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: Add errnos specific for OuroborosSander Vrijders2016-06-224-64/+2
| | | | | | | 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-215-267/+267
| | | | | | | | 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.
* Merge remote-tracking branch 'upstream/be' into beSander Vrijders2016-06-201-22/+183
|\
| * ipcpd: Adds RX_RING and TX_RING in shim-eth-llcSander Vrijders2016-06-201-22/+183
| | | | | | | | | | | | | | | | | | | | | | This adds the RX_RING and TX_RING socket options to the shim-eth-llc for faster transmission and reception. On systems where these options are not available the old method of sending and receiving is used. Further optimization would be creating and assigning a read/write thread per CPU core, but that becomes very platform specific, and is not required in the short term. Fixes #10
* | build: Change install directories and set correct permissionsSander Vrijders2016-06-204-4/+4
|/ | | | | | | | | 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
* ipcpd: fixed missing unlock in shim UDPdimitri staessens2016-06-161-1/+5
| | | | Unlock missing when compiled without DNS support.
* irmd: clean up stale pending flowsdimitri staessens2016-06-161-1/+1
| | | | | | | Adds a thread that cleans up stale pending flows. Compile time option IRMD_FLOW_TIMEOUT allows setting the timeout period. Default timeout is 5 seconds. The thread wakes up 20 times per period to check the flows.
* ipcpd: fixed locking and cleanupdimitri staessens2016-06-162-1/+5
| | | | | The ipcpds didn't unlock the flows lock when the dst_name is unbeknownst to the IRMd.
* ipcpd: Fix wrong length in shim-eth-llcSander Vrijders2016-06-141-4/+7
| | | | | | | The shim Ethernet with LLC was using the frame length in the header of the 802.3 frame, which contained a wrong value when sent over the wire. Probably the kernel filled in a wrong value. Now it uses the length as reported by recv.
* ipcpd: Remove source AP name from protobuf messageSander Vrijders2016-06-141-5/+4
| | | | | The source AP name was still present in the protobuf message the shim-eth-llc uses.
* ipcpd: Remove source AP name from shim-eth-llcSander Vrijders2016-06-141-9/+2
| | | | | This removes the source AP name from all shim-eth-llc flow allocation operations, since it was removed from flow allocation by 6271d09bd.
* Merge remote-tracking branch 'upstream/be' into be-llcSander Vrijders2016-06-145-18/+7
|\
| * Fixed comments on #122dimitri staessens2016-06-141-1/+1
| |
| * ipdpd: fixed flow deallocation in local ipcpddimitri staessens2016-06-141-1/+3
| | | | | | | | | | Now correctly deallocates the local fd if the remote already deallocated the flow.
| * lib, irmd, tools, ipcpd: updates to dev API.dimitri staessens2016-06-135-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Address comments by DimitriSander Vrijders2016-06-141-30/+23
| | | | | | | | | | This addresses some comments Dimitri had on the shim Ethernet with LLC.
* | ipcpd: Adds a shim over IEEE 802.2 over IEEE 802.3Sander Vrijders2016-06-146-3/+1220
|/ | | | | 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-292-12/+10
|
* lib: shm_ap_rbuff: sleep when read on empty rbuffdimitri staessens2016-05-281-1/+0
| | | | | When the ring buffer is empty, a read call will sleep. A write call on an empty ring buffer will wake up sleeping readers.
* ipcpd: cleanup of IPC processesdimitri staessens2016-05-282-9/+18
| | | | | | | This stops IPC processes from hanging due to bad locks. It first informs all threads that the IPCP is shutting down, then cancels all threads. Cancellation is still required because threads may be in accept() or receivefrom().
* build: fixed typo in ipcpd/local/dimitri staessens2016-05-281-1/+1
|
* ipcpd: IPCP over local memorydimitri staessens2016-05-283-0/+683
| | | | | | | | | | | | | 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
* ipcpd: shim-udp changed to blocking writedimitri staessens2016-05-271-14/+11
| | | | | The shim UDP did a non-blocking write call, causing loss of SDU's. This has been changed to a blocking write call.