blob: 9a887aef09b5445d9dac5532be8c4be92c1bf4ad [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();
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070069}