blob: f78d869d620966a355a8520af260cce539285624 [file] [log] [blame]
sangho27462c62015-05-14 00:39:53 -07001/*
Brian O'Connor43b53542016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
sangho27462c62015-05-14 00:39:53 -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.segmentrouting;
17
18import java.util.List;
19
20/**
21 * Segment Routing Service for REST API.
22 */
23public interface SegmentRoutingService {
Charles Chan82ab1932016-01-30 23:22:37 -080024 /**
Charles Chan82ab1932016-01-30 23:22:37 -080025 * Highest flow priority.
26 */
27 int HIGHEST_PRIORITY = 0xffff;
28
29 /**
30 * VLAN cross-connect priority.
31 */
32 int XCONNECT_PRIORITY = 1000;
33
34 /**
35 * Default flow priority.
36 */
37 int DEFAULT_PRIORITY = 100;
38
39 /**
40 * Minimum IP priority.
41 *
Charles Chand86904c2016-02-18 10:43:46 -080042 * Should < 0 such that priority of /0 will not conflict with lowest
Charles Chan82ab1932016-01-30 23:22:37 -080043 * priority default entries.
44 */
45 int MIN_IP_PRIORITY = 10;
46
47 /**
48 * Subnet flooding flow priority.
49 */
50 int FLOOD_PRIORITY = 5;
51
sangho27462c62015-05-14 00:39:53 -070052 /**
53 * Returns all tunnels.
54 *
55 * @return list of tunnels
56 */
57 List<Tunnel> getTunnels();
58
59 /**
60 * Creates a tunnel.
61 *
62 * @param tunnel tunnel reference to create
sanghobd812f82015-06-29 14:58:47 -070063 * @return WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID
64 * exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR
65 * if the tunnel creation failed internally, SUCCESS if the tunnel is created
66 * successfully
sangho27462c62015-05-14 00:39:53 -070067 */
sanghobd812f82015-06-29 14:58:47 -070068 TunnelHandler.Result createTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -070069
70 /**
71 * Returns all policies.
72 *
73 * @return list of policy
74 */
75 List<Policy> getPolicies();
76
77 /**
78 * Creates a policy.
79 *
80 * @param policy policy reference to create
sanghobd812f82015-06-29 14:58:47 -070081 * @return ID_EXISTS if the same policy ID exists,
82 * POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel
83 * does not exists, UNSUPPORTED_TYPE if the policy type is not supported,
84 * SUCCESS if the policy is created successfully.
sangho27462c62015-05-14 00:39:53 -070085 */
sanghobd812f82015-06-29 14:58:47 -070086 PolicyHandler.Result createPolicy(Policy policy);
sangho27462c62015-05-14 00:39:53 -070087
88 /**
89 * Removes a tunnel.
90 *
91 * @param tunnel tunnel reference to remove
sanghobd812f82015-06-29 14:58:47 -070092 * @return TUNNEL_NOT_FOUND if the tunnel to remove does not exists,
93 * INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS
94 * if the tunnel is created successfully.
sangho27462c62015-05-14 00:39:53 -070095 */
sanghobd812f82015-06-29 14:58:47 -070096 TunnelHandler.Result removeTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -070097
98 /**
99 * Removes a policy.
100 *
101 * @param policy policy reference to remove
sanghobd812f82015-06-29 14:58:47 -0700102 * @return POLICY_NOT_FOUND if the policy to remove does not exists,
103 * SUCCESS if it is removed successfully
sangho27462c62015-05-14 00:39:53 -0700104 */
sanghobd812f82015-06-29 14:58:47 -0700105 PolicyHandler.Result removePolicy(Policy policy);
Saurav Das07c74602016-04-27 18:35:50 -0700106
107 /**
108 * Use current state of the network to repopulate forwarding rules.
109 *
110 */
111 void rerouteNetwork();
sangho27462c62015-05-14 00:39:53 -0700112}