Replace the dpkg-buildpackage / debhelper rig with the same pattern
used in vpp-maglev: a Makefile that cross-compiles CGO-free static
binaries for amd64 and arm64, plus a debian/build-deb.sh that stages
the .deb directly with dpkg-deb. The two arch packages drop into
build/ and run on any glibc/musl Linux of the matching arch.
VERSION is parsed once from debian/changelog and injected at link
time via -ldflags "-X 'main.Version=...' -X 'main.Commit=...' -X
'main.Date=...'", so 'govpp-snmp-agentx --version' is the source of
truth for which build is running. main.go's Version constant becomes
a var to make this work; the old sync-version make target is gone.
Removes the now-unused debian/{control,rules,postinst,prerm,*.debhelper}
files and adds build/ to .gitignore.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related bugs left interfaces faster than 1Gbps reporting wrong
values to SNMP collectors:
1. ifSpeed (.5) was silently dropped for interfaces whose link speed
exceeded 2.5Gbps. RFC 2863 requires ifSpeed to always be present
and saturated at uint32 max (4294967295) when the real speed
exceeds what fits in a Gauge32; ifHighSpeed carries the actual
Mbps value. The row is now always emitted, capped at math.MaxUint32.
2. UpdateStats only rebuilt the MIB when the interface set changed.
On startup, the stats routine connects to VPP and runs the first
poll before the 1-second event-monitor poll has had a chance to
call InitializeEventWatching, so the MIB is built from an empty
interfaceDetails map and every row defaults to 1Gbps for life.
Fix: filterValidInterfaces (which already calls
GetAllInterfaceDetails to filter deleted interfaces from the stats
segment) now also pushes those details through the MIB callback
via a new InterfaceManager.NotifyDetails method. UpdateInterface-
Details sets a staticFieldsDirty flag whenever Speed/MAC/MTU/
admin/oper/name actually change, and UpdateStats forces a rebuild
on the next poll while that flag is set. Identical re-pushes do
not dirty the cache, so AgentX session re-registration only
happens on real change.
Adds tests for the ifSpeed branches (0/nil/1G/10G/25G/100G) and for
the dirty-flag transitions (fresh push, identical re-push, changed
Speed).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>