View Javadoc
1   /*
2    * Copyright 2017-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.software.os;
6   
7   import oshi.annotation.concurrent.ThreadSafe;
8   
9   /**
10   * NetworkParams presents network parameters of running OS, such as DNS, host name etc.
11   */
12  @ThreadSafe
13  public interface NetworkParams {
14  
15      /**
16       * Gets the HostName of the machine executing OSHI.
17       *
18       * @return the hostname
19       */
20      String getHostName();
21  
22      /**
23       * Gets the Domain Name of the machine executing OSHI.
24       *
25       * @return the domain name
26       */
27      String getDomainName();
28  
29      /**
30       * Gets the DNS Servers configured for this machine.
31       *
32       * @return the DNS servers
33       */
34      String[] getDnsServers();
35  
36      /**
37       * Gets the default gateway(routing destination for 0.0.0.0/0) for IPv4 connections.
38       *
39       * @return default gateway for IPv4, or empty string if not defined.
40       */
41      String getIpv4DefaultGateway();
42  
43      /**
44       * Gets default gateway(routing destination for ::/0) for IPv6 connections.
45       *
46       * @return default gateway for IPv6, or empty string if not defined.
47       */
48      String getIpv6DefaultGateway();
49  }