T - The type of the target data model.public abstract class VirtualBridge<T extends VtnPortMappableBridge> extends VirtualNode<T,BridgeIdentifier<T>>
VInterface describes a configuration and runtime status for a
virtual bridge inside VTN.| Modifier | Constructor and Description |
|---|---|
protected |
VirtualBridge(BridgeIdentifier<T> brId)
Construct a new instance.
|
protected |
VirtualBridge(BridgeIdentifier<T> brId,
T value)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
broadcastInterfaces(PacketContext pctx,
Set<PortVlan> sent)
Broadcast the given packet to all the virtual interfaces configured in
this virtual bridge.
|
static <B extends VtnPortMappableBridge> |
create(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
BridgeIdentifier<B> ident)
Construct a new virtual bridge instance.
|
abstract void |
destroy(TxContext ctx,
boolean retain)
Destroy the virtual bridge.
|
protected void |
destroyInterfaces(TxContext ctx)
Destroy all the virtual interfaces in this virtual bridge.
|
protected abstract PacketContext |
evaluateOutputFilter(PacketContext pctx,
int vid)
Evaluate flow filters configured in this bridge against the given
outgoing packet.
|
protected abstract VnodeState |
eventReceived(TxContext ctx,
VtnNodeEvent ev)
Notify virtual mappings in this bridge of node event.
|
protected abstract VnodeState |
eventReceived(TxContext ctx,
VtnPortEvent ev)
Notify virtual mappings in this bridge of port event.
|
protected void |
forward(PacketContext pctx,
SalPort egress,
int outVid)
Forward the given unicast packet to the specified physical network, and
establish the data flow for the given packet.
|
protected abstract void |
forward(PacketContext pctx,
VirtualMapNode vnode)
Forward the specified packet to the virtual mapping configured in this
virtual bridge.
|
BridgeStatus |
getBridgeStatus()
Return the runtime status information of the virtual bridge.
|
protected abstract VnodeState |
getMapState(TxContext ctx)
Return the state of the virtual mapping configured to this bridge.
|
VnodeState |
getState()
Return the current state of this virtual bridge.
|
boolean |
hasPathFault()
Determine whether at least one path fault is detected in this vBridge
or not.
|
boolean |
isFilterEmpty()
Determine whether this virtual bridge contains no flow filter or not.
|
protected VirtualMapNode |
match(PacketContext pctx,
EtherAddress eaddr,
SalPort sport,
int vid)
Return the virtual network node in this virtual bridge that maps the
specified host.
|
protected VirtualMapNode |
match(PacketContext pctx,
TenantNodeIdentifier<?,?> ref,
EtherAddress eaddr,
SalPort sport,
int vid,
boolean pktin)
Return the virtual network node in this bridge which maps the specified
host.
|
static BridgeStatus |
newBridgeStatus()
Create a default virtual bridge status.
|
static BridgeStatus |
newBridgeStatus(VnodeState st,
List<FaultedPaths> faults)
Create a new virtual bridge status.
|
abstract VInterface<T> |
newInterface(VInterfaceIdentifier<T> ifId,
Vinterface vif)
Construct a new virtual interface instance associated with the interface
inside this virtual bridge.
|
abstract VInterface<T> |
newInterface(VInterfaceIdentifier<T> ifId,
VtnVinterfaceConfig vifc,
VTNPortMapConfig pmap)
Construct a new virtual interface instance associated with the interface
inside this virtual bridge.
|
void |
notifyNode(TxContext ctx,
VtnNodeEvent ev)
Invoked when a physical switch is added, removed, or changed.
|
void |
notifyPort(TxContext ctx,
VtnPortEvent ev)
Invoked when a physical switch port is added, removed, or changed.
|
void |
putState(TxContext ctx)
Scan virtual mappings configured in this virtual bridge, and update the
bridge status in the MD-SAL datastore.
|
void |
putState(TxContext ctx,
VInterface vif)
Scan virtual mappings configured in this virtual bridge, and update the
bridge status in the MD-SAL datastore.
|
void |
putState(TxContext ctx,
VnodeState cstate)
Scan virtual mappings configured in this virtual bridge, and update the
bridge status in the MD-SAL datastore.
|
void |
receive(PacketContext pctx,
TenantNodeIdentifier<?,?> ref)
Receive a packet mapped to the virtual bridge.
|
void |
redirect(PacketContext pctx,
RedirectFlowException rex)
Redirect the given packet to the specified virtual interface.
|
List<Vinterface> |
resume(TxContext ctx,
XmlLogger xlogger,
List<XmlVInterface> xiflist)
Resume the runtime status information about virtual interfaces inside
this virtual bridge.
|
void |
routingUpdated(TxContext ctx)
Invoked when the packet routing table has been updated.
|
void |
setInterfaceEnabled(TxContext ctx,
VInterfaceIdentifier<T> ifId,
boolean value)
Set the enabled state to the specified virtual interface.
|
void |
submit(TxContext ctx)
Update the runtime status information in the MD-SAL datastore.
|
protected void |
traceState(VirtualElement<?,?> child,
VnodeState cst,
VnodeState st)
Record a trace log for transition of the virtual bridge status.
|
void |
updateState(TxContext ctx)
Scan virtual mappings configured in this virtual bridge, and update the
bridge status in this instance.
|
void |
updateState(VirtualElement<?,?> child,
VnodeState cstate)
Update the state of this virtual bridge using the child node state.
|
static VnodeState |
updateState(VnodeState bstate,
VnodeState cstate)
Update the state of this virtual bridge using the child node state.
|
getFlowFilterListgetIdentifier, getInitialValue, getLoggerprotected VirtualBridge(BridgeIdentifier<T> brId)
This constructor is used to resume runtime status of the virtual bridge on bootstrap.
brId - The identifier for the virtual bridge.protected VirtualBridge(BridgeIdentifier<T> brId, T value)
brId - The identifier for the virtual bridge.value - A data object read from the MD-SAL datastore.public static final VnodeState updateState(VnodeState bstate, VnodeState cstate)
bstate - The current state of the virtual bridge.cstate - The state of the child node inside this virtual bridge.public static final BridgeStatus newBridgeStatus()
BridgeStatus instance.public static final BridgeStatus newBridgeStatus(VnodeState st, List<FaultedPaths> faults)
st - The state of the virtual bridge.faults - A list of faulted paths.BridgeStatus instance.public static final <B extends VtnPortMappableBridge> VirtualBridge<B> create(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, BridgeIdentifier<B> ident) throws VTNException
B - The type of the virtual bridge.rtx - A read transaction for the MD-SAL datastore.ident - The virtual bridge identifier.VirtualBridge instance.VTNException - An error occurred.public final VnodeState getState()
public final boolean hasPathFault()
true only if at least one path fault is detected.public final BridgeStatus getBridgeStatus()
BridgeStatus instance.public final void updateState(TxContext ctx)
ctx - MD-SAL datastore transaction context.public final void updateState(VirtualElement<?,?> child, VnodeState cstate)
child - The child node in this virtual bridge.cstate - The state of the child node inside this virtual bridge.public final void putState(TxContext ctx)
ctx - MD-SAL datastore transaction context.public final void putState(TxContext ctx, VInterface vif)
ctx - MD-SAL datastore transaction context.vif - A VInterface instance that was changed its status.
This is used as a hint for determining the virtual bridge
status.public final void putState(TxContext ctx, VnodeState cstate)
ctx - MD-SAL datastore transaction context.cstate - The state of the child node inside this virtual bridge.
This is used as a hint for determining the virtual bridge
status.public final void submit(TxContext ctx)
ctx - MD-SAL datastore transaction context.public final void setInterfaceEnabled(TxContext ctx, VInterfaceIdentifier<T> ifId, boolean value) throws VTNException
ctx - MD-SAL datastore transaction context.ifId - The identifier for the target virtual interface.
The specified interface must be present in this virtual
bridge.value - A new value of the enabled state.VTNException - An error occurred.public final List<Vinterface> resume(TxContext ctx, XmlLogger xlogger, List<XmlVInterface> xiflist) throws VTNException
ctx - MD-SAL datastore transaction context.xlogger - A XmlLogger instance.xiflist - A list of XmlVInterface which represents the
configuration of virtual interfaces inside this virtual
bridge.Vinterface instances or null.VTNException - Failed to resume the vBridge.public boolean isFilterEmpty()
true if this virtual bridge contains no flow filter.
false otherwise.public final void receive(PacketContext pctx, TenantNodeIdentifier<?,?> ref) throws VTNException, DropFlowException, RedirectFlowException
pctx - A runtime context for a received packet.ref - A TenantNodeIdentifier instance that specifies
the virtual mapping that maps the packet.
Note that the specified virtual mapping must be present
in this virtual bridge.DropFlowException - The given packet was discarded by a flow filter.RedirectFlowException - The given packet was redirected by a flow filter.VTNException - An error occurred.public final void redirect(PacketContext pctx, RedirectFlowException rex) throws DropFlowException, RedirectFlowException, VTNException
pctx - A runtime context for a received packet.rex - An exception that keeps information about the packet
redirection.DropFlowException - The given packet was discarded by a DROP flow filter.RedirectFlowException - The given packet was redirected by a REDIRECT flow filter.VTNException - An error occurred.public final void notifyNode(TxContext ctx, VtnNodeEvent ev)
ctx - MD-SAL datastore transaction context.ev - A VtnNodeEvent instance.public final void notifyPort(TxContext ctx, VtnPortEvent ev)
ctx - MD-SAL datastore transaction context.ev - A VtnPortEvent instance.public final void routingUpdated(TxContext ctx)
Note that the caller must guarantee that a set of faulted paths in this instance is not yet modified.
ctx - MD-SAL datastore transaction context.protected final void destroyInterfaces(TxContext ctx) throws VTNException
This method is called only when this virtual bridge is being destroyed.
ctx - MD-SAL datastore transaction context.VTNException - An error occurred.protected final void traceState(VirtualElement<?,?> child, VnodeState cst, VnodeState st)
child - The child node in this virtual bridge.cst - The state of the child node.st - The current state of this virtual bridge.protected final VirtualMapNode match(PacketContext pctx, EtherAddress eaddr, SalPort sport, int vid) throws VTNException
pctx - A runtime context for a received packet.eaddr - The MAC address of the host.sport - A SalPort instance that specifies the switch port
where the host was detected.vid - The VLAN ID associated with the specified host.VirtualMapNode if the specified VLAN is mapped to
this virtual bridge. null otherwise.VTNException - An error occurred.protected VirtualMapNode match(PacketContext pctx, TenantNodeIdentifier<?,?> ref, EtherAddress eaddr, SalPort sport, int vid, boolean pktin) throws VTNException
pctx - A runtime context for a received packet.ref - Reference to the virtual network mapping that maps the
host. Note that the specified virtual mapping must be
present in this virtual bridge.eaddr - The MAC address of the host.sport - A SalPort instance that specifies the switch port
where the host was detected.vid - The VLAN ID associated with the specified host.pktin - true indicates the caller is the PACKET_IN
handler.VirtualMapNode if the specified host is mapped to
this virtual bridge. null otherwise.VTNException - An error occurred.protected final void forward(PacketContext pctx, SalPort egress, int outVid) throws VTNException
pctx - A runtime context for a received packet.egress - A SalPort corresponding to the outgoing physical
switch port.outVid - A VLAN ID for the outgoing packet.VTNException - An error occurred.protected final void broadcastInterfaces(PacketContext pctx, Set<PortVlan> sent) throws RedirectFlowException, VTNException
pctx - A runtime context for a received packet.sent - A set of PortVlan which indicates the network
already processed.RedirectFlowException - The given packet was redirected by a flow filter.VTNException - An error occurred.public abstract void destroy(TxContext ctx, boolean retain) throws VTNException
ctx - MD-SAL datastore transaction context.retain - true means that the parent virtual node will be
retained. false means that the parent virtual
node is being destroyed.VTNException - An error occurred.public abstract VInterface<T> newInterface(VInterfaceIdentifier<T> ifId, Vinterface vif)
ifId - The identifier for a new virtual interface.vif - A Vinterface instance read from the MD-SAL
datastore.VInterface instance.public abstract VInterface<T> newInterface(VInterfaceIdentifier<T> ifId, VtnVinterfaceConfig vifc, VTNPortMapConfig pmap)
This method is used to resume runtime status of the virtual interface on bootstrap.
ifId - The identifier for a new virtual interface.vifc - Configuration of the virtual interface.pmap - Port mapping configuration.VInterface instance.protected abstract VnodeState getMapState(TxContext ctx)
ctx - MD-SAL datastore transaction context.protected abstract VnodeState eventReceived(TxContext ctx, VtnNodeEvent ev)
ctx - MD-SAL datastore transaction context.ev - A VtnNodeEvent instance.protected abstract VnodeState eventReceived(TxContext ctx, VtnPortEvent ev)
ctx - MD-SAL datastore transaction context.ev - A VtnPortEvent instance.protected abstract PacketContext evaluateOutputFilter(PacketContext pctx, int vid) throws DropFlowException, RedirectFlowException
pctx - A runtime context for a received packet.vid - A VLAN ID to be used for packet matching.
A VLAN ID configured in the given packet is used if a
negative value is specified.PacketContext to be used for transmitting packet.DropFlowException - The given packet was discarded by a flow filter.RedirectFlowException - The given packet was redirected by a flow filter.protected abstract void forward(PacketContext pctx, VirtualMapNode vnode) throws DropFlowException, RedirectFlowException, VTNException
pctx - A runtime context for a received packet.vnode - A VirtualMapNode instance that maps the given
packet.DropFlowException - The given packet was discarded by a flow filter.RedirectFlowException - The given packet was redirected by a flow filter.VTNException - An error occurred.Copyright © 2018 OpenDaylight. All rights reserved.