blob: f40452ab9ac3b724b276687ab91bf89cc9a3edfc [file] [log] [blame]
samanwita palf28207b2015-09-04 10:41:56 -07001/*
Thomas Vachuska54dc3522015-09-09 00:11:45 -07002 * Copyright 2015 Open Networking Laboratory
samanwita palf28207b2015-09-04 10:41:56 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.dhcp;
17
18import org.onlab.packet.Ip4Address;
19import org.onlab.packet.MacAddress;
20
21import java.util.Map;
22
23/**
24 * DHCP Service Interface.
25 */
26public interface DHCPService {
27
28 /**
29 * Returns a collection of all the MacAddress to IPAddress mapping.
30 *
31 * @return collection of mappings.
32 */
Thomas Vachuska54dc3522015-09-09 00:11:45 -070033 Map<MacAddress, IPAssignment> listMapping();
samanwita palf28207b2015-09-04 10:41:56 -070034
35 /**
36 * Returns the default lease time granted by the DHCP Server.
37 *
38 * @return lease time
39 */
40 int getLeaseTime();
41
42 /**
43 * Returns the default renewal time granted by the DHCP Server.
44 *
45 * @return renewal time
46 */
47 int getRenewalTime();
48
49 /**
50 * Returns the default rebinding time granted by the DHCP Server.
51 *
52 * @return rebinding time
53 */
54 int getRebindingTime();
55
56 /**
57 * Registers a static IP mapping with the DHCP Server.
58 *
59 * @param macID macID of the client
60 * @param ipAddress IP Address requested for the client
61 * @return true if the mapping was successfully registered, false otherwise
62 */
63 boolean setStaticMapping(MacAddress macID, Ip4Address ipAddress);
64
65 /**
66 * Removes a static IP mapping with the DHCP Server.
67 *
68 * @param macID macID of the client
69 * @return true if the mapping was successfully removed, false otherwise
70 */
71 boolean removeStaticMapping(MacAddress macID);
72
73 /**
74 * Returns the list of all the available IPs with the server.
75 *
76 * @return list of available IPs
77 */
78 Iterable<Ip4Address> getAvailableIPs();
79
80}