summaryrefslogtreecommitdiff
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: Fix bug in rib_testdimitri staessens2017-02-091-1/+1
|
* lib, tools, ipcpd: Fix compilation on FreeBSDdimitri staessens2017-02-091-2/+6
| | | | | | | | | | | | FreeBSD defines its own bswap64 in the <sys/endian.h> header, which is now included correctly. POSIX requires XSI or RTS extensions to be enabled for the sa_sigaction field to be visible. Linux doesn't do the check correctly, but FreeBSD does. Removes the LOG_MISSING call which was deprecated with the last revision of the logging system.
* ipcpd, lib: Report IPCP creation failuredimitri staessens2017-02-093-73/+127
| | | | | | | | The IPCP will now respond with an ipcp_create_r message when it fails, informing the IRMd. Also adds some const qualifiers in the public headers and fixes some formatting in dev.c.
* lib, ipcpd: Comply to pedantic C99Sander Vrijders2017-02-081-1/+4
| | | | | | With the changes in this commit Ouroboros will compile with the pedantic flag on when the standard is C99. The main problem was the used of unnamed structs and unions, which is C11.
* lib: Log to the logging systemdimitri staessens2017-02-083-19/+12
| | | | | | | | | | This removes the logfile and outputs log messages to the logging system. The creation of the logfiles (as well as the ap_init() call) were moved into ipcp_init() to simplify the IPCP creation and shutdown. Fixes #25 Fixes #27
* ipcpd: Revise PCI manipulation in normaldimitri staessens2017-02-071-14/+6
| | | | | | | | | | | The pci function will store offsets to avoid having to recalculate them every time. TTL handling is removed from the fmgr, the TTL is automatically decreased when deserializing the PCI (or set to 1 if there is no TTL present so the PDU will be forwarded). The deserialisation function now takes a pointer to a struct pci as input to avoid memory allocation and release each time a PDU is processed. Some checks have been replaced with assert() and return values replaced with void where it makes sense.
* ipcpd, lib: Revise normal IPCPdimitri staessens2017-02-062-10/+10
| | | | | | | | | | This PR updates the normal IPCP to use the new RIB. The old ribmgr is removed and replaced by a stub that needs to be implemented. All components (dir, fmgr, frct) were adapted to the new RIB API. A lot of functionality was moved outside of the ribmgr, such as the addr_auth, which is now a component of the IPCP. The address is also stored to the ipcpi struct. The irm tool has an option to set the gam policy of the rib manager.
* lib: Fix memleak in cacepdimitri staessens2017-02-061-0/+1
|
* lib: Handle receiving CDAP reply before waitdimitri staessens2017-02-041-1/+9
| | | | | | In extreme cases, the response to a CDAP request can arrive before the AE doing the request has called cdap_request_wait. This PR handles it by waiting for the state to move away from INIT before responding.
* lib: Retrieve number of children of a RIB nodedimitri staessens2017-02-031-3/+10
|
* lib: Fix insertion order in RIBdimitri staessens2017-02-021-8/+13
| | | | | | | | The new element must be added before the larger element (list_add_tail, since it's a circular list). Also fixes a bug and improves the locking in rib_pack (rib must be locked until the subtree is fully packed in the buffer).
* lib: Add packing and unpacking RIBdimitri staessens2017-01-314-30/+325
| | | | | | | | | | | | | | | | | | | The rib_pack function allows packing a subtree of the RIB for dissemination. The options PACK_HASH_ROOT and PACK_HASH_ALL will add the hashes for the root object of the packed subtree or every object to the packed message respectively. Checking of the hashes is currently only performed at the top level object, verifying the complete operation. The rib_unpack function unpacks a packed message and inserts its contents in the RIB. The option UNPACK_CREATE flags that the unpack operation is allowed to create new objects, else it will only update existing objects. More advanced options could be added in the future. The packed message structure uses Google Protocol Buffers, as defined in ro.proto. It adds tests for these functions to the rib_test.
* lib: Add function to get children of node in RIBdimitri staessens2017-01-292-0/+91
| | | | | Returns the names of the nodes (not the full paths). The function allocates memory to the children pointer that should be freed.
* lib: Fix reading from non-blocking flowsdimitri staessens2017-01-241-4/+3
| | | | | The -EAGAIN from a failed non-blocking flow read would trigger the assertion. This snuck in somehow (we need some unit tests for dev.c).
* lib: Add new version of Resource Information Basedimitri staessens2017-01-214-0/+1321
| | | | | | | | | | | | The new RIB is implemented as a tree with doubly linked nodes (parents keep a link to each child, each child keeps a link to its parent). An index is kept in a btree using CRC32 hashes of the path name in the RIB. Nodes keep an SHA3-256 hash value that is unique for the entire subtree. This allows quick checks to see if two RIB subtrees are in sync. The event system for the RIB is based on the event system for flows (fqueue), but implemented completely in dynamic memory using linked lists. An initial test is performed for the RIB. This PR does not modify existing code to use the new RIB.
* lib: Add move operation for listsdimitri staessens2017-01-201-0/+11
| | | | | Allows moving the elements of one linked list to another. Re-initializes the source list.
* lib: Fix return value and typo in fqueuedimitri staessens2017-01-201-1/+1
|
* lib: Add B-tree implementationdimitri staessens2017-01-165-0/+609
| | | | | Adds an implementation of B-trees of order k (k children, min fill is k/2, max fill k - 1). Useful to implement indexes for faster lookups.
* lib: Add test for crc32 functiondimitri staessens2017-01-152-0/+72
|
* lib: Move CRC32 implementation to librarydimitri staessens2017-01-142-0/+85
| | | | The CRC32 implementation will be used to ID objects in the RIB.
* lib: Add test for SHA-3 functiondimitri staessens2017-01-132-0/+296
| | | | Test the SHA3 function with known hashes.
* Merged in sandervrijders/ouroboros/be-gam (pull request #345)dimitri staessens2017-01-125-8/+211
|\ | | | | | | Be gam
| * ipcpd: normal: Create policies for GAMSander Vrijders2017-01-123-6/+9
| | | | | | | | | | This allows the selection of a policy for the graph adjacency manager. Currently we only support constructing a complete graph.
| * Merge remote-tracking branch 'upstream/be' into be-gamSander Vrijders2017-01-0923-302/+270
| |\
| * | lib: Add Common Application Connection Establishment PhaseSander Vrijders2017-01-093-5/+205
| | | | | | | | | | | | | | | | | | This adds CACEP to the library, which can be used for authenticating the other party after flow allocation and for obtaining other relevant information.
* | | lib: Add SHA3 hash functiondimitri staessens2017-01-114-0/+603
| | | | | | | | | | | | | | | | | | Adds an SHA-3 hash implementation that will be used in the rib, adapted and redistributed from the RHASH project (https://github.com/rhash/RHash)
* | | lib, include: Fix typo in list.c/hdimitri staessens2017-01-091-2/+2
| |/ |/|
* | include: Improve lockfile descriptiondimitri staessens2017-01-091-1/+1
| |
* | build: Update licenses and copyrightdimitri staessens2017-01-0923-205/+225
| | | | | | | | | | Copyright is set to 2016 - 2017. License text on includes and sources in the library are changed to indicate the LGPLv2.1 license.
* | lib: Revise implementation of listdimitri staessens2017-01-094-96/+44
|/ | | | Adds LGPL license to the ouroboros lists.
* lib, ipcpd, irmd: Proof of concept QoSdimitri staessens2017-01-033-23/+48
| | | | | | | | | | Now correctly relays the qoscube end-to-end in the stack. A simple function specifying the cube in the spec is used for initial testing. The translation is now done in dev.c, but it could be moved elsewhere when qos cabability matures and the need arises.
* lib: Fix race in destruction of cdap_reqdimitri staessens2016-12-282-10/+18
| | | | | If cdap_req_destroy was called while in REQ_DONE, cdap->state would be accessed in cdap_req_respond.
* lib: Fix leaks in cdapdimitri staessens2016-12-281-14/+19
| | | | | Fixes a memleak of cdap_req structs and correcly releases invoke_ids if the cdap_request_send operation fails during its execution.
* include, lib: Report communication failure with the IRMddimitri staessens2016-12-282-44/+23
| | | | | | | An errno EIRMD has been added to errno.h to indicate failure to send a message tot the IRMd. The IRM tool will report such errors, which makes it easier for users to detect that the IRM was not started or has failed.
* lib: Fix memleak in irm.cdimitri staessens2016-12-271-1/+3
|
* lib: Fix shutdown in multithreaded programsdimitri staessens2016-12-241-6/+6
| | | | | If a thread with a pending flow terminates, ap_fini would wait for the condvar to destroy the flow indefinitely.
* lib: Initialise qos cube to best effortdimitri staessens2016-12-241-0/+2
| | | | | The QoS cubes were not initialized in dev.c, which sometimes caused segfaults in the fmgr when calling ipcp_flow_get_qoscube.
* ouroboros: Correct license statementsdimitri staessens2016-12-2423-69/+46
| | | | | This corrects the license statements on all files. Installed headers are LGPLv2.1, the rest of the code is GPLv2.
* ipcpd, lib, irmd: Update to use qoscube_tdimitri staessens2016-12-241-5/+3
|
* ipcpd, lib: Refactor normal ipcp and cdapdimitri staessens2016-12-244-137/+615
| | | | | Refactors the normal IPCP fmgr and ribmgr, and modifies the API for cdap so that no callbacks are needed.
* lib, ipcpd: Add hashtable and PDU Forwarding FunctionSander Vrijders2016-12-214-0/+323
| | | | | | | This adds a hash table that takes 64-bit integers as key and uses separate chaining on collision. It also adds the PDU Forwarding Function, which the Flow Manager can use to lookup the fd towards the next hop. Routing policies will add/update/remove entries in the PFF.
* src, tools: Set/get timeout and get qos for flowsdimitri staessens2016-12-122-37/+155
| | | | | | | | | | | | | | | | Receiver timeouts can now be set on a flow using the flow_set_timeout function. Specifying NULL disables the timeout. The flow_get_timeout function gets the value for the timeout. This commit also deprecates fcntl in favor of flow_get_flags and flow_set_flags functions. struct qos_spec is typedef'd as a qosspec_t. The tools and cdap.c are updated to use the new API. Fixes a bug in operf client where the client's writer thread wouldn't cancel on SIGINT.
* lib: Fix indentation in shm_rdrbuff.cdimitri staessens2016-12-121-4/+4
|
* lib: Simplify shm_rbuff_read_bdimitri staessens2016-12-121-12/+6
|
* lib: Remove logs from stable sourcesdimitri staessens2016-12-035-273/+123
| | | | | This removes log output in applications and some size_t printf errors when compiling on 32 bit machines.
* lib, irmd: Ensure rbuffs are empty upon destructiondimitri staessens2016-11-301-2/+8
| | | | Also cleans up the flow_set if an AP-I dies abruptly.
* ipcpd, lib: Fix timerwheel issues / time_utilsdimitri staessens2016-11-251-2/+2
| | | | | | | Timerwheel would skip some additions due to a missed wakeup signal. Addition of timespecs and timevals in the time utilities would overflow tv_nsec/tv_usec if the sum is an integer number of seconds.
* lib: Deprecate shm_rbuff_resetdimitri staessens2016-11-251-10/+0
|
* ipcpd, lib: Add syntax version to protobuf filesSander Vrijders2016-11-224-2/+80
| | | | | | This adds a syntax version to the protobuf files. The latest version of protobuf otherwise complains that it is missing. The GPL license is also added on files where it was missing.
* lib: Remove dst_api field from rdrbuff blocksdimitri staessens2016-11-173-188/+95
| | | | | | Now that we have an rbuff per flow per AP, there is no more need to keep the dst_api in the rdrbuff. This also simplifies the sanitizer in the irmd.