summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index dde60a6c90..90439d5e17 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -765,15 +765,17 @@ static int zclient_connect(struct thread *t)
enum zclient_send_status zclient_send_rnh(struct zclient *zclient, int command,
const struct prefix *p,
- bool exact_match, vrf_id_t vrf_id)
+ bool connected,
+ bool resolve_via_def, vrf_id_t vrf_id)
{
struct stream *s;
s = zclient->obuf;
stream_reset(s);
zclient_create_header(s, command, vrf_id);
- stream_putc(s, (exact_match) ? 1 : 0);
-
+ stream_putc(s, (connected) ? 1 : 0);
+ stream_putc(s, (resolve_via_def) ? 1 : 0);
+ stream_putw(s, SAFI_UNICAST);
stream_putw(s, PREFIX_FAMILY(p));
stream_putc(s, p->prefixlen);
switch (PREFIX_FAMILY(p)) {
@@ -1925,6 +1927,7 @@ bool zapi_nexthop_update_decode(struct stream *s, struct zapi_route *nhr)
memset(nhr, 0, sizeof(*nhr));
STREAM_GETL(s, nhr->message);
+ STREAM_GETW(s, nhr->safi);
STREAM_GETW(s, nhr->prefix.family);
STREAM_GETC(s, nhr->prefix.prefixlen);
switch (nhr->prefix.family) {
@@ -2096,7 +2099,7 @@ stream_failure:
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Harware Address Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Hardware Address if HW lenght different from 0 |
+ * | Hardware Address if HW length different from 0 |
* | ... max INTERFACE_HWADDR_MAX |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Link_params? | Whether a link-params follows: 1 or 0.
@@ -2161,19 +2164,21 @@ static int zclient_interface_add(struct zclient *zclient, vrf_id_t vrf_id)
struct interface *ifp;
char ifname_tmp[INTERFACE_NAMSIZ + 1] = {};
struct stream *s = zclient->ibuf;
+ struct vrf *vrf;
/* Read interface name. */
STREAM_GET(ifname_tmp, s, INTERFACE_NAMSIZ);
/* Lookup/create interface by name. */
- if (!vrf_get(vrf_id, NULL)) {
+ vrf = vrf_lookup_by_id(vrf_id);
+ if (!vrf) {
zlog_debug(
"Rx'd interface add from Zebra, but VRF %u does not exist",
vrf_id);
return -1;
}
- ifp = if_get_by_name(ifname_tmp, vrf_id);
+ ifp = if_get_by_name(ifname_tmp, vrf_id, vrf->name);
zebra_interface_if_set_value(s, ifp);
@@ -2435,7 +2440,7 @@ size_t zebra_interface_link_params_write(struct stream *s,
}
/*
- * format of message for address additon is:
+ * format of message for address addition is:
* 0
* 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+
@@ -2700,9 +2705,9 @@ static int zclient_read_sync_response(struct zclient *zclient,
return 0;
}
/**
- * Connect to label manager in a syncronous way
+ * Connect to label manager in a synchronous way
*
- * It first writes the request to zcient output buffer and then
+ * It first writes the request to zclient output buffer and then
* immediately reads the answer from the input buffer.
*
* @param zclient Zclient used to connect to label manager (zebra)
@@ -2795,7 +2800,7 @@ stream_failure:
}
/**
- * Function to request a srv6-locator chunk in an Asyncronous way
+ * Function to request a srv6-locator chunk in an asynchronous way
*
* @param zclient Zclient used to connect to table manager (zebra)
* @param locator_name Name of SRv6-locator
@@ -2905,9 +2910,9 @@ enum zclient_send_status zclient_send_get_label_chunk(struct zclient *zclient,
}
/**
- * Function to request a label chunk in a syncronous way
+ * Function to request a label chunk in a synchronous way
*
- * It first writes the request to zlcient output buffer and then
+ * It first writes the request to zclient output buffer and then
* immediately reads the answer from the input buffer.
*
* @param zclient Zclient used to connect to label manager (zebra)
@@ -3082,9 +3087,9 @@ int lm_release_label_chunk(struct zclient *zclient, uint32_t start,
}
/**
- * Connect to table manager in a syncronous way
+ * Connect to table manager in a synchronous way
*
- * It first writes the request to zcient output buffer and then
+ * It first writes the request to zclient output buffer and then
* immediately reads the answer from the input buffer.
*
* @param zclient Zclient used to connect to table manager (zebra)
@@ -3141,7 +3146,7 @@ stream_failure:
}
/**
- * Function to request a table chunk in a syncronous way
+ * Function to request a table chunk in a synchronous way
*
* It first writes the request to zclient output buffer and then
* immediately reads the answer from the input buffer.
@@ -4016,13 +4021,6 @@ static int zclient_read(struct thread *thread)
(*zclient->nexthop_update)(command, zclient, length,
vrf_id);
break;
- case ZEBRA_IMPORT_CHECK_UPDATE:
- if (zclient_debug)
- zlog_debug("zclient rcvd import check update");
- if (zclient->import_check_update)
- (*zclient->import_check_update)(command, zclient,
- length, vrf_id);
- break;
case ZEBRA_BFD_DEST_REPLAY:
if (zclient->bfd_dest_replay)
(*zclient->bfd_dest_replay)(command, zclient, length,