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 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
      • 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