pcap.codec.ndp.NeighborDiscoveryOptions Maven / Gradle / Ivy
/** This code is licenced under the GPL version 2. */
package pcap.codec.ndp;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import pcap.codec.AbstractPacket;
import pcap.codec.Packet;
import pcap.codec.UnknownPacket;
import pcap.common.annotation.Inclubating;
import pcap.common.memory.Memory;
import pcap.common.util.NamedNumber;
import pcap.common.util.Strings;
/** @author Ardika Rommy Sanjaya */
@Inclubating
public class NeighborDiscoveryOptions extends AbstractPacket {
private final Header header;
private final Packet payload;
private final Builder builder;
/**
* Builde Neighbor Discovery Options packet.
*
* @param builder builder.
*/
public NeighborDiscoveryOptions(Builder builder) {
this.header = new Header(builder);
this.payload = null;
payloadBuffer = builder.payloadBuffer;
this.builder = builder;
}
@Override
public Header header() {
return header;
}
@Override
public Packet payload() {
return payload;
}
@Override
public Builder builder() {
return builder;
}
@Override
public Memory buffer() {
return header().buffer();
}
@Override
public String toString() {
return Strings.toStringBuilder(this)
.add("header", header)
.add("payload", payload != null ? payload.getClass().getSimpleName() : "(None)")
.toString();
}
public static class Header extends AbstractPacket.Header {
private final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy