Class IPHeader.LooseSourceRouteOption

Enclosing class:
IPHeader

public static final class IPHeader.LooseSourceRouteOption extends IPHeader.RouteOption
This class represents the loose source routing options that may be part of an IP header. The loose source route defines a set of IP addresses that a packet should pass though. As the packet reaches each address the packet is forwarded to the next element in the route.
  • Constructor Details

    • LooseSourceRouteOption

      public LooseSourceRouteOption(IPv4Address[] addrs)
      Constructs a new instance of the class with the passed addresses used for the routing. If the set of addresses is larger than the option can hold an exception is thrown.
      Parameters:
      addrs - The list of addresses for the loose source route.
      Throws:
      IndexOutOfBoundsException - Thrown if the number of addresses is to large for the option
    • LooseSourceRouteOption

      public LooseSourceRouteOption(List<IPv4Address> addrs)
      Constructs a new instance of the class with the passed addresses used for the routing. If the set of addresses is larger than the option can hold an exception is thrown.
      Parameters:
      addrs - The list of addresses for the loose source route.
      Throws:
      IndexOutOfBoundsException - Thrown if the number of addresses is to large for the option