mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-09-18 19:35:20 +00:00
ospf meta file temp
This commit is contained in:
parent
e8a325313e
commit
080c9a7afe
20
yang/show_memory_meta.c
Normal file
20
yang/show_memory_meta.c
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
UYTC_MODULE(show_memory) {
|
||||||
|
UYTC_GROUPING(memory, resmem) {
|
||||||
|
UYTC_LEAF(effective, resmem.effective);
|
||||||
|
UYTC_LEAF(overhead, resmem.overhead);
|
||||||
|
}
|
||||||
|
|
||||||
|
UYTC_CONTAINER(message, msg) {
|
||||||
|
UYTC_LEAF(header, "BIRD memory usage");
|
||||||
|
UYTC_CONTAINER(body, body) {
|
||||||
|
UYTC_LEAF(routing_tables, rmemsize(rt_table_pool));
|
||||||
|
UYTC_LEAF(route_attributes, rmemsize(rta_pool));
|
||||||
|
...;
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
|
UYTC_LEAF(standby_memory, (struct resmem) { .overhead = page_size * *pages_kept });
|
||||||
|
#endif
|
||||||
|
UYTC_LEAF(total, rmemsize(&root_pool));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -32,53 +32,55 @@ module show_ospf {
|
|||||||
uses router;
|
uses router;
|
||||||
uses distance;
|
uses distance;
|
||||||
|
|
||||||
list vlink {
|
list rt {
|
||||||
key "vlink";
|
key "dummy_yang_id";
|
||||||
leaf vlink {
|
leaf dummy_yang_id {
|
||||||
type int32;
|
type int32;
|
||||||
}
|
}
|
||||||
uses metric;
|
leaf metric {
|
||||||
}
|
type int32;
|
||||||
|
}
|
||||||
|
choice rt_type {
|
||||||
|
case vlink {
|
||||||
|
grouping vlink {
|
||||||
|
leaf vlink {
|
||||||
|
type int32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list router_metric {
|
case router {
|
||||||
key "router";
|
grouping router_metric {
|
||||||
uses router;
|
uses router;
|
||||||
uses metric;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list network {
|
case network {
|
||||||
key "dummy_yang_id";
|
grouping network {
|
||||||
leaf dummy_yang_id {
|
leaf network {
|
||||||
type int32;
|
type ipv4;
|
||||||
}
|
}
|
||||||
leaf network {
|
leaf len {
|
||||||
type int32;
|
type int32;
|
||||||
}
|
mandatory false;
|
||||||
choice len_nif {
|
}
|
||||||
case len {
|
leaf nif {
|
||||||
leaf len {
|
type int32;
|
||||||
type int32;
|
mandatory false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case nif {
|
}
|
||||||
leaf nif {
|
|
||||||
type int32;
|
case stubnet {
|
||||||
}
|
grouping stubnet {
|
||||||
}
|
leaf stubnet {
|
||||||
}
|
type ipv4;
|
||||||
leaf metric {
|
}
|
||||||
mandatory false;
|
leaf len {
|
||||||
type int32;
|
type int32;
|
||||||
}
|
}
|
||||||
list stubnet {
|
}
|
||||||
key "stubnet";
|
}
|
||||||
leaf stubnet {
|
|
||||||
type int32;
|
|
||||||
}
|
|
||||||
leaf len {
|
|
||||||
type int32;
|
|
||||||
}
|
|
||||||
uses metric;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
53
yang/show_ospf_meta.c
Normal file
53
yang/show_ospf_meta.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
static inline void
|
||||||
|
show_lsa_router_cbor(UYTC_CONTEXT_TYPE UYTC_CONTEXT, struct top_hash_entry *he, int verbose)
|
||||||
|
{
|
||||||
|
UYTC_GROUPING(lsa_router) {
|
||||||
|
UYTC_ITEM(router, he->lsa.rt);
|
||||||
|
|
||||||
|
...;
|
||||||
|
|
||||||
|
lsa_walk_rt_init(p, he, &rtl);
|
||||||
|
int i = 0;
|
||||||
|
while (lsa_walk_rt(&rtl))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
UYTC_LIST_ITEM(rt) {
|
||||||
|
UYTC_LEAF(dummy_yang_id, i);
|
||||||
|
UYTC_LEAF(metric, rtl.metric);
|
||||||
|
switch (rtl.type) {
|
||||||
|
case LSART_VLNK:
|
||||||
|
UYTC_CHOICE_ITEM(rt_type, vlink) {
|
||||||
|
UYTC_GROUPING(vlink) {
|
||||||
|
UYTC_LEAF(vlink, rtl.id);
|
||||||
|
UYTC_LEAF(name, rtl.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LSART_PTP:
|
||||||
|
...;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (i = 0; i < j1; i++) {
|
||||||
|
UYTC_LIST_ITEM(areas) {
|
||||||
|
struct top_hash_entry *he = hea[i];
|
||||||
|
UYTC_LEAF(dummy_yang_id, i);
|
||||||
|
UYTC_LEAF(area, he->domain);
|
||||||
|
|
||||||
|
switch (he->lsa_type)
|
||||||
|
{
|
||||||
|
case LSA_T_RT:
|
||||||
|
UYTC_CHOICE_ITEM(lsa_type, rt, show_lsa_router_cbor(UYTC_CONTEXT, he));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LSA_T_NET:
|
||||||
|
UYTC_CHOICE_ITEM(lsa_type, net, show_lsa_network_cbor(UYTC_CONTEXT, he, ospf2));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user