blob: 29551f8c03e4f2855c16f59262afa4a0b0717e5c [file] [log] [blame]
Sho SHIMIZUb2b2d982015-09-11 15:35:06 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Sho SHIMIZUb2b2d982015-09-11 15:35:06 -07003 *
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.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 */
Sho SHIMIZUe2952e42015-09-11 17:11:21 -070030 enum Mode {
Sho SHIMIZUb2b2d982015-09-11 15:35:06 -070031 DHCPV6_STATEFUL, DHCPV6_STATELESS, SLAAC
32 }
33
34 /**
35 * Returns the subnet identifier.
36 *
37 * @return identifier
38 */
39 SubnetId id();
40
41 /**
42 * Returns the name of the subnet.
43 *
44 * @return subnetName
45 */
46 String subnetName();
47
48 /**
49 * Returns the network identifier.
50 *
51 * @return the network identifier
52 */
53 TenantNetworkId networkId();
54
55 /**
56 * Returns tenant identifier.
57 *
58 * @return the tenant identifier
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 /**
77 * Returns the gateway IP address.
78 *
79 * @return gatewayIp
80 */
81 IpAddress gatewayIp();
82
83 /**
84 * Returns true if DHCP is enabled and return false if DHCP is disabled.
85 *
86 * @return true or false
87 */
88 boolean dhcpEnabled();
89
90 /**
91 * Indicates whether this tenantNetwork is shared across all tenants. By
92 * default, only administrative user can change this value.
93 *
94 * @return true or false
95 */
96 boolean shared();
97
98 /**
99 * Returns a collection of hostRoutes.
100 *
101 * @return a collection of hostRoutes
102 */
103 Iterable<HostRoute> hostRoutes();
104
105 /**
106 * Returns the ipV6AddressMode. A valid value is dhcpv6-stateful,
107 * dhcpv6-stateless, or slaac.
108 *
109 * @return ipV6AddressMode whose value is dhcpv6-stateful, dhcpv6-stateless
110 * or slaac
111 */
112 Mode ipV6AddressMode();
113
114 /**
115 * Returns the ipV6RaMode.A valid value is dhcpv6-stateful,
116 * dhcpv6-stateless, or slaac.
117 *
118 * @return ipV6RaMode whose value is dhcpv6-stateful, dhcpv6-stateless or
119 * slaac
120 */
121 Mode ipV6RaMode();
122
123 /**
124 * Returns a collection of allocation_pools.
125 *
126 * @return a collection of allocationPools
127 */
128 Iterable<AllocationPool> allocationPools();
129}