summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ipcpd: Fix reading LSAs in link-state policy0.10.7Dimitri Staessens2018-03-162-3/+3
| | | | | | | | | | | The read buffer had the exact length of a link-state message. With the partial read implemented, we should then do another read() to check if there are more parts of the message (which will return 0). To avoid the additional read() call every time, the buffer was extended by 1 byte. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Simplify some code in rdrbuffDimitri Staessens2018-03-161-8/+2
| | | | | | | This simplifies some functions in the rdrbuff. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Use non-blocking read in serversDimitri Staessens2018-03-162-2/+2
| | | | | | | | | | | The oping and ocbr servers were using non-blocking read/writes. This caused writes to fail on high-performance tests if the buffer got full, instead of waiting for a slot in the buffer. The write failure caused the server to quit. This fixes the tools by setting the I/O to blocking write and non-blocking read. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use sequenced datagrams with UNIX socketsSander Vrijders2018-03-131-2/+2
| | | | | | | | The UNIX sockets were using SOCK_STREAM, which does not preserve the message boundaries. This switches to SOCK_SEQPACKET. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* lib: Allow partial readDimitri Staessens2018-03-122-21/+44
| | | | | | | | | | | | | This implements partial read of packets if the buffer supplied to flow_read() is smaller than the packet in the buffer. If the number of bytes returned by flow_read equals the size of the buffer, the next read() will deliver the next bytes of the packet (or 0 if the packet was exactly the size of the buffer on the previous read). Implements #7. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Implement timeout on blocking writeDimitri Staessens2018-03-123-39/+63
| | | | | | | | | | This completes the implementation of the SNDTIMEO for a blocking write. Fixes #6. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add validity checks for eth-dixDimitri Staessens2018-03-122-1/+11
| | | | | | | | This will check if the Ethertype value is a valid Ethertype in the irm tool and the eth-dix IPCPd. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add length field to eth-dixDimitri Staessens2018-03-101-62/+57
| | | | | | | | | Some NICs added padding to the Ethernet II frames causing bad frame lengths and GPB unpack fails. This adds a 2-byte length field to the DIX frame to circumvent this. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add IPCP over DIX EthernetDimitri Staessens2018-03-1013-406/+760
| | | | | | | | | | | | | | | | | | This adds an IPC Process that uses DIX Ethernet with an Ethertype that is configurable at bootstrap. This allows parallel DIX layers over the same Ethernet network with different Ethertypes (and one LLC layer). It allows jumbo frames in the future, and should avoid the problems we have with some routers not handling LLC traffic very well. The destination endpoint ID is sent as a 16 bit integer, so the maximum payload is 1498 bytes in standard Ethernet, and 8998 bytes when Jumbo frames are used. The implementation is very similar to the Ethernet LLC IPCP, so it is implemented using preprocessor macros in the single source instead of duplicating code. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use PTHREAD_COND_CLOCK for blocking reads0.10.6Dimitri Staessens2018-03-103-4/+7
| | | | | | | | | | | The rbuff uses the PTHREAD_COND_CLOCK for its condition variables, but the flow_read was passing a time it got from the CLOCK_REALTIME_COARSE clock. This causes the blocking reads not to timeout correctly. The oping was updated to detect server timeouts and finish gracefully. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix bytes sent in send statisticsDimitri Staessens2018-03-081-6/+11
| | | | | | | | The number of bytes sent was not counting the data transfer PCI. This is now fixed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Don't cancel reader thread in oping0.10.5Dimitri Staessens2018-03-052-3/+1
| | | | | | | | The reader thread was cancelled as soon as the writer was finished, which resulted in missed responses and misreported packet loss. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Add fccntl operation to get queue lengthsDimitri Staessens2018-02-284-9/+40
| | | | | | | | | | This adds the FLOWGRXQLEN and FLOWGTXQLEN operations to fccntl to get the number of packets that are in the receive and transmit buffers respectively. The flow statistics are updated to show these queue lengths. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix flow statisticDimitri Staessens2018-02-261-1/+1
| | | | | | | There was a wrong rcv_bytes where it should have been snd_bytes. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Fix FUSE access for non-root users0.10.4Dimitri Staessens2018-02-262-11/+8
| | | | | | | | | | This fixes the access to the RIB for non-root users. Thanks to Sitri and Dagger from the ##fuse channel for their assistance. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Reduce default buffer size to 4096 blocksDimitri Staessens2018-02-261-2/+1
| | | | | | | | This reduces the default buffer size to 4096 blocks (about 16MB). This will avoid problems when users try a default build on smaller machines. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix access to uninitialized valueDimitri Staessens2018-02-261-14/+14
| | | | | | | | | This fixes the access to an uninitialized dt_pci struct when updating flow statistics in the case there is no next hop, which often resulted in a segmentation fault. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix data race when accessing DHT stateDimitri Staessens2018-02-261-1/+2
| | | | | | | | The dht_get_state() function should be used to get the state of the DHT. This fixes bug #4. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Enable debug symbols for debug buildsDimitri Staessens2018-02-261-0/+2
| | | | | | | | This sets the "-g" compiler flag if the build is not "Release" so that the sanitizers correctly display line numbers in their output. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Cleanup flow datastructures on exit0.10.3Dimitri Staessens2018-02-242-6/+13
| | | | | | | | | The irmd was not cleaning up non-deallocated flows upon exit. This bug was probably introduced with the introduction of the threadpool managers. Also fixes a missing rwlock_destroy(). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix malformed sprintf in dt component0.10.2Dimitri Staessens2018-02-242-2/+2
| | | | | | | | The sprintf was missing a format string. Some compilers did not complain about this. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix missing free in graph implementationSander Vrijders2018-02-241-0/+2
| | | | | | | | There was a missing free in case the address was not found in the routing table when trying to add an LFA for a certain address. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* irmd: Remove dead variable assignmentsSander Vrijders2018-02-241-2/+0
| | | | | | | | This removes two useless variable assignments from the IRMd, which were remnants from when the pending flow was being deallocated. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Fix cleanup of sdu schedulerDimitri Staessens2018-02-241-7/+7
| | | | | | | | | | Not all threads were cancelled on exit. This fixes (the rather cryptic) error message "The futex facility returned an unexpected error code" when running the stack with the address sanitizer. Also fixes possible double frees when a pthread_create would fail. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Print establishment time in flow statsDimitri Staessens2018-02-231-22/+35
| | | | | | | | | | The time of establishment will be printed as part of the flow statistics (it is the same as the modification time of the file in the FUSE filesystem). Some output was reordered and the length of the sizes is updated to be sufficient for 64-bit values. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* irmd: Replace fork and execv with posix_spawnSander Vrijders2018-02-232-28/+16
| | | | | | | | | This replaces the fork and execv calls with posix_spawn since it is supported on more platforms, and is more efficient. Also fixes some bad indentation. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* build: Deprecate version generation from git tag0.10.1Dimitri Staessens2018-02-232-50/+4
| | | | | | | | | | This deprecates the version generation from git tags. The version is now set in the CMakeLists.txt. This avoids wrong versions when checking out old commits and building the repository inside another repository. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Print endpoint in flow statisticsDimitri Staessens2018-02-234-14/+30
| | | | | | | | | | The flow statistics will now print the endpoint of the flow. If it's a local endpoint for the IPCP, it will print the component (e.g. "flow-allocator"). For remote flows, it will print the address of the IPCP. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Reset flow statistics on reuseDimitri Staessens2018-02-231-0/+2
| | | | | | | | The flow statistics were not reset when a new connection was created, resulting in wrong statistics. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix locking issues in flow statisticsDimitri Staessens2018-02-231-12/+59
| | | | | | | | | The locks were not initialised correctly due to a misspelled define and the fail_write was trying to lock a bad mutex (sometimes -1 out of array). This also fixes the statistics gathered. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix double definition of ipcp configDimitri Staessens2018-02-234-43/+16
| | | | | | | | | | The import of the IPCP config protobuf message in the enrollment message caused a double definition. The enroll.proto file is deprecated and the definition of the enrollment message is moved to the library to avoid this. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix missing lock in link-state policyDimitri Staessens2018-02-231-0/+27
| | | | | | | | The replication of the database was missing a lock. Now the database is first copied under lock and then sent. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Ignore void return value for gcry_randomizeDimitri Staessens2018-02-231-1/+2
| | | | | | | | The libgcrypt gcry_randomize function returns void which was returned as an int, which gives warnings on some compilers. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Export flow statistics to RIBDimitri Staessens2018-02-203-20/+399
| | | | | | | | | | This adds flow statistics for the data transfer (DT) component to the RIB. The DT component will keep track of the traffic on each flow. This feature can be enabled or disabled by setting the IPCP_FLOW_STATS variable in the build system. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Get RIB attributes from componentDimitri Staessens2018-02-203-52/+132
| | | | | | | | | | | | This revises the RIB so it gets the complete file attribute list from the component instead of setting some attributes in the library. This will allow setting read/write access later on in the component itself. The time of last change of lsdb entries in the file system is now set to the time of the last received Link State Update for that entry. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Allow out-of-tree build of toolsDimitri Staessens2018-02-1417-57/+150
| | | | | | | | | | This removes the dependencies for the tools on some ouroboros internal headers (endian.h and time_utils.h) so they can be built out-of-tree. The echo-app tool has been renamed oecho and the cbr tool has been renamed ocbr. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Revise Data Transfer component0.10.0Dimitri Staessens2018-02-1342-499/+492
| | | | | | | | | | | This makes the TTL non-optional and allows the maximum (initial) value of the TTL to be specified at bootstrap (the default is set to 60). The fd in the DT PCI is now called EID (Endpoint ID). The names "dif" and "ae" have been replaced by "layer" and "component" respectively in all sources. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Add sort command to GitVersionGen0.9.10Sander Vrijders2018-02-131-0/+7
| | | | | | | | This adds the sort command with the version sort to GitVersionGen so the latest version is used when running cmake. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Revise lookup tracking in DHTDimitri Staessens2018-02-102-54/+88
| | | | | | | | | | The lookups now track the responses by cookie instead of just counting the remaining number of responses. This is needed because simultaneous lookups for the same hash interfere with eachother and lead to missed responses. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Use GNUInstallDirs instead of hardcoded values0.9.9Sander Vrijders2018-02-0615-23/+23
| | | | | | | | This changes the build to use GNUInstallDirs instead of hardcoded values. Package maintainers can then override these defaults by passing the correct value to cmake on the command line. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Add option to disable SWIG supportDimitri Staessens2018-02-061-49/+54
| | | | | | | | This allows disabling swig support on systems where swig is installed but it fails building (e.g. some versions of Raspbian). Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Replicate database on new MGMT flowDimitri Staessens2018-02-061-0/+17
| | | | | | | | This will trigger the existing member to send all entries in its database as LSAs to the new member. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Handle LU_DONE state in DHTDimitri Staessens2018-02-061-0/+1
| | | | | | | | The DHT would enter an infinite loop in lookup_wait() because the LU_DONE state was not handled correctly. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* Merge branch 'testing' into beSander Vrijders2018-02-051-2/+2
|\
| * irmd: Fix lookup of program for autoexecution0.9.8Dimitri Staessens2018-02-051-2/+2
| | | | | | | | | | | | | | | | Autoexecution failed because the lookup for the program was for the wrong field of the progtable. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | Merge branch 'testing' into beDimitri Staessens2018-02-031-1/+1
|\|
| * tools: Fix check for return value in irm tool0.9.7Sander Vrijders2018-02-031-1/+1
| | | | | | | | | | | | | | | | A check was done in the irm tool for the pid of a newly created IPCP, but it didn't catch all failures, this fixes that. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* | Merge branch 'testing' into beDimitri Staessens2018-01-291-2/+2
|\|
| * lib: Fix assertions in timerwheel0.9.6Sander Vrijders2018-01-291-2/+2
| | | | | | | | | | | | | | | | The previous commit only fixed the issue for release builds. This fixes it for debug builds as well. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* | Merge branch 'testing' into beDimitri Staessens2018-01-291-3/+3
|\|