public class IPConfiguration extends Object
Constructor and Description |
---|
IPConfiguration() |
Modifier and Type | Method and Description |
---|---|
InetAddress[] |
getDNS()
Gets the DNS server addresses.
|
InetAddress |
getGateway()
Gets the gateway address.
|
InetAddress |
getIP()
Gets the IP address.
|
InetAddress |
getNetmask()
Gets the netmask.
|
boolean |
isDNSStatic()
Tells whether the DNS server address is statically configured or retrieved
from DHCP server.
|
boolean |
isStatic()
Tells whether the IP configuration is set statically or retrieved from a DHCP
server.
|
void |
setDNS(InetAddress[] dnsList)
Sets the addresses of the DNS servers.
|
void |
setGateway(InetAddress gateway)
Sets the IP address of the gateway.
|
void |
setIP(InetAddress ip)
Sets the IP address.
|
void |
setNetmask(InetAddress netmask)
Sets the netmask.
|
void |
useDHCP(boolean use)
Forces the use of DHCP or not.
|
void |
useStaticDNS(boolean use)
Selects the DNS configuration between a static statically configured DNS and
the DNS given by DHCP server.
|
public InetAddress[] getDNS()
null
if not set.public InetAddress getGateway()
null
if not set.public InetAddress getIP()
null
if not set.public InetAddress getNetmask()
null
if not set.public boolean isDNSStatic()
isStatic()
, the return
of this method is not relevant.true
for static DNS configuration, false
if
DHCP is used also for DNS.public boolean isStatic()
true
for static configuration, false
if
DHCP is used.public void setDNS(InetAddress[] dnsList)
dnsList
- the addresses of the DNS servers or null
.public void setGateway(InetAddress gateway)
gateway
- the IP address of the gateway or null
.public void setIP(InetAddress ip)
ip
- the IP address or null
.public void setNetmask(InetAddress netmask)
netmask
- the netmask or null
.public void useDHCP(boolean use)
use
- true
to use DHCP, false
for a static
configuration.setIP(InetAddress)
public void useStaticDNS(boolean use)
use
- true
to use a static DNS, false
for a
dynamic one.setDNS(InetAddress[])