Package org.onosproject.segmentrouting
Class SegmentRoutingNeighbourHandler
- java.lang.Object
-
- org.onosproject.segmentrouting.SegmentRoutingNeighbourHandler
-
- Direct Known Subclasses:
ArpHandler,IcmpHandler
public class SegmentRoutingNeighbourHandler extends Object
This handler provides provides useful functions to the neighbour handlers (ARP, NDP).
-
-
Field Summary
Fields Modifier and Type Field Description protected DeviceConfigurationconfigprotected SegmentRoutingManagersrManager
-
Constructor Summary
Constructors Constructor Description SegmentRoutingNeighbourHandler()Creates an SegmentRoutingNeighbourHandler object.SegmentRoutingNeighbourHandler(SegmentRoutingManager srManager)Creates an SegmentRoutingNeighbourHandler object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidflood(org.onlab.packet.Ethernet packet, org.onosproject.net.ConnectPoint inPort, org.onlab.packet.IpAddress targetAddress)Flood to all ports in the same subnet.protected voidflood(org.onosproject.net.neighbour.NeighbourMessageContext pkt)protected booleangetSenderInfo(byte[] mac, byte[] ip, org.onosproject.net.DeviceId deviceId, org.onlab.packet.IpAddress targetAddress)Retrieve router (device) info.protected booleanrespondToUnknownHosts()Reads the boolean configuration for responding to unknown hosts.protected voidsendResponse(org.onosproject.net.neighbour.NeighbourMessageContext pkt, org.onlab.packet.MacAddress targetMac, org.onosproject.net.host.HostService hostService, boolean isRouter)Utility to send a ND reply using the supplied information.
-
-
-
Field Detail
-
srManager
protected SegmentRoutingManager srManager
-
config
protected DeviceConfiguration config
-
-
Constructor Detail
-
SegmentRoutingNeighbourHandler
public SegmentRoutingNeighbourHandler(SegmentRoutingManager srManager)
Creates an SegmentRoutingNeighbourHandler object.- Parameters:
srManager- SegmentRoutingManager object
-
SegmentRoutingNeighbourHandler
public SegmentRoutingNeighbourHandler()
Creates an SegmentRoutingNeighbourHandler object.
-
-
Method Detail
-
getSenderInfo
protected boolean getSenderInfo(byte[] mac, byte[] ip, org.onosproject.net.DeviceId deviceId, org.onlab.packet.IpAddress targetAddress)Retrieve router (device) info.- Parameters:
mac- where to copy the macip- where to copy the ipdeviceId- the device idtargetAddress- the target address- Returns:
- true if it was possible to get the necessary info. False for errors
-
respondToUnknownHosts
protected boolean respondToUnknownHosts()
Reads the boolean configuration for responding to unknown hosts.- Returns:
- respondToUnknownHosts boolean.
-
sendResponse
protected void sendResponse(org.onosproject.net.neighbour.NeighbourMessageContext pkt, org.onlab.packet.MacAddress targetMac, org.onosproject.net.host.HostService hostService, boolean isRouter)Utility to send a ND reply using the supplied information.- Parameters:
pkt- the requesttargetMac- the target machostService- the host serviceisRouter- true if this reply is sent on behalf of a router
-
flood
protected void flood(org.onlab.packet.Ethernet packet, org.onosproject.net.ConnectPoint inPort, org.onlab.packet.IpAddress targetAddress)Flood to all ports in the same subnet.- Parameters:
packet- packet to be floodedinPort- where the packet comes fromtargetAddress- the target address
-
flood
protected void flood(org.onosproject.net.neighbour.NeighbourMessageContext pkt)
-
-