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