blob: 2d2a576764dde2b0eab3666ebaba99704988eed7 [file] [log] [blame]
nosignal5fd282e2016-09-16 16:11:40 -07001/*
2 * Copyright 2016-present 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.vpls.config;
17
18import com.google.common.collect.SetMultimap;
19import org.onlab.packet.VlanId;
20import org.onosproject.incubator.net.intf.Interface;
21import org.onosproject.net.ConnectPoint;
Luca Prete092e8952016-10-26 16:25:56 +020022import org.onosproject.net.EncapsulationType;
nosignal5fd282e2016-09-16 16:11:40 -070023
Luca Prete092e8952016-10-26 16:25:56 +020024import java.util.Map;
nosignal5fd282e2016-09-16 16:11:40 -070025import java.util.Set;
26
27/**
28 * Provides information about the VPLS configuration.
29 */
Carolina Fernandezb1cef5c2016-11-22 19:18:40 +010030public interface VplsConfigService {
Luca Prete092e8952016-10-26 16:25:56 +020031 Class<VplsAppConfig> CONFIG_CLASS = VplsAppConfig.class;
nosignal5fd282e2016-09-16 16:11:40 -070032
33 /**
34 * Adds a VPLS to the configuration.
35 *
Luca Prete092e8952016-10-26 16:25:56 +020036 * @param vplsName the name of the VPLS
nosignal5fd282e2016-09-16 16:11:40 -070037 * @param ifaces the interfaces associated with the VPLS
Luca Prete092e8952016-10-26 16:25:56 +020038 * @param encap the encapsulation type
nosignal5fd282e2016-09-16 16:11:40 -070039 */
Luca Prete092e8952016-10-26 16:25:56 +020040 void addVpls(String vplsName, Set<String> ifaces, String encap);
nosignal5fd282e2016-09-16 16:11:40 -070041
42 /**
43 * Removes a VPLS from the configuration.
44 *
Luca Prete092e8952016-10-26 16:25:56 +020045 * @param vplsName the name of the VPLS to be removed
nosignal5fd282e2016-09-16 16:11:40 -070046 */
Luca Prete092e8952016-10-26 16:25:56 +020047 void removeVpls(String vplsName);
nosignal5fd282e2016-09-16 16:11:40 -070048
49 /**
50 * Adds a network interface to a VPLS.
51 *
Luca Prete092e8952016-10-26 16:25:56 +020052 * @param vplsName the name of the VPLS
nosignal5fd282e2016-09-16 16:11:40 -070053 * @param iface the network interface to be added to the VPLS
54 */
Luca Prete092e8952016-10-26 16:25:56 +020055 void addIface(String vplsName, String iface);
56
57 /**
58 * Sets an encapsulation parameter for a VPLS.
59 *
60 * @param vplsName the name of the VPLS
61 * @param encap the encapsulation used (i.e. MPLS or VLAN) or
62 */
63 void setEncap(String vplsName, String encap);
64
65 /**
66 * Returns the encapsulation type in use for a given VPLS.
67 *
68 * @param vplsName the name of the VPLS
69 * @return the encapsulation type in use, if any
70 */
71 EncapsulationType encap(String vplsName);
nosignal5fd282e2016-09-16 16:11:40 -070072
73 /**
74 * Removes a network interface from a VPLS.
75 *
76 * @param iface the network interface to be removed from the VPLS
77 */
Luca Prete092e8952016-10-26 16:25:56 +020078 void removeIface(String iface);
nosignal5fd282e2016-09-16 16:11:40 -070079
80 /**
81 * Cleans up the VPLS configuration. Removes all VPLSs.
82 */
Luca Prete092e8952016-10-26 16:25:56 +020083 void cleanVplsConfig();
nosignal5fd282e2016-09-16 16:11:40 -070084
85 /**
86 * Retrieves the VPLS names modified from CLI.
87 *
Luca Prete092e8952016-10-26 16:25:56 +020088 * @return the VPLS names modified from CLI
nosignal5fd282e2016-09-16 16:11:40 -070089 */
Luca Prete092e8952016-10-26 16:25:56 +020090 Set<String> vplsAffectedByApi();
91 // TODO Remove this function after the intent framework race condition has been fixed
nosignal5fd282e2016-09-16 16:11:40 -070092
93 /**
Luca Pretedce16f82016-11-22 13:11:56 -080094 * Retrieves the interfaces without IP configured, so compatible with VPLS,
95 * from the interface service.
nosignal5fd282e2016-09-16 16:11:40 -070096 *
Luca Pretedce16f82016-11-22 13:11:56 -080097 * @return the set of interfaces configured, compatible with VPLS
nosignal5fd282e2016-09-16 16:11:40 -070098 */
Luca Prete092e8952016-10-26 16:25:56 +020099 Set<Interface> allIfaces();
nosignal5fd282e2016-09-16 16:11:40 -0700100
101 /**
Luca Pretedce16f82016-11-22 13:11:56 -0800102 * Retrieves the interfaces associated to a VPLS.
Carolina Fernandezb1cef5c2016-11-22 19:18:40 +0100103 *
Luca Pretedce16f82016-11-22 13:11:56 -0800104 * @return the set of interfaces associated to a VPLS
Carolina Fernandezb1cef5c2016-11-22 19:18:40 +0100105 */
106 Set<Interface> ifaces();
107
108 /**
Luca Pretedce16f82016-11-22 13:11:56 -0800109 * Retrieves the interfaces associated to the VPLS specified.
nosignal5fd282e2016-09-16 16:11:40 -0700110 *
Luca Prete092e8952016-10-26 16:25:56 +0200111 * @param vplsName the name of the VPLS
Luca Pretedce16f82016-11-22 13:11:56 -0800112 * @return the set of interfaces associated to the VPLS specified
nosignal5fd282e2016-09-16 16:11:40 -0700113 */
Luca Prete092e8952016-10-26 16:25:56 +0200114 Set<Interface> ifaces(String vplsName);
nosignal5fd282e2016-09-16 16:11:40 -0700115
116 /**
117 * Retrieves all VPLS names.
118 *
119 * @return a set of VPLS names
120 */
Luca Prete092e8952016-10-26 16:25:56 +0200121 Set<String> vplsNames();
nosignal5fd282e2016-09-16 16:11:40 -0700122
123 /**
124 * Retrieves all VPLS names from the old config.
125 *
126 * @return a set of VPLS names
127 */
Luca Prete092e8952016-10-26 16:25:56 +0200128 Set<String> vplsNamesOld();
Luca Pretedce16f82016-11-22 13:11:56 -0800129 // TODO Removes this function after the race condition gets fixed in IF
nosignal5fd282e2016-09-16 16:11:40 -0700130
131 /**
Luca Prete092e8952016-10-26 16:25:56 +0200132 * Returns the VPLS names and associated interfaces from the configuration.
nosignal5fd282e2016-09-16 16:11:40 -0700133 *
Luca Prete092e8952016-10-26 16:25:56 +0200134 * @return a map of VPLS names and associated interfaces
nosignal5fd282e2016-09-16 16:11:40 -0700135 */
Luca Prete092e8952016-10-26 16:25:56 +0200136 SetMultimap<String, Interface> ifacesByVplsName();
nosignal5fd282e2016-09-16 16:11:40 -0700137
138 /**
Luca Prete092e8952016-10-26 16:25:56 +0200139 * Returns the list of interfaces grouped by VPLS name, given a VLAN Id and
140 * a connect point.
nosignal5fd282e2016-09-16 16:11:40 -0700141 *
142 * @param vlan the VLAN Id
143 * @param connectPoint the connect point
Luca Prete092e8952016-10-26 16:25:56 +0200144 * @return a map of VPLS names and associated interfaces; null otherwise
nosignal5fd282e2016-09-16 16:11:40 -0700145 */
Luca Prete092e8952016-10-26 16:25:56 +0200146 SetMultimap<String, Interface> ifacesByVplsName(VlanId vlan,
147 ConnectPoint connectPoint);
148
149 /**
150 * Returns the VPLS names and associated encapsulation type.
151 *
152 * @return a map of VPLS names and associated encapsulation type
153 */
154 Map<String, EncapsulationType> encapByVplsName();
nosignal5fd282e2016-09-16 16:11:40 -0700155}