Allow daemons to add blackholes of specific types (reject/drop.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
stream_putc(s, api_nh->type);
switch (api_nh->type) {
case NEXTHOP_TYPE_BLACKHOLE:
+ stream_putc(s, api_nh->bh_type);
break;
case NEXTHOP_TYPE_IPV4:
stream_put_in_addr(s, &api_nh->gate.ipv4);
api_nh->type = stream_getc(s);
switch (api_nh->type) {
case NEXTHOP_TYPE_BLACKHOLE:
+ api_nh->bh_type = stream_getc(s);
break;
case NEXTHOP_TYPE_IPV4:
api_nh->gate.ipv4.s_addr = stream_get_ipv4(s);
api_nh->type = nexthop->type;
switch (nexthop->type) {
case NEXTHOP_TYPE_BLACKHOLE:
+ api_nh->bh_type = nexthop->bh_type;
break;
case NEXTHOP_TYPE_IPV4:
api_nh->gate.ipv4 = nexthop->gate.ipv4;
struct route_entry *re;
struct nexthop *nexthop = NULL;
int i, ret;
- enum blackhole_type bh_type = BLACKHOLE_NULL;
s = client->ibuf;
if (zapi_route_decode(s, &api) < 0)
api_nh->ifindex);
break;
case NEXTHOP_TYPE_BLACKHOLE:
- route_entry_nexthop_blackhole_add(re, bh_type);
+ route_entry_nexthop_blackhole_add(re,
+ api_nh->bh_type);
break;
}