stream_putl(s, api->tag);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
stream_putl(s, api->mtu);
+ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID))
+ stream_putl(s, api->tableid);
/* Put length at the first point of the stream. */
stream_putw_at(s, 0, stream_get_endp(s));
STREAM_GETL(s, api->tag);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
STREAM_GETL(s, api->mtu);
+ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID))
+ STREAM_GETL(s, api->tableid);
stream_failure:
return 0;
#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
+ * default vrf, else this will be ignored.
+ */
+#define ZAPI_MESSAGE_TABLEID 0x80
/* Zserv protocol message header */
struct zserv_header {
vrf_id_t vrf_id;
+ uint32_t tableid;
+
struct ethaddr rmac;
};
re->flags = api.flags;
re->uptime = time(NULL);
re->vrf_id = vrf_id;
- re->table = zvrf->table_id;
+ if (api.tableid && vrf_id == VRF_DEFAULT)
+ re->table = api.tableid;
+ else
+ re->table = zvrf->table_id;
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP)) {
for (i = 0; i < api.nexthop_num; i++) {