Commit ec93726159 ("Adds strings translation methods") broke non-Linux
builds by relying on unix constants that are only declared on the linux
platform in the upstream x/sys/unix package.
Other platforms report undefined variables, such as the following:
$ GOOS=darwin go build .
# github.com/vishvananda/netlink
./route.go:17:7: undefined: SCOPE_UNIVERSE
./route.go:19:7: undefined: SCOPE_SITE
./route.go:21:7: undefined: SCOPE_LINK
./route.go:23:7: undefined: SCOPE_HOST
./route.go:25:7: undefined: SCOPE_NOWHERE
./route.go:55:7: undefined: unix.RTPROT_BABEL
./route.go:57:7: undefined: unix.RTPROT_BGP
./route.go:59:7: undefined: unix.RTPROT_BIRD
./route.go:61:7: undefined: unix.RTPROT_BOOT
./route.go:63:7: undefined: unix.RTPROT_DHCP
./route.go:63:7: too many errors
Move the platform-specific implementations to platform-specific files
and add stubs to satisfy other platforms.
Fixes: ec93726159 ("Adds strings translation methods")
Signed-off-by: Joe Stringer <joe@cilium.io>
The go get command and make both fail when executed on
non-linux platforms. Modified it so that there are no
compilation errors when developing in such an
environment.