| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
package arp |
| 16 |
|
| 17 |
import ( |
| 18 |
"inet.af/netstack/tcpip" |
| 19 |
"inet.af/netstack/tcpip/stack" |
| 20 |
) |
| 21 |
|
| 22 |
var _ stack.NetworkEndpointStats = (*Stats)(nil) |
| 23 |
|
| 24 |
|
| 25 |
type Stats struct { |
| 26 |
|
| 27 |
ARP tcpip.ARPStats |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
func (*Stats) IsNetworkEndpointStats() {} |
| 32 |
|
| 33 |
type sharedStats struct { |
| 34 |
localStats Stats |
| 35 |
arp multiCounterARPStats |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
type multiCounterARPStats struct { |
| 41 |
packetsReceived tcpip.MultiCounterStat |
| 42 |
disabledPacketsReceived tcpip.MultiCounterStat |
| 43 |
malformedPacketsReceived tcpip.MultiCounterStat |
| 44 |
requestsReceived tcpip.MultiCounterStat |
| 45 |
requestsReceivedUnknownTargetAddress tcpip.MultiCounterStat |
| 46 |
outgoingRequestInterfaceHasNoLocalAddressErrors tcpip.MultiCounterStat |
| 47 |
outgoingRequestBadLocalAddressErrors tcpip.MultiCounterStat |
| 48 |
outgoingRequestsDropped tcpip.MultiCounterStat |
| 49 |
outgoingRequestsSent tcpip.MultiCounterStat |
| 50 |
repliesReceived tcpip.MultiCounterStat |
| 51 |
outgoingRepliesDropped tcpip.MultiCounterStat |
| 52 |
outgoingRepliesSent tcpip.MultiCounterStat |
| 53 |
} |
| 54 |
|
| 55 |
func (m *multiCounterARPStats) init(a, b *tcpip.ARPStats) { |
| 56 |
m.packetsReceived.Init(a.PacketsReceived, b.PacketsReceived) |
| 57 |
m.disabledPacketsReceived.Init(a.DisabledPacketsReceived, b.DisabledPacketsReceived) |
| 58 |
m.malformedPacketsReceived.Init(a.MalformedPacketsReceived, b.MalformedPacketsReceived) |
| 59 |
m.requestsReceived.Init(a.RequestsReceived, b.RequestsReceived) |
| 60 |
m.requestsReceivedUnknownTargetAddress.Init(a.RequestsReceivedUnknownTargetAddress, b.RequestsReceivedUnknownTargetAddress) |
| 61 |
m.outgoingRequestInterfaceHasNoLocalAddressErrors.Init(a.OutgoingRequestInterfaceHasNoLocalAddressErrors, b.OutgoingRequestInterfaceHasNoLocalAddressErrors) |
| 62 |
m.outgoingRequestBadLocalAddressErrors.Init(a.OutgoingRequestBadLocalAddressErrors, b.OutgoingRequestBadLocalAddressErrors) |
| 63 |
m.outgoingRequestsDropped.Init(a.OutgoingRequestsDropped, b.OutgoingRequestsDropped) |
| 64 |
m.outgoingRequestsSent.Init(a.OutgoingRequestsSent, b.OutgoingRequestsSent) |
| 65 |
m.repliesReceived.Init(a.RepliesReceived, b.RepliesReceived) |
| 66 |
m.outgoingRepliesDropped.Init(a.OutgoingRepliesDropped, b.OutgoingRepliesDropped) |
| 67 |
m.outgoingRepliesSent.Init(a.OutgoingRepliesSent, b.OutgoingRepliesSent) |
| 68 |
} |
| 69 |
|
| 70 |
|