rtrlib: Make API consistent- To avoid name clashes and have a consistent API naming, every function,
enum, struct, ... that is exported is prefixed with `rtr_`/`RTR_`.
- `int` return types are changed to the pertinent `enum` type if applicable.
- Change `bool` type to indicate the performed operation when notifying users
about changes in the SPKI and PFX tables to specific `enum` type to improve
readability and mak...
rtr_mgr: Add callback to notify users when a new thread starts- Previously, it was not possible for users of the RTRlib to run arbitrary
code once a processing thread for an RTR socket has been started.
This commit adds an optional callback for notifying the user whenever a
new thread has been started and in the future possibly about other events
as well.
- The callback can be configured when initializing the RTRlib.
aspa: Replace existing ASPA record with new one- Whenever an ASPA announcement PDU is received and an ASPA record for that
customer ASN already exists, the new record replaces the old one as defined
in [draft-ietf-sidrops-8210bis-21].
- When an ASPA announcement and a withdrawal is received (in that order) within
one response from the cache server, it is considered a no-op if the customer
ASN doesn't exist yet; if it already exists,...
tests: Use domain of TU dresden for live tests- Further, the tests `test_live_fetching` and `test_live_disabled_features`
are added to the CTest test suite and thus will be executed when running
`ctest`
rtr: Check for plausible length of ASPA PDU- [draft-ietf-sidrops-8210bis-21] specifies that an ASPA PDU must have a
length that is divisible by 4 to be correct. This commit adds a check
and if its length is not divisible by 4 a `Corrupt Data (0)` error is
sent.
- The unit tests in `test_aspa.c` are extended by checks for sent error
PDUs.
[draft-ietf-sidrops-8210bis-21]: https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-8...
rtr: Remove commented out check for `afi_flags`- The previous ASPA implementation contained an `afi_flags` field
in the PDU, which doesn't exist (anymore) in the draft version 21.
Thus, everything remaining to `afi_flags` is removed.
rtr_mgr: Change return type from `int` to enum- Although most functions within the `rtr_mgr` return an enum value,
the function signature defines the return type as `int`. This is
error-prone and reduces readability. To fix this, the `int` return
data type has been replaced by the respective enum type.
Ignore received PDUs of supported but disabled features- Previously, when a PDU of a supported but disabled feature has been received,
a segmentation fault was caused for some of the PDUs due to missing NULL-checks.
Now, those PDUs are ignored and not further processed.
- Previously, a feature that has not been initialized would cause a segmentation
fault when the RTRlib manager was stopped and freed. This has been fixed by
adding the neces...
rtr: Respond with error if ASPA announcement PDU contains no providers- Draft `8210bis` version 21; Section 5.12. states that an ASPA
announcement PDU must always contain at least one provider
autonomous system number
- If an announcement doesn't contain any provider autonomous
system numbers an error `ASPA Provider List Error (9)` is
sent to the cache server and the transport connection is
closed
rtr: Respond with error if ASPA withdrawal PDU contains data- Draft `8210bis` version 21; Section 5.12. states that an ASPA
withdrawal PDU must always be exactly 12 octets long and thus
must not contain any `Provider Autonomous System Numbers`
- Since no other error code is specified for that scenario,
a `Corrupt Data (0)` error response is sent to the cache server
rtr: Update format of ASPA PDU to `8210bis` Draft version 21This removes the `uint16_t provider_count` and the `uint8_t afi_flags` fields
of `struct pdu_aspa`, changes the data type of `uint16_t zero` to `uint8_t`,
and moves the `uint8_t flags` field to be directly after the `uint8_t type`
field.
Fix: Add missing memory allocation NULL-checks (#298)* transport: add missing NULL checks to memory allocation calls
- Memory allocation by `lrtr_calloc` or `lrtr_malloc` could fail which led
to undefined behavior / segmentation faults when dereferencing the result
pointer while initializing an SSH or TCP socket. Now, the `tr_ssh_init`
and `tr_tcp_init` functions prematurely return with an error code instead.
- In addition, the `tr_ssh_ini...
transport: fix bad copy-paste in `tr_ssh_init` (#299)- Checking the wrong pointer (`ssh_socket->config.client_privkey_path`
instead of `ssh_socket->config.server_hostkey_path`) for `NULL` after
copying the server host key path to the SSH socket struct could lead
to undefined behavior or at least an unnecessary error if
`ssh_socket->config.client_privkey_path` is set to `NULL`.
This commit fixes the check so that the correct pointer is e...
rtrlib: extra checks for when user didn't initialize some tables- added null ptr checks in pfx_validate, aspa_verify and spki_validate
- added warnings if the user tries to validate objects where there is no
table
rtrlib: reworking user interface adding rtr_mgr_setup_sockets function- adjusted tests and tools
- added function rtr_mgr_setup_sockets with functionality that
previously resided in rtr_mgr_init
tools: update rtrclient to support aspa- update main cmake file
Co-authored-by: mrzslz <moritz.schulz@proton.me>
Co-authored-by: carl <115627588+carl-tud@users.noreply.github.com>
tests: add aspa tests- add tests for AS_PATH verification
- add tests for `aspa_array`
- add tests for aspa pdu parsing and `aspa_table` updating
- add tests for live interaction with rtr cache servers
Co-authored-by: mrzslz <moritz.schulz@proton.me>
Co-authored-by: carl <115627588+carl-tud@users.noreply.github.com>
rtrlib: add aspa to central management data structure- add aspa_table to rtr_mgr functions
- fix typos and format
Co-authored-by: mrzslz <moritz.schulz@proton.me>
Co-authored-by: carl <115627588+carl-tud@users.noreply.github.com>
rtr: add support for aspa pdus- add support for rtrv2 including aspa pdus
- move rtr pdus to separate header
- refactor undo-update logic
- add aspa in-place and swap-in update mechanism
Co-authored-by: mrzslz <moritz.schulz@proton.me>
Co-authored-by: carl <115627588+carl-tud@users.noreply.github.com>
[FIX] Bit selection error for trie buildingMotivation:
- test cases for arm7 Ubuntu18.04 and ppc64le Ubuntu18.04 failed
- pipeline results in fail after commit
- minor improvements for uniform build up live_tests
How:
- trie building is based on address (binary-trie)
- getting a single bit for IPv6 addresses has been error prone for
bit_postion > 95
- unsure why other distributions did not fail
=> may be due to different en...
Updates public rpki-cache and fixes pipline issuesMotivation
- get pipeline checks running
How:
- insert valid rpki-cache which runs also rtr
- edit url in live_tests, README
- modify changelog date in librtr.spec file
=> no changelog results in error, because all changes older
than 2years are dismissed
- add more output on failure for tests
Updates the used public rpki-caches for testing environmentMotivation
- get pipeline checks running
How:
- find valid rpki-cache which runs also rtr
- edit url in live_tests
rtr_mgr: replace mutex with rwlockrtr_mgr could enter a deadlocked state with multiple socket groups when
a group with at least one group of lower preference comes back online.
This happens because the thread of the group coming back online blocks
on trying to shut down all threads with lower preference while holding
the rtr_mgrs mutex, but a thread that tries to acquire that same mutex
cannot be shut down while doing so.
Sinc...
redhat: Fix RPM file to work on Fedora 33+ and RedHat 9+- Newer Fedora/RedHat changes cmake rpm build to build out of tree
and requires the use of macros for correct locations
See https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
- On newer Fedora, the SOURCES subdirectory isn't created
automatically and needs to be created in the prep phase before
the tar is created
Signed-off-by: Martin Winter <mwinter@opensourcerout...
rtrlib/rtr_mgr: properly cleanup rtr_sockets on stop (#268)Previously rtr_sockets could not be restarted because their state
remained on SHUTDOWN, which they can, by design, not recover from
themselves.