/** 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; }
/** Fetch the ICMP header a byte array. */ public byte[] getICMPHeader() { if (_icmpHeaderBytes == null) { _icmpHeaderBytes = PacketEncoding.extractHeader(_ipOffset, ICMP_HEADER_LEN, _bytes); } return _icmpHeaderBytes; }