Package oshi.software.os.linux
Class LinuxInternetProtocolStats
- java.lang.Object
-
- oshi.software.common.AbstractInternetProtocolStats
-
- oshi.software.os.linux.LinuxInternetProtocolStats
-
- All Implemented Interfaces:
InternetProtocolStats
@ThreadSafe public class LinuxInternetProtocolStats extends AbstractInternetProtocolStats
Internet Protocol Stats implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oshi.software.os.InternetProtocolStats
InternetProtocolStats.IPConnection, InternetProtocolStats.TcpState, InternetProtocolStats.TcpStats, InternetProtocolStats.UdpStats
-
-
Constructor Summary
Constructors Constructor Description LinuxInternetProtocolStats()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<InternetProtocolStats.IPConnection>getConnections()Gets a list of TCP and UDP connections.InternetProtocolStats.TcpStatsgetTCPv4Stats()Get the TCP stats for IPv4 connections.InternetProtocolStats.UdpStatsgetUDPv4Stats()Get the UDP stats for IPv4 datagrams.InternetProtocolStats.UdpStatsgetUDPv6Stats()Get the UDP stats for IPv6 datagrams, if available.private static Pair<java.lang.Integer,java.lang.Integer>parseHexColonHex(java.lang.String s)private static Pair<byte[],java.lang.Integer>parseIpAddr(java.lang.String s)private static java.util.List<InternetProtocolStats.IPConnection>queryConnections(java.lang.String protocol, int ipver, java.util.Map<java.lang.Long,java.lang.Integer> pidMap)private static InternetProtocolStats.TcpStatestateLookup(int state)-
Methods inherited from class oshi.software.common.AbstractInternetProtocolStats
getTCPv6Stats
-
-
-
-
Method Detail
-
getTCPv4Stats
public InternetProtocolStats.TcpStats getTCPv4Stats()
Description copied from interface:InternetProtocolStatsGet the TCP stats for IPv4 connections.On macOS connection information requires elevated permissions. Without elevatd permissions, segment data is estimated.
- Returns:
- a
InternetProtocolStats.TcpStatsobject encapsulating the stats.
-
getUDPv4Stats
public InternetProtocolStats.UdpStats getUDPv4Stats()
Description copied from interface:InternetProtocolStatsGet the UDP stats for IPv4 datagrams.- Returns:
- a
InternetProtocolStats.UdpStatsobject encapsulating the stats.
-
getUDPv6Stats
public InternetProtocolStats.UdpStats getUDPv6Stats()
Description copied from interface:InternetProtocolStatsGet the UDP stats for IPv6 datagrams, if available. If not available separately, these may be 0 and included in IPv4 datagrams.- Specified by:
getUDPv6Statsin interfaceInternetProtocolStats- Overrides:
getUDPv6Statsin classAbstractInternetProtocolStats- Returns:
- a
InternetProtocolStats.UdpStatsobject encapsulating the stats.
-
getConnections
public java.util.List<InternetProtocolStats.IPConnection> getConnections()
Description copied from interface:InternetProtocolStatsGets a list of TCP and UDP connections.- Specified by:
getConnectionsin interfaceInternetProtocolStats- Overrides:
getConnectionsin classAbstractInternetProtocolStats- Returns:
- A list of
InternetProtocolStats.IPConnectionobjects for TCP and UDP connections.
-
queryConnections
private static java.util.List<InternetProtocolStats.IPConnection> queryConnections(java.lang.String protocol, int ipver, java.util.Map<java.lang.Long,java.lang.Integer> pidMap)
-
parseIpAddr
private static Pair<byte[],java.lang.Integer> parseIpAddr(java.lang.String s)
-
parseHexColonHex
private static Pair<java.lang.Integer,java.lang.Integer> parseHexColonHex(java.lang.String s)
-
stateLookup
private static InternetProtocolStats.TcpState stateLookup(int state)
-
-