1 // Copyright 2016 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.
9 func (typ RIBType) parseable() bool {
11 case sysNET_RT_STATS, sysNET_RT_TABLE:
18 // RouteMetrics represents route metrics.
19 type RouteMetrics struct {
20 PathMTU int // path maximum transmission unit
23 // SysType implements the SysType method of Sys interface.
24 func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
26 // Sys implements the Sys method of Message interface.
27 func (m *RouteMessage) Sys() []Sys {
30 PathMTU: int(nativeEndian.Uint32(m.raw[60:64])),
35 // InterfaceMetrics represents interface metrics.
36 type InterfaceMetrics struct {
37 Type int // interface type
38 MTU int // maximum transmission unit
41 // SysType implements the SysType method of Sys interface.
42 func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
44 // Sys implements the Sys method of Message interface.
45 func (m *InterfaceMessage) Sys() []Sys {
49 MTU: int(nativeEndian.Uint32(m.raw[28:32])),
54 func probeRoutingStack() (int, map[int]*wireFormat) {
56 rtm := &wireFormat{extOff: -1, bodyOff: -1}
57 rtm.parse = rtm.parseRouteMessage
58 ifm := &wireFormat{extOff: -1, bodyOff: -1}
59 ifm.parse = ifm.parseInterfaceMessage
60 ifam := &wireFormat{extOff: -1, bodyOff: -1}
61 ifam.parse = ifam.parseInterfaceAddrMessage
62 ifanm := &wireFormat{extOff: -1, bodyOff: -1}
63 ifanm.parse = ifanm.parseInterfaceAnnounceMessage
64 return int(unsafe.Sizeof(p)), map[int]*wireFormat{
77 sysRTM_IFANNOUNCE: ifanm,