blob: add898fff1305f28adbd3799864d2be88a5b85de [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 Khana40f9b62014-10-20 18:33:45 -07008import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.TunnelInfo;
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -07009import 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 */
15public interface ISegmentRoutingService extends IFloodlightService {
16
17 /**
18 * Create a tunnel for policy routing.
19 *
20 * @param tunnelId ID for the tunnel
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070021 * @param labelIds Node label IDs for the tunnel
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070022 *
23 * @return "true/false" depending tunnel creation status
24 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070025 public boolean createTunnel(String tunnelId, List<Integer> labelIds);
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070026
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 Vavilapalli1f6a5742014-10-21 13:45:11 -070038 *
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070039 * @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 Khana40f9b62014-10-20 18:33:45 -070062 /**
63 * Return the collection of TunnelInfo which contains
64 * info about tunnels
65 * @return Collection<TunnelInfo>
66 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070067
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -070068 public Collection<TunnelInfo> getTunnelTable();
Fahad Naeem Khan95aa4012014-10-21 14:07:00 -070069 /**
70 * Get the first group ID for the tunnel for specific source router
71 * If Segment Stitching was required to create the tunnel, there are
72 * mutiple source routers.
73 *
74 * @param tunnelId ID for the tunnel
75 * @param dpid source router DPID
76 * @return the first group ID of the tunnel and -1 if sw with specifed
77 * dpid is not found
78 */
79 public int getTunnelGroupId(String tunnelId, String dpid);
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070080}