2d1bb3116feaf36ead8c91f2ed1eb063b3491c89
[onosfw.git] /
1 /*
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  */
16 package org.onosproject.routing;
17
18 import org.onlab.packet.IpAddress;
19 import org.onlab.packet.IpPrefix;
20 import org.onlab.packet.MacAddress;
21 import org.onosproject.net.ConnectPoint;
22
23 /**
24  * An interface to process intent requests.
25  */
26 public interface IntentRequestListener {
27
28     /**
29      * Sets up connectivity for packet from Internet to a host in local
30      * SDN network.
31      *
32      * @param dstIpAddress IP address of destination host in local SDN network
33      */
34     void setUpConnectivityInternetToHost(IpAddress dstIpAddress);
35
36     /**
37      * Sets up the connectivity for two hosts in local SDN network.
38      *
39      * @param dstIpAddress the destination IP address
40      * @param srcIpAddress the source IP address
41      * @param srcMacAddress the source MAC address
42      * @param srcConnectPoint the connectPoint of the source host
43      */
44     void setUpConnectivityHostToHost(IpAddress dstIpAddress,
45                                      IpAddress srcIpAddress,
46                                      MacAddress srcMacAddress,
47                                      ConnectPoint srcConnectPoint);
48
49     /**
50      * Adds one new ingress connect point into ingress points of an existing
51      * intent and resubmits the new intent.
52      * <p>
53      * If there is already an intent for an IP prefix in the system, we do not
54      * need to create a new one, we only need to update this existing intent by
55      * adding more ingress points.
56      * </p>
57      *
58      * @param ipPrefix the IP prefix used to search the existing
59      *        MultiPointToSinglePointIntent
60      * @param ingressConnectPoint the ingress connect point to be added into
61      *        the exiting intent
62      */
63     void updateExistingMp2pIntent(IpPrefix ipPrefix,
64                                   ConnectPoint ingressConnectPoint);
65
66     /**
67      * Checks whether there is a MultiPointToSinglePointIntent in memory for a
68      * given IP prefix.
69      *
70      * @param ipPrefix the IP prefix used to search the existing
71      *        MultiPointToSinglePointIntent
72      * @return true if there is a MultiPointToSinglePointIntent, otherwise false
73      */
74     boolean mp2pIntentExists(IpPrefix ipPrefix);
75
76 }