mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 09:00:55 +00:00
isisd: add segment-routing YANG nodes and skeleton callbacks
Most definitions were borrowed from the IETF IS-IS SR YANG module, with a few adaptations. Of particular notice are the following: * No support for the configuration of multiple SRGBs. * No distinction between local and connected Prefix-SIDs, both are configured the same way. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
885e241337
commit
7e405d3b19
@ -454,6 +454,56 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
.modify = isis_instance_mpls_te_router_address_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/enabled",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_enabled_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/srgb/lower-bound",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_srgb_lower_bound_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/srgb/upper-bound",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_srgb_upper_bound_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/msd/node-msd",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_msd_node_msd_modify,
|
||||
.destroy = isis_instance_segment_routing_msd_node_msd_destroy,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid",
|
||||
.cbs = {
|
||||
.create = isis_instance_segment_routing_prefix_sid_map_prefix_sid_create,
|
||||
.destroy = isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify,
|
||||
},
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-interface:lib/interface/frr-isisd:isis",
|
||||
.cbs = {
|
||||
|
@ -172,6 +172,28 @@ int lib_interface_isis_ipv4_routing_modify(struct nb_cb_modify_args *args);
|
||||
int lib_interface_isis_ipv6_routing_modify(struct nb_cb_modify_args *args);
|
||||
int lib_interface_isis_circuit_type_modify(struct nb_cb_modify_args *args);
|
||||
int lib_interface_isis_bfd_monitoring_modify(struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_enabled_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_enabled_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_srgb_lower_bound_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_srgb_upper_bound_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_msd_node_msd_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_msd_node_msd_destroy(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int lib_interface_isis_csnp_interval_level_1_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int lib_interface_isis_csnp_interval_level_2_modify(
|
||||
|
@ -1402,6 +1402,191 @@ int isis_instance_mpls_te_router_address_destroy(
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/segment-routing/enabled
|
||||
*/
|
||||
int isis_instance_segment_routing_enabled_modify(enum nb_event event,
|
||||
const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/segment-routing/srgb/lower-bound
|
||||
*/
|
||||
int isis_instance_segment_routing_srgb_lower_bound_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/segment-routing/srgb/upper-bound
|
||||
*/
|
||||
int isis_instance_segment_routing_srgb_upper_bound_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd
|
||||
*/
|
||||
int isis_instance_segment_routing_msd_node_msd_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
int isis_instance_segment_routing_msd_node_msd_destroy(
|
||||
enum nb_event event, const struct lyd_node *dnode)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid
|
||||
*/
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_destroy(
|
||||
enum nb_event event, const struct lyd_node *dnode)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value-type
|
||||
*/
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_type_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/sid-value
|
||||
*/
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_sid_value_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid/last-hop-behavior
|
||||
*/
|
||||
int isis_instance_segment_routing_prefix_sid_map_prefix_sid_last_hop_behavior_modify(
|
||||
enum nb_event event, const struct lyd_node *dnode,
|
||||
union nb_resource *resource)
|
||||
{
|
||||
switch (event) {
|
||||
case NB_EV_VALIDATE:
|
||||
case NB_EV_PREPARE:
|
||||
case NB_EV_ABORT:
|
||||
case NB_EV_APPLY:
|
||||
/* TODO: implement me. */
|
||||
break;
|
||||
}
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-interface:lib/interface/frr-isisd:isis
|
||||
*/
|
||||
|
@ -1161,6 +1161,107 @@ module frr-isisd {
|
||||
"Stable IP address of the advertising router.";
|
||||
}
|
||||
}
|
||||
|
||||
container segment-routing {
|
||||
description
|
||||
"Segment Routing global configuration.";
|
||||
leaf enabled {
|
||||
type boolean;
|
||||
default "false";
|
||||
description
|
||||
"Enables segment-routing protocol extensions.";
|
||||
}
|
||||
container srgb {
|
||||
description
|
||||
"Global blocks to be advertised.";
|
||||
must "./upper-bound > ./lower-bound";
|
||||
leaf lower-bound {
|
||||
type uint32;
|
||||
default "16000";
|
||||
description
|
||||
"Lower value in the label range.";
|
||||
}
|
||||
leaf upper-bound {
|
||||
type uint32;
|
||||
default "23999";
|
||||
description
|
||||
"Upper value in the label range.";
|
||||
}
|
||||
}
|
||||
container msd {
|
||||
description
|
||||
"MSD configuration.";
|
||||
leaf node-msd {
|
||||
type uint8;
|
||||
description
|
||||
"Node MSD is the lowest MSD supported by the node.";
|
||||
}
|
||||
}
|
||||
container prefix-sid-map {
|
||||
description
|
||||
"Prefix SID configuration.";
|
||||
list prefix-sid {
|
||||
key "prefix";
|
||||
unique "sid-value-type sid-value";
|
||||
description
|
||||
"List of prefix SID mapped to IPv4/IPv6
|
||||
local prefixes.";
|
||||
leaf prefix {
|
||||
type inet:ip-prefix;
|
||||
description
|
||||
"Connected prefix sid.";
|
||||
}
|
||||
leaf sid-value-type {
|
||||
type enumeration {
|
||||
enum "index" {
|
||||
value 0;
|
||||
description
|
||||
"The value will be interpreted as an index.";
|
||||
}
|
||||
enum "absolute" {
|
||||
value 1;
|
||||
description
|
||||
"The value will become interpreted as an absolute
|
||||
value.";
|
||||
}
|
||||
}
|
||||
default "index";
|
||||
description
|
||||
"This leaf defines how value must be interpreted.";
|
||||
}
|
||||
leaf sid-value {
|
||||
type uint32;
|
||||
mandatory true;
|
||||
description
|
||||
"Value associated with prefix. The value must be
|
||||
interpreted in the context of sid-value-type.";
|
||||
}
|
||||
leaf last-hop-behavior {
|
||||
type enumeration {
|
||||
enum "explicit-null" {
|
||||
value 0;
|
||||
description
|
||||
"Use explicit-null for the SID.";
|
||||
}
|
||||
enum "no-php" {
|
||||
value 1;
|
||||
description
|
||||
"Do not use Penultimate Hop Popping (PHP)
|
||||
for the SID.";
|
||||
}
|
||||
enum "php" {
|
||||
value 2;
|
||||
description
|
||||
"Use PHP for the SID.";
|
||||
}
|
||||
}
|
||||
default "php";
|
||||
description
|
||||
"Configure last hop behavior.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user