Home | History | Annotate | Download | only in syscall
      1 // Copyright 2014 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 // +build freebsd,amd64
      6 
      7 package syscall
      8 
      9 import "unsafe"
     10 
     11 func (any *anyMessage) parseRouteMessage(b []byte) *RouteMessage {
     12 	p := (*RouteMessage)(unsafe.Pointer(any))
     13 	return &RouteMessage{Header: p.Header, Data: b[rsaAlignOf(int(unsafe.Offsetof(p.Header.Rmx))+SizeofRtMetrics):any.Msglen]}
     14 }
     15 
     16 func (any *anyMessage) parseInterfaceMessage(b []byte) *InterfaceMessage {
     17 	p := (*InterfaceMessage)(unsafe.Pointer(any))
     18 	return &InterfaceMessage{Header: p.Header, Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]}
     19 }
     20