Include selected overlay type in connection status
This commit is contained in:
1 parent
da49e71eb8
commit
91afa7f7f4
5 files changed
+31
-1
No files matched your search
@@ -662,6 +662,10 @@ func (fwd *fastDatapathForwarder) ControlMessage(tag byte, msg []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fwd *fastDatapathForwarder) DisplayName() string {
|
||||||
|
return "fastdp"
|
||||||
|
}
|
||||||
|
|
||||||
func (fwd *fastDatapathForwarder) handleHeartbeatAck() {
|
func (fwd *fastDatapathForwarder) handleHeartbeatAck() {
|
||||||
log.Debug(fwd.logPrefix(), "handleHeartbeatAck")
|
log.Debug(fwd.logPrefix(), "handleHeartbeatAck")
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ type OverlayForwarder interface {
|
|||||||
// compatibility, and should always be
|
// compatibility, and should always be
|
||||||
// ProtocolOverlayControlMessage for non-sleeve overlays.
|
// ProtocolOverlayControlMessage for non-sleeve overlays.
|
||||||
ControlMessage(tag byte, msg []byte)
|
ControlMessage(tag byte, msg []byte)
|
||||||
|
|
||||||
|
// User facing overlay name
|
||||||
|
DisplayName() string
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullOverlay struct{}
|
type NullOverlay struct{}
|
||||||
@@ -129,3 +132,7 @@ func (NullOverlay) Stop() {
|
|||||||
|
|
||||||
func (NullOverlay) ControlMessage(byte, []byte) {
|
func (NullOverlay) ControlMessage(byte, []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (NullOverlay) DisplayName() string {
|
||||||
|
return "null"
|
||||||
|
}
|
||||||
@@ -393,3 +393,15 @@ func (fwd *overlaySwitchForwarder) ControlMessage(tag byte, msg []byte) {
|
|||||||
subFwd.ControlMessage(msg[1], msg[2:])
|
subFwd.ControlMessage(msg[1], msg[2:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fwd *overlaySwitchForwarder) DisplayName() string {
|
||||||
|
fwd.lock.Lock()
|
||||||
|
best := fwd.best
|
||||||
|
fwd.lock.Unlock()
|
||||||
|
|
||||||
|
if best == nil {
|
||||||
|
return "none"
|
||||||
|
}
|
||||||
|
|
||||||
|
return best.DisplayName()
|
||||||
|
}
|
||||||
@@ -593,6 +593,10 @@ func (fwd *sleeveForwarder) ControlMessage(tag byte, msg []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fwd *sleeveForwarder) DisplayName() string {
|
||||||
|
return "sleeve"
|
||||||
|
}
|
||||||
|
|
||||||
func (fwd *sleeveForwarder) Stop() {
|
func (fwd *sleeveForwarder) Stop() {
|
||||||
fwd.sleeve.removeForwarder(fwd.remotePeer.Name, fwd)
|
fwd.sleeve.removeForwarder(fwd.remotePeer.Name, fwd)
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,7 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -170,7 +171,9 @@ func NewLocalConnectionStatusSlice(cm *ConnectionMaker) []LocalConnectionStatus
|
|||||||
if conn.Established() {
|
if conn.Established() {
|
||||||
state = "established"
|
state = "established"
|
||||||
}
|
}
|
||||||
slice = append(slice, LocalConnectionStatus{conn.RemoteTCPAddr(), conn.Outbound(), state, conn.Remote().String()})
|
lc, _ := conn.(*LocalConnection)
|
||||||
|
info := fmt.Sprintf("%-6v %v", lc.forwarder.DisplayName(), conn.Remote())
|
||||||
|
slice = append(slice, LocalConnectionStatus{conn.RemoteTCPAddr(), conn.Outbound(), state, info})
|
||||||
}
|
}
|
||||||
for address, target := range cm.targets {
|
for address, target := range cm.targets {
|
||||||
add := func(state, info string) {
|
add := func(state, info string) {
|
||||||
|
|||||||
Reference in new issue
Block a user