0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

get_route_info() added.

This commit is contained in:
Ondrej Filip 2000-05-28 19:16:04 +00:00
parent d150c6379c
commit f7c0525edc
2 changed files with 21 additions and 7 deletions

View File

@ -197,6 +197,17 @@ ospf_get_status(struct proto *p, byte *buf)
} }
} }
static void
ospf_get_route_info(rte *rte, byte *buf, ea_list *attrs)
{
char met=' ';
if(rte->u.ospf.type=='E') met='1';
if(rte->u.ospf.metric2!=0) met='2';
buf += bsprintf(buf, " %c%c %d", rte->u.ospf.type, met,
(rte->u.ospf.metric2==0) ? rte->u.ospf.metric1 : rte->u.ospf.metric2);
}
struct protocol proto_ospf = { struct protocol proto_ospf = {
name: "OSPF", name: "OSPF",
template: "ospf%d", template: "ospf%d",
@ -204,5 +215,6 @@ struct protocol proto_ospf = {
dump: ospf_dump, dump: ospf_dump,
start: ospf_start, start: ospf_start,
shutdown: ospf_shutdown, shutdown: ospf_shutdown,
get_route_info: ospf_get_route_info,
get_status: ospf_get_status get_status: ospf_get_status
}; };

View File

@ -229,6 +229,7 @@ again:
e->u.ospf.metric1=nf->metric; e->u.ospf.metric1=nf->metric;
e->u.ospf.metric2=0; e->u.ospf.metric2=0;
e->u.ospf.tag=0; /* FIXME Some config? */ e->u.ospf.tag=0; /* FIXME Some config? */
e->u.ospf.type='I';
e->pflags = 0; e->pflags = 0;
e->net=ne; e->net=ne;
e->pref = p->preference; e->pref = p->preference;
@ -448,6 +449,7 @@ noch:
e->u.ospf.metric1=nf->metric; e->u.ospf.metric1=nf->metric;
e->u.ospf.metric2=nf->metric2; e->u.ospf.metric2=nf->metric2;
e->u.ospf.tag=0; /* FIXME Some config? */ e->u.ospf.tag=0; /* FIXME Some config? */
e->u.ospf.type='E';
e->pflags = 0; e->pflags = 0;
e->net=ne; e->net=ne;
e->pref = p->preference; e->pref = p->preference;