HIGUCHI Yuta | 2051490 | 2013-06-12 11:24:16 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.core; |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 2 | |
Pavlin Radoslavov | 64647d2 | 2013-11-04 19:07:03 -0800 | [diff] [blame] | 3 | import java.util.List; |
| 4 | |
Pankaj Berde | bbd3861 | 2013-06-22 05:59:12 -0700 | [diff] [blame] | 5 | import net.floodlightcontroller.core.IOFSwitch; |
| 6 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 7 | import org.openflow.protocol.OFPhysicalPort; |
| 8 | |
| 9 | public interface ISwitchStorage extends INetMapStorage { |
| 10 | |
Pankaj Berde | 28cc61c | 2013-01-08 18:19:33 -0800 | [diff] [blame] | 11 | public enum SwitchState { |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 12 | INACTIVE, |
| 13 | ACTIVE |
| 14 | } |
| 15 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 16 | /* |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 17 | * Initialize |
| 18 | */ |
| 19 | public void init(String conf); |
| 20 | /* |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 21 | * Update the switch details |
| 22 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 23 | public boolean updateSwitch(String dpid, SwitchState state, DM_OPERATION op); |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 24 | /* |
Pankaj Berde | bbd3861 | 2013-06-22 05:59:12 -0700 | [diff] [blame] | 25 | * Add a switch and all its associated ports |
| 26 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 27 | public boolean addSwitch(IOFSwitch sw); |
Pankaj Berde | bbd3861 | 2013-06-22 05:59:12 -0700 | [diff] [blame] | 28 | /* |
| 29 | * Add a switch |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 30 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 31 | public boolean addSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 32 | /* |
| 33 | * Delete switch and associated ports |
| 34 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 35 | public boolean deleteSwitch(String dpid); |
| 36 | /* |
Jonathan Hart | adc6389 | 2013-11-08 14:03:55 -0800 | [diff] [blame] | 37 | * Deactivate the switch and associated ports |
| 38 | */ |
| 39 | public boolean deactivateSwitch(String dpid); |
| 40 | /* |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 41 | * Update the port details |
| 42 | */ |
| 43 | public boolean updatePort(String dpid, short port, int state, String desc); |
| 44 | /* |
| 45 | * Associate a port on switch |
| 46 | */ |
| 47 | public boolean addPort(String dpid, OFPhysicalPort port); |
| 48 | /* |
| 49 | * Delete a port on a switch by num |
| 50 | */ |
| 51 | public boolean deletePort(String dpid, short port); |
Pavlin Radoslavov | 64647d2 | 2013-11-04 19:07:03 -0800 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Get list of all ports on the switch specified by given DPID. |
| 55 | * |
| 56 | * @param dpid DPID of desired switch. |
| 57 | * @return List of port IDs. Empty list if no port was found. |
| 58 | */ |
| 59 | public List<Short> getPorts(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 60 | } |