Commit 1d6af0dc authored by Mikio Hara's avatar Mikio Hara

x/net/ipv4: fix freebsd/{386,arm}, linux/{386,arm} build

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/172360043
parent 0d352615
......@@ -57,12 +57,12 @@ const (
sysMCAST_MSFILTER = C.MCAST_MSFILTER
sysIP_MULTICAST_ALL = C.IP_MULTICAST_ALL
sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT
sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT
sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO
sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE
sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE
sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT
//sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT
//sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT
//sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO
//sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE
//sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE
//sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT
sysSO_EE_ORIGIN_NONE = C.SO_EE_ORIGIN_NONE
sysSO_EE_ORIGIN_LOCAL = C.SO_EE_ORIGIN_LOCAL
......
......@@ -63,7 +63,12 @@ func genzsys() error {
if err != nil {
return err
}
if err := ioutil.WriteFile("zsys_"+runtime.GOOS+".go", b, 0644); err != nil {
zsys := "zsys_" + runtime.GOOS + ".go"
switch runtime.GOOS {
case "freebsd", "linux":
zsys = "zsys_" + runtime.GOOS + "_" + runtime.GOARCH + ".go"
}
if err := ioutil.WriteFile(zsys, b, 0644); err != nil {
return err
}
return nil
......
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_freebsd.go
package ipv4
const (
sysIP_OPTIONS = 0x1
sysIP_HDRINCL = 0x2
sysIP_TOS = 0x3
sysIP_TTL = 0x4
sysIP_RECVOPTS = 0x5
sysIP_RECVRETOPTS = 0x6
sysIP_RECVDSTADDR = 0x7
sysIP_SENDSRCADDR = 0x7
sysIP_RETOPTS = 0x8
sysIP_RECVIF = 0x14
sysIP_ONESBCAST = 0x17
sysIP_BINDANY = 0x18
sysIP_RECVTTL = 0x41
sysIP_MINTTL = 0x42
sysIP_DONTFRAG = 0x43
sysIP_RECVTOS = 0x44
sysIP_MULTICAST_IF = 0x9
sysIP_MULTICAST_TTL = 0xa
sysIP_MULTICAST_LOOP = 0xb
sysIP_ADD_MEMBERSHIP = 0xc
sysIP_DROP_MEMBERSHIP = 0xd
sysIP_MULTICAST_VIF = 0xe
sysIP_ADD_SOURCE_MEMBERSHIP = 0x46
sysIP_DROP_SOURCE_MEMBERSHIP = 0x47
sysIP_BLOCK_SOURCE = 0x48
sysIP_UNBLOCK_SOURCE = 0x49
sysMCAST_JOIN_GROUP = 0x50
sysMCAST_LEAVE_GROUP = 0x51
sysMCAST_JOIN_SOURCE_GROUP = 0x52
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
)
type sysSockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
X__ss_align int64
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
Len uint8
Family uint8
Port uint16
Addr [4]byte /* in_addr */
Zero [8]int8
}
type sysIPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
Interface uint32
Group sysSockaddrStorage
}
type sysGroupSourceReq struct {
Interface uint32
Group sysSockaddrStorage
Source sysSockaddrStorage
}
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_freebsd.go
package ipv4
const (
sysIP_OPTIONS = 0x1
sysIP_HDRINCL = 0x2
sysIP_TOS = 0x3
sysIP_TTL = 0x4
sysIP_RECVOPTS = 0x5
sysIP_RECVRETOPTS = 0x6
sysIP_RECVDSTADDR = 0x7
sysIP_SENDSRCADDR = 0x7
sysIP_RETOPTS = 0x8
sysIP_RECVIF = 0x14
sysIP_ONESBCAST = 0x17
sysIP_BINDANY = 0x18
sysIP_RECVTTL = 0x41
sysIP_MINTTL = 0x42
sysIP_DONTFRAG = 0x43
sysIP_RECVTOS = 0x44
sysIP_MULTICAST_IF = 0x9
sysIP_MULTICAST_TTL = 0xa
sysIP_MULTICAST_LOOP = 0xb
sysIP_ADD_MEMBERSHIP = 0xc
sysIP_DROP_MEMBERSHIP = 0xd
sysIP_MULTICAST_VIF = 0xe
sysIP_ADD_SOURCE_MEMBERSHIP = 0x46
sysIP_DROP_SOURCE_MEMBERSHIP = 0x47
sysIP_BLOCK_SOURCE = 0x48
sysIP_UNBLOCK_SOURCE = 0x49
sysMCAST_JOIN_GROUP = 0x50
sysMCAST_LEAVE_GROUP = 0x51
sysMCAST_JOIN_SOURCE_GROUP = 0x52
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
)
type sysSockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
X__ss_align int64
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
Len uint8
Family uint8
Port uint16
Addr [4]byte /* in_addr */
Zero [8]int8
}
type sysIPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
Interface uint32
Group sysSockaddrStorage
}
type sysGroupSourceReq struct {
Interface uint32
Group sysSockaddrStorage
Source sysSockaddrStorage
}
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_linux.go
package ipv4
const (
sysIP_TOS = 0x1
sysIP_TTL = 0x2
sysIP_HDRINCL = 0x3
sysIP_OPTIONS = 0x4
sysIP_ROUTER_ALERT = 0x5
sysIP_RECVOPTS = 0x6
sysIP_RETOPTS = 0x7
sysIP_PKTINFO = 0x8
sysIP_PKTOPTIONS = 0x9
sysIP_MTU_DISCOVER = 0xa
sysIP_RECVERR = 0xb
sysIP_RECVTTL = 0xc
sysIP_RECVTOS = 0xd
sysIP_MTU = 0xe
sysIP_FREEBIND = 0xf
sysIP_TRANSPARENT = 0x13
sysIP_RECVRETOPTS = 0x7
sysIP_ORIGDSTADDR = 0x14
sysIP_RECVORIGDSTADDR = 0x14
sysIP_MINTTL = 0x15
sysIP_NODEFRAG = 0x16
sysIP_UNICAST_IF = 0x32
sysIP_MULTICAST_IF = 0x20
sysIP_MULTICAST_TTL = 0x21
sysIP_MULTICAST_LOOP = 0x22
sysIP_ADD_MEMBERSHIP = 0x23
sysIP_DROP_MEMBERSHIP = 0x24
sysIP_UNBLOCK_SOURCE = 0x25
sysIP_BLOCK_SOURCE = 0x26
sysIP_ADD_SOURCE_MEMBERSHIP = 0x27
sysIP_DROP_SOURCE_MEMBERSHIP = 0x28
sysIP_MSFILTER = 0x29
sysMCAST_JOIN_GROUP = 0x2a
sysMCAST_LEAVE_GROUP = 0x2d
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
sysMCAST_BLOCK_SOURCE = 0x2b
sysMCAST_UNBLOCK_SOURCE = 0x2c
sysMCAST_MSFILTER = 0x30
sysIP_MULTICAST_ALL = 0x31
sysSO_EE_ORIGIN_NONE = 0x0
sysSO_EE_ORIGIN_LOCAL = 0x1
sysSO_EE_ORIGIN_ICMP = 0x2
sysSO_EE_ORIGIN_ICMP6 = 0x3
sysSO_EE_ORIGIN_TXSTATUS = 0x4
sysSO_EE_ORIGIN_TIMESTAMPING = 0x4
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
)
type sysKernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
Code uint8
Pad uint8
Info uint32
Data uint32
}
type sysIPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
Interface uint32
Group sysKernelSockaddrStorage
}
type sysGroupSourceReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
}
......@@ -46,13 +46,6 @@ const (
sysMCAST_MSFILTER = 0x30
sysIP_MULTICAST_ALL = 0x31
sysIP_PMTUDISC_DONT = 0x0
sysIP_PMTUDISC_WANT = 0x1
sysIP_PMTUDISC_DO = 0x2
sysIP_PMTUDISC_PROBE = 0x3
sysIP_PMTUDISC_INTERFACE = 0x4
sysIP_PMTUDISC_OMIT = 0x5
sysSO_EE_ORIGIN_NONE = 0x0
sysSO_EE_ORIGIN_LOCAL = 0x1
sysSO_EE_ORIGIN_ICMP = 0x2
......
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_linux.go
package ipv4
const (
sysIP_TOS = 0x1
sysIP_TTL = 0x2
sysIP_HDRINCL = 0x3
sysIP_OPTIONS = 0x4
sysIP_ROUTER_ALERT = 0x5
sysIP_RECVOPTS = 0x6
sysIP_RETOPTS = 0x7
sysIP_PKTINFO = 0x8
sysIP_PKTOPTIONS = 0x9
sysIP_MTU_DISCOVER = 0xa
sysIP_RECVERR = 0xb
sysIP_RECVTTL = 0xc
sysIP_RECVTOS = 0xd
sysIP_MTU = 0xe
sysIP_FREEBIND = 0xf
sysIP_TRANSPARENT = 0x13
sysIP_RECVRETOPTS = 0x7
sysIP_ORIGDSTADDR = 0x14
sysIP_RECVORIGDSTADDR = 0x14
sysIP_MINTTL = 0x15
sysIP_NODEFRAG = 0x16
sysIP_UNICAST_IF = 0x32
sysIP_MULTICAST_IF = 0x20
sysIP_MULTICAST_TTL = 0x21
sysIP_MULTICAST_LOOP = 0x22
sysIP_ADD_MEMBERSHIP = 0x23
sysIP_DROP_MEMBERSHIP = 0x24
sysIP_UNBLOCK_SOURCE = 0x25
sysIP_BLOCK_SOURCE = 0x26
sysIP_ADD_SOURCE_MEMBERSHIP = 0x27
sysIP_DROP_SOURCE_MEMBERSHIP = 0x28
sysIP_MSFILTER = 0x29
sysMCAST_JOIN_GROUP = 0x2a
sysMCAST_LEAVE_GROUP = 0x2d
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
sysMCAST_BLOCK_SOURCE = 0x2b
sysMCAST_UNBLOCK_SOURCE = 0x2c
sysMCAST_MSFILTER = 0x30
sysIP_MULTICAST_ALL = 0x31
sysSO_EE_ORIGIN_NONE = 0x0
sysSO_EE_ORIGIN_LOCAL = 0x1
sysSO_EE_ORIGIN_ICMP = 0x2
sysSO_EE_ORIGIN_ICMP6 = 0x3
sysSO_EE_ORIGIN_TXSTATUS = 0x4
sysSO_EE_ORIGIN_TIMESTAMPING = 0x4
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
)
type sysKernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
Code uint8
Pad uint8
Info uint32
Data uint32
}
type sysIPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
Interface uint32
Group sysKernelSockaddrStorage
}
type sysGroupSourceReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment