blob: 2e417959f951dcfc1ee51887a1992b3fce0145aa [file] [log] [blame]
sangho1e575652015-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 */
16
17package org.onosproject.segmentrouting;
18
sangho1e575652015-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 {
27 // Tunnel flow policy type
28 TUNNEL_FLOW,
29
30 // Load balancing policy type
31 LOADBALANCE,
32
33 // policy to avoid specific routers or links
34 AVOID,
35
36 // Access Control policy type
37 DENY
38 }
39
40 /**
41 * Returns the policy ID.
42 *
43 * @return policy ID
44 */
45 String id();
46
47 /**
sangho1e575652015-05-14 00:39:53 -070048 * Returns the priority of the policy.
49 *
50 * @return priority
51 */
52 int priority();
53
54 /**
55 * Returns the policy type.
56 *
57 * @return policy type
58 */
59 Type type();
60
61 /**
sangho0b2b6d12015-05-20 22:16:38 -070062 * Returns the source IP address of the policy.
sangho1e575652015-05-14 00:39:53 -070063 *
sangho0b2b6d12015-05-20 22:16:38 -070064 * @return source IP address
sangho1e575652015-05-14 00:39:53 -070065 */
sangho0b2b6d12015-05-20 22:16:38 -070066 String srcIp();
sangho1e575652015-05-14 00:39:53 -070067
68 /**
sangho0b2b6d12015-05-20 22:16:38 -070069 * Returns the destination IP address of the policy.
sangho1e575652015-05-14 00:39:53 -070070 *
sangho0b2b6d12015-05-20 22:16:38 -070071 * @return destination IP address
sangho1e575652015-05-14 00:39:53 -070072 */
sangho0b2b6d12015-05-20 22:16:38 -070073 String dstIp();
74
75 /**
76 * Returns the IP protocol of the policy.
77 *
78 * @return IP protocol
79 */
80 String ipProto();
81
82 /**
83 * Returns the source port of the policy.
84 *
85 * @return source port
86 */
87 short srcPort();
88
89 /**
90 * Returns the destination of the policy.
91 *
92 * @return destination port
93 */
94 short dstPort();
95
sangho1e575652015-05-14 00:39:53 -070096}