Ver código fonte

unix: add IfaCacheinfo on linux

Change-Id: Ifda2eed10f75eeddff7720676fd0a5feee78a7a5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195257
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Tobias Klauser 6 anos atrás
pai
commit
c3b328c6e5

+ 3 - 0
unix/linux/types.go

@@ -726,6 +726,7 @@ const (
 	SizeofRtAttr            = C.sizeof_struct_rtattr
 	SizeofIfInfomsg         = C.sizeof_struct_ifinfomsg
 	SizeofIfAddrmsg         = C.sizeof_struct_ifaddrmsg
+	SizeofIfaCacheinfo      = C.sizeof_struct_ifa_cacheinfo
 	SizeofRtMsg             = C.sizeof_struct_rtmsg
 	SizeofRtNexthop         = C.sizeof_struct_rtnexthop
 	SizeofNdUseroptmsg      = C.sizeof_struct_nduseroptmsg
@@ -746,6 +747,8 @@ type IfInfomsg C.struct_ifinfomsg
 
 type IfAddrmsg C.struct_ifaddrmsg
 
+type IfaCacheinfo C.struct_ifa_cacheinfo
+
 type RtMsg C.struct_rtmsg
 
 type RtNexthop C.struct_rtnexthop

+ 8 - 0
unix/ztypes_linux_386.go

@@ -622,6 +622,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -672,6 +673,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_amd64.go

@@ -623,6 +623,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -673,6 +674,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_arm.go

@@ -626,6 +626,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -676,6 +677,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_arm64.go

@@ -624,6 +624,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -674,6 +675,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_mips.go

@@ -625,6 +625,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -675,6 +676,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_mips64.go

@@ -624,6 +624,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -674,6 +675,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_mips64le.go

@@ -624,6 +624,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -674,6 +675,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_mipsle.go

@@ -625,6 +625,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -675,6 +676,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_ppc64.go

@@ -625,6 +625,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -675,6 +676,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_ppc64le.go

@@ -625,6 +625,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -675,6 +676,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_riscv64.go

@@ -624,6 +624,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -674,6 +675,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_s390x.go

@@ -623,6 +623,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -673,6 +674,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8

+ 8 - 0
unix/ztypes_linux_sparc64.go

@@ -627,6 +627,7 @@ const (
 	SizeofRtAttr            = 0x4
 	SizeofIfInfomsg         = 0x10
 	SizeofIfAddrmsg         = 0x8
+	SizeofIfaCacheinfo      = 0x10
 	SizeofRtMsg             = 0xc
 	SizeofRtNexthop         = 0x8
 	SizeofNdUseroptmsg      = 0x10
@@ -677,6 +678,13 @@ type IfAddrmsg struct {
 	Index     uint32
 }
 
+type IfaCacheinfo struct {
+	Prefered uint32
+	Valid    uint32
+	Cstamp   uint32
+	Tstamp   uint32
+}
+
 type RtMsg struct {
 	Family   uint8
 	Dst_len  uint8