Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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. |
| 15 | */ |
| 16 | package org.onosproject.virtualbng; |
| 17 | |
Pingping Lin | de77ee5 | 2015-06-03 17:16:07 -0700 | [diff] [blame^] | 18 | import java.util.Map; |
| 19 | |
Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 20 | import org.onlab.packet.IpAddress; |
Pingping Lin | be12656 | 2015-05-06 17:57:10 -0700 | [diff] [blame] | 21 | import org.onlab.packet.MacAddress; |
Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Provides information about the virtual BNG configuration. |
| 25 | */ |
| 26 | public interface VbngConfigurationService { |
| 27 | |
| 28 | /** |
| 29 | * Gets the IP address configured for the next hop. |
| 30 | * |
| 31 | * @return the IP address of next hop |
| 32 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 33 | IpAddress getNextHopIpAddress(); |
Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 34 | |
| 35 | /** |
Pingping Lin | be12656 | 2015-05-06 17:57:10 -0700 | [diff] [blame] | 36 | * Gets the MAC address configured for all the public IP addresses. |
| 37 | * |
| 38 | * @return the MAC address |
| 39 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 40 | MacAddress getPublicFacingMac(); |
Pingping Lin | be12656 | 2015-05-06 17:57:10 -0700 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * Evaluates whether an IP address is an assigned public IP address. |
| 44 | * |
| 45 | * @param ipAddress the IP address to evaluate |
| 46 | * @return true if the input IP address is an assigned public IP address, |
| 47 | * otherwise false |
| 48 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 49 | boolean isAssignedPublicIpAddress(IpAddress ipAddress); |
Pingping Lin | be12656 | 2015-05-06 17:57:10 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 52 | * Gets an available public IP address from local public IP prefixes. |
| 53 | * |
| 54 | * @param privateIpAddress a private IP address |
| 55 | * @return an available public IP address if it exists, otherwise null |
| 56 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 57 | IpAddress getAvailablePublicIpAddress(IpAddress privateIpAddress); |
Pingping Lin | 4e0c73d | 2015-05-06 15:41:10 -0700 | [diff] [blame] | 58 | |
| 59 | /** |
| 60 | * Gets the public IP address already assigned for a private IP address. |
| 61 | * |
| 62 | * @param privateIpAddress a private IP address |
| 63 | * @return the assigned public IP address if it exists, otherwise null |
| 64 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 65 | IpAddress getAssignedPublicIpAddress(IpAddress privateIpAddress); |
Pingping Lin | d2afaf2 | 2015-06-02 10:46:29 -0700 | [diff] [blame] | 66 | |
| 67 | /** |
| 68 | * Recycles the public IP address assigned for a private IP address, and |
| 69 | * at the same time deletes the mapping entry from this private IP address |
| 70 | * to the public IP address. |
| 71 | * |
| 72 | * @param privateIpAddress a private IP address |
| 73 | * @return the assigned public IP address if it exists, otherwise null |
| 74 | */ |
| 75 | IpAddress recycleAssignedPublicIpAddress(IpAddress privateIpAddress); |
Pingping Lin | de77ee5 | 2015-06-03 17:16:07 -0700 | [diff] [blame^] | 76 | |
| 77 | /** |
| 78 | * Gets all the mapping entries from private IP address to public IP |
| 79 | * address. |
| 80 | * |
| 81 | * @return the address map from private IP address to public IP address |
| 82 | */ |
| 83 | Map<IpAddress, IpAddress> getIpAddressMappings(); |
Pingping Lin | ffa27d3 | 2015-04-30 14:41:03 -0700 | [diff] [blame] | 84 | } |