test_class.file: src/agents/apps/floodlight/floodlight-1.2/src/test/java/net/floodlightcontroller/packet/IPv6Test.java
test_class.identifier: IPv6Test
test_case.body: @Test
      public void testDeserialize() throws PacketParsingException {
          byte[] spudPacket = {
                  0x64, 0x2B, 0x16, (byte) 0x95, 0x00, 0x15,
                  0x11, (byte) 0xE1, (byte) 0xFE, (byte) 0x80,
                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                  0x7A, (byte) 0xC5, (byte) 0xFF, (byte) 0xFE,
                  0x2E, 0x77, 0x35, (byte) 0xFE, (byte) 0x80,
                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                  0x77, 0x5D, (byte) 0xFF, (byte) 0xFE,
                  (byte) 0xC2, 0x30, (byte) 0xFD, (byte) 0xD2,
                  0x01, 0x05, 0x7A, 0x00, 0x15, (byte) 0xF6,
                  (byte) 0xC8, (byte) 0xD8, 0x00, 0x00,
                  (byte) 0xD8, 0x4A, (byte) 0xC3, (byte) 0xF2,
                  0x02, 0x44, 0x75, (byte) 0x97, 0x69, 0x40
          };
          IPv6 packet = new IPv6();
          packet.deserialize(spudPacket, 0, spudPacket.length);
          byte[] packetSerialized = packet.serialize();
          assertTrue(Arrays.equals(spudPacket, packetSerialized));
      }
test_case.class_method_signature: IPv6Test.testDeserialize()
test_case.full_signature: @Test public void testDeserialize()
test_case.identifier: testDeserialize
test_case.invocations: deserialize serialize assertTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDeserialize()
focal_class.declarator: nextHeaderClassMap
focal_class.modifier: public static
focal_class.original_string: public static Map<IpProtocol, Class<? extends IPacket>> nextHeaderClassMap;
focal_class.type: Map<IpProtocol, Class<? extends IPacket>>
focal_class.var_name: nextHeaderClassMap
focal_class.declarator: HEADER_LENGTH = 40
focal_class.modifier: public static final
focal_class.original_string: public static final int HEADER_LENGTH = 40;
focal_class.type: int
focal_class.var_name: HEADER_LENGTH
focal_class.declarator: version
focal_class.modifier: protected
focal_class.original_string: protected byte version;
focal_class.type: byte
focal_class.var_name: version
focal_class.declarator: trafficClass
focal_class.modifier: protected
focal_class.original_string: protected byte trafficClass;
focal_class.type: byte
focal_class.var_name: trafficClass
focal_class.declarator: flowLabel
focal_class.modifier: protected
focal_class.original_string: protected int flowLabel;
focal_class.type: int
focal_class.var_name: flowLabel
focal_class.declarator: payloadLength
focal_class.modifier: protected
focal_class.original_string: protected short payloadLength;
focal_class.type: short
focal_class.var_name: payloadLength
focal_class.declarator: nextHeader
focal_class.modifier: protected
focal_class.original_string: protected IpProtocol nextHeader;
focal_class.type: IpProtocol
focal_class.var_name: nextHeader
focal_class.declarator: hopLimit
focal_class.modifier: protected
focal_class.original_string: protected byte hopLimit;
focal_class.type: byte
focal_class.var_name: hopLimit
focal_class.declarator: sourceAddress
focal_class.modifier: protected
focal_class.original_string: protected IPv6Address sourceAddress;
focal_class.type: IPv6Address
focal_class.var_name: sourceAddress
focal_class.declarator: destinationAddress
focal_class.modifier: protected
focal_class.original_string: protected IPv6Address destinationAddress;
focal_class.type: IPv6Address
focal_class.var_name: destinationAddress
focal_class.file: src/agents/apps/floodlight/floodlight-1.2/src/main/java/net/floodlightcontroller/packet/IPv6.java
focal_class.identifier: IPv6
focal_class.class_method_signature: IPv6.IPv6()
focal_class.full_signature: public  IPv6()
focal_class.identifier: IPv6
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  IPv6()
focal_class.class_method_signature: IPv6.getVersion()
focal_class.full_signature: public byte getVersion()
focal_class.identifier: getVersion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getVersion()
focal_class.class_method_signature: IPv6.setVersion(byte version)
focal_class.full_signature: public IPv6 setVersion(byte version)
focal_class.identifier: setVersion
focal_class.modifiers: public
focal_class.parameters: (byte version)
focal_class.return: IPv6
focal_class.signature: IPv6 setVersion(byte version)
focal_class.class_method_signature: IPv6.getTrafficClass()
focal_class.full_signature: public byte getTrafficClass()
focal_class.identifier: getTrafficClass
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getTrafficClass()
focal_class.class_method_signature: IPv6.setTrafficClass(byte trafficClass)
focal_class.full_signature: public IPv6 setTrafficClass(byte trafficClass)
focal_class.identifier: setTrafficClass
focal_class.modifiers: public
focal_class.parameters: (byte trafficClass)
focal_class.return: IPv6
focal_class.signature: IPv6 setTrafficClass(byte trafficClass)
focal_class.class_method_signature: IPv6.getFlowLabel()
focal_class.full_signature: public int getFlowLabel()
focal_class.identifier: getFlowLabel
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getFlowLabel()
focal_class.class_method_signature: IPv6.setFlowLabel(int flowLabel)
focal_class.full_signature: public IPv6 setFlowLabel(int flowLabel)
focal_class.identifier: setFlowLabel
focal_class.modifiers: public
focal_class.parameters: (int flowLabel)
focal_class.return: IPv6
focal_class.signature: IPv6 setFlowLabel(int flowLabel)
focal_class.class_method_signature: IPv6.getPayloadLength()
focal_class.full_signature: public short getPayloadLength()
focal_class.identifier: getPayloadLength
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: short
focal_class.signature: short getPayloadLength()
focal_class.class_method_signature: IPv6.setPayloadLength(short payloadLength)
focal_class.full_signature: public IPv6 setPayloadLength(short payloadLength)
focal_class.identifier: setPayloadLength
focal_class.modifiers: public
focal_class.parameters: (short payloadLength)
focal_class.return: IPv6
focal_class.signature: IPv6 setPayloadLength(short payloadLength)
focal_class.class_method_signature: IPv6.getNextHeader()
focal_class.full_signature: public IpProtocol getNextHeader()
focal_class.identifier: getNextHeader
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IpProtocol
focal_class.signature: IpProtocol getNextHeader()
focal_class.class_method_signature: IPv6.setNextHeader(IpProtocol nextHeader)
focal_class.full_signature: public IPv6 setNextHeader(IpProtocol nextHeader)
focal_class.identifier: setNextHeader
focal_class.modifiers: public
focal_class.parameters: (IpProtocol nextHeader)
focal_class.return: IPv6
focal_class.signature: IPv6 setNextHeader(IpProtocol nextHeader)
focal_class.class_method_signature: IPv6.getHopLimit()
focal_class.full_signature: public byte getHopLimit()
focal_class.identifier: getHopLimit
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getHopLimit()
focal_class.class_method_signature: IPv6.setHopLimit(byte hopLimit)
focal_class.full_signature: public IPv6 setHopLimit(byte hopLimit)
focal_class.identifier: setHopLimit
focal_class.modifiers: public
focal_class.parameters: (byte hopLimit)
focal_class.return: IPv6
focal_class.signature: IPv6 setHopLimit(byte hopLimit)
focal_class.class_method_signature: IPv6.getSourceAddress()
focal_class.full_signature: public IPv6Address getSourceAddress()
focal_class.identifier: getSourceAddress
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IPv6Address
focal_class.signature: IPv6Address getSourceAddress()
focal_class.class_method_signature: IPv6.setSourceAddress(IPv6Address sourceAddress)
focal_class.full_signature: public IPv6 setSourceAddress(IPv6Address sourceAddress)
focal_class.identifier: setSourceAddress
focal_class.modifiers: public
focal_class.parameters: (IPv6Address sourceAddress)
focal_class.return: IPv6
focal_class.signature: IPv6 setSourceAddress(IPv6Address sourceAddress)
focal_class.class_method_signature: IPv6.getDestinationAddress()
focal_class.full_signature: public IPv6Address getDestinationAddress()
focal_class.identifier: getDestinationAddress
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IPv6Address
focal_class.signature: IPv6Address getDestinationAddress()
focal_class.class_method_signature: IPv6.setDestinationAddress(IPv6Address destinationAddress)
focal_class.full_signature: public IPv6 setDestinationAddress(IPv6Address destinationAddress)
focal_class.identifier: setDestinationAddress
focal_class.modifiers: public
focal_class.parameters: (IPv6Address destinationAddress)
focal_class.return: IPv6
focal_class.signature: IPv6 setDestinationAddress(IPv6Address destinationAddress)
focal_class.class_method_signature: IPv6.serialize()
focal_class.full_signature: @Override public byte[] serialize()
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] serialize()
focal_class.class_method_signature: IPv6.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: IPv6.deserialize(byte[] data, int offset, int length)
focal_class.full_signature: @Override public IPacket deserialize(byte[] data, int offset, int length)
focal_class.identifier: deserialize
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] data, int offset, int length)
focal_class.return: IPacket
focal_class.signature: IPacket deserialize(byte[] data, int offset, int length)
focal_class.class_method_signature: IPv6.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: IPv6.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.superclass: extends BasePacket
focal_method.body: @Override
  	public IPacket deserialize(byte[] data, int offset, int length)
  			throws PacketParsingException {
  		// Wrap the data in a byte buffer for easier retrieval.
  		ByteBuffer bb = ByteBuffer.wrap(data, offset, length);
  		// Retrieve values from IPv6 header.
  		byte firstByte = bb.get();
  		byte secondByte = bb.get();
  		this.version = (byte) ((firstByte & 0xF0) >>> 4);
  		if (this.version != 6) {
  			throw new PacketParsingException(
  					"Invalid version for IPv6 packet: " +
  							this.version);
  		}
  		this.trafficClass = (byte) (((firstByte & 0xF) << 4) |
  				((secondByte & 0xF0) >>> 4));
  		this.flowLabel = ((secondByte & 0xF) << 16) |
  				(bb.getShort() & 0xFFFF);
  		this.payloadLength = bb.getShort();
  		this.nextHeader = IpProtocol.of(bb.get());
  		this.hopLimit = bb.get();
  		byte[] sourceAddress = new byte[16];
  		bb.get(sourceAddress, 0, 16);
  		byte[] destinationAddress = new byte[16];
  		bb.get(destinationAddress, 0, 16);
  		this.sourceAddress = IPv6Address.of(sourceAddress);
  		this.destinationAddress = IPv6Address.of(destinationAddress);
  		// Retrieve the payload, if possible.
  		IPacket payload;
  		if (IPv6.nextHeaderClassMap.containsKey(this.nextHeader)) {
  			Class<? extends IPacket> clazz = IPv6.nextHeaderClassMap.get(this.nextHeader);
  			try {
  				payload = clazz.newInstance();
  			} catch (Exception e) {
  				throw new RuntimeException("Error parsing payload for IPv6 packet", e);
  			}
  		} else {
  			payload = new Data();
  		}
  		// Deserialize as much of the payload as we can (hopefully all of it).
  		this.payload = payload.deserialize(data, bb.position(),
  				Math.min(this.payloadLength, bb.limit() - bb.position()));
  		this.payload.setParent(this);
  		// We're done!
  		return this;
  	}
focal_method.class_method_signature: IPv6.deserialize(byte[] data, int offset, int length)
focal_method.full_signature: @Override public IPacket deserialize(byte[] data, int offset, int length)
focal_method.identifier: deserialize
focal_method.invocations: wrap get get getShort getShort of get get get get of of containsKey get newInstance deserialize position min limit position setParent
focal_method.modifiers: @Override public
focal_method.parameters: (byte[] data, int offset, int length)
focal_method.return: IPacket
focal_method.signature: IPacket deserialize(byte[] data, int offset, int length)