blob: 7500a0854f331d7d5bc74c56e4a983050deae66d [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 /**
94 * Retrieves the interfaces from the VPLS configuration.
95 *
96 * @return a set of interfaces contained in the VPLS configuration
97 */
Luca Prete092e8952016-10-26 16:25:56 +020098 Set<Interface> allIfaces();
nosignal5fd282e2016-09-16 16:11:40 -070099
100 /**
Carolina Fernandezb1cef5c2016-11-22 19:18:40 +0100101 * Retrieves the interfaces from the VPLS configuration.
102 *
103 * @return a set of interfaces belonging to the VPLS
104 */
105 Set<Interface> ifaces();
106
107 /**
nosignal5fd282e2016-09-16 16:11:40 -0700108 * Retrieves the interfaces belonging to the VPLS.
109 *
Luca Prete092e8952016-10-26 16:25:56 +0200110 * @param vplsName the name of the VPLS
nosignal5fd282e2016-09-16 16:11:40 -0700111 * @return a set of interfaces belonging to the VPLS
112 */
Luca Prete092e8952016-10-26 16:25:56 +0200113 Set<Interface> ifaces(String vplsName);
nosignal5fd282e2016-09-16 16:11:40 -0700114
115 /**
116 * Retrieves all VPLS names.
117 *
118 * @return a set of VPLS names
119 */
Luca Prete092e8952016-10-26 16:25:56 +0200120 Set<String> vplsNames();
nosignal5fd282e2016-09-16 16:11:40 -0700121
122 /**
123 * Retrieves all VPLS names from the old config.
124 *
125 * @return a set of VPLS names
126 */
Luca Prete092e8952016-10-26 16:25:56 +0200127 Set<String> vplsNamesOld();
nosignal5fd282e2016-09-16 16:11:40 -0700128 // TODO Removes this function after intent framework fix race condition
129
130 /**
Luca Prete092e8952016-10-26 16:25:56 +0200131 * Returns the VPLS names and associated interfaces from the configuration.
nosignal5fd282e2016-09-16 16:11:40 -0700132 *
Luca Prete092e8952016-10-26 16:25:56 +0200133 * @return a map of VPLS names and associated interfaces
nosignal5fd282e2016-09-16 16:11:40 -0700134 */
Luca Prete092e8952016-10-26 16:25:56 +0200135 SetMultimap<String, Interface> ifacesByVplsName();
nosignal5fd282e2016-09-16 16:11:40 -0700136
137 /**
Luca Prete092e8952016-10-26 16:25:56 +0200138 * Returns the list of interfaces grouped by VPLS name, given a VLAN Id and
139 * a connect point.
nosignal5fd282e2016-09-16 16:11:40 -0700140 *
141 * @param vlan the VLAN Id
142 * @param connectPoint the connect point
Luca Prete092e8952016-10-26 16:25:56 +0200143 * @return a map of VPLS names and associated interfaces; null otherwise
nosignal5fd282e2016-09-16 16:11:40 -0700144 */
Luca Prete092e8952016-10-26 16:25:56 +0200145 SetMultimap<String, Interface> ifacesByVplsName(VlanId vlan,
146 ConnectPoint connectPoint);
147
148 /**
149 * Returns the VPLS names and associated encapsulation type.
150 *
151 * @return a map of VPLS names and associated encapsulation type
152 */
153 Map<String, EncapsulationType> encapByVplsName();
nosignal5fd282e2016-09-16 16:11:40 -0700154}