Package org.onosproject.dhcp
Interface DhcpStore
-
public interface DhcpStore
DHCPStore Interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
assignIP(HostId hostId, IpAssignment ipAssignment)
Assigns the requested IP to the Mac ID, in response to a DHCP REQUEST message.boolean
assignStaticIP(MacAddress macAddress, IpAssignment ipAssignment)
Assigns the requested IP to the MAC ID (if available) for an indefinite period of time.java.lang.Iterable<Ip4Address>
getAvailableIPs()
Returns the list of all the available IPs with the server.IpAssignment
getIpAssignmentFromAllocationMap(HostId hostId)
Returns IpAssignment from map.java.util.Map<HostId,IpAssignment>
listAllMapping()
Returns a collection of all the MacAddress to IPAddress mapping.java.util.Map<HostId,IpAssignment>
listAssignedMapping()
Returns a collection of all the MacAddress to IPAddress mapping assigned to the hosts.void
populateIPPoolfromRange(Ip4Address startIP, Ip4Address endIP)
Appends all the IPs in a given range to the free pool of IPs.Ip4Address
releaseIP(HostId hostId)
Releases the IP assigned to a Mac ID into the free pool.boolean
removeStaticIP(MacAddress macAddress)
Removes a static IP mapping associated with the given MAC ID from the DHCP Server.void
setDefaultTimeoutForPurge(int timeInSeconds)
Sets the default time for which suggested IP mappings are valid.Ip4Address
suggestIP(HostId hostId, Ip4Address requestedIP)
Returns an IP Address for a Mac ID, in response to a DHCP DISCOVER message.
-
-
-
Method Detail
-
populateIPPoolfromRange
void populateIPPoolfromRange(Ip4Address startIP, Ip4Address endIP)
Appends all the IPs in a given range to the free pool of IPs.- Parameters:
startIP
- Start IP for the rangeendIP
- End IP for the range
-
suggestIP
Ip4Address suggestIP(HostId hostId, Ip4Address requestedIP)
Returns an IP Address for a Mac ID, in response to a DHCP DISCOVER message.- Parameters:
hostId
- Host ID of the client requesting an IPrequestedIP
- requested IP address- Returns:
- IP address assigned to the Mac address; null if no available IP
-
assignIP
boolean assignIP(HostId hostId, IpAssignment ipAssignment)
Assigns the requested IP to the Mac ID, in response to a DHCP REQUEST message.- Parameters:
hostId
- Host Id of the client requesting an IPipAssignment
- ip assignment- Returns:
- returns true if the assignment was successful, false otherwise
-
setDefaultTimeoutForPurge
void setDefaultTimeoutForPurge(int timeInSeconds)
Sets the default time for which suggested IP mappings are valid.- Parameters:
timeInSeconds
- default time for IP mappings to be valid
-
releaseIP
Ip4Address releaseIP(HostId hostId)
Releases the IP assigned to a Mac ID into the free pool.- Parameters:
hostId
- the host ID for which the mapping needs to be changed- Returns:
- released ip
-
listAssignedMapping
java.util.Map<HostId,IpAssignment> listAssignedMapping()
Returns a collection of all the MacAddress to IPAddress mapping assigned to the hosts.- Returns:
- the collection of the mappings
-
listAllMapping
java.util.Map<HostId,IpAssignment> listAllMapping()
Returns a collection of all the MacAddress to IPAddress mapping.- Returns:
- the collection of the mappings
-
assignStaticIP
boolean assignStaticIP(MacAddress macAddress, IpAssignment ipAssignment)
Assigns the requested IP to the MAC ID (if available) for an indefinite period of time.- Parameters:
macAddress
- mac address of the clientipAssignment
- ip address and dhcp options requested for the client- Returns:
- true if the mapping was successfully registered, false otherwise
-
removeStaticIP
boolean removeStaticIP(MacAddress macAddress)
Removes a static IP mapping associated with the given MAC ID from the DHCP Server.- Parameters:
macAddress
- mac address of the client- Returns:
- true if the mapping was successfully registered, false otherwise
-
getAvailableIPs
java.lang.Iterable<Ip4Address> getAvailableIPs()
Returns the list of all the available IPs with the server.- Returns:
- list of available IPs
-
getIpAssignmentFromAllocationMap
IpAssignment getIpAssignmentFromAllocationMap(HostId hostId)
Returns IpAssignment from map.- Parameters:
hostId
- host identification- Returns:
- IpAssignment
-
-