-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(link-info): move from meshviewer-ffrgb to runtime
- Loading branch information
Showing
7 changed files
with
187 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package runtime | ||
|
||
type LinkType int | ||
|
||
const ( | ||
UnknownLinkType LinkType = iota | ||
WirelessLinkType | ||
TunnelLinkType | ||
OtherLinkType | ||
) | ||
|
||
func (lt LinkType) String() string { | ||
switch lt { | ||
case WirelessLinkType: | ||
return "wifi" | ||
case TunnelLinkType: | ||
return "vpn" | ||
case OtherLinkType: | ||
return "other" | ||
} | ||
return "unknown" | ||
} | ||
|
||
type LinkProtocol int | ||
|
||
const ( | ||
UnknownLinkProtocol LinkProtocol = iota | ||
BatadvLinkProtocol | ||
BabelLinkProtocol | ||
LLDPLinkProtocol | ||
) | ||
|
||
func (lp LinkProtocol) String() string { | ||
switch lp { | ||
case BatadvLinkProtocol: | ||
return "batadv" | ||
case BabelLinkProtocol: | ||
return "babel" | ||
case LLDPLinkProtocol: | ||
return "lldp" | ||
} | ||
return "unkown" | ||
} | ||
|
||
// Link represents a link between two nodes | ||
type Link struct { | ||
SourceID string | ||
SourceHostname string | ||
SourceAddress string | ||
TargetID string | ||
TargetAddress string | ||
TargetHostname string | ||
TQ float32 | ||
Type LinkType | ||
Protocol LinkProtocol | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.