|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.protocols.ip.IPHeader.Option
org.opennms.protocols.ip.IPHeader.RouteOption
This class represents routing options that may be part of an IP header. The route defines a set of IP addresses that a packet may have or should pass though.
Field Summary | |
protected java.util.List |
m_addrs
The list of addresses for the packet to hit on it's way to it's destination |
Fields inherited from class org.opennms.protocols.ip.IPHeader.Option |
CODE_END_OF_OPTION_LIST, CODE_LOOSE_SOURCE_ROUTE, CODE_ROUTE_RECORD, CODE_STRICT_SOURCE_ROUTE, m_code |
Constructor Summary | |
(package private) |
IPHeader.RouteOption(byte code)
Constructs a new, empty instance of the class. |
(package private) |
IPHeader.RouteOption(byte code,
IPv4Address[] addrs)
Constructs a new instance of the class with the passed addresses used for the routing. |
(package private) |
IPHeader.RouteOption(byte code,
java.util.List addrs)
Constructs a new instance of the class with the passed addresses used for the routing. |
Method Summary | |
(package private) void |
add(IPv4Address addr)
Adds an address to the end of the set of addresses to hit on its lan trip |
(package private) int |
bytesRequired()
The number of bytes required to represent this option in an IP header |
java.util.Iterator |
iterator()
Returns the iterator that may be used to look at the encapsulated addresses. |
int |
size()
Returns the number of addresses contained in the option list. |
(package private) int |
writeBytes(byte[] dest,
int offset)
This method is used to serialized the data contained in the option to the passed array, starting at the offset passed. |
Methods inherited from class org.opennms.protocols.ip.IPHeader.Option |
getOptionClass, getOptionNumber, isOptionCopied |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List m_addrs
Constructor Detail |
IPHeader.RouteOption(byte code)
IPHeader.RouteOption(byte code, IPv4Address[] addrs)
addrs
- The list of addresses for the loose source route.
java.lang.IndexOutOfBoundsException
- Thrown if the number of addresses is to large for the
optionIPHeader.RouteOption(byte code, java.util.List addrs)
addrs
- The list of addresses for the loose source route.
java.lang.IndexOutOfBoundsException
- Thrown if the number of addresses is to large for the
optionMethod Detail |
void add(IPv4Address addr)
addr
- The address to add to the loose source route
java.lang.IndexOutOfBoundsException
- Thrown if the address list is fullint bytesRequired()
bytesRequired
in class IPHeader.Option
int writeBytes(byte[] dest, int offset)
writeBytes
in class IPHeader.Option
dest
- The destination bufferoffset
- The offset to start writing data
java.lang.ArrayIndexOutOfBounds
- Thrown if there is not sufficent space in the passed
buffer.public java.util.Iterator iterator()
public int size()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |