mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 05:00:23 +00:00
isisd: changed to output the adjacency-sid in yang format
Signed-off-by: kanaya516 <abcs516tk1@gmail.com>
This commit is contained in:
parent
23691a80d7
commit
098737293c
@ -1106,6 +1106,36 @@ const struct frr_yang_module_info frr_isisd_info = {
|
|||||||
.get_elem = lib_interface_state_isis_adjacencies_adjacency_state_get_elem,
|
.get_elem = lib_interface_state_isis_adjacencies_adjacency_state_get_elem,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid",
|
||||||
|
.cbs = {
|
||||||
|
.get_next = lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_get_next,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/af",
|
||||||
|
.cbs = {
|
||||||
|
.get_elem = lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_af_get_elem,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/value",
|
||||||
|
.cbs = {
|
||||||
|
.get_elem = lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_value_get_elem,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/weight",
|
||||||
|
.cbs = {
|
||||||
|
.get_elem = lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_weight_get_elem,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/protection-requested",
|
||||||
|
.cbs = {
|
||||||
|
.get_elem = lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_protection_requested_get_elem,
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/event-counters/adjacency-changes",
|
.xpath = "/frr-interface:lib/interface/state/frr-isisd:isis/event-counters/adjacency-changes",
|
||||||
.cbs = {
|
.cbs = {
|
||||||
|
@ -369,6 +369,16 @@ lib_interface_state_isis_adjacencies_adjacency_neighbor_priority_get_elem(
|
|||||||
struct nb_cb_get_elem_args *args);
|
struct nb_cb_get_elem_args *args);
|
||||||
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_state_get_elem(
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_state_get_elem(
|
||||||
struct nb_cb_get_elem_args *args);
|
struct nb_cb_get_elem_args *args);
|
||||||
|
const void *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_get_next(
|
||||||
|
struct nb_cb_get_next_args *args);
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_af_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args);
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_value_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args);
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_weight_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args);
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_protection_requested_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args);
|
||||||
struct yang_data *
|
struct yang_data *
|
||||||
lib_interface_state_isis_event_counters_adjacency_changes_get_elem(
|
lib_interface_state_isis_event_counters_adjacency_changes_get_elem(
|
||||||
struct nb_cb_get_elem_args *args);
|
struct nb_cb_get_elem_args *args);
|
||||||
|
@ -214,6 +214,109 @@ struct yang_data *lib_interface_state_isis_adjacencies_adjacency_state_get_elem(
|
|||||||
isis_adj_yang_state(adj->adj_state));
|
isis_adj_yang_state(adj->adj_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid
|
||||||
|
*/
|
||||||
|
const void *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_get_next(
|
||||||
|
struct nb_cb_get_next_args *args)
|
||||||
|
{
|
||||||
|
const struct isis_adjacency *adj = args->parent_list_entry;
|
||||||
|
const struct sr_adjacency *sra = args->list_entry, *sra_next = NULL;
|
||||||
|
struct listnode *node, *node_next;
|
||||||
|
|
||||||
|
if (args->list_entry == NULL)
|
||||||
|
sra_next = listnode_head(adj->adj_sids);
|
||||||
|
else {
|
||||||
|
node = listnode_lookup(adj->adj_sids, sra);
|
||||||
|
node_next = listnextnode(node);
|
||||||
|
if (node_next)
|
||||||
|
sra_next = listgetdata(node_next);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sra_next;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/af
|
||||||
|
*/
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_af_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args)
|
||||||
|
{
|
||||||
|
const struct sr_adjacency *sra = args->list_entry;
|
||||||
|
|
||||||
|
switch (sra->adj->circuit->circ_type) {
|
||||||
|
case CIRCUIT_T_BROADCAST:
|
||||||
|
/* Adjacency SID is not published with circuit type Broadcast */
|
||||||
|
return NULL;
|
||||||
|
case CIRCUIT_T_P2P:
|
||||||
|
return yang_data_new_uint8(args->xpath, sra->u.adj_sid->family);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/value
|
||||||
|
*/
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_value_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args)
|
||||||
|
{
|
||||||
|
const struct sr_adjacency *sra = args->list_entry;
|
||||||
|
|
||||||
|
switch (sra->adj->circuit->circ_type) {
|
||||||
|
case CIRCUIT_T_BROADCAST:
|
||||||
|
/* Adjacency SID is not published with circuit type Broadcast */
|
||||||
|
return NULL;
|
||||||
|
case CIRCUIT_T_P2P:
|
||||||
|
return yang_data_new_uint32(args->xpath, sra->u.adj_sid->sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/weight
|
||||||
|
*/
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_weight_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args)
|
||||||
|
{
|
||||||
|
const struct sr_adjacency *sra = args->list_entry;
|
||||||
|
|
||||||
|
switch (sra->adj->circuit->circ_type) {
|
||||||
|
case CIRCUIT_T_BROADCAST:
|
||||||
|
/* Adjacency SID is not published with circuit type Broadcast */
|
||||||
|
return NULL;
|
||||||
|
case CIRCUIT_T_P2P:
|
||||||
|
return yang_data_new_uint8(args->xpath, sra->u.adj_sid->weight);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-interface:lib/interface/state/frr-isisd:isis/adjacencies/adjacency/adjacency-sids/adjacency-sid/protection-requested
|
||||||
|
*/
|
||||||
|
struct yang_data *lib_interface_state_isis_adjacencies_adjacency_adjacency_sids_adjacency_sid_protection_requested_get_elem(
|
||||||
|
struct nb_cb_get_elem_args *args)
|
||||||
|
{
|
||||||
|
const struct sr_adjacency *sra = args->list_entry;
|
||||||
|
|
||||||
|
switch (sra->adj->circuit->circ_type) {
|
||||||
|
case CIRCUIT_T_BROADCAST:
|
||||||
|
/* Adjacency SID is not published with circuit type Broadcast */
|
||||||
|
return NULL;
|
||||||
|
case CIRCUIT_T_P2P:
|
||||||
|
return yang_data_new_bool(args->xpath, sra->u.adj_sid->flags & EXT_SUBTLV_LINK_ADJ_SID_BFLG);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XPath:
|
* XPath:
|
||||||
* /frr-interface:lib/interface/state/frr-isisd:isis/event-counters/adjacency-changes
|
* /frr-interface:lib/interface/state/frr-isisd:isis/event-counters/adjacency-changes
|
||||||
|
@ -881,6 +881,8 @@ module frr-isisd {
|
|||||||
description
|
description
|
||||||
"This leaf describes the state of the interface.";
|
"This leaf describes the state of the interface.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uses adjacency-sids;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1004,6 +1006,41 @@ module frr-isisd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grouping adjacency-sids {
|
||||||
|
description
|
||||||
|
"IS-IS segment routing adjacency SID grouping.";
|
||||||
|
container adjacency-sids {
|
||||||
|
description
|
||||||
|
"This container lists the information of adjacency SID.";
|
||||||
|
list adjacency-sid {
|
||||||
|
leaf af {
|
||||||
|
type uint8;
|
||||||
|
description
|
||||||
|
"This leaf describes the protocol-family associated with the
|
||||||
|
adjacency SID.";
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf value {
|
||||||
|
type uint32;
|
||||||
|
description
|
||||||
|
"This leaf describes the value of adjacency SID.";
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf weight {
|
||||||
|
type uint8;
|
||||||
|
description
|
||||||
|
"This leaf describes the weight of the adjacency SID.";
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf protection-requested {
|
||||||
|
type boolean;
|
||||||
|
description
|
||||||
|
"This leaf describes if the adjacency SID must be protected.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
container isis {
|
container isis {
|
||||||
description
|
description
|
||||||
"Configuration of the IS-IS routing daemon.";
|
"Configuration of the IS-IS routing daemon.";
|
||||||
|
Loading…
Reference in New Issue
Block a user