diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2016-12-07 15:30:46 +0100 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2016-12-07 15:30:46 +0100 |
commit | ad88b94bca78e010357a6c7806e1d5e01701d4a7 (patch) | |
tree | 9c06e9c1b0c87f372dcf27cc832d5692db112e80 /nest | |
parent | d15b0b0a1b494c14b139d2d28706d82cd6e2f139 (diff) | |
parent | af62c0f9f1f6382fe88c8ae5e514f70c0b5b6d05 (diff) |
Merge branch 'int-new-rpki-squashed' (early part) into int-new
Diffstat (limited to 'nest')
-rw-r--r-- | nest/proto.c | 3 | ||||
-rw-r--r-- | nest/protocol.h | 6 | ||||
-rw-r--r-- | nest/route.h | 5 | ||||
-rw-r--r-- | nest/rt-table.c | 8 |
4 files changed, 16 insertions, 6 deletions
diff --git a/nest/proto.c b/nest/proto.c index bfbf80d8..815d0652 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -1265,6 +1265,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 19414525..6efaaaf7 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 pool *proto_pool; extern list proto_list; @@ -568,11 +568,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 8a238860..d652ca15 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 */ int rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter); rte *rt_export_merged(struct channel *c, net *net, rte **rt_free, struct ea_list **tmpa, linpool *pool, int silent); @@ -383,6 +383,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 @@ -572,6 +574,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 ae56e50a..6bf6c2fe 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1301,7 +1301,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; @@ -2695,6 +2695,12 @@ rt_show(struct rt_show_data *d) } } + if (d->table->addr_type != d->addr->type) + { + cli_msg(8001, "Incompatible type of prefix/ip with table"); + return; + } + if (d->show_for) n = net_route(d->table, d->addr); else |