Package org.onosproject.net.neighbour
Interface NeighbourMessageContext
-
public interface NeighbourMessageContextContext 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 voiddrop()Drops the incoming message.MacAddressdstMac()Gets the destination MAC address of the message.voidflood()Floods the incoming message out all ports except the input port.voidforward(ConnectPoint outPort)Forwards the message to a given output port.voidforward(Interface outIntf)Forwards the message to a given interface.ConnectPointinPort()Gets the port where the packet came in to the network.default booleanisRouter()Gets whether this neighbour message context involves a router.Ethernetpacket()Gets the full parsed representation of the packet.NeighbourProtocolprotocol()Gets the protocol of the packet.voidreply(MacAddress targetMac)Replies to the request message with a given MAC address.IpAddresssender()Gets the source IP address of the message.default voidsetIsRouter(boolean isRouter)Sets whether this neighbour message context involves a router.MacAddresssrcMac()Gets the source MAC address of the message.IpAddresstarget()Gets the target IP address of the message.NeighbourMessageTypetype()Gets the message type of the packet.VlanIdvlan()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
-
-