public abstract class OVXSwitch extends Switch<OVXPort> implements Persistable
Modifier and Type | Field and Description |
---|---|
protected static int |
bufferDimension |
protected LRULinkedHashMap<Integer,OVXPacketIn> |
bufferMap |
protected OVXSwitchCapabilities |
capabilities |
static String |
DPDESCSTRING
Datapath description string.
|
protected FlowTable |
flowTable |
protected boolean |
isActive |
protected Short |
missSendLen |
protected static int |
supportedActions |
protected Integer |
tenantId |
channel, DB_KEY, desc, featuresReply, isConnected, map, portMap, switchId, switchName
Modifier | Constructor and Description |
---|---|
protected |
OVXSwitch(Long switchId,
Integer tenantId)
Instantiates a new OVX switch.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultPort(LinkedList<OFPhysicalPort> ports)
Adds a default OpenFlow port to the give list of physical ports.
|
int |
addToBufferMap(OVXPacketIn pktIn)
Adds a packet_in to the buffer map and returns a unique buffer ID.
|
boolean |
boot()
Boots virtual switch by connecting it to the controller.
|
OVXFlowMod |
deleteFlowMod(Long cookie)
Removes an entry in the mapping.
|
boolean |
equals(Object obj) |
void |
generateFeaturesReply()
Generate features reply.
|
Map<String,Object> |
getDBIndex() |
String |
getDBKey() |
String |
getDBName() |
Map<String,Object> |
getDBObject() |
OVXFlowMod |
getFlowMod(Long cookie)
Gets a OVXFlowMod out of the map based on the given cookie.
|
FlowTable |
getFlowTable()
Gets the flow table.
|
OVXPacketIn |
getFromBufferMap(Integer bufId)
Gets a packet_in from a given buffer ID.
|
short |
getMissSendLen()
Gets the miss send len.
|
short |
getNextPortNumber()
Gets the next available port number.
|
Short |
getPhysicalPortNumber(Short ovxPortNumber)
Gets the physical port number.
|
Integer |
getTenantId()
Gets the tenant id.
|
void |
handleIO(OFMessage msg,
org.jboss.netty.channel.Channel channel) |
void |
handleRoleIO(OFVendor msg,
org.jboss.netty.channel.Channel channel) |
int |
hashCode() |
int |
incrementBackOff()
Increments the backoff counter.
|
boolean |
isActive()
Checks if is active.
|
void |
register(List<PhysicalSwitch> physicalSwitches)
Registers switch in the mapping and adds it to persistent storage.
|
void |
relesePortNumber(short portNumber)
Releases the given port number so it can be reused.
|
void |
removeChannel(org.jboss.netty.channel.Channel channel)
Removes the given channel.
|
void |
resetBackOff()
Resets the backoff counter.
|
void |
sendMsg(OFMessage msg,
OVXSendMsg from) |
abstract void |
sendSouth(OFMessage msg,
OVXPort inPort)
Sends a message towards the physical network, via the PhysicalSwitch
mapped to this OVXSwitch.
|
void |
setActive(boolean isActive)
Sets the active.
|
void |
setChannel(org.jboss.netty.channel.Channel channel)
Sets the channel.
|
boolean |
setMissSendLen(Short missSendLen)
Sets the miss send len.
|
void |
tearDown()
Tear down.
|
String |
toString() |
abstract int |
translate(OFMessage msg,
OVXPort inPort)
Generates a new XID for messages destined for the physical network.
|
void |
unregister()
Unregisters switch from persistent storage, from the mapping,
and removes all virtual elements that rely on this switch.
|
addPort, getFeaturesReply, getMap, getName, getPort, getPorts, getSwitchId, getSwitchName, removePort, setConnected, setDescriptionStats, setFeaturesReply
public static final String DPDESCSTRING
protected static int supportedActions
protected static int bufferDimension
protected Integer tenantId
protected Short missSendLen
protected boolean isActive
protected OVXSwitchCapabilities capabilities
protected LRULinkedHashMap<Integer,OVXPacketIn> bufferMap
protected FlowTable flowTable
public Integer getTenantId()
public short getMissSendLen()
public boolean setMissSendLen(Short missSendLen)
missSendLen
- the miss send lenpublic boolean isActive()
public void setActive(boolean isActive)
isActive
- the new activepublic Short getPhysicalPortNumber(Short ovxPortNumber)
ovxPortNumber
- the ovx port numberpublic void resetBackOff()
public int incrementBackOff()
public short getNextPortNumber() throws IndexOutOfBoundException
IndexOutOfBoundException
- if no more port numbers are availablepublic void relesePortNumber(short portNumber)
portNumber
- the port numberprotected void addDefaultPort(LinkedList<OFPhysicalPort> ports)
ports
- the list of portspublic void register(List<PhysicalSwitch> physicalSwitches)
physicalSwitches
- public void unregister()
unregister
in class Switch<OVXPort>
public Map<String,Object> getDBIndex()
getDBIndex
in interface Persistable
public String getDBKey()
getDBKey
in interface Persistable
public String getDBName()
getDBName
in interface Persistable
public Map<String,Object> getDBObject()
getDBObject
in interface Persistable
public void tearDown()
Switch
public void generateFeaturesReply()
public boolean boot()
public int addToBufferMap(OVXPacketIn pktIn)
pktIn
- the packet_inpublic OVXPacketIn getFromBufferMap(Integer bufId)
bufId
- the buffer IDpublic FlowTable getFlowTable()
public void sendMsg(OFMessage msg, OVXSendMsg from)
sendMsg
in interface OVXSendMsg
public void handleIO(OFMessage msg, org.jboss.netty.channel.Channel channel)
handleIO
in interface OVXEventHandler
handleIO
in class Switch<OVXPort>
public void handleRoleIO(OFVendor msg, org.jboss.netty.channel.Channel channel)
handleRoleIO
in class Switch<OVXPort>
public OVXFlowMod getFlowMod(Long cookie) throws MappingException
cookie
- the physical cookieMappingException
- if the cookie is not foundpublic void setChannel(org.jboss.netty.channel.Channel channel)
setChannel
in class Switch<OVXPort>
channel
- the channelpublic void removeChannel(org.jboss.netty.channel.Channel channel)
removeChannel
in class Switch<OVXPort>
channel
- the channelpublic OVXFlowMod deleteFlowMod(Long cookie)
cookie
- public abstract int translate(OFMessage msg, OVXPort inPort)
msg
- The OFMessage being translatedinPort
- The ingress portpublic abstract void sendSouth(OFMessage msg, OVXPort inPort)
msg
- The OFMessage being translatedinPort
- The ingress port, used to identify the PhysicalSwitch
underlying an OVXBigSwitch. May be null. Sends a message
towards the physical networkCopyright © 2015. All rights reserved.