summaryrefslogtreecommitdiffstats
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-04-11 23:52:46 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-28 01:21:43 +0200
commit09a484dd1d27580d98c4b94d3ed77e47d7aac0b5 (patch)
treeac178c846ddabfe4d6c80d5f6b5f4ba6025bbea2 /lib/zclient.h
parentMerge pull request #1054 from dslicenc/eigrp-connected (diff)
downloadfrr-09a484dd1d27580d98c4b94d3ed77e47d7aac0b5.tar.xz
frr-09a484dd1d27580d98c4b94d3ed77e47d7aac0b5.zip
*: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from API
FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackholes as proper nexthops inside the message. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 7c4780201..e05e9d8ad 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -222,7 +222,10 @@ struct zserv_header {
struct zapi_nexthop {
enum nexthop_types_t type;
ifindex_t ifindex;
- union g_addr gate;
+ union {
+ union g_addr gate;
+ enum blackhole_type bh_type;
+ };
/* MPLS labels for BGP-LU or Segment Routing */
uint8_t label_num;
@@ -429,4 +432,14 @@ extern int zclient_route_send(u_char, struct zclient *, struct zapi_route *);
extern int zapi_route_encode(u_char, struct stream *, struct zapi_route *);
extern int zapi_route_decode(struct stream *, struct zapi_route *);
+static inline void zapi_route_set_blackhole(struct zapi_route *api,
+ enum blackhole_type bh_type)
+{
+ api->nexthop_num = 1;
+ api->nexthops[0].type = NEXTHOP_TYPE_BLACKHOLE;
+ api->nexthops[0].bh_type = bh_type;
+ SET_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP);
+};
+
+
#endif /* _ZEBRA_ZCLIENT_H */