summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ipcpd: Wait for DHT running state before accessDimitri Staessens2017-12-061-12/+13
| | | | | | | | | | The DHT will now wait for the DHT_RUNNING state before handling request messages, ensuring that the parameters are set correctly before they are read and sent at JOIN. Also fixes a re-introduced assertion failure when a JOIN fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix missing bracket in DHTDimitri Staessens2017-12-051-1/+1
| | | | | | | | ca2f47d had a missing bracket after a last-minute update to simplify the logic. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Update DHT buckets in JOINING stateDimitri Staessens2017-12-051-7/+31
| | | | | | | | | | The DHT buckets were not updated in JOINING state, which sometimes caused the DHT to miss its first peer update when joining and become isolated. This also checks if a name is already registered to avoid adding it multiple times. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Make hash algorithm configurableSander Vrijders2017-12-042-28/+34
| | | | | | | | | | This makes the hashing algorithm configurable once more for the local and the shim-eth-llc, since their scope is so small that it is up to the network administrator to select a correct algorithm for the whole network. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from flow allocator0.8Sander Vrijders2017-12-043-117/+54
| | | | | | | | This will remove google protocol buffers from the flow allocator component in the normal IPCP. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Remove protocol buffers from link stateSander Vrijders2017-12-043-66/+24
| | | | | | | | | This will remove google protocol buffers from the link state routing algorithm in the normal IPCP. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from shim-udpSander Vrijders2017-12-043-104/+69
| | | | | | | | This will remove google protocol buffers from the shim-udp. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from shim-eth-llcSander Vrijders2017-12-043-122/+99
| | | | | | | | This will remove google protocol buffers from the shim-eth-llc. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* lib, tools: Rename application process and instanceDimitri Staessens2017-12-0267-1177/+1204
| | | | | | | | | | | This refactors ouroboros to use "program" instead of "application process" and "process" instead of "application process instance" to align with current naming in current Operating Systems courses instead of the ISO nomenclature adopted by RINA. This change permeates through the entire implementation. Also contains some minor other refactors. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Don't read commands under lockDimitri Staessens2017-11-301-3/+3
| | | | | | | | | The commands were read under a mutex. Since the cmd struct was just malloc'd, this is not needed. Also fixes closing the socket if the malloc fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Don't read commands under lockDimitri Staessens2017-11-301-3/+3
| | | | | | | | | The commands were read under a mutex. Since the cmd struct was just malloc'd, this is not needed. Also fixes closing the socket if the malloc fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Refactor shm_rdrbuff and shm_rbuffDimitri Staessens2017-11-304-497/+286
| | | | | | | | | | This refactors the creation of shm_rdrbuff and shm_rbuff elements. All cleanup is now handled and the common code between the _open() and _create() calls is moved to a static function. Common code between the pthread and lockless rbuff implementations was moved to shm_rbuff.c Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Set correct clock for irm_flow condvarDimitri Staessens2017-11-291-21/+31
| | | | | | | | | The irm_flow condition variable was not initialized to the correct clock, resulting in bad timedwaits when a flow was allocated with a timeout. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd, irmd: Bugfix for failed accept() callsDimitri Staessens2017-11-292-4/+2
| | | | | | | | | The ipcp will not have the rx_rb set for a pending flow, so it should not call shm_rbuff_fini. The irmd should not call ipcp_flow_dealloc for flows that are still pending flow allocation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Remove unnecessary linker directivesDimitri Staessens2017-11-292-3/+3
| | | | | | | The ouroboros-dev library links against ouroboros-common. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Don't bind from the IPCPDimitri Staessens2017-11-295-30/+71
| | | | | | | | | | The binding of the normal IPCP to its name is moved from the source code to the irm tool introducing the "autobind" option for the bootstrap and enroll commands. With this option, the IPCP will be bound to the IPCP name and the DIF name automatically. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Only update DHT buckets in running stateDimitri Staessens2017-11-281-1/+2
| | | | | | | This fixes accessing buckets when a DHT join fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Fix false alarm when registering before bindDimitri Staessens2017-11-271-1/+1
| | | | | | | | When registering a name in a dif before binding a program to it without auto, the IRMd would erroneously log that the binding failed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Fix SEGV in oping clientDimitri Staessens2017-11-221-4/+8
| | | | | | | | | | | The oping client tried to cancel non-created pthreads if it was killed during flow allocation, which caused a SEGV. The threads are now stopped using a variable. Fixes bug #2. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Install system-wide on OS XDimitri Staessens2017-11-201-1/+1
| | | | | | | | OS X should disable the system integrity protection system so ouroboros can be install system-wide. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Fix init and fini ELF sections for OS XDimitri Staessens2017-11-201-2/+10
| | | | | | | OS X uses a different syntax for specifying ELF sections. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Add library initializers to .init_arrayDimitri Staessens2017-11-201-4/+7
| | | | | | | | | | The library initializers with argc and argv arguments were specified using the __attribute__((constructor)). This is undefined behaviour as constructors should have no arguments. This is fixed by passing the functions to the .init_array. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Unset SHIM_ETH_LLC_TARGETDimitri Staessens2017-11-191-0/+1
| | | | | | | | This fixes the IRMd thinking a shim-eth-llc is available after it is disabled by configuring Ouroboros using ccmake. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Send time in oping packetsDimitri Staessens2017-11-192-38/+23
| | | | | | | | The oping tool now stores the time it sent the packet inside the SDU, simplifying the implementation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Define HAVE_LIBGCRYPT for IPCPsDimitri Staessens2017-11-181-0/+2
| | | | | | | | The HAVE_LIBGCRYPT variable was not defined for IPCPs, causing them to call the gcrypt functions with the wrong values for the enum. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Fix setting configuration definitionsDimitri Staessens2017-11-183-2/+14
| | | | | | | | Variable in cache need to be explicitly unset else they will remain in the cache and still be defined by #cmakedefine. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set correct rpath in non-sandboxed buildSander Vrijders2017-11-161-3/+9
| | | | | | | | After the previous commits, the rpath was not being correctly set anymore for the sandboxed and non-sandboxed build. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* build: Fix setting default build typeSander Vrijders2017-11-151-3/+4
| | | | | | | | This adds a check and sets the FORCE parameter to override the cmake default build type. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* build: Deprecate the compile/install scriptsDimitri Staessens2017-11-154-102/+0
| | | | | | | | | | | | | | | | The build system updates have made installing simple and robust using the following commands: mkdir build && cd build cmake .. ccmake . sudo make install Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Check process id when binding a processSander Vrijders2017-11-151-1/+11
| | | | | | | | This adds a check that the passed process id is in fact a number and not gibberish. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Add return statement in eth-llc loopDimitri Staessens2017-11-151-0/+2
| | | | | | | | Some compiler versions complained about a missing return in non-void function. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set defaults for prefix and build typeDimitri Staessens2017-11-151-0/+8
| | | | | | | | This defaults the CMAKE install prefix to "/". It also sets the default build type to "Release". Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Reset *dist on graph_routing_table failDimitri Staessens2017-11-151-0/+1
| | | | | | | | | | The *dist pointer was not reset on failure, causing the caller to try to free an unmalloced or already freed pointer. Reported-by: Nick Aerts <nick.aerts@ugent.be> Tested-by: Nick Aerts <nick.aerts@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set CMAKE_REQUIRED_FLAGS in CompilerUtilsSander Vrijders2017-11-142-3/+4
| | | | | | | | | This sets the cmake variable CMAKE_REQUIRED_FLAGS to the compiler flags that are being tested so that the linker doesn't fail when trying the compile flag. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* build: Add options for debug builds with sanitizerDimitri Staessens2017-11-147-12/+19
| | | | | | | | | This adds three build types, DebugASan, DebugTSan and DebugLSan that enable the Address, Thread and Leak Sanitizer by setting the fsanitize flag to the compiler. This option is supported by both gcc and clang. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set libraries for OpenSSL when not foundDimitri Staessens2017-11-141-0/+1
| | | | | | | | | The build didn't reset the CMake variable for OPENSSL_LIBRARIES, causing bad input to the linker. This error showed up when trying to build on XUbuntu 17.10 without OpenSSL or libgrcypt installed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Don't access entry after unlockDimitri Staessens2017-11-141-1/+1
| | | | | | | | When bootstrapping an IPCP entry->api variable was accessed after the registry was unlocked for printing and info message. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Avoid duplicate definitions in librariesDimitri Staessens2017-11-131-4/+2
| | | | | | | | There were sources defined in multiple libraries. This issue was reported by the address sanitizer on FreeBSD. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set compiler optimization for release buildDimitri Staessens2017-11-131-0/+3
| | | | | | | This automatically sets the -O3 compiler flag for release builds. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Fix detection of python for swig bindingsDimitri Staessens2017-11-101-3/+6
| | | | | | | | | | The cmake build only looked for the libraries but not the interpreter, which caused the build to fail if the library was present, but the interpreter was not installed and executable using the "python" command. The build now looks for the python interpreter as well. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix unused label with netmap for LLC shimDimitri Staessens2017-11-101-1/+3
| | | | | | | | When the netmap driver is used for the LLC shim, the label fail_device: was never used, resulting in a compiler error. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use correct names for st_modes in RIBDimitri Staessens2017-11-101-6/+8
| | | | | | | | | The RIB implementation was using internal variables from the linux implementation instead of the POSIX defined macros. The POSIX defined macros require defining __USE_XOPEN to access them. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Fix FRCT sequence number network endiannessDimitri Staessens2017-11-092-4/+9
| | | | | | | | Endianness conversion from/to the network for the sequence number was missing in 68694bc. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use packed struct for FRCT header accessDimitri Staessens2017-11-087-261/+142
| | | | | | | | | | | | | | | This replaces the variable FRCT header with a packed struct, which significantly simplifies the implementation. The shm_du_buff calls to release the head/tail are updated to return a pointer to the original head or the new tail (in symmetry to the alloc calls, which return a pointer to the new head and old tail), so that it immediately points to the structure that is needed. The frct_pci sources are removed and frct is now fully in the frct.c source file. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: List adjacencies in link-state databaseDimitri Staessens2017-11-071-4/+27
| | | | | | | The lsdb will now list management and data transfer adjacencies. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Create new SDUs for DHT join retriesDimitri Staessens2017-11-071-15/+15
| | | | | | | | | | The DHT join operation left an SDU in the rdrbuff for a couple of seconds during retries, which may cause the system to block if there is heavy traffic. This patch releases the sdb when the write fails and creates a new packet for every retry. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Refactor FRCT implementationDimitri Staessens2017-11-077-546/+572
| | | | | | | | | | | | | | | | | | | | The frct_pci and rq headers are moved from include/ouroboros to src/lib since they are only needed in the library. FRCT is moved to its own source file. FRCT takes the application PDUs, encapsulates and processes them and hands them back. This makes it easier to disable FRCT should the application want to write to a "raw" flow. An FRCT instance is now allocated upon alloc and released upon dealloc. The FRCT data structure is split into a sender and receiver connection record. Setting a new configuration will now be done upon sending the next data PDU, which will flag the DRF for a new run and use that configuration. This avoids some issues should packets arrive out-of-order, and simplifies setting a configuration. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Improve bash scriptsSander Vrijders2017-10-304-13/+18
| | | | | | | | This improves the bash scripts so they are less error prone. Mistakes were found using the parser on shellcheck.net Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* dev: Split nonblocking read and writeDimitri Staessens2017-10-303-4/+11
| | | | | | | | | | The FLOWFNONBLOCK flag now has two subflags FLOWFRNOBLOCK and FLOWFWNOBLOCK which allows setting the behavior of read and write independently. The default behavior is unchanged (blocking read and write). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* dev: Bind python scripts to script nameDimitri Staessens2017-10-251-0/+13
| | | | | | | | | | This revises the library init script so that it checks whether the program is run by a python executable (python, python2 or python3) and announces the script name instead of the python interpreter. This enables binding python scripts. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>