blob: fbb3f5bd8c6a26f51bd2c9817dffa238dd2b7e38 [file] [log] [blame]
Pingping Line28ae4c2015-03-13 11:37:03 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Pingping Line28ae4c2015-03-13 11:37:03 -07003 *
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.routing;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.IpPrefix;
20import org.onlab.packet.MacAddress;
21import org.onosproject.net.ConnectPoint;
22
23/**
24 * An interface to process intent requests.
25 */
26public 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 /**
Jonathan Hart9a426f82015-09-03 15:43:13 +020050 * Sets up connectivity for packet from a local host to the Internet.
51 *
52 * @param hostIp IP address of the local host
53 * @param prefix external IP prefix that the host is talking to
54 * @param nextHopIpAddress IP address of the next hop router for the prefix
55 */
56 void setUpConnectivityHostToInternet(IpAddress hostIp, IpPrefix prefix,
57 IpAddress nextHopIpAddress);
58
59 /**
Pingping Line28ae4c2015-03-13 11:37:03 -070060 * Adds one new ingress connect point into ingress points of an existing
61 * intent and resubmits the new intent.
62 * <p>
63 * If there is already an intent for an IP prefix in the system, we do not
64 * need to create a new one, we only need to update this existing intent by
65 * adding more ingress points.
66 * </p>
67 *
68 * @param ipPrefix the IP prefix used to search the existing
69 * MultiPointToSinglePointIntent
70 * @param ingressConnectPoint the ingress connect point to be added into
71 * the exiting intent
72 */
73 void updateExistingMp2pIntent(IpPrefix ipPrefix,
74 ConnectPoint ingressConnectPoint);
75
76 /**
77 * Checks whether there is a MultiPointToSinglePointIntent in memory for a
78 * given IP prefix.
79 *
80 * @param ipPrefix the IP prefix used to search the existing
81 * MultiPointToSinglePointIntent
82 * @return true if there is a MultiPointToSinglePointIntent, otherwise false
83 */
84 boolean mp2pIntentExists(IpPrefix ipPrefix);
85
86}