diff options
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/network/internal/ip/stats.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/network/ipv4/icmp.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/network/ipv4/stats.go | 4 | ||||
-rw-r--r-- | pkg/tcpip/tcpip.go | 171 |
4 files changed, 80 insertions, 99 deletions
diff --git a/pkg/tcpip/network/internal/ip/stats.go b/pkg/tcpip/network/internal/ip/stats.go index 5f7e60c5c..b6f39ddb1 100644 --- a/pkg/tcpip/network/internal/ip/stats.go +++ b/pkg/tcpip/network/internal/ip/stats.go @@ -69,8 +69,8 @@ type MultiCounterIPStats struct { IPTablesOutputDropped tcpip.MultiCounterStat // TODO(https://gvisor.dev/issues/5529): Move the IPv4-only option stats out - // of IPStats. + // OptionTimestampReceived is the number of Timestamp options seen. OptionTimestampReceived tcpip.MultiCounterStat diff --git a/pkg/tcpip/network/ipv4/icmp.go b/pkg/tcpip/network/ipv4/icmp.go index bd0eabad1..5bf7809e8 100644 --- a/pkg/tcpip/network/ipv4/icmp.go +++ b/pkg/tcpip/network/ipv4/icmp.go @@ -238,7 +238,7 @@ func (e *endpoint) handleICMP(pkt *stack.PacketBuffer) { // TODO(b/112892170): Meaningfully handle all ICMP types. switch h.Type() { case header.ICMPv4Echo: - received.echo.Increment() + received.echoRequest.Increment() sent := e.stats.icmp.packetsSent if !e.protocol.stack.AllowICMPMessage() { diff --git a/pkg/tcpip/network/ipv4/stats.go b/pkg/tcpip/network/ipv4/stats.go index 5ae73fbfb..5798cfec6 100644 --- a/pkg/tcpip/network/ipv4/stats.go +++ b/pkg/tcpip/network/ipv4/stats.go @@ -52,7 +52,7 @@ type sharedStats struct { // LINT.IfChange(multiCounterICMPv4PacketStats) type multiCounterICMPv4PacketStats struct { - echo tcpip.MultiCounterStat + echoRequest tcpip.MultiCounterStat echoReply tcpip.MultiCounterStat dstUnreachable tcpip.MultiCounterStat srcQuench tcpip.MultiCounterStat @@ -66,7 +66,7 @@ type multiCounterICMPv4PacketStats struct { } func (m *multiCounterICMPv4PacketStats) init(a, b *tcpip.ICMPv4PacketStats) { - m.echo.Init(a.Echo, b.Echo) + m.echoRequest.Init(a.EchoRequest, b.EchoRequest) m.echoReply.Init(a.EchoReply, b.EchoReply) m.dstUnreachable.Init(a.DstUnreachable, b.DstUnreachable) m.srcQuench.Init(a.SrcQuench, b.SrcQuench) diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index 01a4389e3..87ea09a5e 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -1258,44 +1258,38 @@ func (m *MultiCounterStat) IncrementBy(v uint64) { type ICMPv4PacketStats struct { // LINT.IfChange(ICMPv4PacketStats) - // Echo is the total number of ICMPv4 echo packets counted. - Echo *StatCounter + // EchoRequest is the number of ICMPv4 echo packets counted. + EchoRequest *StatCounter - // EchoReply is the total number of ICMPv4 echo reply packets counted. + // EchoReply is the number of ICMPv4 echo reply packets counted. EchoReply *StatCounter - // DstUnreachable is the total number of ICMPv4 destination unreachable - // packets counted. + // DstUnreachable is the number of ICMPv4 destination unreachable packets + // counted. DstUnreachable *StatCounter - // SrcQuench is the total number of ICMPv4 source quench packets - // counted. + // SrcQuench is the number of ICMPv4 source quench packets counted. SrcQuench *StatCounter - // Redirect is the total number of ICMPv4 redirect packets counted. + // Redirect is the number of ICMPv4 redirect packets counted. Redirect *StatCounter - // TimeExceeded is the total number of ICMPv4 time exceeded packets - // counted. + // TimeExceeded is the number of ICMPv4 time exceeded packets counted. TimeExceeded *StatCounter - // ParamProblem is the total number of ICMPv4 parameter problem packets - // counted. + // ParamProblem is the number of ICMPv4 parameter problem packets counted. ParamProblem *StatCounter - // Timestamp is the total number of ICMPv4 timestamp packets counted. + // Timestamp is the number of ICMPv4 timestamp packets counted. Timestamp *StatCounter - // TimestampReply is the total number of ICMPv4 timestamp reply packets - // counted. + // TimestampReply is the number of ICMPv4 timestamp reply packets counted. TimestampReply *StatCounter - // InfoRequest is the total number of ICMPv4 information request - // packets counted. + // InfoRequest is the number of ICMPv4 information request packets counted. InfoRequest *StatCounter - // InfoReply is the total number of ICMPv4 information reply packets - // counted. + // InfoReply is the number of ICMPv4 information reply packets counted. InfoReply *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterICMPv4PacketStats) @@ -1307,12 +1301,11 @@ type ICMPv4SentPacketStats struct { ICMPv4PacketStats - // Dropped is the total number of ICMPv4 packets dropped due to link - // layer errors. + // Dropped is the number of ICMPv4 packets dropped due to link layer errors. Dropped *StatCounter - // RateLimited is the total number of ICMPv4 packets dropped due to - // rate limit being exceeded. + // RateLimited is the number of ICMPv4 packets dropped due to rate limit being + // exceeded. RateLimited *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterICMPv4SentPacketStats) @@ -1324,7 +1317,7 @@ type ICMPv4ReceivedPacketStats struct { ICMPv4PacketStats - // Invalid is the total number of invalid ICMPv4 packets received. + // Invalid is the number of invalid ICMPv4 packets received. Invalid *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterICMPv4ReceivedPacketStats) @@ -1347,59 +1340,50 @@ type ICMPv4Stats struct { type ICMPv6PacketStats struct { // LINT.IfChange(ICMPv6PacketStats) - // EchoRequest is the total number of ICMPv6 echo request packets - // counted. + // EchoRequest is the number of ICMPv6 echo request packets counted. EchoRequest *StatCounter - // EchoReply is the total number of ICMPv6 echo reply packets counted. + // EchoReply is the number of ICMPv6 echo reply packets counted. EchoReply *StatCounter - // DstUnreachable is the total number of ICMPv6 destination unreachable - // packets counted. + // DstUnreachable is the number of ICMPv6 destination unreachable packets + // counted. DstUnreachable *StatCounter - // PacketTooBig is the total number of ICMPv6 packet too big packets - // counted. + // PacketTooBig is the number of ICMPv6 packet too big packets counted. PacketTooBig *StatCounter - // TimeExceeded is the total number of ICMPv6 time exceeded packets - // counted. + // TimeExceeded is the number of ICMPv6 time exceeded packets counted. TimeExceeded *StatCounter - // ParamProblem is the total number of ICMPv6 parameter problem packets - // counted. + // ParamProblem is the number of ICMPv6 parameter problem packets counted. ParamProblem *StatCounter - // RouterSolicit is the total number of ICMPv6 router solicit packets - // counted. + // RouterSolicit is the number of ICMPv6 router solicit packets counted. RouterSolicit *StatCounter - // RouterAdvert is the total number of ICMPv6 router advert packets - // counted. + // RouterAdvert is the number of ICMPv6 router advert packets counted. RouterAdvert *StatCounter - // NeighborSolicit is the total number of ICMPv6 neighbor solicit - // packets counted. + // NeighborSolicit is the number of ICMPv6 neighbor solicit packets counted. NeighborSolicit *StatCounter - // NeighborAdvert is the total number of ICMPv6 neighbor advert packets - // counted. + // NeighborAdvert is the number of ICMPv6 neighbor advert packets counted. NeighborAdvert *StatCounter - // RedirectMsg is the total number of ICMPv6 redirect message packets - // counted. + // RedirectMsg is the number of ICMPv6 redirect message packets counted. RedirectMsg *StatCounter - // MulticastListenerQuery is the total number of Multicast Listener Query - // messages counted. + // MulticastListenerQuery is the number of Multicast Listener Query messages + // counted. MulticastListenerQuery *StatCounter - // MulticastListenerReport is the total number of Multicast Listener Report - // messages counted. + // MulticastListenerReport is the number of Multicast Listener Report messages + // counted. MulticastListenerReport *StatCounter - // MulticastListenerDone is the total number of Multicast Listener Done - // messages counted. + // MulticastListenerDone is the number of Multicast Listener Done messages + // counted. MulticastListenerDone *StatCounter // LINT.ThenChange(network/ipv6/stats.go:multiCounterICMPv6PacketStats) @@ -1411,12 +1395,11 @@ type ICMPv6SentPacketStats struct { ICMPv6PacketStats - // Dropped is the total number of ICMPv6 packets dropped due to link - // layer errors. + // Dropped is the number of ICMPv6 packets dropped due to link layer errors. Dropped *StatCounter - // RateLimited is the total number of ICMPv6 packets dropped due to - // rate limit being exceeded. + // RateLimited is the number of ICMPv6 packets dropped due to rate limit being + // exceeded. RateLimited *StatCounter // LINT.ThenChange(network/ipv6/stats.go:multiCounterICMPv6SentPacketStats) @@ -1428,15 +1411,15 @@ type ICMPv6ReceivedPacketStats struct { ICMPv6PacketStats - // Unrecognized is the total number of ICMPv6 packets received that the - // transport layer does not know how to parse. + // Unrecognized is the number of ICMPv6 packets received that the transport + // layer does not know how to parse. Unrecognized *StatCounter - // Invalid is the total number of invalid ICMPv6 packets received. + // Invalid is the number of invalid ICMPv6 packets received. Invalid *StatCounter - // RouterOnlyPacketsDroppedByHost is the total number of ICMPv6 packets - // dropped due to being router-specific packets. + // RouterOnlyPacketsDroppedByHost is the number of ICMPv6 packets dropped due + // to being router-specific packets. RouterOnlyPacketsDroppedByHost *StatCounter // LINT.ThenChange(network/ipv6/stats.go:multiCounterICMPv6ReceivedPacketStats) @@ -1468,18 +1451,18 @@ type ICMPStats struct { type IGMPPacketStats struct { // LINT.IfChange(IGMPPacketStats) - // MembershipQuery is the total number of Membership Query messages counted. + // MembershipQuery is the number of Membership Query messages counted. MembershipQuery *StatCounter - // V1MembershipReport is the total number of Version 1 Membership Report - // messages counted. + // V1MembershipReport is the number of Version 1 Membership Report messages + // counted. V1MembershipReport *StatCounter - // V2MembershipReport is the total number of Version 2 Membership Report - // messages counted. + // V2MembershipReport is the number of Version 2 Membership Report messages + // counted. V2MembershipReport *StatCounter - // LeaveGroup is the total number of Leave Group messages counted. + // LeaveGroup is the number of Leave Group messages counted. LeaveGroup *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterIGMPPacketStats) @@ -1491,7 +1474,7 @@ type IGMPSentPacketStats struct { IGMPPacketStats - // Dropped is the total number of IGMP packets dropped. + // Dropped is the number of IGMP packets dropped. Dropped *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterIGMPSentPacketStats) @@ -1503,15 +1486,14 @@ type IGMPReceivedPacketStats struct { IGMPPacketStats - // Invalid is the total number of invalid IGMP packets received. + // Invalid is the number of invalid IGMP packets received. Invalid *StatCounter - // ChecksumErrors is the total number of IGMP packets dropped due to bad - // checksums. + // ChecksumErrors is the number of IGMP packets dropped due to bad checksums. ChecksumErrors *StatCounter - // Unrecognized is the total number of unrecognized messages counted, these - // are silently ignored for forward-compatibilty. + // Unrecognized is the number of unrecognized messages counted, these are + // silently ignored for forward-compatibilty. Unrecognized *StatCounter // LINT.ThenChange(network/ipv4/stats.go:multiCounterIGMPReceivedPacketStats) @@ -1534,51 +1516,50 @@ type IGMPStats struct { type IPStats struct { // LINT.IfChange(IPStats) - // PacketsReceived is the total number of IP packets received from the - // link layer. + // PacketsReceived is the number of IP packets received from the link layer. PacketsReceived *StatCounter - // DisabledPacketsReceived is the total number of IP packets received from the - // link layer when the IP layer is disabled. + // DisabledPacketsReceived is the number of IP packets received from the link + // layer when the IP layer is disabled. DisabledPacketsReceived *StatCounter - // InvalidDestinationAddressesReceived is the total number of IP packets - // received with an unknown or invalid destination address. + // InvalidDestinationAddressesReceived is the number of IP packets received + // with an unknown or invalid destination address. InvalidDestinationAddressesReceived *StatCounter - // InvalidSourceAddressesReceived is the total number of IP packets received - // with a source address that should never have been received on the wire. + // InvalidSourceAddressesReceived is the number of IP packets received with a + // source address that should never have been received on the wire. InvalidSourceAddressesReceived *StatCounter - // PacketsDelivered is the total number of incoming IP packets that - // are successfully delivered to the transport layer. + // PacketsDelivered is the number of incoming IP packets that are successfully + // delivered to the transport layer. PacketsDelivered *StatCounter - // PacketsSent is the total number of IP packets sent via WritePacket. + // PacketsSent is the number of IP packets sent via WritePacket. PacketsSent *StatCounter - // OutgoingPacketErrors is the total number of IP packets which failed - // to write to a link-layer endpoint. + // OutgoingPacketErrors is the number of IP packets which failed to write to a + // link-layer endpoint. OutgoingPacketErrors *StatCounter - // MalformedPacketsReceived is the total number of IP Packets that were - // dropped due to the IP packet header failing validation checks. + // MalformedPacketsReceived is the number of IP Packets that were dropped due + // to the IP packet header failing validation checks. MalformedPacketsReceived *StatCounter - // MalformedFragmentsReceived is the total number of IP Fragments that were - // dropped due to the fragment failing validation checks. + // MalformedFragmentsReceived is the number of IP Fragments that were dropped + // due to the fragment failing validation checks. MalformedFragmentsReceived *StatCounter - // IPTablesPreroutingDropped is the total number of IP packets dropped - // in the Prerouting chain. + // IPTablesPreroutingDropped is the number of IP packets dropped in the + // Prerouting chain. IPTablesPreroutingDropped *StatCounter - // IPTablesInputDropped is the total number of IP packets dropped in - // the Input chain. + // IPTablesInputDropped is the number of IP packets dropped in the Input + // chain. IPTablesInputDropped *StatCounter - // IPTablesOutputDropped is the total number of IP packets dropped in - // the Output chain. + // IPTablesOutputDropped is the number of IP packets dropped in the Output + // chain. IPTablesOutputDropped *StatCounter // TODO(https://gvisor.dev/issues/5529): Move the IPv4-only option stats out |