Source file
src/syscall/route_freebsd_32bit.go
1
2
3
4
5
6
7 package syscall
8
9 import "unsafe"
10
11 func (any *anyMessage) parseRouteMessage(b []byte) *RouteMessage {
12 p := (*RouteMessage)(unsafe.Pointer(any))
13 off := int(unsafe.Offsetof(p.Header.Rmx)) + SizeofRtMetrics
14 if freebsdConfArch == "amd64" {
15 off += SizeofRtMetrics
16 }
17 return &RouteMessage{Header: p.Header, Data: b[rsaAlignOf(off):any.Msglen]}
18 }
19
20 func (any *anyMessage) parseInterfaceMessage(b []byte) *InterfaceMessage {
21 p := (*InterfaceMessage)(unsafe.Pointer(any))
22
23
24
25 if supportsABI(1000000) {
26 m := (*ifMsghdr)(unsafe.Pointer(any))
27 p.Header.Data.Hwassist = uint32(m.Data.Hwassist)
28 p.Header.Data.Epoch = m.Data.Epoch
29 p.Header.Data.Lastchange = m.Data.Lastchange
30 return &InterfaceMessage{Header: p.Header, Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]}
31 }
32 return &InterfaceMessage{Header: p.Header, Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]}
33 }
34
View as plain text