Statistics
| Branch: | Revision:

iof-bird / bird-2.0.1 / proto / rpki / packets.h @ 6b3f1a54

History | View | Annotate | Download (1.2 KB)

1
/*
2
 *        BIRD -- The Resource Public Key Infrastructure (RPKI) to Router Protocol
3
 *
4
 *        (c) 2015 CZ.NIC
5
 *        (c) 2015 Pavel Tvrdik <pawel.tvrdik@gmail.com>
6
 *
7
 *        This file was a part of RTRlib: http://rpki.realmv6.org/
8
 *
9
 *        Can be freely distributed and used under the terms of the GNU GPL.
10
 */
11

    
12
#ifndef _BIRD_RPKI_PACKETS_H_
13
#define _BIRD_RPKI_PACKETS_H_
14

    
15
#include <arpa/inet.h>
16

    
17
#define RPKI_PDU_HEADER_LEN         8
18

    
19
/* A Error PDU size is the biggest (has encapsulate PDU inside):
20
 *            +8 bytes (Header size)
21
 *            +4 bytes (Length of Encapsulated PDU)
22
 *           +32 bytes (Encapsulated PDU IPv6 32)
23
 *            +4 bytes (Length of inserted text)
24
 *          +800 bytes (UTF-8 text 400*2 bytes)
25
 *         ------------
26
 *         = 848 bytes (Maximal expected PDU size) */
27
#define RPKI_PDU_MAX_LEN        848
28

    
29
/* RX buffer size has a great impact to scheduler granularity */
30
#define RPKI_RX_BUFFER_SIZE        4096
31
#define RPKI_TX_BUFFER_SIZE        RPKI_PDU_MAX_LEN
32

    
33
/* Return values */
34
enum rpki_rtvals {
35
  RPKI_SUCCESS                         = 0,
36
  RPKI_ERROR                         = -1
37
};
38

    
39
int rpki_send_serial_query(struct rpki_cache *cache);
40
int rpki_send_reset_query(struct rpki_cache *cache);
41
int rpki_rx_hook(sock *sk, uint size);
42
void rpki_connected_hook(sock *sk);
43
void rpki_err_hook(sock *sk, int size);
44

    
45
#endif