summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorPavel TvrdĂ­k <pawel.tvrdik@gmail.com>2015-09-17 17:15:30 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-07 09:35:24 +0100
commit65d2a88dd2aaef7344cfa62918e3ddf4c72ca50a (patch)
tree26da08ceb1c12c4b5fd37d9a4fd51cfc5b70b301 /nest
parent2706747f66ab0e7a7f2b8acc6bd7fbd376647258 (diff)
RPKI protocol with one cache server per protocol
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 Example configuration of bird.conf: ... roa4 table r4; roa6 table r6; protocol rpki { debug all; # Import both IPv4 and IPv6 ROAs roa4 { table r4; }; roa6 { table r6; }; # Set cache server (validator) address, # overwrite default port 323 remote "rpki-validator.realmv6.org" port 8282; # Overwrite default time intervals retry 10; # Default 600 seconds refresh 60; # Default 3600 seconds expire 600; # Default 7200 seconds } protocol rpki { debug all; # Import only IPv4 routes roa4 { table r4; }; # Set cache server address to localhost, # use default ports tcp => 323 or ssh => 22 remote 127.0.0.1; # Use SSH transport instead of unprotected transport over TCP ssh encryption { bird private key "/home/birdgeek/.ssh/id_rsa"; remote public key "/home/birdgeek/.ssh/known_hosts"; user "birdgeek"; }; } ...
Diffstat (limited to 'nest')
-rw-r--r--nest/proto.c3
-rw-r--r--nest/protocol.h6
-rw-r--r--nest/route.h5
-rw-r--r--nest/rt-table.c2
4 files changed, 10 insertions, 6 deletions
diff --git a/nest/proto.c b/nest/proto.c
index f2416748..670ee00e 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1262,6 +1262,9 @@ protos_build(void)
#ifdef CONFIG_BABEL
proto_build(&proto_babel);
#endif
+#ifdef CONFIG_RPKI
+ proto_build(&proto_rpki);
+#endif
proto_pool = rp_new(&root_pool, "Protocols");
proto_shutdown_timer = tm_new(proto_pool);
diff --git a/nest/protocol.h b/nest/protocol.h
index 4b7bfdf3..6041f314 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -81,7 +81,7 @@ void protos_dump_all(void);
extern struct protocol
proto_device, proto_radv, proto_rip, proto_static,
- proto_ospf, proto_pipe, proto_bgp, proto_bfd, proto_babel;
+ proto_ospf, proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki;
/*
* Routing Protocol Instance
@@ -271,7 +271,7 @@ proto_get_router_id(struct proto_config *pc)
}
/* Moved from route.h to avoid dependency conflicts */
-static inline void rte_update(struct proto *p, net_addr *n, rte *new) { rte_update2(p->main_channel, n, new, p->main_source); }
+static inline void rte_update(struct proto *p, const net_addr *n, rte *new) { rte_update2(p->main_channel, n, new, p->main_source); }
extern list proto_list;
@@ -562,11 +562,9 @@ int proto_configure_channel(struct proto *p, struct channel **c, struct channel_
void channel_set_state(struct channel *c, uint state);
-/*
static inline void channel_init(struct channel *c) { channel_set_state(c, CS_START); }
static inline void channel_open(struct channel *c) { channel_set_state(c, CS_UP); }
static inline void channel_close(struct channel *c) { channel_set_state(c, CS_FLUSHING); }
-*/
void channel_request_feeding(struct channel *c);
void *channel_config_new(const struct channel_class *cc, uint net_type, struct proto_config *proto);
diff --git a/nest/route.h b/nest/route.h
index b5885ee3..74bbe4ab 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -283,7 +283,7 @@ void *net_route(rtable *tab, const net_addr *n);
int net_roa_check(rtable *tab, const net_addr *n, u32 asn);
rte *rte_find(net *net, struct rte_src *src);
rte *rte_get_temp(struct rta *);
-void rte_update2(struct channel *c, net_addr *n, rte *new, struct rte_src *src);
+void rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src);
/* rte_update() moved to protocol.h to avoid dependency conflicts */
void rte_discard(rtable *tab, rte *old);
int rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter);
@@ -384,6 +384,8 @@ typedef struct rta {
#define RTS_BGP 11 /* BGP route */
#define RTS_PIPE 12 /* Inter-table wormhole */
#define RTS_BABEL 13 /* Babel route */
+#define RTS_RPKI 14 /* Route Origin Authorization */
+
#define RTC_UNICAST 0
#define RTC_BROADCAST 1
@@ -561,6 +563,7 @@ extern struct protocol *attr_class_to_protocol[EAP_MAX];
#define DEF_PREF_BABEL 130 /* Babel */
#define DEF_PREF_RIP 120 /* RIP */
#define DEF_PREF_BGP 100 /* BGP */
+#define DEF_PREF_RPKI 100 /* RPKI */
#define DEF_PREF_INHERITED 10 /* Routes inherited from other routing daemons */
/*
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 9e9d4c7a..8d780633 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1291,7 +1291,7 @@ rte_unhide_dummy_routes(net *net, rte **dummy)
*/
void
-rte_update2(struct channel *c, net_addr *n, rte *new, struct rte_src *src)
+rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
{
struct proto *p = c->proto;
struct proto_stats *stats = &c->stats;