diff --git a/doc/user/sharp.rst b/doc/user/sharp.rst index 2be38a31df..e68f4eefa0 100644 --- a/doc/user/sharp.rst +++ b/doc/user/sharp.rst @@ -198,14 +198,18 @@ keyword. At present, no sharp commands will be preserved in the config. router# sharp install seg6local-routes 1::4 nexthop-seg6local dum0 End_DX4 10.0.0.1 1 router# sharp install seg6local-routes 1::5 nexthop-seg6local dum0 End_DT6 10 1 router# sharp install seg6local-routes 1::6 nexthop-seg6local dum0 End_DT46 10 1 + router# sharp install seg6local-routes 1::7 nexthop-seg6local dum0 uN 1 + router# sharp install seg6local-routes 1::8 nexthop-seg6local dum0 uA 2001::1 1 router# show ipv6 route - D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End USP, weight 1, 00:00:05 + D>* 1::1/128 [150/0] is directly connected, dum0, seg6local End -, weight 1, 00:00:05 D>* 1::2/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:00:05 D>* 1::3/128 [150/0] is directly connected, dum0, seg6local End.T table 10, weight 1, 00:00:05 D>* 1::4/128 [150/0] is directly connected, dum0, seg6local End.DX4 nh4 10.0.0.1, weight 1, 00:00:05 D>* 1::5/128 [150/0] is directly connected, dum0, seg6local End.DT6 table 10, weight 1, 00:00:05 D>* 1::6/128 [150/0] is directly connected, dum0, seg6local End.DT46 table 10, weight 1, 00:00:05 + D>* 1::7/128 [150/0] is directly connected, dum0, seg6local End -, weight 1, 00:00:05 + D>* 1::8/128 [150/0] is directly connected, dum0, seg6local End.X nh6 2001::1, weight 1, 00:01:17 bash# ip -6 route 1::1 encap seg6local action End dev dum0 proto 194 metric 20 pref medium @@ -214,6 +218,9 @@ keyword. At present, no sharp commands will be preserved in the config. 1::4 encap seg6local action End.DX4 nh4 10.0.0.1 dev dum0 proto 194 metric 20 pref medium 1::5 encap seg6local action End.DT6 table 10 dev dum0 proto 194 metric 20 pref medium 1::6 encap seg6local action End.DT46 table 10 dev dum0 proto 194 metric 20 pref medium + 1::7 encap seg6local action End flavors next-csid lblen 32 nflen 16 dev dum0 proto 194 metric 20 pref medium + 1::8 encap seg6local action End.X nh6 2001::1 flavors next-csid lblen 32 nflen 16 dev dum0 proto 194 metric 20 pref medium + .. clicmd:: show sharp segment-routing srv6 diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c index 17e6d04430..a0f59f7db2 100644 --- a/sharpd/sharp_vty.c +++ b/sharpd/sharp_vty.c @@ -445,13 +445,21 @@ DEFPY (install_seg6local_routes, X:X::X:X$start6\ nexthop-seg6local NAME$seg6l_oif\ \ + uDT4$seg6l_micro_enddt4 (1-4294967295)$seg6l_micro_enddt4_table|\ + End_DT46$seg6l_enddt46 (1-4294967295)$seg6l_enddt46_table|\ + uDT46$seg6l_micro_enddt46 (1-4294967295)$seg6l_micro_enddt46_table>\ (1-1000000)$routes [repeat (2-1000)$rpt]", "Sharp routing Protocol\n" "install some routes\n" @@ -462,20 +470,35 @@ DEFPY (install_seg6local_routes, "Nexthop-seg6local to use\n" "Output device to use\n" "SRv6 End function to use\n" + "SRv6 uN function to use\n" "SRv6 End.X function to use\n" "V6 Nexthop address to use\n" + "SRv6 uA function to use\n" + "V6 Nexthop address to use\n" "SRv6 End.T function to use\n" "Redirect table id to use\n" + "SRv6 uDT function to use\n" + "Redirect table id to use\n" "SRv6 End.DX4 function to use\n" "V4 Nexthop address to use\n" + "SRv6 uDX4 function to use\n" + "V4 Nexthop address to use\n" "SRv6 End.DX6 function to use\n" "V6 Nexthop address to use\n" + "SRv6 uDX6 function to use\n" + "V6 Nexthop address to use\n" "SRv6 End.DT6 function to use\n" "Redirect table id to use\n" + "SRv6 uDT6 function to use\n" + "Redirect table id to use\n" "SRv6 End.DT4 function to use\n" "Redirect table id to use\n" + "SRv6 uDT4 function to use\n" + "Redirect table id to use\n" "SRv6 End.DT46 function to use\n" "Redirect table id to use\n" + "SRv6 uDT46 function to use\n" + "Redirect table id to use\n" "How many to create\n" "Should we repeat this command\n" "How many times to repeat this command\n") @@ -519,27 +542,57 @@ DEFPY (install_seg6local_routes, if (seg6l_enddx4) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4; ctx.nh4 = seg6l_enddx4_nh4; + } else if (seg6l_micro_enddx4) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4; + ctx.nh4 = seg6l_micro_enddx4_nh4; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_enddx6) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DX6; ctx.nh6 = seg6l_enddx6_nh6; + } else if (seg6l_micro_enddx6) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_DX6; + ctx.nh6 = seg6l_enddx6_nh6; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_endx) { action = ZEBRA_SEG6_LOCAL_ACTION_END_X; ctx.nh6 = seg6l_endx_nh6; + } else if (seg6l_micro_endx) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_X; + ctx.nh6 = seg6l_micro_endx_nh6; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_endt) { action = ZEBRA_SEG6_LOCAL_ACTION_END_T; ctx.table = seg6l_endt_table; + } else if (seg6l_micro_endt) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_T; + ctx.table = seg6l_micro_endt_table; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_enddt6) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DT6; ctx.table = seg6l_enddt6_table; + } else if (seg6l_micro_enddt6) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_DT6; + ctx.table = seg6l_micro_enddt6_table; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_enddt4) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DT4; ctx.table = seg6l_enddt4_table; + } else if (seg6l_micro_enddt4) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_DT4; + ctx.table = seg6l_micro_enddt4_table; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); } else if (seg6l_enddt46) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DT46; ctx.table = seg6l_enddt46_table; - } else { + } else if (seg6l_micro_enddt46) { + action = ZEBRA_SEG6_LOCAL_ACTION_END_DT46; + ctx.table = seg6l_micro_enddt46_table; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); + } else if (seg6l_micro_end) { + action = ZEBRA_SEG6_LOCAL_ACTION_END; + SET_SRV6_FLV_OP(ctx.flv.flv_ops, ZEBRA_SEG6_LOCAL_FLV_OP_NEXT_CSID); + } else action = ZEBRA_SEG6_LOCAL_ACTION_END; - } sg.r.nhop.type = NEXTHOP_TYPE_IFINDEX; sg.r.nhop.ifindex = ifname2ifindex(seg6l_oif, vrf->vrf_id);