diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-31 23:28:13 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-02 15:46:33 +0100 |
commit | 694b242f21afd759bed9bae4ab130587f4faef97 (patch) | |
tree | bafae6587a7ba9a3c840af13bb8441674b9d9a42 /sharpd/sharp_vty.c | |
parent | Merge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee (diff) | |
download | frr-694b242f21afd759bed9bae4ab130587f4faef97.tar.xz frr-694b242f21afd759bed9bae4ab130587f4faef97.zip |
sharp: Modify route install to take nexthop groups
Modify the route_add function to take nexthop groups. Future commits
will allow sharpd to use nexthop groups as the install mechanism
for routes.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'sharpd/sharp_vty.c')
-rw-r--r-- | sharpd/sharp_vty.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c index 797e336c2..700b5a911 100644 --- a/sharpd/sharp_vty.c +++ b/sharpd/sharp_vty.c @@ -28,6 +28,7 @@ #include "log.h" #include "vrf.h" #include "zclient.h" +#include "nexthop_group.h" #include "sharpd/sharp_zebra.h" #include "sharpd/sharp_vty.h" @@ -96,6 +97,7 @@ DEFPY (install_routes, int i; struct prefix p; struct nexthop nhop; + struct nexthop_group nhg; uint32_t temp; total_routes = routes; @@ -103,6 +105,7 @@ DEFPY (install_routes, memset(&p, 0, sizeof(p)); memset(&nhop, 0, sizeof(nhop)); + memset(&nhg, 0, sizeof(nhg)); p.family = AF_INET; p.prefixlen = 32; @@ -116,11 +119,12 @@ DEFPY (install_routes, nhop.type = NEXTHOP_TYPE_IPV6; } + nhg.nexthop = &nhop; zlog_debug("Inserting %ld routes", routes); temp = ntohl(p.u.prefix4.s_addr); for (i = 0; i < routes; i++) { - route_add(&p, (uint8_t)instance, &nhop); + route_add(&p, (uint8_t)instance, &nhg); p.u.prefix4.s_addr = htonl(++temp); } |