summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 7adb294a31..70304127a2 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -289,7 +289,6 @@ struct zclient {
#define ZAPI_MESSAGE_TAG 0x08
#define ZAPI_MESSAGE_MTU 0x10
#define ZAPI_MESSAGE_SRCPFX 0x20
-#define ZAPI_MESSAGE_LABEL 0x40
/*
* This should only be used by a DAEMON that needs to communicate
* the table being used is not in the VRF. You must pass the
@@ -313,7 +312,7 @@ struct zapi_nexthop {
enum nexthop_types_t type;
vrf_id_t vrf_id;
ifindex_t ifindex;
- bool onlink;
+ uint8_t flags;
union {
union g_addr gate;
enum blackhole_type bh_type;
@@ -324,9 +323,18 @@ struct zapi_nexthop {
mpls_label_t labels[MPLS_MAX_LABELS];
struct ethaddr rmac;
+
+ uint32_t weight;
};
/*
+ * ZAPI nexthop flags values
+ */
+#define ZAPI_NEXTHOP_FLAG_ONLINK 0x01
+#define ZAPI_NEXTHOP_FLAG_LABEL 0x02
+#define ZAPI_NEXTHOP_FLAG_WEIGHT 0x04
+
+/*
* Some of these data structures do not map easily to
* a actual data structure size giving different compilers
* and systems. For those data structures we need
@@ -485,6 +493,29 @@ enum zapi_iptable_notify_owner {
ZAPI_IPTABLE_FAIL_REMOVE,
};
+static inline const char *
+zapi_rule_notify_owner2str(enum zapi_rule_notify_owner note)
+{
+ const char *ret = "UNKNOWN";
+
+ switch (note) {
+ case ZAPI_RULE_FAIL_INSTALL:
+ ret = "ZAPI_RULE_FAIL_INSTALL";
+ break;
+ case ZAPI_RULE_INSTALLED:
+ ret = "ZAPI_RULE_INSTALLED";
+ break;
+ case ZAPI_RULE_FAIL_REMOVE:
+ ret = "ZAPI_RULE_FAIL_REMOVE";
+ break;
+ case ZAPI_RULE_REMOVED:
+ ret = "ZAPI_RULE_REMOVED";
+ break;
+ }
+
+ return ret;
+}
+
/* Zebra MAC types */
#define ZEBRA_MACIP_TYPE_STICKY 0x01 /* Sticky MAC*/
#define ZEBRA_MACIP_TYPE_GW 0x02 /* gateway (SVI) mac*/
@@ -666,6 +697,8 @@ extern int zclient_route_send(uint8_t, struct zclient *, struct zapi_route *);
extern int zclient_send_rnh(struct zclient *zclient, int command,
struct prefix *p, bool exact_match,
vrf_id_t vrf_id);
+int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
+ uint32_t api_flags);
extern int zapi_route_encode(uint8_t, struct stream *, struct zapi_route *);
extern int zapi_route_decode(struct stream *, struct zapi_route *);
bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
@@ -690,6 +723,8 @@ bool zapi_iptable_notify_decode(struct stream *s,
enum zapi_iptable_notify_owner *note);
extern struct nexthop *nexthop_from_zapi_nexthop(struct zapi_nexthop *znh);
+int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh,
+ const struct nexthop *nh);
extern bool zapi_nexthop_update_decode(struct stream *s,
struct zapi_route *nhr);