An open-source C implementation of the RPKI/Router Protocol client
C Perl CMake C++ Objective-C Makefile Shell
Latest commit 621aee0 Feb 10, 2017 @fho fho pfx: fix possible memory leaks in pfx_table_del_elem() on realloc error
Fix the following issues:
- when realloc failed, data->ary became NULL and the previous memory
  area was leaked
  If realloc() fails the function now returns an error and keep the old
  memory area. If the element wouldn't have been at the of the list
  before, it would be then.
  Before the realloc() all elements are shifted to the beginning so that
  the not needed memory area is at the end and it can be resized.
  If realloc() failed the element that was planned to be deleted would
  then be inserted as last element in the list again. So that the
  dataset is not changed in a case of an error.

- when the last element was removed from data->ary, realloc() was called
  with a size of 0 to free the array.
  On Linux a call to realloc() with size of 0 behaves like a free.
  BUT on BSD systems a size of 0 means that the original data area is
  freed and a minimum sized data area is returned.
  This would have been leaked in the previous version.
Failed to load latest commit information.
doxygen rtrlib: rename lpfst to trie Feb 9, 2017
rtrlib pfx: fix possible memory leaks in pfx_table_del_elem() on realloc error Feb 14, 2017
scripts rtrlib: rename lpfst to trie Feb 9, 2017
tests tests: add test for rtr_send_error_pdu Feb 9, 2017
tools fix license header May 26, 2016
.codecov.yml tests: add some unit tests Nov 2, 2016
.editorconfig add editorconfig file May 2, 2016
.gitattributes .gitattributes added, to exclude .gitignore from git-archive calls Aug 30, 2011
.gitignore gitignore: add more ignore patterns Feb 9, 2017
.travis.yml tests: add some unit tests Nov 2, 2016
CHANGELOG update for version 0.3.6 Apr 5, 2016
LICENSE update year Apr 4, 2016


The RTRlib implements the client-side of the RPKI-RTR protocol (RFC
6810) and BGP Prefix Origin Validation (RFC 6811). This release also
supports Internet-Draft draft-ietf-sidr-rpki-rtr-rfc6810-bis, which
enables the maintenance of router keys. Router keys are required to
deploy BGPSEC.

The software was successfully tested on Linux and FreeBSD.

This package contains also the rtrclient program. It connects to an
RTR-Server over TCP or SSH and shows on STDOUT prefix origin data and
router keys that have been received from the RTR server. The program can
be found in the bin/ directory.

To build the RTRlib, the CMake build system must be installed.

To establish an SSH connection between RTR-Client and RTR-Server, the
libssh 0.6.x or higher library must also be installed.

cmocka (optional) is required for unit tests
Doxygen (optional) is required to create the HTML documentation.


* Generate Makefile:

  Without debugging options

    cmake -D CMAKE_BUILD_TYPE=Release .

  With debug symbols and debug messages:

    cmake -D CMAKE_BUILD_TYPE=Debug .

  If the libssh isn't installed within the systems include and library
  directories you can run cmake with the following parameters:

      -D LIBSSH_INCLUDE=<include-directory>

  To specify another directory where the RTRlib will be installed, you
  can pass the following argument to cmake:


* Build library, tests, and tools


To copy libraries and headers to system directories, run (optional):

    make install

Linking to RTRlib
The name of the shared library is rtr. To link programs to the RTRlib,
pass the following parameter to gcc:


In case an error such as

    -/usr/bin/ld: cannot find -lrtr
    -collect2: error: ld returned 1 exit status

occurs, the location of the library can be passed explicitly as a parameter



API Documentation
The RTRlib includes a HTML documentation of the API. To build them,
doxygen must be installed. The documentation will be located in the
docs/ directory after the execution of:

    make doc

Test RTR-Server Connection
The following command establishes a plain TCP connection to an
RTR-Server using the rtrclient command line tool:

    bin/rtrclient tcp 8282 is an open RTR-Server instance for testing
purposes, which runs the RIPE Validator. It listens on port 8282 and
validates ROAs from the following trust anchors: AfriNIC, APNIC, ARIN,

* cmake/      - CMake modules
* doxygen/    - Example code and graphics used in the Doxygen
* rtrlib/     - Header and source code files of the RTRlib
* tests/      - Unit tests
* tools/      - Contains the rtrclient


Mailing List:

/* vim: set tw=72 sts=2 sw=2 ts=2 expandtab: */