|
6 | 6 | Welcome to rtrlib-python's documentation! |
7 | 7 | ========================================= |
8 | 8 |
|
9 | | -rtrlib-python is a cffi based binding for rtrlib_. |
| 9 | +rtrlib-python_ is a cffi based binding for RTRlib_. |
| 10 | + |
| 11 | +The RTRlib implements the client-side of the RPKI-RTR protocol (RFC |
| 12 | +6810) and BGP Prefix Origin Validation (RFC 6811). This release also |
| 13 | +supports Internet-Draft draft-ietf-sidr-rpki-rtr-rfc6810-bis, which |
| 14 | +enables the maintenance of router keys. Router keys are required to |
| 15 | +deploy BGPSEC. |
10 | 16 |
|
11 | 17 | Since this is a work in progress currently only basic validation against one cache is supported. |
12 | 18 |
|
| 19 | +Installation |
| 20 | +------------ |
| 21 | +Requirements |
| 22 | +'''''''''''''' |
| 23 | +- python 2.7 or python 3 |
| 24 | +- C Compiler |
| 25 | +- RTRlib_ |
| 26 | + |
| 27 | +Python Requirements |
| 28 | +''''''''''''''''''' |
| 29 | +If you are using virtualenv these are installed automatically during the install step, |
| 30 | +otherwise you have to use your platforms package management tool or just run ``pip install -r requirements.txt``. |
| 31 | + |
| 32 | +- cffi>=1.4.0 |
| 33 | +- enum34 |
| 34 | +- six |
| 35 | + |
| 36 | +Download and Installation |
| 37 | +''''''''''''''''''''''''' |
| 38 | + |
| 39 | +- ``git clone https://github.com/rtrlib/python-binding.git`` |
| 40 | +- ``cd python-binding`` |
| 41 | +- ``python setup.py build`` |
| 42 | +- ``python setup.py install`` |
| 43 | + |
| 44 | +Example |
| 45 | +------- |
| 46 | +:: |
| 47 | + |
| 48 | + from rtrlib import RTRManager, PfxvState |
| 49 | + |
| 50 | + mgr = RTRManager('rpki-validator.realmv6.org', 8282) |
| 51 | + mgr.start() |
| 52 | + result = mgr.validate(12345, '10.10.0.0', 24) |
| 53 | + |
| 54 | + if result == PfxvState.valid: |
| 55 | + print('Prefix Valid') |
| 56 | + elif result == PfxvState.invalid: |
| 57 | + print('Prefix Invalid') |
| 58 | + elif result == PfxvState.not_found: |
| 59 | + print('Prefix not found') |
| 60 | + else: |
| 61 | + print('Invalid response') |
| 62 | + |
| 63 | + |
| 64 | +Further examples can be found in the tools_ dir of the repository. |
13 | 65 |
|
14 | | -For usage examples see the tools_ directory on github |
15 | 66 |
|
16 | | -.. _rtrlib: https://github.com/rtrlib/rtrlib |
| 67 | +.. _rtrlib-python: https://github.com/rtrlib/python-binding |
| 68 | +.. _RTRlib: https://github.com/rtrlib/rtrlib |
17 | 69 | .. _tools: https://github.com/mroethke/rtrlib-python/tree/master/tools |
18 | 70 |
|
19 | 71 | Contents: |
|
0 commit comments