diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2011-09-04 00:56:02 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2011-09-04 00:56:02 +0200 |
commit | 51947659abbf9af861aa7dec36fd1c845fb617ab (patch) | |
tree | 1492753ca0221a454b7918a6f3bd3c1c4da9f8aa /proto | |
parent | 6c4df70373fa640a7f068d4e1b563621b67c0d2b (diff) | |
download | bird-51947659abbf9af861aa7dec36fd1c845fb617ab.tar bird-51947659abbf9af861aa7dec36fd1c845fb617ab.zip |
Minor changes in BGP protocol info.
Shows neighbor IP and ASN even if protocol is down.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/bgp/bgp.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index d26b481..4e4ca9f 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1042,8 +1042,8 @@ bgp_last_errmsg(struct bgp_proto *p) static const char * bgp_state_dsc(struct bgp_proto *p) { - //if (p->p.proto_state == PS_DOWN) - // return "Down"; + if (p->p.proto_state == PS_DOWN) + return "Down"; int state = MAX(p->incoming_conn.state, p->outgoing_conn.state); if ((state == BS_IDLE) && (p->start_state >= BSS_CONNECT) && p->cf->passive) @@ -1075,10 +1075,9 @@ bgp_show_proto_info(struct proto *P) struct bgp_proto *p = (struct bgp_proto *) P; struct bgp_conn *c = p->conn; - if (P->proto_state == PS_DOWN) - return; - cli_msg(-1006, " BGP state: %s", bgp_state_dsc(p)); + cli_msg(-1006, " Neighbor address: %I", p->cf->remote_ip); + cli_msg(-1006, " Neighbor AS: %u", p->remote_as); if (P->proto_state == PS_START) { @@ -1096,18 +1095,17 @@ bgp_show_proto_info(struct proto *P) } else if (P->proto_state == PS_UP) { - cli_msg(-1006, " Session: %s%s%s%s", + cli_msg(-1006, " Neighbor ID: %R", p->remote_id); + cli_msg(-1006, " Neighbor caps: %s%s", + c->peer_refresh_support ? " refresh" : "", + c->peer_as4_support ? " AS4" : ""); + cli_msg(-1006, " Session: %s%s%s%s%s", p->is_internal ? "internal" : "external", + p->cf->multihop ? " multihop" : "", p->rr_client ? " route-reflector" : "", p->rs_client ? " route-server" : "", p->as4_session ? " AS4" : ""); - cli_msg(-1006, " Neighbor AS: %u", p->remote_as); - cli_msg(-1006, " Neighbor ID: %R", p->remote_id); - cli_msg(-1006, " Neighbor address: %I", p->cf->remote_ip); cli_msg(-1006, " Source address: %I", p->source_addr); - cli_msg(-1006, " Neighbor caps: %s%s", - c->peer_refresh_support ? " refresh" : "", - c->peer_as4_support ? " AS4" : ""); if (p->cf->route_limit) cli_msg(-1006, " Route limit: %d/%d", p->p.stats.imp_routes, p->cf->route_limit); |