Add HTTP API with JSON status endpoint and typeid support

This commit is contained in:
Ian Gulliver
2026-01-24 11:03:34 -08:00
parent 168cdedbcb
commit 9aebe8b83d
13 changed files with 409 additions and 115 deletions

View File

@@ -58,6 +58,7 @@ type Tendrils struct {
DebugBMD bool
DebugShure bool
DebugYamaha bool
HTTPPort string
}
func New() *Tendrils {
@@ -83,6 +84,7 @@ func (t *Tendrils) Run() {
}()
t.populateLocalAddresses()
t.startHTTPServer()
if !t.DisableARP {
t.readARPTable()
@@ -239,8 +241,9 @@ func (t *Tendrils) pollNode(node *Node) {
t.nodes.mu.RLock()
var ips []net.IP
for _, iface := range node.Interfaces {
for _, ip := range iface.IPs {
if ip.To4() != nil {
for ipStr := range iface.IPs {
ip := net.ParseIP(ipStr)
if ip != nil && ip.To4() != nil {
ips = append(ips, ip)
}
}