public final class VTNMacMap extends VirtualElement<MacMap,MacMapIdentifier> implements VirtualMapNode
VTNMacMap
describes a configuration and runtime status for a
MAC mapping.Constructor and Description |
---|
VTNMacMap(BridgeIdentifier<Vbridge> vbrId,
MacMap mmp)
Construct a new instance.
|
VTNMacMap(BridgeIdentifier<Vbridge> vbrId,
VTNMacMapConfig mmc)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
activate(TxContext ctx,
VBridge vbr,
EtherAddress eaddr,
SalPort sport,
int vid)
Activate the specified host in the MAC mapping.
|
void |
destroy(TxContext ctx,
boolean retain)
Destroy the MAC mapping.
|
void |
disableInput(PacketContext pctx)
This method does nothing.
|
void |
filterPacket(PacketContext pctx,
int vid)
This method does nothing.
|
PacketContext |
filterPacket(PacketContext pctx,
int vid,
VirtualBridge<?> bridge)
Evaluate flow filters for outgoing packet to be transmitted by this
MAC mapping.
|
VBridgeMapIdentifier<?> |
getIdentifier(EtherAddress eaddr,
int vid)
Return the identifier for the virtual mapping which maps the given host.
|
VNodeHop |
getIngressHop(EtherAddress eaddr,
int vid)
Return a
VNodeHop instance that indicates the packet was mapped
by the MAC mapping. |
protected org.slf4j.Logger |
getLogger()
Return a logger instance.
|
VnodeState |
getState(TxContext ctx)
Return the state of this MAC mapping.
|
boolean |
isActive(TxContext ctx,
EtherAddress eaddr,
SalPort sport,
int vid)
Determine whether the given host is currently mapped by the MAC mapping
or not.
|
boolean |
isEnabled()
Determine whether this MAC mapping is administravely enabled or not.
|
VnodeState |
notifyNode(TxContext ctx,
VtnNodeEvent ev)
Invoked when a physical switch is added, removed, or changed.
|
VnodeState |
notifyPort(TxContext ctx,
VtnPortEvent ev)
Invoked when a physical switch port is added, removed, or changed.
|
MacMap |
resume(TxContext ctx)
Resume the MAC mapping.
|
void |
transmit(PacketContext pctx,
VBridge vbr,
Set<PortVlan> sent)
Transmit the given packet to the physical network mapped by this
VLAN mapping.
|
getIdentifier, getInitialValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIdentifier
public VTNMacMap(BridgeIdentifier<Vbridge> vbrId, VTNMacMapConfig mmc)
This constructor is used to resume runtime status of the MAC mapping on bootstrap.
vbrId
- The identifier for a vBridge that contains this MAC
mapping.mmc
- MAC mapping configuration.public VTNMacMap(BridgeIdentifier<Vbridge> vbrId, MacMap mmp) throws RpcException
vbrId
- The identifier for a vBridge that contains this MAC
mapping.mmp
- A MacMap
instance read from the MD-SAL datastore.RpcException
- mmp
contains invalid configuration.public VnodeState getState(TxContext ctx)
ctx
- MD-SAL datastore transaction context.VnodeState.UP
if this MAC mapping is active.
VnodeState.DOWN
otherwise.public MacMap resume(TxContext ctx)
ctx
- MD-SAL datastore transaction context.MacMap
instance on success.
null
on failure.public void destroy(TxContext ctx, boolean retain)
ctx
- MD-SAL datastore transaction context.retain
- true
means that the parent vBridge will be
retained. false
means that the parent vBridge
is being destroyed.public VnodeState notifyNode(TxContext ctx, VtnNodeEvent ev)
ctx
- MD-SAL datastore transaction context.ev
- A VtnNodeEvent
instance.public VnodeState notifyPort(TxContext ctx, VtnPortEvent ev)
ctx
- MD-SAL datastore transaction context.ev
- A VtnPortEvent
instance.public boolean activate(TxContext ctx, VBridge vbr, EtherAddress eaddr, SalPort sport, int vid) throws VTNException
ctx
- MD-SAL datastore transaction context.vbr
- The parent vBridge.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.true
on success.
false
on failure.VTNException
- An error occurred.public boolean isActive(TxContext ctx, EtherAddress eaddr, SalPort sport, int vid) throws VTNException
ctx
- MD-SAL datastore transaction context.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.true
if the given host is mapped by the MAC mapping.
false
if not mapped.VTNException
- An error occurred.public void transmit(PacketContext pctx, VBridge vbr, Set<PortVlan> sent) throws RedirectFlowException, VTNException
pctx
- A runtime context for a received packet.vbr
- A VBridge
instance that contains this VLAN mapping.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.protected org.slf4j.Logger getLogger()
getLogger
in class VirtualElement<MacMap,MacMapIdentifier>
Logger
instance.public VBridgeMapIdentifier<?> getIdentifier(EtherAddress eaddr, int vid)
getIdentifier
in interface VirtualMapNode
eaddr
- An EtherAddress
instance that specifies the MAC
address of the mapped host.
null
should be treated as if the mapped host is
not specified.vid
- The VLAN ID of the mapped host.public boolean isEnabled()
isEnabled
in interface VirtualMapNode
true
because the MAC mapping cannot be
disabled administratively.public VNodeHop getIngressHop(EtherAddress eaddr, int vid)
VNodeHop
instance that indicates the packet was mapped
by the MAC mapping.getIngressHop
in interface VirtualMapNode
eaddr
- An EtherAddress
instance that specifies the MAC
address of the mapped host.
null
should be treated as if the mapped host is
not specified.vid
- The VLAN ID of the mapped host.VNodeHop
instance.public void disableInput(PacketContext pctx)
disableInput
in interface VirtualMapNode
pctx
- Unused.public void filterPacket(PacketContext pctx, int vid)
The input filters configured in the vBridge should be evaluated
by VBridge
.
filterPacket
in interface VirtualMapNode
pctx
- Unused.vid
- Unused.public PacketContext filterPacket(PacketContext pctx, int vid, VirtualBridge<?> bridge) throws DropFlowException, RedirectFlowException
filterPacket
in interface VirtualMapNode
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.bridge
- A VirtualBridge
instance associated with this
virtual mapping.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.Copyright © 2018 OpenDaylight. All rights reserved.