test_class.declarator: pktSerialized = new byte[] {
              // (byte) 0xc8, 0x2a, 0x14, 0x2d, 0x35, (byte) 0xf1,
              // 0x00, 0x0c, 0x29, 0x3b, (byte) 0x95, (byte) 0xf2, 0x08, 0x0,
              0x45, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01,
              (byte) 0xa3, (byte) 0xcb,
              (byte) 0xc0, (byte) 0xa8, (byte) 0x0a, (byte) 0xe7,
              (byte) 0xc0, (byte) 0xa8, (byte) 0x0a, (byte) 0xdb,
              0x08, 0x00, 0x7f, 0x0a, 0x76, (byte) 0xf2, 0x00, 0x02,
              0x01, 0x01, 0x01 }
test_class.modifier: private
test_class.original_string: private byte[] pktSerialized = new byte[] {
              // (byte) 0xc8, 0x2a, 0x14, 0x2d, 0x35, (byte) 0xf1,
              // 0x00, 0x0c, 0x29, 0x3b, (byte) 0x95, (byte) 0xf2, 0x08, 0x0,
              0x45, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01,
              (byte) 0xa3, (byte) 0xcb,
              (byte) 0xc0, (byte) 0xa8, (byte) 0x0a, (byte) 0xe7,
              (byte) 0xc0, (byte) 0xa8, (byte) 0x0a, (byte) 0xdb,
              0x08, 0x00, 0x7f, 0x0a, 0x76, (byte) 0xf2, 0x00, 0x02,
              0x01, 0x01, 0x01 };
test_class.type: byte[]
test_class.var_name: pktSerialized
test_class.file: src/agents/apps/floodlight/floodlight-1.0/src/test/java/net/floodlightcontroller/packet/ICMPTest.java
test_class.identifier: ICMPTest
test_case.body: @Test
      public void testSerialize() {
          IPacket packet = new IPv4()
              .setIdentification((short) 0)
              .setFlags((byte) 0x02)
              .setTtl((byte) 64)
              .setSourceAddress("192.168.10.231")
              .setDestinationAddress("192.168.10.219")
              .setPayload(new ICMP()
                              .setIcmpType((byte) 8)
                              .setIcmpCode((byte) 0)
                              .setPayload(new Data(new byte[]
                                          {0x76, (byte) 0xf2, 0x0, 0x2, 0x1, 0x1, 0x1}))
                         );
          byte[] actual = packet.serialize();
          assertTrue(Arrays.equals(pktSerialized, actual));
      }
test_case.class_method_signature: ICMPTest.testSerialize()
test_case.full_signature: @Test public void testSerialize()
test_case.identifier: testSerialize
test_case.invocations: setPayload setDestinationAddress setSourceAddress setTtl setFlags setIdentification setPayload setIcmpCode setIcmpType serialize assertTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSerialize()
focal_class.declarator: icmpType
focal_class.modifier: protected
focal_class.original_string: protected byte icmpType;
focal_class.type: byte
focal_class.var_name: icmpType
focal_class.declarator: icmpCode
focal_class.modifier: protected
focal_class.original_string: protected byte icmpCode;
focal_class.type: byte
focal_class.var_name: icmpCode
focal_class.declarator: checksum
focal_class.modifier: protected
focal_class.original_string: protected short checksum;
focal_class.type: short
focal_class.var_name: checksum
focal_class.declarator: paddingMap
focal_class.modifier: public static final
focal_class.original_string: public static final Map<Byte, Short> paddingMap;
focal_class.type: Map<Byte, Short>
focal_class.var_name: paddingMap
focal_class.declarator: ECHO_REPLY = 0x0
focal_class.modifier: public static final
focal_class.original_string: public static final byte ECHO_REPLY = 0x0;
focal_class.type: byte
focal_class.var_name: ECHO_REPLY
focal_class.declarator: ECHO_REQUEST = 0x8
focal_class.modifier: public static final
focal_class.original_string: public static final byte ECHO_REQUEST = 0x8;
focal_class.type: byte
focal_class.var_name: ECHO_REQUEST
focal_class.declarator: TIME_EXCEEDED = 0xB
focal_class.modifier: public static final
focal_class.original_string: public static final byte TIME_EXCEEDED = 0xB;
focal_class.type: byte
focal_class.var_name: TIME_EXCEEDED
focal_class.declarator: DESTINATION_UNREACHABLE = 0x3
focal_class.modifier: public static final
focal_class.original_string: public static final byte DESTINATION_UNREACHABLE = 0x3;
focal_class.type: byte
focal_class.var_name: DESTINATION_UNREACHABLE
focal_class.declarator: CODE_PORT_UNREACHABLE = 0x3
focal_class.modifier: public static final
focal_class.original_string: public static final byte CODE_PORT_UNREACHABLE = 0x3;
focal_class.type: byte
focal_class.var_name: CODE_PORT_UNREACHABLE
focal_class.file: src/agents/apps/floodlight/floodlight-1.0/src/main/java/net/floodlightcontroller/packet/ICMP.java
focal_class.identifier: ICMP
focal_class.class_method_signature: ICMP.getIcmpType()
focal_class.full_signature: public byte getIcmpType()
focal_class.identifier: getIcmpType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getIcmpType()
focal_class.class_method_signature: ICMP.setIcmpType(byte icmpType)
focal_class.full_signature: public ICMP setIcmpType(byte icmpType)
focal_class.identifier: setIcmpType
focal_class.modifiers: public
focal_class.parameters: (byte icmpType)
focal_class.return: ICMP
focal_class.signature: ICMP setIcmpType(byte icmpType)
focal_class.class_method_signature: ICMP.getIcmpCode()
focal_class.full_signature: public byte getIcmpCode()
focal_class.identifier: getIcmpCode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getIcmpCode()
focal_class.class_method_signature: ICMP.setIcmpCode(byte icmpCode)
focal_class.full_signature: public ICMP setIcmpCode(byte icmpCode)
focal_class.identifier: setIcmpCode
focal_class.modifiers: public
focal_class.parameters: (byte icmpCode)
focal_class.return: ICMP
focal_class.signature: ICMP setIcmpCode(byte icmpCode)
focal_class.class_method_signature: ICMP.getChecksum()
focal_class.full_signature: public short getChecksum()
focal_class.identifier: getChecksum
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: short
focal_class.signature: short getChecksum()
focal_class.class_method_signature: ICMP.setChecksum(short checksum)
focal_class.full_signature: public ICMP setChecksum(short checksum)
focal_class.identifier: setChecksum
focal_class.modifiers: public
focal_class.parameters: (short checksum)
focal_class.return: ICMP
focal_class.signature: ICMP setChecksum(short checksum)
focal_class.class_method_signature: ICMP.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: ICMP.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: ICMP.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.class_method_signature: ICMP.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.superclass: extends BasePacket
focal_method.body: @Override
      public byte[] serialize() {
          short padding = 0;
          if (paddingMap.containsKey(this.icmpType))
              padding = paddingMap.get(this.icmpType);
  
          int length = 4 + padding;
          byte[] payloadData = null;
          if (payload != null) {
              payload.setParent(this);
              payloadData = payload.serialize();
              length += payloadData.length;
          }
  
          byte[] data = new byte[length];
          ByteBuffer bb = ByteBuffer.wrap(data);
  
          bb.put(this.icmpType);
          bb.put(this.icmpCode);
          bb.putShort(this.checksum);
          for (int i = 0; i < padding; i++)
              bb.put((byte) 0);
  
          if (payloadData != null)
              bb.put(payloadData);
  
          if (this.parent != null && this.parent instanceof IPv4)
              ((IPv4)this.parent).setProtocol(IpProtocol.ICMP);
  
          // compute checksum if needed
          if (this.checksum == 0) {
              bb.rewind();
              int accumulation = 0;
  
              for (int i = 0; i < length / 2; ++i) {
                  accumulation += 0xffff & bb.getShort();
              }
              // pad to an even number of shorts
              if (length % 2 > 0) {
                  accumulation += (bb.get() & 0xff) << 8;
              }
  
              accumulation = ((accumulation >> 16) & 0xffff)
                      + (accumulation & 0xffff);
              this.checksum = (short) (~accumulation & 0xffff);
              bb.putShort(2, this.checksum);
          }
          return data;
      }
focal_method.class_method_signature: ICMP.serialize()
focal_method.full_signature: @Override public byte[] serialize()
focal_method.identifier: serialize
focal_method.invocations: containsKey get setParent serialize wrap put put putShort put put setProtocol rewind getShort get putShort
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: byte[]
focal_method.signature: byte[] serialize()