Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core; |
| 2 | |
| 3 | import java.util.Collection; |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 4 | import java.util.List; |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 5 | |
| 6 | import org.openflow.protocol.OFPhysicalPort; |
| 7 | |
| 8 | public interface ISwitchStorage extends INetMapStorage { |
| 9 | |
Pankaj Berde | 28cc61c | 2013-01-08 18:19:33 -0800 | [diff] [blame] | 10 | public enum SwitchState { |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 11 | INACTIVE, |
| 12 | ACTIVE |
| 13 | } |
| 14 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 15 | /* |
| 16 | * Update the switch details |
| 17 | */ |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 18 | public void update(String dpid,SwitchState state, DM_OPERATION op); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 19 | /* |
| 20 | * Associate a port on switch |
| 21 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 22 | public void addPort(String dpid, OFPhysicalPort port); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 23 | /* |
| 24 | * Get all ports associated on a switch |
| 25 | */ |
| 26 | public Collection<OFPhysicalPort> getPorts(long dpid); |
| 27 | /* |
| 28 | * Get Port by Number |
| 29 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 30 | public OFPhysicalPort getPort(String dpid, short portnum); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 31 | /* |
| 32 | * Get port by name |
| 33 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 34 | public OFPhysicalPort getPort(String dpid, String portName); |
| 35 | /* |
| 36 | * Add a switch |
| 37 | */ |
| 38 | public void addSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 39 | /* |
| 40 | * Delete switch and associated ports |
| 41 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 42 | public void deleteSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 43 | /* |
| 44 | * Delete a port on a switch by num |
| 45 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 46 | public void deletePort(String dpid, short port); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 47 | /* |
| 48 | * Delete port on a switch by name |
| 49 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 50 | public void deletePort(String dpid, String portName); |
| 51 | |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 52 | public List<String> getActiveSwitches(); |
| 53 | |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 54 | /* |
| 55 | * Initialize |
| 56 | */ |
| 57 | public void init(String conf); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 58 | } |