blob: 37ebcd58d9a2f4ff17df322472d2341156abb652 [file] [log] [blame]
Andrea Campanella545edb42018-03-20 16:37:29 -07001/*
2 * Copyright 2018-present Open Networking Foundation
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.mcast.api;
17
18import com.google.common.annotations.Beta;
19import org.onlab.packet.IpAddress;
20import org.onosproject.event.ListenerService;
21import org.onosproject.net.ConnectPoint;
22import org.onosproject.net.HostId;
23
Andrea Campanella545edb42018-03-20 16:37:29 -070024import java.util.Set;
25
26/**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070027 * A service interface for maintaining Multicast information.
Andrea Campanella545edb42018-03-20 16:37:29 -070028 */
29@Beta
30public interface MulticastRouteService
31 extends ListenerService<McastEvent, McastListener> {
32
33 /**
34 * Adds an empty route to the information base for the given group IP.
35 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070036 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070037 */
38 void add(McastRoute route);
39
40 /**
41 * Removes a route from the information base.
42 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070043 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070044 */
45 void remove(McastRoute route);
46
47 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070048 * Gets all Multicast routes in the system.
Andrea Campanella545edb42018-03-20 16:37:29 -070049 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070050 * @return set of Multicast routes
Andrea Campanella545edb42018-03-20 16:37:29 -070051 */
52 Set<McastRoute> getRoutes();
53
54 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070055 * Gets a Multicast route in the system.
Andrea Campanella545edb42018-03-20 16:37:29 -070056 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070057 * @param groupIp Multicast group IP address
58 * @param sourceIp Multicasto source Ip address
59 * @return set of Multicast routes
Andrea Campanella545edb42018-03-20 16:37:29 -070060 */
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070061 Set<McastRoute> getRoute(IpAddress groupIp, IpAddress sourceIp);
Andrea Campanella545edb42018-03-20 16:37:29 -070062
63 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070064 * Adds a set of sources connect points to the route from where the
Andrea Campanella545edb42018-03-20 16:37:29 -070065 * data stream is originating.
66 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070067 * @param route the Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070068 * @param sources a set of sources
69 */
70 void addSources(McastRoute route, Set<ConnectPoint> sources);
71
72 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070073 * Removes all the sources connect points from the route.
Andrea Campanella545edb42018-03-20 16:37:29 -070074 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070075 * @param route the Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070076 */
77 void removeSources(McastRoute route);
78
79 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070080 * Removes a set of sources connect points from the route.
Andrea Campanella545edb42018-03-20 16:37:29 -070081 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070082 * @param route the Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070083 * @param sources a set of sources
84 */
85 void removeSources(McastRoute route, Set<ConnectPoint> sources);
86
87 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070088 * Adds a sink to the route to which a data stream should be
Andrea Campanella545edb42018-03-20 16:37:29 -070089 * sent to.
90 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070091 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070092 * @param hostId a sink host
93 */
94 void addSink(McastRoute route, HostId hostId);
95
96 /**
97 * Adds a set of sink to the route to which a data stream should be
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070098 * sent to. If this method is used the connect points will all be
99 * used as different sinks for that Mcast Tree. For dual-homed sinks
100 * please use {@link #addSink(McastRoute route, HostId hostId) addSink}.
Andrea Campanella545edb42018-03-20 16:37:29 -0700101 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700102 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700103 * @param sinks a set of sink connect point
104 */
105 void addSink(McastRoute route, Set<ConnectPoint> sinks);
106
107 /**
108 * Removes all the sinks from the route.
109 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700110 * @param route the Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700111 */
112 void removeSinks(McastRoute route);
113
114 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700115 * Removes a sink from the route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700116 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700117 * @param route the Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700118 * @param hostId a sink host
119 */
120 void removeSink(McastRoute route, HostId hostId);
121
122 /**
Andrea Campanella545edb42018-03-20 16:37:29 -0700123 * Removes a set of sinks to the route to which a data stream should be
124 * sent to. If this method is used the mcast tree does not work
125 * for any other sink until it's added. For dual-homed sinks please use
126 * {@link #removeSink(McastRoute route, HostId hostId) removeSink}.
127 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700128 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700129 * @param sink a sink connect point
130 */
131 void removeSinks(McastRoute route, Set<ConnectPoint> sink);
132
133 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700134 * Return the Multicast data for this route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700135 *
136 * @param route route
137 * @return the mcast route data
138 */
139 McastRouteData routeData(McastRoute route);
140
141 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700142 * Find the data source association for this Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700143 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700144 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700145 * @return a connect point
146 */
147 Set<ConnectPoint> sources(McastRoute route);
148
149 /**
150 * Find the list of sinks for this route.
151 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700152 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700153 * @return a list of connect points
154 */
155 Set<ConnectPoint> sinks(McastRoute route);
156
157 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700158 * Find the set of connect points for a given sink for this route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700159 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700160 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700161 * @param hostId the host
162 * @return a list of connect points
163 */
164 Set<ConnectPoint> sinks(McastRoute route, HostId hostId);
165
166 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700167 * Obtains all the non host specific sinks for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700168 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700169 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700170 * @return a set of sinks
171 */
172 Set<ConnectPoint> nonHostSinks(McastRoute route);
173}