blob: 12b7e6d43acca27ea454cf24fdbbfae461ec7dec [file] [log] [blame]
alshabibeff00542015-09-23 13:22:33 -07001/*
2 * Copyright 2015 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.mfwd.impl;
17
18import org.onlab.packet.IpPrefix;
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.intent.Key;
21import org.onosproject.net.intent.SinglePointToMultiPointIntent;
22
23import java.util.Set;
24
25/**
26 * This McastRouteBase interface is implemented by the McastRouteBase class which
27 * in turn acts as the base class for both the McastRouteGroup and McastRouteSource.
28 */
29interface McastRoute {
30
31 /**
32 * Gets the group addresses.
33 *
34 * @return group address
35 */
36 public IpPrefix getGaddr();
37
38 /**
39 * Gets the source address.
40 *
41 * @return the source address
42 */
43 public IpPrefix getSaddr();
44
45 /**
46 * Determines if this is an IPv4 multicast route.
47 *
48 * @return true if it is an IPv4 route
49 */
50 public boolean isIp4();
51
52 /**
53 * Determines if this is an IPv6 multicast route.
54 *
55 * @return true if it is an IPv6 route
56 */
57 public boolean isIp6();
58
59 /**
Rusty Eddyddef8932015-09-25 01:15:53 +000060 * Add the ingress ConnectPoint.
alshabibeff00542015-09-23 13:22:33 -070061 *
Rusty Eddyddef8932015-09-25 01:15:53 +000062 * @param cpstr string representing a ConnectPoint
63 * @return whether ingress has been added, only add if ingressPoint is null
alshabibeff00542015-09-23 13:22:33 -070064 */
Rusty Eddyddef8932015-09-25 01:15:53 +000065 public boolean addIngressPoint(String cpstr);
alshabibeff00542015-09-23 13:22:33 -070066
67 /**
Rusty Eddyddef8932015-09-25 01:15:53 +000068 * Add the ingress ConnectPoint.
alshabibeff00542015-09-23 13:22:33 -070069 *
Rusty Eddyddef8932015-09-25 01:15:53 +000070 * @param cp the ConnectPoint of incoming traffic.
71 * @return whether ingress has been added, only add if ingressPoint is null
alshabibeff00542015-09-23 13:22:33 -070072 */
Rusty Eddyddef8932015-09-25 01:15:53 +000073 public boolean addIngressPoint(ConnectPoint cp);
alshabibeff00542015-09-23 13:22:33 -070074
75 /**
76 * Get the ingress connect point.
77 *
78 * @return the ingress connect point
79 */
Rusty Eddyddef8932015-09-25 01:15:53 +000080 public McastConnectPoint getIngressPoint();
alshabibeff00542015-09-23 13:22:33 -070081
82 /**
83 * Add an egress connect point.
84 *
Rusty Eddyddef8932015-09-25 01:15:53 +000085 * @param cp the egress McastConnectPoint to be added
86 * @return return the McastConnectPoint
alshabibeff00542015-09-23 13:22:33 -070087 */
Rusty Eddyddef8932015-09-25 01:15:53 +000088 public McastConnectPoint addEgressPoint(ConnectPoint cp);
alshabibeff00542015-09-23 13:22:33 -070089
90 /**
91 * Add an egress connect point.
92 *
Rusty Eddyddef8932015-09-25 01:15:53 +000093 * @param connectPoint deviceId/portNum
94 * @return return the McastConnectPoint
alshabibeff00542015-09-23 13:22:33 -070095 */
Rusty Eddyddef8932015-09-25 01:15:53 +000096 public McastConnectPoint addEgressPoint(String connectPoint);
97
98 /**
99 * Add an egress connect point.
100 *
101 * @param cp the egress McastConnectPoint to be added
102 * @param interest the protocol that has shown interest in this route
103 * @return return the McastConnectPoint
104 */
105 public McastConnectPoint addEgressPoint(ConnectPoint cp, McastConnectPoint.JoinSource interest);
106
107 /**
108 * Add an egress connect point.
109 *
110 * @param connectPoint deviceId/portNum
111 * @param interest the protocol that has shown interest in this route
112 * @return return the McastConnectPoint
113 */
114 public McastConnectPoint addEgressPoint(String connectPoint, McastConnectPoint.JoinSource interest);
alshabibeff00542015-09-23 13:22:33 -0700115
116 /**
117 * Get the egress connect points.
118 *
119 * @return a set of egress connect points
120 */
Rusty Eddyddef8932015-09-25 01:15:53 +0000121 public Set<McastConnectPoint> getEgressPoints();
122
123 /**
124 * Get the egress connect points.
125 *
126 * @return a set of egress connect points
127 */
128 public Set<ConnectPoint> getEgressConnectPoints();
129
130 /**
131 * Find the egress connect point if it exists.
132 *
Rusty Eddyc0e3fea2015-09-28 21:20:41 +0000133 * @param cp ConnectPoint to search for
Rusty Eddyddef8932015-09-25 01:15:53 +0000134 * @return the connect point when found, null otherwise.
135 */
136 public McastConnectPoint findEgressConnectPoint(ConnectPoint cp);
137
138 /**
139 * remove Interest from a McastConnectPoint.
140 *
141 * @param mcp connect point.
142 * @param interest the protocol interested in this multicast stream
143 * @return whether or not interest was removed
144 */
145 public boolean removeInterest(McastConnectPoint mcp, McastConnectPoint.JoinSource interest);
alshabibeff00542015-09-23 13:22:33 -0700146
147 /**
148 * Increment the punt count.
149 */
150 public void incrementPuntCount();
151
152 /**
153 * Get the punt count.
154 *
155 * @return the punt count
156 */
157 public int getPuntCount();
158
159 /**
160 * Have the McastIntentManager create an intent, attempt to
161 * install the intent and then save the key.
162 */
163 public void setIntent();
164
165 /**
166 * Set the Intent key.
167 *
168 * @param intent intent
169 */
170 public void setIntent(SinglePointToMultiPointIntent intent);
171
172 /**
173 * Withdraw the intent if it has been installed.
174 */
175 public void withdrawIntent();
176
177 /**
178 * Get the intent key.
179 *
180 * @return the intentKey
181 */
182 public Key getIntentKey();
183
184 /**
185 * Pretty print the the route.
186 *
187 * @return a pretty string
188 */
189 public String toString();
190}