View Javadoc
1   /*
2    * Copyright 2021-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.software.os.unix.openbsd;
6   
7   import oshi.annotation.concurrent.ThreadSafe;
8   import oshi.driver.unix.NetStat;
9   import oshi.software.common.AbstractInternetProtocolStats;
10  
11  /**
12   * Internet Protocol Stats implementation
13   */
14  @ThreadSafe
15  public class OpenBsdInternetProtocolStats extends AbstractInternetProtocolStats {
16  
17      @Override
18      public TcpStats getTCPv4Stats() {
19          return NetStat.queryTcpStats("netstat -s -p tcp");
20      }
21  
22      @Override
23      public UdpStats getUDPv4Stats() {
24          return NetStat.queryUdpStats("netstat -s -p udp");
25      }
26  }