mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
RPKI: Update doc and comments
This commit is contained in:
parent
ffda86a34d
commit
47101e2ba5
@ -1 +1,6 @@
|
|||||||
S rpki.c
|
S rpki.c
|
||||||
|
S packets.c
|
||||||
|
S rtr.c
|
||||||
|
S transport.c
|
||||||
|
S tcp_transport.c
|
||||||
|
S ssh_transport.c
|
@ -505,7 +505,7 @@ rtr_check_receive_packet(struct rpki_cache *cache, void *pdu, const size_t len)
|
|||||||
// 16 = unknown pdu version
|
// 16 = unknown pdu version
|
||||||
int error = RTR_SUCCESS;
|
int error = RTR_SUCCESS;
|
||||||
|
|
||||||
//header in hostbyte order, retain original received pdu, in case we need to detach it to an error pdu
|
// header in hostbyte order, retain original received pdu, in case we need to detach it to an error pdu
|
||||||
struct pdu_header header;
|
struct pdu_header header;
|
||||||
memcpy(&header, pdu, sizeof(header));
|
memcpy(&header, pdu, sizeof(header));
|
||||||
rtr_pdu_header_to_host_byte_order(&header);
|
rtr_pdu_header_to_host_byte_order(&header);
|
||||||
@ -517,7 +517,7 @@ rtr_check_receive_packet(struct rpki_cache *cache, void *pdu, const size_t len)
|
|||||||
return RTR_ERROR;
|
return RTR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do dont handle error PDUs here, leave this task to rtr_handle_error_pdu()
|
// Do not handle error PDUs here, leave this task to rtr_handle_error_pdu()
|
||||||
if (header.ver != rtr_socket->version && header.type != ERROR)
|
if (header.ver != rtr_socket->version && header.type != ERROR)
|
||||||
{
|
{
|
||||||
// If this is the first PDU we have received -> Downgrade.
|
// If this is the first PDU we have received -> Downgrade.
|
||||||
|
@ -3,13 +3,18 @@
|
|||||||
*
|
*
|
||||||
* (c) 2015 CZ.NIC
|
* (c) 2015 CZ.NIC
|
||||||
*
|
*
|
||||||
* Using RTRLib: http://rpki.realmv6.org/
|
* Using RTRlib: http://rpki.realmv6.org/
|
||||||
*
|
*
|
||||||
* Can be freely distributed and used under the terms of the GNU GPL.
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DOC: The Resource Public Key Infrastructure (RPKI) to Router Protocol
|
* DOC: RPKI to Router Protocol
|
||||||
|
*
|
||||||
|
* The Resource Public Key Infrastructure (RPKI) to router protocol implementation
|
||||||
|
* is based on the RTRlib (http://rpki.realmv6.org/). The BIRD takes over
|
||||||
|
* |packets.c|, |rtr.c|, |transport.c|, |tcp_transport.c| and |ssh_transport.c| files
|
||||||
|
* from RTRlib.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef LOCAL_DEBUG
|
#undef LOCAL_DEBUG
|
||||||
@ -259,11 +264,12 @@ rpki_free_cache(struct rpki_cache *cache)
|
|||||||
mb_free(cache->rtr_socket->tr_socket);
|
mb_free(cache->rtr_socket->tr_socket);
|
||||||
mb_free(cache->rtr_socket);
|
mb_free(cache->rtr_socket);
|
||||||
|
|
||||||
|
/* timers */
|
||||||
tm_stop(cache->retry_timer);
|
tm_stop(cache->retry_timer);
|
||||||
tm_stop(cache->refresh_timer);
|
tm_stop(cache->refresh_timer);
|
||||||
tm_stop(cache->expire_timer);
|
tm_stop(cache->expire_timer);
|
||||||
|
|
||||||
rfree(cache->retry_timer);
|
rfree(cache->retry_timer);
|
||||||
|
|
||||||
rfree(cache->refresh_timer);
|
rfree(cache->refresh_timer);
|
||||||
rfree(cache->expire_timer);
|
rfree(cache->expire_timer);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* (c) 2015 CZ.NIC
|
* (c) 2015 CZ.NIC
|
||||||
*
|
*
|
||||||
* Using RTRLib: http://rpki.realmv6.org/
|
* Using RTRlib: http://rpki.realmv6.org/
|
||||||
*
|
*
|
||||||
* Can be freely distributed and used under the terms of the GNU GPL.
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
||||||
*/
|
*/
|
||||||
@ -53,7 +53,7 @@ struct rpki_cache {
|
|||||||
node n;
|
node n;
|
||||||
struct rpki_proto *p;
|
struct rpki_proto *p;
|
||||||
struct rpki_cache_cfg *cfg;
|
struct rpki_cache_cfg *cfg;
|
||||||
struct rtr_socket *rtr_socket; /* RTRLib's socket data structure */
|
struct rtr_socket *rtr_socket; /* RTRlib's socket data structure */
|
||||||
sock *sk; /* BIRD's socket data structure */
|
sock *sk; /* BIRD's socket data structure */
|
||||||
timer *retry_timer; /* Timer for Cache server */
|
timer *retry_timer; /* Timer for Cache server */
|
||||||
timer *refresh_timer; /* Timer for Cache server */
|
timer *refresh_timer; /* Timer for Cache server */
|
||||||
|
@ -67,7 +67,7 @@ rtr_purge_records_if_outdated(struct rpki_cache *cache)
|
|||||||
if ((rtr_socket->last_update + rtr_socket->expire_interval) < now)
|
if ((rtr_socket->last_update + rtr_socket->expire_interval) < now)
|
||||||
{
|
{
|
||||||
pfx_table_src_remove(cache);
|
pfx_table_src_remove(cache);
|
||||||
CACHE_TRACE(D_EVENTS, cache, "Remove outdated records from pfx_table");
|
CACHE_TRACE(D_EVENTS, cache, "All ROA records from %s expired", get_cache_ident(cache));
|
||||||
rtr_socket->request_session_id = true;
|
rtr_socket->request_session_id = true;
|
||||||
rtr_socket->serial_number = 0;
|
rtr_socket->serial_number = 0;
|
||||||
rtr_socket->last_update = 0;
|
rtr_socket->last_update = 0;
|
||||||
@ -162,7 +162,7 @@ rpki_refresh_hook(struct timer *tm)
|
|||||||
|
|
||||||
case RTR_CONNECTING:
|
case RTR_CONNECTING:
|
||||||
case RTR_SYNC:
|
case RTR_SYNC:
|
||||||
/* Wait small amout of time to transite state */
|
/* Wait a small amount of time to the end of transitive state */
|
||||||
tm_start(tm, 1);
|
tm_start(tm, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user