blob: 1fede7195eb3eb01f5dfee81b8061ccae3eaf1cc [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
18import org.apache.felix.scr.annotations.Service;
19import 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 */
29@Service
30public interface XconnectService {
31
32 /**
33 * VLAN cross-connect ACL priority.
34 */
35 int XCONNECT_ACL_PRIORITY = 60000;
36
37 /**
38 * VLAN cross-connect Bridging priority.
39 */
40 int XCONNECT_PRIORITY = 1000;
41
42 /**
43 * Creates or updates Xconnect.
44 *
45 * @param deviceId device ID
46 * @param vlanId VLAN ID
47 * @param ports set of ports
48 */
49 void addOrUpdateXconnect(DeviceId deviceId, VlanId vlanId, Set<PortNumber> ports);
50
51 /**
52 * Deletes Xconnect.
53 *
54 * @param deviceId device ID
55 * @param vlanId VLAN ID
56 */
57 void removeXonnect(DeviceId deviceId, VlanId vlanId);
58
59 /**
60 * Gets Xconnects.
61 *
62 * @return set of Xconnect descriptions
63 */
64 Set<XconnectDesc> getXconnects();
65
66 /**
67 * Check if there is Xconnect configured on given connect point.
68 *
69 * @param cp connect point
70 * @return true if there is Xconnect configured on the connect point
71 */
72 boolean hasXconnect(ConnectPoint cp);
73
74}