summaryrefslogtreecommitdiff
path: root/src/ipcpd
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* ipcpd: fixed the shim-udp grinding the cpudimitri staessens2016-05-271-3/+4
| | | | | | | | In linux, the select call changes the timeout variable to the time not spent in sleep, causing the timeout to decrease and that loop to grind the cpu. The timeval is now reset to the correct value every loop. Also removed a LOG_ERR message that was hampering performance.
* ipcpd: Cleanup handler for main message loopSander Vrijders2016-05-261-0/+5
| | | | | This adds a cleanup handler for the main message loop, which closes the socket upon pthread_cancel so that the ipcp can exit cleanly.
* ipcpd: shim-udp: fixed missing NULL checkdimitri staessens2016-05-221-0/+3
| | | | Conf was not checked on bootstrap.
* ipcpd: Remove install command from buildSander Vrijders2016-05-221-2/+0
| | | | | This removes an install command from the build, since the protobuf header file was being installed in the source directory.
* lib: removed fd cleaning functiondimitri staessens2016-05-221-3/+4
|
* ipcpd: homogenous debug messages for deallocationdimitri staessens2016-05-211-8/+1
|
* lib, irmd, ipcpd: Flow deallocation over shim UDPdimitri staessens2016-05-212-52/+153
| | | | | | 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
|
* ipcpd: shim-udp: read fd on client sidedimitri staessens2016-05-201-0/+13
| | | | | There could be a theoretical race condition that the server sends a message before the FD is set on the client side, which is resolved.
* ipcpd: shim-ipcp: fixed race conditionsdimitri staessens2016-05-201-40/+57
| | | | | | | | | | | There were two race conditions. The first was where client received the response message before the client UDP port was connected to the server UDP port and the first message of the client was sent to the LISTEN port instead of the server application port. This was solved by reordering the operations so the response is sent after the port is correctly connected. The second race condition is that the FD is not added to the set in time at the server side before the first SDU arrives. This was solved by adding a variable proteceted by a mutex.
* ipcpd: shim-udp: removed debug codedimitri staessens2016-05-191-12/+0
| | | | | some debug code for locking and a sleep check are removed from the shim-udp.
* Implementation of a full flow allocator for the shim UDP.dimitri staessens2016-05-185-257/+540
| | | | | | | | | It uses UDP port 0x0D1F on all hosts to send and receive flow allocation messages. It supports communication between server and client AP over a single shim IPCP. Implementation of full flow deallocation is pending. Both the client and the server still have to call flow_dealloc();
* lib: Add missing modulo calculationSander Vrijders2016-05-161-2/+1
| | | | | | Adds a missing modulo calculation that would result in index -1 being returned instead of zero when the ringbuffer skipped back to the beginning.
* fixed two unlocks, removed the thread_lock.dimitri staessens2016-05-151-13/+3
|
* ipcpd: shim-udp: Revised lockingdimitri staessens2016-05-152-96/+97
| | | | | | | | | | Simplified locking to take only two locks: the first lock guards the state of the ipcp. This lock must be held for writing on bootstrap and closing, and held for reading during all other operations. The second lock guards operations on flows, and must be held for writing during allocation and deallocation, and held for reading when sending sdu's. After adding a fd to FD_SET, the shim will wait for 1 ms to ensure that the FD is added to the select call.
* ipcpd: Move lock in ipcp_udp_listenerSander Vrijders2016-05-151-2/+2
| | | | | This takes a lock before notifying the IRMd of a new flow request, to avoid race conditions when trying to retrieve the fd by port-id.
* ipcpd: shim-udp: added missing checksdimitri staessens2016-05-151-10/+10
|
* ipcpd: shim-udp: fixed locking.dimitri staessens2016-05-141-15/+21
| | | | | The fd_to_port_id function has no internal locking and must now be called under lock.
* Merged in sandervrijders/ouroboros/be (pull request #84)dimitri staessens2016-05-146-44/+31
|\ | | | | | | lib, ipcpd, irmd: Add QoS cube definition
| * lib: Fix header inclusionSander Vrijders2016-05-141-0/+1
| | | | | | | | | | | | This fixes wrong header inclusion that would make programs which are not developed within ouroboros fail upon compilation, since they would not find certain headers on their system.
| * lib, ipcpd, irmd: Add QoS cube definitionSander Vrijders2016-05-146-44/+30
| | | | | | | | | | | | | | | | | | | | 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.
* | ipcpd: shim-udp: log error when failed sending SDUdimitri staessens2016-05-141-1/+2
| |
* | ipcpd: shim-udp: complete lockingdimitri staessens2016-05-143-109/+386
|/ | | | | | | Added necessary locks for the shim-udp. This PR also improves thread management, the main thread now starts a mainloop thread, which spawns sdu handler threads when it the IPCP is enrolled. If the IPCP exits the enrolled state, the sdu loop is cancelled.
* ipcpd: threading and cleanup of ipcpd_udpdimitri staessens2016-05-111-98/+40
| | | | | The shim_udp now correctly destroys its ringbuffer on exit. Now handles sdu's in a single thread using select() with a 10 us timeout.
* ipcpd: Fix unitialized valueSander Vrijders2016-05-101-2/+2
| | | | | A value that was unitialized was being treated as an error in the release build with gcc.
* ipcpd: Add nslookup to shim UDPSander Vrijders2016-05-103-25/+156
| | | | | This adds nslookup support to the shim UDP, so that a custom DNS server can be queried.
* ipcpd: Allow disabling of DNSSander Vrijders2016-05-103-29/+79
| | | | | | This allows someone to disable the use of DNS in the shim UDP. It also adds a config file specific for the shim UDP (which holds the nsupdate location). Certain defines were also moved to the global config file.
* ipcpd-udp: fixed missing closedimitri staessens2016-05-081-0/+1
| | | | caused the shim to run out of file descriptors fast...
* lib: changed port_id to intdimitri staessens2016-05-084-26/+26
| | | | | returning -1 as uint32_t leads to bugs. also changed types in GPB to sint to use zigzag encoding.