0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 18:08:45 +00:00
bird/proto/rpki/packets.h
Pavel Tvrdík 41f4b5940f RPKI protocol with integrated RTRLib inside
Add the RPKI protocol (RFC 6810) using the RTRLib
(http://rpki.realmv6.org/) that is integrated inside
the BIRD's code.

Implemeted transports are:
 - unprotected transport over TCP
 - secure transport over SSHv2

The code should work properly with one or more cache servers per protocol.

Example configuration of bird.conf:
  ...
  roa4 table roatable;

  protocol rpki {
    table roatable;

    cache 127.0.0.1; # defaults: port 8282, preference 1, no encryption

    cache 127.0.0.1 {
      preference 1;
      port 2222;
      ssh encryption {
        bird private key "/home/birdgeek/.ssh/id_rsa";
        cache public key "/home/birdgeek/.ssh/known_hosts";
        user "birdgeek";
      };
    };

    cache "rpki-validator.realmv6.org" {
      preference 2;
    };
  }
  ...
2016-01-25 15:39:38 +01:00

39 lines
1.1 KiB
C

/*
* BIRD -- The Resource Public Key Infrastructure (RPKI) to Router Protocol
*
* (c) 2015 CZ.NIC
*
* This file is part of RTRlib: http://rpki.realmv6.org/
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#ifndef RTR_PACKETS_H
#define RTR_PACKETS_H
#include <arpa/inet.h>
#include "rtr.h"
#define RPKI_RX_BUFFER_SIZE 65536
#define RPKI_TX_BUFFER_SIZE 65536
#define RPKI_PDU_HEADER_LEN 8
#define RPKI_PDU_MAX_LEN 848 /* Error PDU size is the biggest (has encapsulate PDU inside):
* header(8) +
* len_of_encapsulated_pdu(4) +
* encapsulated_pdu_ipv6(32) +
* len_of_text(4) +
* utf-8 text(400*2) = 848
*/
#define RPKI_RECV_TIMEOUT 60
#define RPKI_SEND_TIMEOUT 60
int rtr_sync(struct rpki_cache *cache);
int rtr_wait_for_sync(struct rpki_cache *cache);
int rtr_send_serial_query(struct rpki_cache *cache);
int rtr_send_reset_query(struct rpki_cache *cache);
int rpki_rx_hook(struct birdsock *sk, int size);
void rpki_connected_hook(sock *sk);
void rpki_err_hook(struct birdsock *sk, int size);
void pfx_table_src_remove(struct rpki_cache *cache);
#endif