summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xcli/gobgpcli5
-rw-r--r--server/peer.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/cli/gobgpcli b/cli/gobgpcli
index 29dcecdd..cdf5b56e 100755
--- a/cli/gobgpcli
+++ b/cli/gobgpcli
@@ -179,7 +179,7 @@ class Show(object):
maxtimelen = len(str(t))
n["info"]["time"] = t
- h = "{:%ds} {:>%ds} {:%ds} {:8s} |" % (maxaddrlen, maxaslen, maxtimelen)
+ h = "{:%ds} {:>%ds} {:%ds} {:11s} |" % (maxaddrlen, maxaslen, maxtimelen)
f1 = h + "#{:8s} {:8s} {:8s}"
print(f1.format("Peer", "AS", "Up/Down", "State", "Advertised", "Received", "Accepted"))
for n in sorted_neighbors:
@@ -197,6 +197,9 @@ class Show(object):
elif s == "BGP_FSM_ESTABLISHED":
state = "Establ"
+ if n["info"]["AdminState"] == "ADMIN_STATE_DOWN":
+ state = "Idle(Admin)"
+
f2 = h + " {:>8d} {:>8d} {:>8d}"
print f2.format(n["conf"]["remote_ip"], str(n["conf"]["remote_as"]), n["info"]["time"], state, n["info"]["Advertized"], n["info"]["Received"], n["info"]["Accepted"])
return 0
diff --git a/server/peer.go b/server/peer.go
index c635b2b1..3c274344 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -472,6 +472,7 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
p["info"] = struct {
BgpState string `json:"bgp_state"`
+ AdminState string
FsmEstablishedTransitions uint32 `json:"fsm_established_transitions"`
TotalMessageOut uint32 `json:"total_message_out"`
TotalMessageIn uint32 `json:"total_message_in"`
@@ -498,6 +499,7 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
}{
BgpState: f.state.String(),
+ AdminState: f.adminState.String(),
FsmEstablishedTransitions: s.EstablishedCount,
TotalMessageOut: s.TotalOut,
TotalMessageIn: s.TotalIn,