pim controls the vrf table creation for due to the way that
pim must interact with the kernel. In order to match the
table_id for unicast <-> multicast( not necessary but a
real nice to have ) we need to pass up from zebra the
table_id associated with the vrf.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
+/*
+ * Pass some OS specific data up through
+ * to the daemons
+ */
+struct vrf_data
+{
+ union
+ {
+ struct {
+ uint32_t table_id;
+ } l;
+ };
+};
+
struct vrf
{
RB_ENTRY(vrf) id_entry, name_entry;
/* User data */
void *info;
+ /* The table_id from the kernel */
+ struct vrf_data data;
+
QOBJ_FIELDS
};
RB_HEAD (vrf_id_head, vrf);
{
struct vrf *vrf;
char vrfname_tmp[VRF_NAMSIZ];
+ struct vrf_data data;
+ stream_get (&data, zclient->ibuf, sizeof (struct vrf_data));
/* Read interface name. */
stream_get (vrfname_tmp, zclient->ibuf, VRF_NAMSIZ);
/* Lookup/create vrf by vrf_id. */
vrf = vrf_get (vrf_id, vrfname_tmp);
+ vrf->data = data;
vrf_enable (vrf);
}
static void
zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
{
+ struct vrf_data data;
+
+ data.l.table_id = zvrf->table_id;
+ /* Pass the tableid */
+ stream_put (s, &data, sizeof (struct vrf_data));
/* Interface information. */
stream_put (s, zvrf_name (zvrf), VRF_NAMSIZ);