blob: 25f1b0185e8e4d9b6ab30943a3bfcbbfda165f80 [file] [log] [blame]
Charles Chanc7b3c452018-06-19 20:31:57 -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.segmentrouting.xconnect.api;
17
Charles Chand5814aa2018-08-19 19:21:46 -070018import com.google.common.collect.ImmutableMap;
Charles Chanc7b3c452018-06-19 20:31:57 -070019import org.apache.felix.scr.annotations.Service;
20import org.onlab.packet.VlanId;
21import org.onosproject.net.ConnectPoint;
22import org.onosproject.net.DeviceId;
23import org.onosproject.net.PortNumber;
24
25import java.util.Set;
26
27/**
28 * VLAN cross connect between exactly two ports.
29 */
30@Service
31public interface XconnectService {
32
33 /**
34 * VLAN cross-connect ACL priority.
35 */
36 int XCONNECT_ACL_PRIORITY = 60000;
37
38 /**
39 * VLAN cross-connect Bridging priority.
40 */
41 int XCONNECT_PRIORITY = 1000;
42
43 /**
44 * Creates or updates Xconnect.
45 *
46 * @param deviceId device ID
47 * @param vlanId VLAN ID
48 * @param ports set of ports
49 */
50 void addOrUpdateXconnect(DeviceId deviceId, VlanId vlanId, Set<PortNumber> ports);
51
52 /**
53 * Deletes Xconnect.
54 *
55 * @param deviceId device ID
56 * @param vlanId VLAN ID
57 */
58 void removeXonnect(DeviceId deviceId, VlanId vlanId);
59
60 /**
61 * Gets Xconnects.
62 *
63 * @return set of Xconnect descriptions
64 */
65 Set<XconnectDesc> getXconnects();
66
67 /**
68 * Check if there is Xconnect configured on given connect point.
69 *
70 * @param cp connect point
71 * @return true if there is Xconnect configured on the connect point
72 */
73 boolean hasXconnect(ConnectPoint cp);
74
Charles Chand5814aa2018-08-19 19:21:46 -070075 /**
76 * Returns the Xconnect next objective store.
77 *
78 * @return current contents of the xconnectNextObjStore
79 */
Charles Chan3e56d9f2018-09-21 11:29:12 -070080 ImmutableMap<XconnectKey, Integer> getNext();
Charles Chand5814aa2018-08-19 19:21:46 -070081
82 /**
83 * Removes given next ID from Xconnect next objective store.
84 *
85 * @param nextId next ID
86 */
87 void removeNextId(int nextId);
88
Charles Chanc7b3c452018-06-19 20:31:57 -070089}