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 | /* |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 17 | * Initialize |
| 18 | */ |
yoshi | 2fd4c7e | 2013-11-22 15:47:55 -0800 | [diff] [blame] | 19 | public void init(final String dbStore, final String conf); |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 20 | |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 21 | /* |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 22 | * Update the switch details |
| 23 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 24 | public boolean updateSwitch(String dpid, SwitchState state, DM_OPERATION op); |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 25 | /* |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 26 | * Add a switch and all its associated ports |
| 27 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 28 | public boolean addSwitch(IOFSwitch sw); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 29 | /* |
| 30 | * Add a switch |
| 31 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 32 | public boolean addSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 33 | /* |
| 34 | * Delete switch and associated ports |
| 35 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 36 | public boolean deleteSwitch(String dpid); |
| 37 | /* |
Jonathan Hart | adc6389 | 2013-11-08 14:03:55 -0800 | [diff] [blame] | 38 | * Deactivate the switch and associated ports |
| 39 | */ |
| 40 | public boolean deactivateSwitch(String dpid); |
| 41 | /* |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 42 | * Update the port details |
yoshi | 0fee3de | 2013-11-23 09:13:37 -0800 | [diff] [blame] | 43 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 44 | public boolean updatePort(String dpid, short port, int state, String desc); |
| 45 | /* |
| 46 | * Associate a port on switch |
| 47 | */ |
| 48 | public boolean addPort(String dpid, OFPhysicalPort port); |
| 49 | /* |
| 50 | * Delete a port on a switch by num |
| 51 | */ |
| 52 | public boolean deletePort(String dpid, short port); |
Pavlin Radoslavov | 64647d2 | 2013-11-04 19:07:03 -0800 | [diff] [blame] | 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 | } |