blob: ef8698a024d717b12aebc003cfff5e0690b54cc5 [file] [log] [blame]
Pingping Linffa27d32015-04-30 14:41:03 -07001/*
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 */
16package org.onosproject.virtualbng;
17
Pingping Linde77ee52015-06-03 17:16:07 -070018import java.util.Map;
19
Pingping Linffa27d32015-04-30 14:41:03 -070020import org.onlab.packet.IpAddress;
Pingping Linbe126562015-05-06 17:57:10 -070021import org.onlab.packet.MacAddress;
Pingping Linffa27d32015-04-30 14:41:03 -070022
23/**
24 * Provides information about the virtual BNG configuration.
25 */
26public 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 SHIMIZU3310a342015-05-13 12:14:05 -070033 IpAddress getNextHopIpAddress();
Pingping Linffa27d32015-04-30 14:41:03 -070034
35 /**
Pingping Linbe126562015-05-06 17:57:10 -070036 * Gets the MAC address configured for all the public IP addresses.
37 *
38 * @return the MAC address
39 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070040 MacAddress getPublicFacingMac();
Pingping Linbe126562015-05-06 17:57:10 -070041
42 /**
Pingping Line10ece02015-06-11 19:26:24 -070043 * Gets the IP address configured for XOS server.
44 *
45 * @return the IP address configured for the XOS server
46 */
47 IpAddress getXosIpAddress();
48
49 /**
50 * Gets the REST communication port configured for XOS server.
51 *
52 * @return the REST communication port configured for XOS server
53 */
54 int getXosRestPort();
55
56 /**
Pingping Linbe126562015-05-06 17:57:10 -070057 * Evaluates whether an IP address is an assigned public IP address.
58 *
59 * @param ipAddress the IP address to evaluate
60 * @return true if the input IP address is an assigned public IP address,
61 * otherwise false
62 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070063 boolean isAssignedPublicIpAddress(IpAddress ipAddress);
Pingping Linbe126562015-05-06 17:57:10 -070064
65 /**
Pingping Linffa27d32015-04-30 14:41:03 -070066 * Gets an available public IP address from local public IP prefixes.
67 *
68 * @param privateIpAddress a private IP address
69 * @return an available public IP address if it exists, otherwise null
70 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070071 IpAddress getAvailablePublicIpAddress(IpAddress privateIpAddress);
Pingping Lin4e0c73d2015-05-06 15:41:10 -070072
73 /**
74 * Gets the public IP address already assigned for a private IP address.
75 *
76 * @param privateIpAddress a private IP address
77 * @return the assigned public IP address if it exists, otherwise null
78 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070079 IpAddress getAssignedPublicIpAddress(IpAddress privateIpAddress);
Pingping Lind2afaf22015-06-02 10:46:29 -070080
81 /**
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.
85 *
86 * @param privateIpAddress a private IP address
87 * @return the assigned public IP address if it exists, otherwise null
88 */
89 IpAddress recycleAssignedPublicIpAddress(IpAddress privateIpAddress);
Pingping Linde77ee52015-06-03 17:16:07 -070090
91 /**
92 * Gets all the mapping entries from private IP address to public IP
93 * address.
94 *
95 * @return the address map from private IP address to public IP address
96 */
97 Map<IpAddress, IpAddress> getIpAddressMappings();
Pingping Lin53ae34f2015-06-09 10:07:08 -070098
99 /**
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.
103 *
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
107 */
108 boolean assignSpecifiedPublicIp(IpAddress publicIpAddress,
109 IpAddress privateIpAddress);
Pingping Linffa27d32015-04-30 14:41:03 -0700110}