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 | 12fa63a | 2014-10-21 17:01:27 -0700 | [diff] [blame^] | 8 | import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.PolicyInfo; |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 9 | import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.TunnelInfo; |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 10 | import net.onrc.onos.core.util.IPv4Net; |
| 11 | |
| 12 | /** |
| 13 | * The API exported by the main SDN-IP class. This is the interface between the |
| 14 | * REST handlers and the SDN-IP module. |
| 15 | */ |
| 16 | public interface ISegmentRoutingService extends IFloodlightService { |
| 17 | |
| 18 | /** |
| 19 | * Create a tunnel for policy routing. |
| 20 | * |
| 21 | * @param tunnelId ID for the tunnel |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame] | 22 | * @param labelIds Node label IDs for the tunnel |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 23 | * |
| 24 | * @return "true/false" depending tunnel creation status |
| 25 | */ |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame] | 26 | public boolean createTunnel(String tunnelId, List<Integer> labelIds); |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 27 | |
| 28 | /** |
| 29 | * Remove a Segment Routing tunnel given a tunnel Id. |
| 30 | * |
| 31 | * @param tunnelId ID for the tunnel |
| 32 | * |
| 33 | * @return "true/false" depending tunnel deletion status |
| 34 | */ |
| 35 | public boolean removeTunnel(String tunnelId); |
| 36 | |
| 37 | /** |
| 38 | * Create a policy for policy based segment routing |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame] | 39 | * |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 40 | * @param pid Unique Policy Identifier |
| 41 | * @param srcIP Source IP address in CIDR format |
| 42 | * @param dstIP Destination IP address in CIDR format |
| 43 | * @param ipProto IP protocol type |
| 44 | * @param srcPort Source L4 port |
| 45 | * @param dstPort Destination L4 port |
| 46 | * @param priority Priority of the policy |
| 47 | * @param tid SR Tunnel Id to be associated with this policy |
| 48 | * |
| 49 | * @return "true/false" depending tunnel creation status |
| 50 | */ |
| 51 | public boolean createPolicy(String pid, MACAddress srcMac, MACAddress dstMac, |
| 52 | Short etherType, IPv4Net srcIp, IPv4Net dstIp, Byte ipProto, |
| 53 | Short srcPort, Short dstPort, int priority, String tid); |
| 54 | |
| 55 | /** |
| 56 | * Remove a policy given policy Id |
| 57 | * |
| 58 | * @param pid Unique Policy Identifier |
| 59 | * |
| 60 | * @return "true/false" depending tunnel deletion status |
| 61 | */ |
| 62 | public boolean removePolicy(String pid); |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Return the collection of TunnelInfo which contains |
| 65 | * info about tunnels |
| 66 | * @return Collection<TunnelInfo> |
| 67 | */ |
Srikanth Vavilapalli | 1f6a574 | 2014-10-21 13:45:11 -0700 | [diff] [blame] | 68 | |
Fahad Naeem Khan | a40f9b6 | 2014-10-20 18:33:45 -0700 | [diff] [blame] | 69 | public Collection<TunnelInfo> getTunnelTable(); |
Fahad Naeem Khan | 95aa401 | 2014-10-21 14:07:00 -0700 | [diff] [blame] | 70 | /** |
| 71 | * Get the first group ID for the tunnel for specific source router |
| 72 | * If Segment Stitching was required to create the tunnel, there are |
| 73 | * mutiple source routers. |
| 74 | * |
| 75 | * @param tunnelId ID for the tunnel |
| 76 | * @param dpid source router DPID |
| 77 | * @return the first group ID of the tunnel and -1 if sw with specifed |
| 78 | * dpid is not found |
| 79 | */ |
| 80 | public int getTunnelGroupId(String tunnelId, String dpid); |
Fahad Naeem Khan | 12fa63a | 2014-10-21 17:01:27 -0700 | [diff] [blame^] | 81 | /** |
| 82 | * return list of all the policies currently there in Segment Router |
| 83 | * @return Collection<PolicyInfo> |
| 84 | */ |
| 85 | public Collection<PolicyInfo> getPoclicyTable(); |
Srikanth Vavilapalli | fb38ed6 | 2014-10-20 13:34:01 -0700 | [diff] [blame] | 86 | } |