Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 3 | * |
| 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. |
Yi Tseng | 5130129 | 2017-07-28 13:02:59 -0700 | [diff] [blame] | 15 | * |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 16 | */ |
| 17 | |
Yi Tseng | 5130129 | 2017-07-28 13:02:59 -0700 | [diff] [blame] | 18 | package org.onosproject.dhcprelay.api; |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 19 | |
Yi Tseng | 13a41a1 | 2017-07-26 13:45:01 -0700 | [diff] [blame] | 20 | import org.onlab.packet.MacAddress; |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 21 | import org.onosproject.dhcprelay.store.DhcpRecord; |
| 22 | import org.onosproject.net.HostId; |
| 23 | |
| 24 | import java.util.Collection; |
Yi Tseng | 2fe8f3f | 2017-09-07 16:22:51 -0700 | [diff] [blame] | 25 | import java.util.List; |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 26 | import java.util.Optional; |
| 27 | |
| 28 | public interface DhcpRelayService { |
| 29 | /** |
| 30 | * Gets DHCP record for specific host id (mac + vlan). |
| 31 | * |
| 32 | * @param hostId the id of host |
| 33 | * @return the DHCP record of the host |
| 34 | */ |
| 35 | Optional<DhcpRecord> getDhcpRecord(HostId hostId); |
| 36 | |
| 37 | /** |
| 38 | * Gets all DHCP records from store. |
| 39 | * |
| 40 | * @return all DHCP records from store |
| 41 | */ |
| 42 | Collection<DhcpRecord> getDhcpRecords(); |
Yi Tseng | 13a41a1 | 2017-07-26 13:45:01 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Gets mac address of DHCP server. |
| 46 | * |
| 47 | * @return the mac address of DHCP server; empty if not exist |
Yi Tseng | 2fe8f3f | 2017-09-07 16:22:51 -0700 | [diff] [blame] | 48 | * @deprecated 1.12, use get DHCP server configs method |
Yi Tseng | 13a41a1 | 2017-07-26 13:45:01 -0700 | [diff] [blame] | 49 | */ |
Yi Tseng | 2fe8f3f | 2017-09-07 16:22:51 -0700 | [diff] [blame] | 50 | @Deprecated |
Yi Tseng | 13a41a1 | 2017-07-26 13:45:01 -0700 | [diff] [blame] | 51 | Optional<MacAddress> getDhcpServerMacAddress(); |
Yi Tseng | 2fe8f3f | 2017-09-07 16:22:51 -0700 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Gets list of default DHCP server information. |
| 55 | * |
| 56 | * @return list of default DHCP server information |
| 57 | */ |
| 58 | List<DhcpServerInfo> getDefaultDhcpServerInfoList(); |
| 59 | |
| 60 | /** |
| 61 | * Gets list of indirect DHCP server information. |
| 62 | * |
| 63 | * @return list of indirect DHCP server information |
| 64 | */ |
| 65 | List<DhcpServerInfo> getIndirectDhcpServerInfoList(); |
Yi Tseng | 7a38f9a | 2017-06-09 14:36:40 -0700 | [diff] [blame] | 66 | } |