@Override public IpV6TrafficClass newInstance(byte[] rawData, int offset, int length) { ByteArrays.validateBounds(rawData, offset, length); return IpV6SimpleTrafficClass.newInstance(rawData[offset]); }
/** * @param value value * @return a new IpV6SimpleTrafficClass object. */ public static IpV6SimpleTrafficClass newInstance(byte value) { return new IpV6SimpleTrafficClass(value); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!this.getClass().isInstance(obj)) { return false; } return (getClass().cast(obj)).value() == this.value; }
ipV6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.IPV6_FRAG)
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!this.getClass().isInstance(obj)) { return false; } return (getClass().cast(obj)).value() == this.value; }
/** * @param value value * @return a new IpV6SimpleTrafficClass object. */ public static IpV6SimpleTrafficClass newInstance(byte value) { return new IpV6SimpleTrafficClass(value); }
@Override public IpV6TrafficClass newInstance(byte[] rawData, int offset, int length) { ByteArrays.validateBounds(rawData, offset, length); return IpV6SimpleTrafficClass.newInstance(rawData[offset]); }
@Override protected Packet getWholePacket() { Inet6Address srcAddr; Inet6Address dstAddr; try { srcAddr = (Inet6Address) InetAddress.getByName("2001:db8::3:2:1"); dstAddr = (Inet6Address) InetAddress.getByName("2001:db8::3:2:2"); } catch (UnknownHostException e) { throw new AssertionError(); } IpV6Packet.Builder IpV6b = new IpV6Packet.Builder(); IpV6b.version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.SCTP) .hopLimit((byte) 100) .srcAddr(srcAddr) .dstAddr(dstAddr) .payloadBuilder(packet.getBuilder()) .correctLengthAtBuild(true); EthernetPacket.Builder eb = new EthernetPacket.Builder(); eb.dstAddr(MacAddress.getByName("fe:00:00:00:00:02")) .srcAddr(MacAddress.getByName("fe:00:00:00:00:01")) .type(EtherType.IPV6) .payloadBuilder(IpV6b) .paddingAtBuild(true); return eb.build(); }
public IpV6PacketTest() throws Exception { this.version = IpVersion.IPV6; this.trafficClass = IpV6SimpleTrafficClass.newInstance((byte) 0x12); this.flowLabel = IpV6SimpleFlowLabel.newInstance(0x12345); this.payloadLength = (short) 12;
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)
ipv6b .version(IpVersion.IPV6) .trafficClass(IpV6SimpleTrafficClass.newInstance((byte) 0x12)) .flowLabel(IpV6SimpleFlowLabel.newInstance(0x12345)) .nextHeader(IpNumber.ICMPV6)