Commit b1d51c63 authored by Mikio Hara's avatar Mikio Hara

syscall: add if_announce support for freebsd

Update #4866.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7398047
parent 72b6daa3
...@@ -207,7 +207,7 @@ ccflags="$@" ...@@ -207,7 +207,7 @@ ccflags="$@"
$2 ~ /^LINUX_REBOOT_CMD_/ || $2 ~ /^LINUX_REBOOT_CMD_/ ||
$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
$2 !~ "NLA_TYPE_MASK" && $2 !~ "NLA_TYPE_MASK" &&
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ ||
$2 ~ /^SIOC/ || $2 ~ /^SIOC/ ||
$2 ~ /^TIOC/ || $2 ~ /^TIOC/ ||
$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ || $2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||
......
...@@ -193,12 +193,13 @@ type FdSet C.fd_set ...@@ -193,12 +193,13 @@ type FdSet C.fd_set
// Routing and interface messages // Routing and interface messages
const ( const (
SizeofIfMsghdr = C.sizeof_struct_if_msghdr SizeofIfMsghdr = C.sizeof_struct_if_msghdr
SizeofIfData = C.sizeof_struct_if_data SizeofIfData = C.sizeof_struct_if_data
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
SizeofRtMetrics = C.sizeof_struct_rt_metrics SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
SizeofRtMetrics = C.sizeof_struct_rt_metrics
) )
type IfMsghdr C.struct_if_msghdr type IfMsghdr C.struct_if_msghdr
...@@ -209,6 +210,8 @@ type IfaMsghdr C.struct_ifa_msghdr ...@@ -209,6 +210,8 @@ type IfaMsghdr C.struct_ifa_msghdr
type IfmaMsghdr C.struct_ifma_msghdr type IfmaMsghdr C.struct_ifma_msghdr
type IfAnnounceMsghdr C.struct_if_announcemsghdr
type RtMsghdr C.struct_rt_msghdr type RtMsghdr C.struct_rt_msghdr
type RtMetrics C.struct_rt_metrics type RtMetrics C.struct_rt_metrics
......
...@@ -369,6 +369,8 @@ const ( ...@@ -369,6 +369,8 @@ const (
F_UNLCK = 0x2 F_UNLCK = 0x2
F_UNLCKSYS = 0x4 F_UNLCKSYS = 0x4
F_WRLCK = 0x3 F_WRLCK = 0x3
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFF_ALLMULTI = 0x200 IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000 IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2 IFF_BROADCAST = 0x2
......
...@@ -369,6 +369,8 @@ const ( ...@@ -369,6 +369,8 @@ const (
F_UNLCK = 0x2 F_UNLCK = 0x2
F_UNLCKSYS = 0x4 F_UNLCKSYS = 0x4
F_WRLCK = 0x3 F_WRLCK = 0x3
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFF_ALLMULTI = 0x200 IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000 IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2 IFF_BROADCAST = 0x2
......
...@@ -466,6 +466,8 @@ const ( ...@@ -466,6 +466,8 @@ const (
ICANON = 0x100 ICANON = 0x100
ICRNL = 0x100 ICRNL = 0x100
IEXTEN = 0x400 IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFF_ALLMULTI = 0x200 IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000 IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2 IFF_BROADCAST = 0x2
......
...@@ -271,12 +271,13 @@ type FdSet struct { ...@@ -271,12 +271,13 @@ type FdSet struct {
} }
const ( const (
SizeofIfMsghdr = 0x60 SizeofIfMsghdr = 0x60
SizeofIfData = 0x50 SizeofIfData = 0x50
SizeofIfaMsghdr = 0x14 SizeofIfaMsghdr = 0x14
SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr = 0x10
SizeofRtMsghdr = 0x5c SizeofIfAnnounceMsghdr = 0x18
SizeofRtMetrics = 0x38 SizeofRtMsghdr = 0x5c
SizeofRtMetrics = 0x38
) )
type IfMsghdr struct { type IfMsghdr struct {
...@@ -339,6 +340,15 @@ type IfmaMsghdr struct { ...@@ -339,6 +340,15 @@ type IfmaMsghdr struct {
Pad_cgo_0 [2]byte Pad_cgo_0 [2]byte
} }
type IfAnnounceMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Index uint16
Name [16]int8
What uint16
}
type RtMsghdr struct { type RtMsghdr struct {
Msglen uint16 Msglen uint16
Version uint8 Version uint8
......
...@@ -273,12 +273,13 @@ type FdSet struct { ...@@ -273,12 +273,13 @@ type FdSet struct {
} }
const ( const (
SizeofIfMsghdr = 0xa8 SizeofIfMsghdr = 0xa8
SizeofIfData = 0x98 SizeofIfData = 0x98
SizeofIfaMsghdr = 0x14 SizeofIfaMsghdr = 0x14
SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr = 0x10
SizeofRtMsghdr = 0x98 SizeofIfAnnounceMsghdr = 0x18
SizeofRtMetrics = 0x70 SizeofRtMsghdr = 0x98
SizeofRtMetrics = 0x70
) )
type IfMsghdr struct { type IfMsghdr struct {
...@@ -341,6 +342,15 @@ type IfmaMsghdr struct { ...@@ -341,6 +342,15 @@ type IfmaMsghdr struct {
Pad_cgo_0 [2]byte Pad_cgo_0 [2]byte
} }
type IfAnnounceMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Index uint16
Name [16]int8
What uint16
}
type RtMsghdr struct { type RtMsghdr struct {
Msglen uint16 Msglen uint16
Version uint8 Version uint8
......
...@@ -273,12 +273,13 @@ type FdSet struct { ...@@ -273,12 +273,13 @@ type FdSet struct {
} }
const ( const (
SizeofIfMsghdr = 0x68 SizeofIfMsghdr = 0x68
SizeofIfData = 0x58 SizeofIfData = 0x58
SizeofIfaMsghdr = 0x14 SizeofIfaMsghdr = 0x14
SizeofIfmaMsghdr = 0x10 SizeofIfmaMsghdr = 0x10
SizeofRtMsghdr = 0x5c SizeofIfAnnounceMsghdr = 0x18
SizeofRtMetrics = 0x38 SizeofRtMsghdr = 0x5c
SizeofRtMetrics = 0x38
) )
type IfMsghdr struct { type IfMsghdr struct {
...@@ -341,6 +342,15 @@ type IfmaMsghdr struct { ...@@ -341,6 +342,15 @@ type IfmaMsghdr struct {
Pad_cgo_0 [2]byte Pad_cgo_0 [2]byte
} }
type IfAnnounceMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Index uint16
Name [16]int8
What uint16
}
type RtMsghdr struct { type RtMsghdr struct {
Msglen uint16 Msglen uint16
Version uint8 Version uint8
......
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