|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.learningswitch.LearningSwitch
public class LearningSwitch
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.floodlightcontroller.core.IListener |
---|
IListener.Command |
Field Summary | |
---|---|
static int |
APP_ID_BITS
|
static int |
APP_ID_SHIFT
|
protected ICounterStoreService |
counterStore
|
protected IFloodlightProviderService |
floodlightProvider
|
protected static short |
FLOWMOD_DEFAULT_HARD_TIMEOUT
|
protected static short |
FLOWMOD_DEFAULT_IDLE_TIMEOUT
|
protected static short |
FLOWMOD_PRIORITY
|
static int |
LEARNING_SWITCH_APP_ID
|
static long |
LEARNING_SWITCH_COOKIE
|
protected static boolean |
LEARNING_SWITCH_REVERSE_FLOW
|
protected static org.slf4j.Logger |
log
|
protected java.util.Map<IOFSwitch,java.util.Map<MacVlanPair,java.lang.Integer>> |
macVlanToSwitchPortMap
|
protected static int |
MAX_MACS_PER_SWITCH
|
protected IRestApiService |
restApi
|
Constructor Summary | |
---|---|
LearningSwitch()
|
Method Summary | |
---|---|
protected void |
addToPortMap(IOFSwitch sw,
long mac,
short vlan,
int portVal)
Adds a host to the MAC/VLAN->SwitchPort mapping |
void |
clearLearnedTable()
Clears the MAC/VLAN -> SwitchPort map for all switches |
void |
clearLearnedTable(IOFSwitch sw)
Clears the MAC/VLAN -> SwitchPort map for a single switch |
java.lang.Integer |
getFromPortMap(IOFSwitch sw,
long mac,
short vlan)
Get the port that a MAC/VLAN pair is associated with |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleDependencies()
Get a list of Modules that this module depends on. |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleServices()
Return the list of interfaces that this module implements. |
java.lang.String |
getName()
The name assigned to this listener |
java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> |
getServiceImpls()
Instantiate (as needed) and return objects that implement each of the services exported by this module. |
java.util.Map<IOFSwitch,java.util.Map<MacVlanPair,java.lang.Integer>> |
getTable()
Returns the LearningSwitch's learned host table |
void |
init(FloodlightModuleContext context)
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized. |
boolean |
isCallbackOrderingPostreq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering post-requisite for this module. |
boolean |
isCallbackOrderingPrereq(OFType type,
java.lang.String name)
Check if the module called name is a callback ordering prerequisite for this module. |
IListener.Command |
receive(IOFSwitch sw,
OFMessage msg,
FloodlightContext cntx)
This is the method Floodlight uses to call listeners with OpenFlow messages |
protected void |
removeFromPortMap(IOFSwitch sw,
long mac,
short vlan)
Removes a host from the MAC/VLAN->SwitchPort mapping |
void |
setFloodlightProvider(IFloodlightProviderService floodlightProvider)
|
void |
startUp(FloodlightModuleContext context)
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
protected IFloodlightProviderService floodlightProvider
protected ICounterStoreService counterStore
protected IRestApiService restApi
protected java.util.Map<IOFSwitch,java.util.Map<MacVlanPair,java.lang.Integer>> macVlanToSwitchPortMap
public static final int LEARNING_SWITCH_APP_ID
public static final int APP_ID_BITS
public static final int APP_ID_SHIFT
public static final long LEARNING_SWITCH_COOKIE
protected static short FLOWMOD_DEFAULT_IDLE_TIMEOUT
protected static short FLOWMOD_DEFAULT_HARD_TIMEOUT
protected static short FLOWMOD_PRIORITY
protected static final int MAX_MACS_PER_SWITCH
protected static final boolean LEARNING_SWITCH_REVERSE_FLOW
Constructor Detail |
---|
public LearningSwitch()
Method Detail |
---|
public void setFloodlightProvider(IFloodlightProviderService floodlightProvider)
floodlightProvider
- the floodlightProvider to setpublic java.lang.String getName()
IListener
getName
in interface IListener<OFType>
protected void addToPortMap(IOFSwitch sw, long mac, short vlan, int portVal)
sw
- The switch to add the mapping tomac
- The MAC address of the host to addvlan
- The VLAN that the host is onportVal
- The switchport that the host is onprotected void removeFromPortMap(IOFSwitch sw, long mac, short vlan)
sw
- The switch to remove the mapping frommac
- The MAC address of the host to removevlan
- The VLAN that the host is onpublic java.lang.Integer getFromPortMap(IOFSwitch sw, long mac, short vlan)
sw
- The switch to get the mapping frommac
- The MAC address to getvlan
- The VLAN number to get
public void clearLearnedTable()
public void clearLearnedTable(IOFSwitch sw)
sw
- The switch to clear the mapping forpublic java.util.Map<IOFSwitch,java.util.Map<MacVlanPair,java.lang.Integer>> getTable()
ILearningSwitchService
getTable
in interface ILearningSwitchService
public IListener.Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
IOFMessageListener
receive
in interface IOFMessageListener
sw
- the OpenFlow switch that sent this messagemsg
- the messagecntx
- a Floodlight message context object you can use to pass
information between listeners
public boolean isCallbackOrderingPrereq(OFType type, java.lang.String name)
IListener
isCallbackOrderingPrereq
in interface IListener<OFType>
type
- the object type to which this appliesname
- the name of the module
public boolean isCallbackOrderingPostreq(OFType type, java.lang.String name)
IListener
isCallbackOrderingPostreq
in interface IListener<OFType>
type
- the object type to which this appliesname
- the name of the module
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
IFloodlightModule
getModuleServices
in interface IFloodlightModule
public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
IFloodlightModule
getServiceImpls
in interface IFloodlightModule
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
IFloodlightModule
getModuleDependencies
in interface IFloodlightModule
public void init(FloodlightModuleContext context) throws FloodlightModuleException
IFloodlightModule
init
in interface IFloodlightModule
FloodlightModuleException
public void startUp(FloodlightModuleContext context)
IFloodlightModule
startUp
in interface IFloodlightModule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |