sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 43b5354 | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.segmentrouting; |
| 18 | |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 19 | /** |
| 20 | * Interface for Segment Routing Policy. |
| 21 | */ |
| 22 | public interface Policy { |
| 23 | /** |
| 24 | * Enums for policy type. |
| 25 | */ |
| 26 | enum Type { |
Charles Chan | b7f75ac | 2016-01-11 18:28:54 -0800 | [diff] [blame] | 27 | /** |
| 28 | * Tunnel flow policy type. |
| 29 | */ |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 30 | TUNNEL_FLOW, |
| 31 | |
Charles Chan | b7f75ac | 2016-01-11 18:28:54 -0800 | [diff] [blame] | 32 | /** |
| 33 | * Load balancing policy type. |
| 34 | */ |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 35 | LOADBALANCE, |
| 36 | |
Charles Chan | b7f75ac | 2016-01-11 18:28:54 -0800 | [diff] [blame] | 37 | /** |
| 38 | * policy to avoid specific routers or links. |
| 39 | */ |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 40 | AVOID, |
| 41 | |
Charles Chan | b7f75ac | 2016-01-11 18:28:54 -0800 | [diff] [blame] | 42 | /** |
| 43 | * Access Control policy type. |
| 44 | */ |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 45 | DENY |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns the policy ID. |
| 50 | * |
| 51 | * @return policy ID |
| 52 | */ |
| 53 | String id(); |
| 54 | |
| 55 | /** |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 56 | * 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 | /** |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 70 | * Returns the source IP address of the policy. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 71 | * |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 72 | * @return source IP address |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 73 | */ |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 74 | String srcIp(); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 75 | |
| 76 | /** |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 77 | * Returns the destination IP address of the policy. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 78 | * |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 79 | * @return destination IP address |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 80 | */ |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 81 | 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 | |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 104 | } |