blob: dfdc4229377463a30d4af022dd63ffa95c87f39a [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;
Charles Chand5814aa2018-08-19 19:21:46 -070024import org.onosproject.net.flowobjective.NextObjective;
Charles Chanc7b3c452018-06-19 20:31:57 -070025
26import java.util.Set;
27
28/**
29 * VLAN cross connect between exactly two ports.
30 */
31@Service
32public interface XconnectService {
33
34 /**
35 * VLAN cross-connect ACL priority.
36 */
37 int XCONNECT_ACL_PRIORITY = 60000;
38
39 /**
40 * VLAN cross-connect Bridging priority.
41 */
42 int XCONNECT_PRIORITY = 1000;
43
44 /**
45 * Creates or updates Xconnect.
46 *
47 * @param deviceId device ID
48 * @param vlanId VLAN ID
49 * @param ports set of ports
50 */
51 void addOrUpdateXconnect(DeviceId deviceId, VlanId vlanId, Set<PortNumber> ports);
52
53 /**
54 * Deletes Xconnect.
55 *
56 * @param deviceId device ID
57 * @param vlanId VLAN ID
58 */
59 void removeXonnect(DeviceId deviceId, VlanId vlanId);
60
61 /**
62 * Gets Xconnects.
63 *
64 * @return set of Xconnect descriptions
65 */
66 Set<XconnectDesc> getXconnects();
67
68 /**
69 * Check if there is Xconnect configured on given connect point.
70 *
71 * @param cp connect point
72 * @return true if there is Xconnect configured on the connect point
73 */
74 boolean hasXconnect(ConnectPoint cp);
75
Charles Chand5814aa2018-08-19 19:21:46 -070076 /**
77 * Returns the Xconnect next objective store.
78 *
79 * @return current contents of the xconnectNextObjStore
80 */
81 ImmutableMap<XconnectKey, NextObjective> getNext();
82
83 /**
84 * Removes given next ID from Xconnect next objective store.
85 *
86 * @param nextId next ID
87 */
88 void removeNextId(int nextId);
89
Charles Chanc7b3c452018-06-19 20:31:57 -070090}