blob: f82ad3e67fefbff01cff61675ecb2597d7222ff8 [file] [log] [blame]
sangho27462c62015-05-14 00:39:53 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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;
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 /**
25 * Segment Routing App ID.
26 */
27 String SR_APP_ID = "org.onosproject.segmentrouting";
28
29 /**
30 * Highest flow priority.
31 */
32 int HIGHEST_PRIORITY = 0xffff;
33
34 /**
35 * VLAN cross-connect priority.
36 */
37 int XCONNECT_PRIORITY = 1000;
38
39 /**
40 * Default flow priority.
41 */
42 int DEFAULT_PRIORITY = 100;
43
44 /**
45 * Minimum IP priority.
46 *
47 * Should > 0 such that priority of /0 will not conflict with lowest
48 * priority default entries.
49 */
50 int MIN_IP_PRIORITY = 10;
51
52 /**
53 * Subnet flooding flow priority.
54 */
55 int FLOOD_PRIORITY = 5;
56
57 long OFPP_MAX = 0xffffff00L;
sangho27462c62015-05-14 00:39:53 -070058
59 /**
60 * Returns all tunnels.
61 *
62 * @return list of tunnels
63 */
64 List<Tunnel> getTunnels();
65
66 /**
67 * Creates a tunnel.
68 *
69 * @param tunnel tunnel reference to create
sanghobd812f82015-06-29 14:58:47 -070070 * @return WRONG_PATH if the tunnel path is wrong, ID_EXISTS if the tunnel ID
71 * exists already, TUNNEL_EXISTS if the same tunnel exists, INTERNAL_ERROR
72 * if the tunnel creation failed internally, SUCCESS if the tunnel is created
73 * successfully
sangho27462c62015-05-14 00:39:53 -070074 */
sanghobd812f82015-06-29 14:58:47 -070075 TunnelHandler.Result createTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -070076
77 /**
78 * Returns all policies.
79 *
80 * @return list of policy
81 */
82 List<Policy> getPolicies();
83
84 /**
85 * Creates a policy.
86 *
87 * @param policy policy reference to create
sanghobd812f82015-06-29 14:58:47 -070088 * @return ID_EXISTS if the same policy ID exists,
89 * POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel
90 * does not exists, UNSUPPORTED_TYPE if the policy type is not supported,
91 * SUCCESS if the policy is created successfully.
sangho27462c62015-05-14 00:39:53 -070092 */
sanghobd812f82015-06-29 14:58:47 -070093 PolicyHandler.Result createPolicy(Policy policy);
sangho27462c62015-05-14 00:39:53 -070094
95 /**
96 * Removes a tunnel.
97 *
98 * @param tunnel tunnel reference to remove
sanghobd812f82015-06-29 14:58:47 -070099 * @return TUNNEL_NOT_FOUND if the tunnel to remove does not exists,
100 * INTERNAL_ERROR if the tunnel creation failed internally, SUCCESS
101 * if the tunnel is created successfully.
sangho27462c62015-05-14 00:39:53 -0700102 */
sanghobd812f82015-06-29 14:58:47 -0700103 TunnelHandler.Result removeTunnel(Tunnel tunnel);
sangho27462c62015-05-14 00:39:53 -0700104
105 /**
106 * Removes a policy.
107 *
108 * @param policy policy reference to remove
sanghobd812f82015-06-29 14:58:47 -0700109 * @return POLICY_NOT_FOUND if the policy to remove does not exists,
110 * SUCCESS if it is removed successfully
sangho27462c62015-05-14 00:39:53 -0700111 */
sanghobd812f82015-06-29 14:58:47 -0700112 PolicyHandler.Result removePolicy(Policy policy);
sangho27462c62015-05-14 00:39:53 -0700113}