blob: e78c2571008df6e3334efd7bd02189e6ac44842b [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 *
133 * @return the connect point when found, null otherwise.
134 */
135 public McastConnectPoint findEgressConnectPoint(ConnectPoint cp);
136
137 /**
138 * remove Interest from a McastConnectPoint.
139 *
140 * @param mcp connect point.
141 * @param interest the protocol interested in this multicast stream
142 * @return whether or not interest was removed
143 */
144 public boolean removeInterest(McastConnectPoint mcp, McastConnectPoint.JoinSource interest);
alshabibeff00542015-09-23 13:22:33 -0700145
146 /**
147 * Increment the punt count.
148 */
149 public void incrementPuntCount();
150
151 /**
152 * Get the punt count.
153 *
154 * @return the punt count
155 */
156 public int getPuntCount();
157
158 /**
159 * Have the McastIntentManager create an intent, attempt to
160 * install the intent and then save the key.
161 */
162 public void setIntent();
163
164 /**
165 * Set the Intent key.
166 *
167 * @param intent intent
168 */
169 public void setIntent(SinglePointToMultiPointIntent intent);
170
171 /**
172 * Withdraw the intent if it has been installed.
173 */
174 public void withdrawIntent();
175
176 /**
177 * Get the intent key.
178 *
179 * @return the intentKey
180 */
181 public Key getIntentKey();
182
183 /**
184 * Pretty print the the route.
185 *
186 * @return a pretty string
187 */
188 public String toString();
189}