sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 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 { |
| 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 | /** |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 48 | * 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 | /** |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 62 | * Returns the source IP address of the policy. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 63 | * |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 64 | * @return source IP address |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 65 | */ |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 66 | String srcIp(); |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 67 | |
| 68 | /** |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 69 | * Returns the destination IP address of the policy. |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 70 | * |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 71 | * @return destination IP address |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 72 | */ |
sangho | 4a5c42a | 2015-05-20 22:16:38 -0700 | [diff] [blame] | 73 | 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 | |
sangho | 27462c6 | 2015-05-14 00:39:53 -0700 | [diff] [blame] | 96 | } |