blob: 87ae549038d6dbb36582e94a9f80f5fcd39393fd [file] [log] [blame]
xuzhang585f9052015-07-22 11:20:13 +08001/*
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 */
16package org.onosproject.app.vtnrsc;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.IpAddress.Version;
20import org.onlab.packet.IpPrefix;
21
22/**
23 * Representation of a subnet.
24 */
25public 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 /**
xuzhang91b2ff42015-08-11 11:05:19 +080035 * Returns the subnet identifier.
xuzhang585f9052015-07-22 11:20:13 +080036 *
xuzhang91b2ff42015-08-11 11:05:19 +080037 * @return identifier
xuzhang585f9052015-07-22 11:20:13 +080038 */
39 SubnetId id();
40
41 /**
42 * Returns the name of the subnet.
43 *
44 * @return subnetName
45 */
46 String subnetName();
47
48 /**
xuzhang91b2ff42015-08-11 11:05:19 +080049 * Returns the network identifier.
xuzhang585f9052015-07-22 11:20:13 +080050 *
xuzhang91b2ff42015-08-11 11:05:19 +080051 * @return the network identifier
xuzhang585f9052015-07-22 11:20:13 +080052 */
53 TenantNetworkId networkId();
54
55 /**
xuzhang91b2ff42015-08-11 11:05:19 +080056 * Returns tenant identifier.
xuzhang585f9052015-07-22 11:20:13 +080057 *
xuzhang91b2ff42015-08-11 11:05:19 +080058 * @return the tenant identifier
xuzhang585f9052015-07-22 11:20:13 +080059 */
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 /**
xuzhang91b2ff42015-08-11 11:05:19 +080077 * Returns the gateway IP address.
xuzhang585f9052015-07-22 11:20:13 +080078 *
xuzhang91b2ff42015-08-11 11:05:19 +080079 * @return gatewayIp
xuzhang585f9052015-07-22 11:20:13 +080080 */
81 IpAddress gatewayIp();
82
83 /**
84 * Returns true if DHCP is enabled and return false if DHCP is disabled.
85 *
xuzhang91b2ff42015-08-11 11:05:19 +080086 * @return true or false
xuzhang585f9052015-07-22 11:20:13 +080087 */
88 boolean dhcpEnabled();
89
90 /**
91 * Indicates whether this tenantNetwork is shared across all tenants. By
xuzhang91b2ff42015-08-11 11:05:19 +080092 * default, only administrative user can change this value.
xuzhang585f9052015-07-22 11:20:13 +080093 *
xuzhang91b2ff42015-08-11 11:05:19 +080094 * @return true or false
xuzhang585f9052015-07-22 11:20:13 +080095 */
96 boolean shared();
97
98 /**
xuzhang91b2ff42015-08-11 11:05:19 +080099 * Returns a collection of hostRoutes.
xuzhang585f9052015-07-22 11:20:13 +0800100 *
xuzhang91b2ff42015-08-11 11:05:19 +0800101 * @return a collection of hostRoutes
xuzhang585f9052015-07-22 11:20:13 +0800102 */
103 Iterable<HostRoute> hostRoutes();
104
105 /**
106 * Returns the ipV6AddressMode. A valid value is dhcpv6-stateful,
107 * dhcpv6-stateless, or slaac.
108 *
xuzhang91b2ff42015-08-11 11:05:19 +0800109 * @return ipV6AddressMode whose value is dhcpv6-stateful, dhcpv6-stateless
110 * or slaac
xuzhang585f9052015-07-22 11:20:13 +0800111 */
112 Mode ipV6AddressMode();
113
114 /**
115 * Returns the ipV6RaMode.A valid value is dhcpv6-stateful,
116 * dhcpv6-stateless, or slaac.
117 *
xuzhang91b2ff42015-08-11 11:05:19 +0800118 * @return ipV6RaMode whose value is dhcpv6-stateful, dhcpv6-stateless or
119 * slaac
xuzhang585f9052015-07-22 11:20:13 +0800120 */
121 Mode ipV6RaMode();
122
123 /**
xuzhang91b2ff42015-08-11 11:05:19 +0800124 * Returns a collection of allocation_pools.
xuzhang585f9052015-07-22 11:20:13 +0800125 *
xuzhang91b2ff42015-08-11 11:05:19 +0800126 * @return a collection of allocationPools
xuzhang585f9052015-07-22 11:20:13 +0800127 */
xuzhang585f9052015-07-22 11:20:13 +0800128 Iterable<AllocationPool> allocationPools();
129}