blob: 8060c4d9d898c16a660cbeb3cc942a48114f9d0d [file] [log] [blame]
Pankaj Berdee73452c2013-01-03 14:57:07 -08001package net.floodlightcontroller.core;
2
3import java.util.Collection;
Pankaj Berde8557a462013-01-07 08:59:31 -08004import java.util.List;
Pankaj Berdee73452c2013-01-03 14:57:07 -08005
6import org.openflow.protocol.OFPhysicalPort;
7
8public interface ISwitchStorage extends INetMapStorage {
9
Pankaj Berde28cc61c2013-01-08 18:19:33 -080010 public enum SwitchState {
Pankaj Berde8557a462013-01-07 08:59:31 -080011 INACTIVE,
12 ACTIVE
13 }
14
Pankaj Berdee73452c2013-01-03 14:57:07 -080015 /*
16 * Update the switch details
17 */
Pankaj Berde8557a462013-01-07 08:59:31 -080018 public void update(String dpid,SwitchState state, DM_OPERATION op);
Pankaj Berdee73452c2013-01-03 14:57:07 -080019 /*
20 * Associate a port on switch
21 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080022 public void addPort(String dpid, OFPhysicalPort port);
Pankaj Berdee73452c2013-01-03 14:57:07 -080023 /*
24 * Get all ports associated on a switch
25 */
26 public Collection<OFPhysicalPort> getPorts(long dpid);
27 /*
28 * Get Port by Number
29 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080030 public OFPhysicalPort getPort(String dpid, short portnum);
Pankaj Berdee73452c2013-01-03 14:57:07 -080031 /*
32 * Get port by name
33 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080034 public OFPhysicalPort getPort(String dpid, String portName);
35 /*
36 * Add a switch
37 */
38 public void addSwitch(String dpid);
Pankaj Berdee73452c2013-01-03 14:57:07 -080039 /*
40 * Delete switch and associated ports
41 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080042 public void deleteSwitch(String dpid);
Pankaj Berdee73452c2013-01-03 14:57:07 -080043 /*
44 * Delete a port on a switch by num
45 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080046 public void deletePort(String dpid, short port);
Pankaj Berdee73452c2013-01-03 14:57:07 -080047 /*
48 * Delete port on a switch by name
49 */
Pankaj Berde4dea3462013-01-03 18:02:38 -080050 public void deletePort(String dpid, String portName);
51
Pankaj Berde8557a462013-01-07 08:59:31 -080052 public List<String> getActiveSwitches();
Pankaj Berded1259e82013-01-23 14:10:00 -080053 public List<String> getAllSwitches();
54 public List<String> getInactiveSwitches();
Pankaj Berde8557a462013-01-07 08:59:31 -080055
Pankaj Berde4dea3462013-01-03 18:02:38 -080056 /*
57 * Initialize
58 */
59 public void init(String conf);
Pankaj Berded1259e82013-01-23 14:10:00 -080060
61
Pankaj Berdee73452c2013-01-03 14:57:07 -080062}