diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-05-02 11:38:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-02 11:38:06 -0400 |
| commit | b46be72b4aff1d413e89bc26a70a29934afe9d85 (patch) | |
| tree | cd556a135211559b7e636db619dbf5257f874e86 /lib/zclient.c | |
| parent | 2a23cf9503bf2ff36d3c34308de78618b3196f35 (diff) | |
| parent | b2ab6b282ce1569ed348aebe17432094adfe7d24 (diff) | |
Merge branch 'master' into EIGRP
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index d2a5186315..e3eadf22a4 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -733,6 +733,18 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, s = zclient->obuf; stream_reset (s); + /* Some checks for labeled-unicast. The current expectation is that each + * nexthop is accompanied by a label in the case of labeled-unicast. + */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL) && + CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP)) + { + /* We expect prefixes installed with labels and the number to match + * the number of nexthops. + */ + assert (api->label_num == api->nexthop_num); + } + zclient_create_header (s, cmd, api->vrf_id); /* Put type and nexthop. */ @@ -749,7 +761,7 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, /* Nexthop, ifindex, distance and metric information. */ if (CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP)) - { + { /* traditional 32-bit data units */ if (CHECK_FLAG (api->flags, ZEBRA_FLAG_BLACKHOLE)) { @@ -765,6 +777,9 @@ zapi_ipv4_route (u_char cmd, struct zclient *zclient, struct prefix_ipv4 *p, { stream_putc (s, NEXTHOP_TYPE_IPV4); stream_put_in_addr (s, api->nexthop[i]); + /* For labeled-unicast, each nexthop is followed by label. */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL)) + stream_putl (s, api->label[i]); } for (i = 0; i < api->ifindex_num; i++) { @@ -800,6 +815,18 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient, s = zclient->obuf; stream_reset (s); + /* Some checks for labeled-unicast. The current expectation is that each + * nexthop is accompanied by a label in the case of labeled-unicast. + */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL) && + CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP)) + { + /* We expect prefixes installed with labels and the number to match + * the number of nexthops. + */ + assert (api->label_num == api->nexthop_num); + } + zclient_create_header (s, cmd, api->vrf_id); /* Put type and nexthop. */ @@ -831,6 +858,9 @@ zapi_ipv4_route_ipv6_nexthop (u_char cmd, struct zclient *zclient, { stream_putc (s, NEXTHOP_TYPE_IPV6); stream_write (s, (u_char *)api->nexthop[i], 16); + /* For labeled-unicast, each nexthop is followed by label. */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL)) + stream_putl (s, api->label[i]); } for (i = 0; i < api->ifindex_num; i++) { @@ -869,6 +899,18 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, s = zclient->obuf; stream_reset (s); + /* Some checks for labeled-unicast. The current expectation is that each + * nexthop is accompanied by a label in the case of labeled-unicast. + */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL) && + CHECK_FLAG (api->message, ZAPI_MESSAGE_NEXTHOP)) + { + /* We expect prefixes installed with labels and the number to match + * the number of nexthops. + */ + assert (api->label_num == api->nexthop_num); + } + zclient_create_header (s, cmd, api->vrf_id); /* Put type and nexthop. */ @@ -907,6 +949,9 @@ zapi_ipv6_route (u_char cmd, struct zclient *zclient, struct prefix_ipv6 *p, { stream_putc (s, NEXTHOP_TYPE_IPV6); stream_write (s, (u_char *)api->nexthop[i], 16); + /* For labeled-unicast, each nexthop is followed by label. */ + if (CHECK_FLAG (api->message, ZAPI_MESSAGE_LABEL)) + stream_putl (s, api->label[i]); } for (i = 0; i < api->ifindex_num; i++) { @@ -1879,6 +1924,12 @@ zclient_read (struct thread *thread) if (zclient->interface_link_params) (*zclient->interface_link_params) (command, zclient, length); break; + case ZEBRA_FEC_UPDATE: + if (zclient_debug) + zlog_debug("zclient rcvd fec update\n"); + if (zclient->fec_update) + (*zclient->fec_update) (command, zclient, length); + break; default: break; } |
