xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 1 | /* |
| 2 | *Copyright 2014 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.app.vtnrsc; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.IpAddress.Version; |
| 20 | import org.onlab.packet.IpPrefix; |
| 21 | |
| 22 | /** |
| 23 | * Representation of a subnet. |
| 24 | */ |
| 25 | public interface Subnet { |
| 26 | |
| 27 | /** |
| 28 | * Coarse classification of the type of the ipV6Mode. |
| 29 | */ |
| 30 | public enum Mode { |
| 31 | DHCPV6_STATEFUL, DHCPV6_STATELESS, SLAAC |
| 32 | } |
| 33 | |
| 34 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 35 | * Returns the subnet identifier. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 36 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 37 | * @return identifier |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 38 | */ |
| 39 | SubnetId id(); |
| 40 | |
| 41 | /** |
| 42 | * Returns the name of the subnet. |
| 43 | * |
| 44 | * @return subnetName |
| 45 | */ |
| 46 | String subnetName(); |
| 47 | |
| 48 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 49 | * Returns the network identifier. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 50 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 51 | * @return the network identifier |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 52 | */ |
| 53 | TenantNetworkId networkId(); |
| 54 | |
| 55 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 56 | * Returns tenant identifier. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 57 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 58 | * @return the tenant identifier |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 59 | */ |
| 60 | TenantId tenantId(); |
| 61 | |
| 62 | /** |
| 63 | * Returns the IP version, which is 4 or 6. |
| 64 | * |
| 65 | * @return ipVersion |
| 66 | */ |
| 67 | Version ipVersion(); |
| 68 | |
| 69 | /** |
| 70 | * Returns the cidr. |
| 71 | * |
| 72 | * @return cidr |
| 73 | */ |
| 74 | IpPrefix cidr(); |
| 75 | |
| 76 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 77 | * Returns the gateway IP address. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 78 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 79 | * @return gatewayIp |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 80 | */ |
| 81 | IpAddress gatewayIp(); |
| 82 | |
| 83 | /** |
| 84 | * Returns true if DHCP is enabled and return false if DHCP is disabled. |
| 85 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 86 | * @return true or false |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 87 | */ |
| 88 | boolean dhcpEnabled(); |
| 89 | |
| 90 | /** |
| 91 | * Indicates whether this tenantNetwork is shared across all tenants. By |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 92 | * default, only administrative user can change this value. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 93 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 94 | * @return true or false |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 95 | */ |
| 96 | boolean shared(); |
| 97 | |
| 98 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 99 | * Returns a collection of hostRoutes. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 100 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 101 | * @return a collection of hostRoutes |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 102 | */ |
| 103 | Iterable<HostRoute> hostRoutes(); |
| 104 | |
| 105 | /** |
| 106 | * Returns the ipV6AddressMode. A valid value is dhcpv6-stateful, |
| 107 | * dhcpv6-stateless, or slaac. |
| 108 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 109 | * @return ipV6AddressMode whose value is dhcpv6-stateful, dhcpv6-stateless |
| 110 | * or slaac |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 111 | */ |
| 112 | Mode ipV6AddressMode(); |
| 113 | |
| 114 | /** |
| 115 | * Returns the ipV6RaMode.A valid value is dhcpv6-stateful, |
| 116 | * dhcpv6-stateless, or slaac. |
| 117 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 118 | * @return ipV6RaMode whose value is dhcpv6-stateful, dhcpv6-stateless or |
| 119 | * slaac |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 120 | */ |
| 121 | Mode ipV6RaMode(); |
| 122 | |
| 123 | /** |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 124 | * Returns a collection of allocation_pools. |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 125 | * |
xuzhang | 91b2ff4 | 2015-08-11 11:05:19 +0800 | [diff] [blame^] | 126 | * @return a collection of allocationPools |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 127 | */ |
xuzhang | 585f905 | 2015-07-22 11:20:13 +0800 | [diff] [blame] | 128 | Iterable<AllocationPool> allocationPools(); |
| 129 | } |