Files
weave-scope/vendor/github.com/vishvananda/netlink/order.go
Bryan Boreham a883e93080 Vendor: add vishvananda/netns and netlink
We will use them to fetch IP addresses from container namespaces

Required an update to golang.org/x/sys/unix
2018-06-02 21:45:17 +00:00

33 lines
535 B
Go

package netlink
import (
"encoding/binary"
"github.com/vishvananda/netlink/nl"
)
var (
native = nl.NativeEndian()
networkOrder = binary.BigEndian
)
func htonl(val uint32) []byte {
bytes := make([]byte, 4)
binary.BigEndian.PutUint32(bytes, val)
return bytes
}
func htons(val uint16) []byte {
bytes := make([]byte, 2)
binary.BigEndian.PutUint16(bytes, val)
return bytes
}
func ntohl(buf []byte) uint32 {
return binary.BigEndian.Uint32(buf)
}
func ntohs(buf []byte) uint16 {
return binary.BigEndian.Uint16(buf)
}