blob: ea922a3f9a77b0ce35c88bb790d8af37bc97cc9d [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 */
16
17package org.onosproject.segmentrouting;
18
sangho27462c62015-05-14 00:39:53 -070019/**
20 * Interface for Segment Routing Policy.
21 */
22public interface Policy {
23 /**
24 * Enums for policy type.
25 */
26 enum Type {
Charles Chanb7f75ac2016-01-11 18:28:54 -080027 /**
28 * Tunnel flow policy type.
29 */
sangho27462c62015-05-14 00:39:53 -070030 TUNNEL_FLOW,
31
Charles Chanb7f75ac2016-01-11 18:28:54 -080032 /**
33 * Load balancing policy type.
34 */
sangho27462c62015-05-14 00:39:53 -070035 LOADBALANCE,
36
Charles Chanb7f75ac2016-01-11 18:28:54 -080037 /**
38 * policy to avoid specific routers or links.
39 */
sangho27462c62015-05-14 00:39:53 -070040 AVOID,
41
Charles Chanb7f75ac2016-01-11 18:28:54 -080042 /**
43 * Access Control policy type.
44 */
sangho27462c62015-05-14 00:39:53 -070045 DENY
46 }
47
48 /**
49 * Returns the policy ID.
50 *
51 * @return policy ID
52 */
53 String id();
54
55 /**
sangho27462c62015-05-14 00:39:53 -070056 * Returns the priority of the policy.
57 *
58 * @return priority
59 */
60 int priority();
61
62 /**
63 * Returns the policy type.
64 *
65 * @return policy type
66 */
67 Type type();
68
69 /**
sangho4a5c42a2015-05-20 22:16:38 -070070 * Returns the source IP address of the policy.
sangho27462c62015-05-14 00:39:53 -070071 *
sangho4a5c42a2015-05-20 22:16:38 -070072 * @return source IP address
sangho27462c62015-05-14 00:39:53 -070073 */
sangho4a5c42a2015-05-20 22:16:38 -070074 String srcIp();
sangho27462c62015-05-14 00:39:53 -070075
76 /**
sangho4a5c42a2015-05-20 22:16:38 -070077 * Returns the destination IP address of the policy.
sangho27462c62015-05-14 00:39:53 -070078 *
sangho4a5c42a2015-05-20 22:16:38 -070079 * @return destination IP address
sangho27462c62015-05-14 00:39:53 -070080 */
sangho4a5c42a2015-05-20 22:16:38 -070081 String dstIp();
82
83 /**
84 * Returns the IP protocol of the policy.
85 *
86 * @return IP protocol
87 */
88 String ipProto();
89
90 /**
91 * Returns the source port of the policy.
92 *
93 * @return source port
94 */
95 short srcPort();
96
97 /**
98 * Returns the destination of the policy.
99 *
100 * @return destination port
101 */
102 short dstPort();
103
sangho27462c62015-05-14 00:39:53 -0700104}