Package org.onosproject.net.neighbour
Interface NeighbourMessageContext
-
public interface NeighbourMessageContext
Context of an incoming neighbor message (e.g. ARP, NDP).This includes information about the message accessible through a protocol-agnostic interface, as well as mechanisms to perform an action in response to the incoming message.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
drop()
Drops the incoming message.MacAddress
dstMac()
Gets the destination MAC address of the message.void
flood()
Floods the incoming message out all ports except the input port.void
forward(ConnectPoint outPort)
Forwards the message to a given output port.void
forward(Interface outIntf)
Forwards the message to a given interface.ConnectPoint
inPort()
Gets the port where the packet came in to the network.default boolean
isRouter()
Gets whether this neighbour message context involves a router.Ethernet
packet()
Gets the full parsed representation of the packet.NeighbourProtocol
protocol()
Gets the protocol of the packet.void
reply(MacAddress targetMac)
Replies to the request message with a given MAC address.IpAddress
sender()
Gets the source IP address of the message.default void
setIsRouter(boolean isRouter)
Sets whether this neighbour message context involves a router.MacAddress
srcMac()
Gets the source MAC address of the message.IpAddress
target()
Gets the target IP address of the message.NeighbourMessageType
type()
Gets the message type of the packet.VlanId
vlan()
Gets the vlan of the packet, if any.
-
-
-
Method Detail
-
inPort
ConnectPoint inPort()
Gets the port where the packet came in to the network.- Returns:
- connect point
-
packet
Ethernet packet()
Gets the full parsed representation of the packet.- Returns:
- ethernet header
-
protocol
NeighbourProtocol protocol()
Gets the protocol of the packet.- Returns:
- protocol
-
type
NeighbourMessageType type()
Gets the message type of the packet.- Returns:
- message type
-
vlan
VlanId vlan()
Gets the vlan of the packet, if any.- Returns:
- vlan
-
srcMac
MacAddress srcMac()
Gets the source MAC address of the message.- Returns:
- source MAC address
-
dstMac
MacAddress dstMac()
Gets the destination MAC address of the message.Only valid for reply packets, will be null for request packets.
- Returns:
- target MAC address
-
target
IpAddress target()
Gets the target IP address of the message.- Returns:
- target IP address
-
sender
IpAddress sender()
Gets the source IP address of the message.- Returns:
- source IP address
-
forward
void forward(ConnectPoint outPort)
Forwards the message to a given output port.- Parameters:
outPort
- output port
-
forward
void forward(Interface outIntf)
Forwards the message to a given interface.The message will be modified to fit the parameters of the outgoing interface. For example, if the interface has a VLAN configured, the outgoing packet will have that VLAN tag added.
- Parameters:
outIntf
- output interface
-
reply
void reply(MacAddress targetMac)
Replies to the request message with a given MAC address.- Parameters:
targetMac
- target MAC address
-
flood
void flood()
Floods the incoming message out all ports except the input port.
-
drop
void drop()
Drops the incoming message.
-
isRouter
default boolean isRouter()
Gets whether this neighbour message context involves a router.- Returns:
- true if this neighbour message context involves a router
-
setIsRouter
default void setIsRouter(boolean isRouter)
Sets whether this neighbour message context involves a router.- Parameters:
isRouter
- true if this neighbour message context involves a router
-
-