bgpd, lib, ospfd, zebra: Add ability to read/write tag value
Modify zebra to pass the tag value to and from the
various protocols.
[forward ported by Cumulus]
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Signed-off-by: Piotr Chytla <pch@packetconsulting.pl>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Edits: Paul Jakma <paul.jakma@hpe.com> rebase conflicts in bgp_zebra.c
diff --git a/lib/zclient.c b/lib/zclient.c
index 097314a..a1de831 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -530,6 +530,8 @@
* If ZAPI_MESSAGE_METRIC is set, the metric value is written as an 8
* byte value.
*
+ * If ZAPI_MESSAGE_TAG is set, the tag value is written as a 2 byte value
+ *
* XXX: No attention paid to alignment.
*/
int
@@ -588,6 +590,8 @@
stream_putl (s, api->metric);
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
stream_putl (s, api->mtu);
+ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
+ stream_putw (s, api->tag);
/* Put length at the first point of the stream. */
stream_putw_at (s, 0, stream_get_endp (s));
@@ -644,6 +648,8 @@
stream_putl (s, api->metric);
if (CHECK_FLAG (api->message, ZAPI_MESSAGE_MTU))
stream_putl (s, api->mtu);
+ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_TAG))
+ stream_putw (s, api->tag);
/* Put length at the first point of the stream. */
stream_putw_at (s, 0, stream_get_endp (s));