blob: 44411cd880ad9e9db208d7028eb2cf61cd3866b9 [file] [log] [blame]
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -07001package net.onrc.onos.apps.segmentrouting;
2
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -07003import java.util.Collection;
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -07004import java.util.List;
5
6import net.floodlightcontroller.core.module.IFloodlightService;
7import net.floodlightcontroller.util.MACAddress;
Fahad Naeem Khan12fa63a2014-10-21 17:01:27 -07008import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.PolicyInfo;
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -07009import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.TunnelInfo;
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070010import 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 */
16public interface ISegmentRoutingService extends IFloodlightService {
17
18 /**
19 * Create a tunnel for policy routing.
20 *
21 * @param tunnelId ID for the tunnel
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070022 * @param labelIds Node label IDs for the tunnel
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070023 *
24 * @return "true/false" depending tunnel creation status
25 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070026 public boolean createTunnel(String tunnelId, List<Integer> labelIds);
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070027
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 Vavilapalli1f6a5742014-10-21 13:45:11 -070039 *
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070040 * @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 Khana40f9b62014-10-20 18:33:45 -070063 /**
64 * Return the collection of TunnelInfo which contains
65 * info about tunnels
66 * @return Collection<TunnelInfo>
67 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070068
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -070069 public Collection<TunnelInfo> getTunnelTable();
Fahad Naeem Khan95aa4012014-10-21 14:07:00 -070070 /**
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 Khan12fa63a2014-10-21 17:01:27 -070081 /**
82 * return list of all the policies currently there in Segment Router
83 * @return Collection<PolicyInfo>
84 */
85 public Collection<PolicyInfo> getPoclicyTable();
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070086}