Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 1 | package net.onrc.onos.apps.segmentrouting; |
| 2 | |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 3 | import java.util.Collection; |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 4 | import java.util.List; |
| 5 | |
| 6 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 7 | import net.floodlightcontroller.util.MACAddress; |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 8 | import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.TunnelInfo; |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 9 | import net.onrc.onos.core.util.IPv4Net; |
| 10 | |
| 11 | /** |
| 12 | * The API exported by the main SDN-IP class. This is the interface between the |
| 13 | * REST handlers and the SDN-IP module. |
| 14 | */ |
| 15 | public interface ISegmentRoutingService extends IFloodlightService { |
| 16 | |
| 17 | /** |
| 18 | * Create a tunnel for policy routing. |
| 19 | * |
| 20 | * @param tunnelId ID for the tunnel |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame^] | 21 | * @param labelIds Node label IDs for the tunnel |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 22 | * |
| 23 | * @return "true/false" depending tunnel creation status |
| 24 | */ |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame^] | 25 | public boolean createTunnel(String tunnelId, List<Integer> labelIds); |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Remove a Segment Routing tunnel given a tunnel Id. |
| 29 | * |
| 30 | * @param tunnelId ID for the tunnel |
| 31 | * |
| 32 | * @return "true/false" depending tunnel deletion status |
| 33 | */ |
| 34 | public boolean removeTunnel(String tunnelId); |
| 35 | |
| 36 | /** |
| 37 | * Create a policy for policy based segment routing |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame^] | 38 | * |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 39 | * @param pid Unique Policy Identifier |
| 40 | * @param srcIP Source IP address in CIDR format |
| 41 | * @param dstIP Destination IP address in CIDR format |
| 42 | * @param ipProto IP protocol type |
| 43 | * @param srcPort Source L4 port |
| 44 | * @param dstPort Destination L4 port |
| 45 | * @param priority Priority of the policy |
| 46 | * @param tid SR Tunnel Id to be associated with this policy |
| 47 | * |
| 48 | * @return "true/false" depending tunnel creation status |
| 49 | */ |
| 50 | public boolean createPolicy(String pid, MACAddress srcMac, MACAddress dstMac, |
| 51 | Short etherType, IPv4Net srcIp, IPv4Net dstIp, Byte ipProto, |
| 52 | Short srcPort, Short dstPort, int priority, String tid); |
| 53 | |
| 54 | /** |
| 55 | * Remove a policy given policy Id |
| 56 | * |
| 57 | * @param pid Unique Policy Identifier |
| 58 | * |
| 59 | * @return "true/false" depending tunnel deletion status |
| 60 | */ |
| 61 | public boolean removePolicy(String pid); |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 62 | /** |
| 63 | * Return the collection of TunnelInfo which contains |
| 64 | * info about tunnels |
| 65 | * @return Collection<TunnelInfo> |
| 66 | */ |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame^] | 67 | |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 68 | public Collection<TunnelInfo> getTunnelTable(); |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 69 | } |