blob: 61ec630e29bdd7125aa8d58da5c02452caeb67f5 [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;
Fahad Naeem Khand1ac3702014-10-22 15:59:31 -07004import java.util.HashMap;
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -07005import java.util.List;
6
7import net.floodlightcontroller.core.module.IFloodlightService;
8import net.floodlightcontroller.util.MACAddress;
Fahad Naeem Khan12fa63a2014-10-21 17:01:27 -07009import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.PolicyInfo;
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -070010import net.onrc.onos.apps.segmentrouting.SegmentRoutingManager.TunnelInfo;
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070011import net.onrc.onos.core.util.IPv4Net;
12
13/**
14 * The API exported by the main SDN-IP class. This is the interface between the
15 * REST handlers and the SDN-IP module.
16 */
17public interface ISegmentRoutingService extends IFloodlightService {
18
19 /**
20 * Create a tunnel for policy routing.
21 *
22 * @param tunnelId ID for the tunnel
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070023 * @param labelIds Node label IDs for the tunnel
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070024 *
25 * @return "true/false" depending tunnel creation status
26 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070027 public boolean createTunnel(String tunnelId, List<Integer> labelIds);
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070028
29 /**
30 * Remove a Segment Routing tunnel given a tunnel Id.
31 *
32 * @param tunnelId ID for the tunnel
33 *
34 * @return "true/false" depending tunnel deletion status
35 */
36 public boolean removeTunnel(String tunnelId);
37
38 /**
39 * Create a policy for policy based segment routing
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070040 *
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -070041 * @param pid Unique Policy Identifier
42 * @param srcIP Source IP address in CIDR format
43 * @param dstIP Destination IP address in CIDR format
44 * @param ipProto IP protocol type
45 * @param srcPort Source L4 port
46 * @param dstPort Destination L4 port
47 * @param priority Priority of the policy
48 * @param tid SR Tunnel Id to be associated with this policy
49 *
50 * @return "true/false" depending tunnel creation status
51 */
52 public boolean createPolicy(String pid, MACAddress srcMac, MACAddress dstMac,
53 Short etherType, IPv4Net srcIp, IPv4Net dstIp, Byte ipProto,
54 Short srcPort, Short dstPort, int priority, String tid);
55
56 /**
57 * Remove a policy given policy Id
58 *
59 * @param pid Unique Policy Identifier
60 *
61 * @return "true/false" depending tunnel deletion status
62 */
63 public boolean removePolicy(String pid);
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -070064 /**
65 * Return the collection of TunnelInfo which contains
66 * info about tunnels
67 * @return Collection<TunnelInfo>
68 */
Srikanth Vavilapalli1f6a5742014-10-21 13:45:11 -070069
Fahad Naeem Khana40f9b62014-10-20 18:33:45 -070070 public Collection<TunnelInfo> getTunnelTable();
Fahad Naeem Khan95aa4012014-10-21 14:07:00 -070071 /**
72 * Get the first group ID for the tunnel for specific source router
73 * If Segment Stitching was required to create the tunnel, there are
74 * mutiple source routers.
75 *
76 * @param tunnelId ID for the tunnel
77 * @param dpid source router DPID
78 * @return the first group ID of the tunnel and -1 if sw with specifed
79 * dpid is not found
80 */
81 public int getTunnelGroupId(String tunnelId, String dpid);
Fahad Naeem Khan12fa63a2014-10-21 17:01:27 -070082 /**
83 * return list of all the policies currently there in Segment Router
84 * @return Collection<PolicyInfo>
85 */
86 public Collection<PolicyInfo> getPoclicyTable();
Fahad Naeem Khand1ac3702014-10-22 15:59:31 -070087 /**
88 * Returns the Adjacency Info for the node
89 *
90 * @param nodeSid Node SID
91 * @return HashMap of <AdjacencyID, list of ports>
92 */
93 public HashMap<Integer, List<Integer>> getAdjacencyInfo(int nodeSid);
94 /**
95 * Returns the Adjacency IDs for the node
96 *
97 * @param nodeSid Node SID
98 * @return Collection of Adjacency ID
99 */
100 public Collection<Integer> getAdjacencyIds(int nodeSid);
Srikanth Vavilapallifb38ed62014-10-20 13:34:01 -0700101}