Commit 9b6ced93 authored by Mikio Hara's avatar Mikio Hara

vendor: update vendored lif

Updates golang_org/x/net/lif to rev 084869a for:
- lif: rename internal types and constants generated by cgo

Change-Id: Icf478d60f5ef35800966c62dcf046f7fe50204ff
Reviewed-on: https://go-review.googlesource.com/30731
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent b108009d
...@@ -56,7 +56,7 @@ func Addrs(af int, name string) ([]Addr, error) { ...@@ -56,7 +56,7 @@ func Addrs(af int, name string) ([]Addr, error) {
} }
var as []Addr var as []Addr
for _, ll := range lls { for _, ll := range lls {
var lifr sysLifreq var lifr lifreq
for i := 0; i < len(ll.Name); i++ { for i := 0; i < len(ll.Name); i++ {
lifr.Name[i] = int8(ll.Name[i]) lifr.Name[i] = int8(ll.Name[i])
} }
...@@ -66,7 +66,7 @@ func Addrs(af int, name string) ([]Addr, error) { ...@@ -66,7 +66,7 @@ func Addrs(af int, name string) ([]Addr, error) {
if err != nil { if err != nil {
continue continue
} }
sa := (*sysSockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0])) sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
l := int(littleEndian.Uint32(lifr.Lifru1[:4])) l := int(littleEndian.Uint32(lifr.Lifru1[:4]))
if l == 0 { if l == 0 {
continue continue
......
...@@ -26,7 +26,7 @@ const ( ...@@ -26,7 +26,7 @@ const (
sysSOCK_DGRAM = C.SOCK_DGRAM sysSOCK_DGRAM = C.SOCK_DGRAM
) )
type sysSockaddrStorage C.struct_sockaddr_storage type sockaddrStorage C.struct_sockaddr_storage
const ( const (
sysLIFC_NOXMIT = C.LIFC_NOXMIT sysLIFC_NOXMIT = C.LIFC_NOXMIT
...@@ -77,11 +77,11 @@ const ( ...@@ -77,11 +77,11 @@ const (
type sysLifnum C.struct_lifnum type sysLifnum C.struct_lifnum
type sysLifreq C.struct_lifreq type lifreq C.struct_lifreq
type sysLifconf C.struct_lifconf type lifconf C.struct_lifconf
type sysLifIfinfoReq C.struct_lif_ifinfo_req type lifIfinfoReq C.struct_lif_ifinfo_req
const ( const (
sysIFT_IPV4 = C.IFT_IPV4 sysIFT_IPV4 = C.IFT_IPV4
......
...@@ -25,7 +25,7 @@ type Link struct { ...@@ -25,7 +25,7 @@ type Link struct {
} }
func (ll *Link) fetch(s uintptr) { func (ll *Link) fetch(s uintptr) {
var lifr sysLifreq var lifr lifreq
for i := 0; i < len(ll.Name); i++ { for i := 0; i < len(ll.Name); i++ {
lifr.Name[i] = int8(ll.Name[i]) lifr.Name[i] = int8(ll.Name[i])
} }
...@@ -71,7 +71,7 @@ func Links(af int, name string) ([]Link, error) { ...@@ -71,7 +71,7 @@ func Links(af int, name string) ([]Link, error) {
func links(eps []endpoint, name string) ([]Link, error) { func links(eps []endpoint, name string) ([]Link, error) {
var lls []Link var lls []Link
lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP} lifn := sysLifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
lifc := sysLifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP} lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
for _, ep := range eps { for _, ep := range eps {
lifn.Family = uint16(ep.af) lifn.Family = uint16(ep.af)
ioc := int64(sysSIOCGLIFNUM) ioc := int64(sysSIOCGLIFNUM)
...@@ -91,7 +91,7 @@ func links(eps []endpoint, name string) ([]Link, error) { ...@@ -91,7 +91,7 @@ func links(eps []endpoint, name string) ([]Link, error) {
} }
nb := make([]byte, 32) // see LIFNAMSIZ in net/if.h nb := make([]byte, 32) // see LIFNAMSIZ in net/if.h
for i := 0; i < int(lifn.Count); i++ { for i := 0; i < int(lifn.Count); i++ {
lifr := (*sysLifreq)(unsafe.Pointer(&b[i*sizeofLifreq])) lifr := (*lifreq)(unsafe.Pointer(&b[i*sizeofLifreq]))
for i := 0; i < 32; i++ { for i := 0; i < 32; i++ {
if lifr.Name[i] == 0 { if lifr.Name[i] == 0 {
nb = nb[:i] nb = nb[:i]
......
...@@ -11,7 +11,7 @@ const ( ...@@ -11,7 +11,7 @@ const (
sysSOCK_DGRAM = 0x1 sysSOCK_DGRAM = 0x1
) )
type sysSockaddrStorage struct { type sockaddrStorage struct {
Family uint16 Family uint16
X_ss_pad1 [6]int8 X_ss_pad1 [6]int8
X_ss_align float64 X_ss_align float64
...@@ -72,14 +72,14 @@ type sysLifnum struct { ...@@ -72,14 +72,14 @@ type sysLifnum struct {
Count int32 Count int32
} }
type sysLifreq struct { type lifreq struct {
Name [32]int8 Name [32]int8
Lifru1 [4]byte Lifru1 [4]byte
Type uint32 Type uint32
Lifru [336]byte Lifru [336]byte
} }
type sysLifconf struct { type lifconf struct {
Family uint16 Family uint16
Pad_cgo_0 [2]byte Pad_cgo_0 [2]byte
Flags int32 Flags int32
...@@ -88,7 +88,7 @@ type sysLifconf struct { ...@@ -88,7 +88,7 @@ type sysLifconf struct {
Lifcu [8]byte Lifcu [8]byte
} }
type sysLifIfinfoReq struct { type lifIfinfoReq struct {
Maxhops uint8 Maxhops uint8
Pad_cgo_0 [3]byte Pad_cgo_0 [3]byte
Reachtime uint32 Reachtime uint32
......
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