예제 #1
0
파일: ICMPPacket.java 프로젝트: kreon/jpcap
  /** Fetch the ICMP data as a byte array. */
  public byte[] getICMPData() {
    if (_icmpDataBytes == null) {
      // set data length based on info in headers (note: tcpdump
      //  can return extra junk bytes which bubble up to here
      int dataLen = _bytes.length - _ipOffset - ICMP_HEADER_LEN;

      _icmpDataBytes = PacketEncoding.extractData(_ipOffset, ICMP_HEADER_LEN, _bytes, dataLen);
    }
    return _icmpDataBytes;
  }
예제 #2
0
파일: ICMPPacket.java 프로젝트: kreon/jpcap
 /** Fetch the ICMP header a byte array. */
 public byte[] getICMPHeader() {
   if (_icmpHeaderBytes == null) {
     _icmpHeaderBytes = PacketEncoding.extractHeader(_ipOffset, ICMP_HEADER_LEN, _bytes);
   }
   return _icmpHeaderBytes;
 }