mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -04:00
unix/linux: Prefixmsg and PrefixCacheinfo structs
These structs and enumeration constants are used to parse RTM_NEWPREFIX netlink messages. Fixes golang/go#77662 Change-Id: I1e7a92e771701c0c790c15e58ad78cd8fe1e5cf5 Reviewed-on: https://go-review.googlesource.com/c/sys/+/746420 Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Florian Lehner <lehner.florian86@gmail.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
@@ -932,12 +932,17 @@ const (
|
|||||||
RTN_THROW = C.RTN_THROW
|
RTN_THROW = C.RTN_THROW
|
||||||
RTN_NAT = C.RTN_NAT
|
RTN_NAT = C.RTN_NAT
|
||||||
RTN_XRESOLVE = C.RTN_XRESOLVE
|
RTN_XRESOLVE = C.RTN_XRESOLVE
|
||||||
|
PREFIX_UNSPEC = C.PREFIX_UNSPEC
|
||||||
|
PREFIX_ADDRESS = C.PREFIX_ADDRESS
|
||||||
|
PREFIX_CACHEINFO = C.PREFIX_CACHEINFO
|
||||||
SizeofNlMsghdr = C.sizeof_struct_nlmsghdr
|
SizeofNlMsghdr = C.sizeof_struct_nlmsghdr
|
||||||
SizeofNlMsgerr = C.sizeof_struct_nlmsgerr
|
SizeofNlMsgerr = C.sizeof_struct_nlmsgerr
|
||||||
SizeofRtGenmsg = C.sizeof_struct_rtgenmsg
|
SizeofRtGenmsg = C.sizeof_struct_rtgenmsg
|
||||||
SizeofNlAttr = C.sizeof_struct_nlattr
|
SizeofNlAttr = C.sizeof_struct_nlattr
|
||||||
SizeofRtAttr = C.sizeof_struct_rtattr
|
SizeofRtAttr = C.sizeof_struct_rtattr
|
||||||
SizeofIfInfomsg = C.sizeof_struct_ifinfomsg
|
SizeofIfInfomsg = C.sizeof_struct_ifinfomsg
|
||||||
|
SizeofPrefixmsg = C.sizeof_struct_prefixmsg
|
||||||
|
SizeofPrefixCacheinfo = C.sizeof_struct_prefix_cacheinfo
|
||||||
SizeofIfAddrmsg = C.sizeof_struct_ifaddrmsg
|
SizeofIfAddrmsg = C.sizeof_struct_ifaddrmsg
|
||||||
SizeofIfAddrlblmsg = C.sizeof_struct_ifaddrlblmsg
|
SizeofIfAddrlblmsg = C.sizeof_struct_ifaddrlblmsg
|
||||||
SizeofIfaCacheinfo = C.sizeof_struct_ifa_cacheinfo
|
SizeofIfaCacheinfo = C.sizeof_struct_ifa_cacheinfo
|
||||||
@@ -959,6 +964,10 @@ type RtAttr C.struct_rtattr
|
|||||||
|
|
||||||
type IfInfomsg C.struct_ifinfomsg
|
type IfInfomsg C.struct_ifinfomsg
|
||||||
|
|
||||||
|
type Prefixmsg C.struct_prefixmsg
|
||||||
|
|
||||||
|
type PrefixCacheinfo C.struct_prefix_cacheinfo
|
||||||
|
|
||||||
type IfAddrmsg C.struct_ifaddrmsg
|
type IfAddrmsg C.struct_ifaddrmsg
|
||||||
|
|
||||||
type IfAddrlblmsg C.struct_ifaddrlblmsg
|
type IfAddrlblmsg C.struct_ifaddrlblmsg
|
||||||
|
|||||||
@@ -684,12 +684,17 @@ const (
|
|||||||
RTN_THROW = 0x9
|
RTN_THROW = 0x9
|
||||||
RTN_NAT = 0xa
|
RTN_NAT = 0xa
|
||||||
RTN_XRESOLVE = 0xb
|
RTN_XRESOLVE = 0xb
|
||||||
|
PREFIX_UNSPEC = 0x0
|
||||||
|
PREFIX_ADDRESS = 0x1
|
||||||
|
PREFIX_CACHEINFO = 0x2
|
||||||
SizeofNlMsghdr = 0x10
|
SizeofNlMsghdr = 0x10
|
||||||
SizeofNlMsgerr = 0x14
|
SizeofNlMsgerr = 0x14
|
||||||
SizeofRtGenmsg = 0x1
|
SizeofRtGenmsg = 0x1
|
||||||
SizeofNlAttr = 0x4
|
SizeofNlAttr = 0x4
|
||||||
SizeofRtAttr = 0x4
|
SizeofRtAttr = 0x4
|
||||||
SizeofIfInfomsg = 0x10
|
SizeofIfInfomsg = 0x10
|
||||||
|
SizeofPrefixmsg = 0xc
|
||||||
|
SizeofPrefixCacheinfo = 0x8
|
||||||
SizeofIfAddrmsg = 0x8
|
SizeofIfAddrmsg = 0x8
|
||||||
SizeofIfAddrlblmsg = 0xc
|
SizeofIfAddrlblmsg = 0xc
|
||||||
SizeofIfaCacheinfo = 0x10
|
SizeofIfaCacheinfo = 0x10
|
||||||
@@ -735,6 +740,22 @@ type IfInfomsg struct {
|
|||||||
Change uint32
|
Change uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Prefixmsg struct {
|
||||||
|
Family uint8
|
||||||
|
Pad1 uint8
|
||||||
|
Pad2 uint16
|
||||||
|
Ifindex int32
|
||||||
|
Type uint8
|
||||||
|
Len uint8
|
||||||
|
Flags uint8
|
||||||
|
Pad3 uint8
|
||||||
|
}
|
||||||
|
|
||||||
|
type PrefixCacheinfo struct {
|
||||||
|
Preferred_time uint32
|
||||||
|
Valid_time uint32
|
||||||
|
}
|
||||||
|
|
||||||
type IfAddrmsg struct {
|
type IfAddrmsg struct {
|
||||||
Family uint8
|
Family uint8
|
||||||
Prefixlen uint8
|
Prefixlen uint8
|
||||||
|
|||||||
Reference in New Issue
Block a user