diff options
author | Hiroki Shirokura <slank.dev@gmail.com> | 2020-12-18 13:18:12 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2021-06-02 16:24:48 +0200 |
commit | af31f6c05c26192d4e2ea18845bef2617b919631 (patch) | |
tree | df1701070ab7fb5e82739b1c5c3fbfe5ba1abbf8 /sharpd | |
parent | zebra: parse non-zebra seg6 configuration via netlink (step3) (diff) | |
download | frr-af31f6c05c26192d4e2ea18845bef2617b919631.tar.xz frr-af31f6c05c26192d4e2ea18845bef2617b919631.zip |
sharpd: install route supports nexthop-seg6 (step3)
We can install seg6 routes from shapd cli.
This is for the behaviour test(topotest) to ensure
SRv6 ZAPI is working fine.
NEW-CLI:
sharp install routes 1::1 nexthop-seg6 2001::1 encap a::
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Diffstat (limited to 'sharpd')
-rw-r--r-- | sharpd/sharp_vty.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c index c580338f3..5997e5e31 100644 --- a/sharpd/sharp_vty.c +++ b/sharpd/sharp_vty.c @@ -197,7 +197,8 @@ DEFPY (install_routes, End_X$seg6l_endx X:X::X:X$seg6l_endx_nh6|\ End_T$seg6l_endt (1-4294967295)$seg6l_endt_table|\ End_DX4$seg6l_enddx4 A.B.C.D$seg6l_enddx4_nh4|\ - End_DT6$seg6l_enddt6 (1-4294967295)$seg6l_enddt6_table>>\ + End_DT6$seg6l_enddt6 (1-4294967295)$seg6l_enddt6_table>|\ + nexthop-seg6$nh_seg6 X:X::X:X$seg6_nh6 encap X:X::X:X$seg6_seg>\ [backup$backup <A.B.C.D$backup_nexthop4|X:X::X:X$backup_nexthop6>] \ (1-1000000)$routes [instance (0-255)$instance] [repeat (2-1000)$rpt] [opaque WORD]", "Sharp routing Protocol\n" @@ -223,6 +224,10 @@ DEFPY (install_routes, "V4 Nexthop address to use\n" "SRv6 End.DT6 function to use\n" "Redirect table id to use\n" + "Nexthop-seg6 to use\n" + "V6 Nexthop address to use\n" + "Encap mode\n" + "Segment List to use\n" "Backup nexthop to use(Can be an IPv4 or IPv6 address)\n" "Backup V4 Nexthop address to use\n" "Backup V6 Nexthop address to use\n" @@ -336,6 +341,14 @@ DEFPY (install_routes, sg.r.nhop_group.nexthop = &sg.r.nhop; nexthop_add_seg6local(&sg.r.nhop, action, &ctx); SET_FLAG(route_flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE); + } else if (nh_seg6) { + sg.r.nhop.type = NEXTHOP_TYPE_IPV6; + sg.r.nhop.gate.ipv6 = seg6_nh6; + sg.r.nhop.vrf_id = vrf->vrf_id; + sg.r.nhop_group.nexthop = &sg.r.nhop; + + nexthop_add_seg6(&sg.r.nhop, &seg6_seg); + SET_FLAG(route_flags, ZEBRA_FLAG_SEG6_ROUTE); } else { if (nexthop4.s_addr != INADDR_ANY) { sg.r.nhop.gate.ipv4 = nexthop4; |