summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/zclient.c34
-rw-r--r--lib/zclient.h4
2 files changed, 38 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 8279fc70a1..42a9659393 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -864,6 +864,32 @@ zebra_router_id_update_read (struct stream *s, struct prefix *rid)
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
+struct vrf *
+zebra_vrf_add_read (struct stream *s, vrf_id_t vrf_id)
+{
+ struct vrf *vrf;
+ char vrfname_tmp[VRF_NAMSIZ];
+
+ /* Read interface name. */
+ stream_get (vrfname_tmp, s, VRF_NAMSIZ);
+
+ /* Lookup/create vrf by vrf_id. */
+ vrf = vrf_get (vrf_id, vrfname_tmp);
+
+ return vrf;
+}
+
+struct vrf *
+zebra_vrf_state_read (struct stream *s, vrf_id_t vrf_id)
+{
+ struct vrf *vrf;
+
+ /* Lookup vrf by vrf_id. */
+ vrf = vrf_lookup (vrf_id);
+
+ return vrf;
+}
+
struct interface *
zebra_interface_add_read (struct stream *s, vrf_id_t vrf_id)
{
@@ -1232,6 +1258,14 @@ zclient_read (struct thread *thread)
if (zclient->router_id_update)
(*zclient->router_id_update) (command, zclient, length, vrf_id);
break;
+ case ZEBRA_VRF_ADD:
+ if (zclient->vrf_add)
+ (*zclient->vrf_add) (command, zclient, length, vrf_id);
+ break;
+ case ZEBRA_VRF_DELETE:
+ if (zclient->vrf_delete)
+ (*zclient->vrf_delete) (command, zclient, length, vrf_id);
+ break;
case ZEBRA_INTERFACE_ADD:
if (zclient->interface_add)
(*zclient->interface_add) (command, zclient, length, vrf_id);
diff --git a/lib/zclient.h b/lib/zclient.h
index 949d42365d..22cd0410e0 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -87,6 +87,8 @@ struct zclient
/* Pointer to the callback functions. */
void (*zebra_connected) (struct zclient *);
int (*router_id_update) (int, struct zclient *, uint16_t, vrf_id_t);
+ int (*vrf_add) (int, struct zclient *, uint16_t, vrf_id_t);
+ int (*vrf_delete) (int, struct zclient *, uint16_t, vrf_id_t);
int (*interface_add) (int, struct zclient *, uint16_t, vrf_id_t);
int (*interface_delete) (int, struct zclient *, uint16_t, vrf_id_t);
int (*interface_up) (int, struct zclient *, uint16_t, vrf_id_t);
@@ -191,6 +193,8 @@ extern int zclient_send_message(struct zclient *);
/* create header for command, length to be filled in by user later */
extern void zclient_create_header (struct stream *, uint16_t, vrf_id_t);
+extern struct vrf *zebra_vrf_add_read (struct stream *, vrf_id_t);
+extern struct vrf *zebra_vrf_state_read (struct stream *s, vrf_id_t);
extern struct interface *zebra_interface_add_read (struct stream *, vrf_id_t);
extern struct interface *zebra_interface_state_read (struct stream *s, vrf_id_t);
extern struct connected *zebra_interface_address_read (int, struct stream *, vrf_id_t);