mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-15 15:57:01 +02:00
51 lines
884 B
Go
51 lines
884 B
Go
//go:build linux && (amd64 || arm64 || ppc64 || ppc64le || mips64 || mips64le || s390x || riscv64 || loong64) && !android && !e2e_testing
|
|
// +build linux
|
|
// +build amd64 arm64 ppc64 ppc64le mips64 mips64le s390x riscv64 loong64
|
|
// +build !android
|
|
// +build !e2e_testing
|
|
|
|
package udp
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
type iovec struct {
|
|
Base *byte
|
|
Len uint64
|
|
}
|
|
|
|
type msghdr struct {
|
|
Name *byte
|
|
Namelen uint32
|
|
Pad0 [4]byte
|
|
Iov *iovec
|
|
Iovlen uint64
|
|
Control *byte
|
|
Controllen uint64
|
|
Flags int32
|
|
Pad1 [4]byte
|
|
}
|
|
|
|
type rawMessage struct {
|
|
Hdr msghdr
|
|
Len uint32
|
|
Pad0 [4]byte
|
|
}
|
|
|
|
func setIovLen(v *iovec, n int) {
|
|
v.Len = uint64(n)
|
|
}
|
|
|
|
func setMsgIovlen(m *msghdr, n int) {
|
|
m.Iovlen = uint64(n)
|
|
}
|
|
|
|
func setMsgControllen(m *msghdr, n int) {
|
|
m.Controllen = uint64(n)
|
|
}
|
|
|
|
func setCmsgLen(h *unix.Cmsghdr, n int) {
|
|
h.Len = uint64(n)
|
|
}
|