2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.virtualbng;
20 import org.onlab.packet.IpAddress;
21 import org.onlab.packet.MacAddress;
24 * Provides information about the virtual BNG configuration.
26 public interface VbngConfigurationService {
29 * Gets the IP address configured for the next hop.
31 * @return the IP address of next hop
33 IpAddress getNextHopIpAddress();
36 * Gets the MAC address configured for all the public IP addresses.
38 * @return the MAC address
40 MacAddress getPublicFacingMac();
43 * Gets the IP address configured for XOS server.
45 * @return the IP address configured for the XOS server
47 IpAddress getXosIpAddress();
50 * Gets the REST communication port configured for XOS server.
52 * @return the REST communication port configured for XOS server
57 * Evaluates whether an IP address is an assigned public IP address.
59 * @param ipAddress the IP address to evaluate
60 * @return true if the input IP address is an assigned public IP address,
63 boolean isAssignedPublicIpAddress(IpAddress ipAddress);
66 * Gets an available public IP address from local public IP prefixes.
68 * @param privateIpAddress a private IP address
69 * @return an available public IP address if it exists, otherwise null
71 IpAddress getAvailablePublicIpAddress(IpAddress privateIpAddress);
74 * Gets the public IP address already assigned for a private IP address.
76 * @param privateIpAddress a private IP address
77 * @return the assigned public IP address if it exists, otherwise null
79 IpAddress getAssignedPublicIpAddress(IpAddress privateIpAddress);
82 * Recycles the public IP address assigned for a private IP address, and
83 * at the same time deletes the mapping entry from this private IP address
84 * to the public IP address.
86 * @param privateIpAddress a private IP address
87 * @return the assigned public IP address if it exists, otherwise null
89 IpAddress recycleAssignedPublicIpAddress(IpAddress privateIpAddress);
92 * Gets all the mapping entries from private IP address to public IP
95 * @return the address map from private IP address to public IP address
97 Map<IpAddress, IpAddress> getIpAddressMappings();
100 * Tries to assign a given public IP address to a private IP address. If
101 * success, then sets up the mapping from this private IP address to the
102 * public IP address, and stores the mapping.
104 * @param publicIpAddress the public IP address try to assign
105 * @param privateIpAddress a private IP address
106 * @return true if this public IP address is available, otherwise false
108 boolean assignSpecifiedPublicIp(IpAddress publicIpAddress,
109 IpAddress privateIpAddress);