Add watchInterfaceEvents() listener

This commit is contained in:
Pim van Pelt
2025-06-23 19:02:02 +02:00
parent 42dbbded3d
commit 35165b0464
7 changed files with 124 additions and 201 deletions

View File

@ -13,9 +13,9 @@ import (
"github.com/posteo/go-agentx/value"
"go.fd.io/govpp/api"
"gopkg.in/yaml.v3"
"govpp-snmp-agentx/logger"
"govpp-snmp-agentx/vppstats"
"govpp-snmp-agentx/vpp"
)
// IF-MIB OID bases:
@ -72,8 +72,8 @@ type VPPConfig struct {
}
type VPPInterface struct {
Description string `yaml:"description"`
SubInterfaces map[string]VPPInterface `yaml:"sub-interfaces"`
Description string `yaml:"description"`
SubInterfaces map[string]VPPInterface `yaml:"sub-interfaces"`
}
type InterfaceMIB struct {
@ -172,7 +172,7 @@ func (m *InterfaceMIB) UpdateStats(interfaceStats *api.InterfaceStats) {
}
func (m *InterfaceMIB) addInterfaceToMIB(iface *api.InterfaceCounters) {
idx := int(iface.InterfaceIndex) + *vppstats.IfIndexOffset
idx := int(iface.InterfaceIndex) + *vpp.IfIndexOffset
// Add ifEntry (classic interface table) entries
m.addIfEntry(iface, idx)