org.jnetpcap.packet
Interface JPayloadAccessor
- All Known Implementing Classes:
- AbstractMessageHeader, Arp, Ethernet, Html, Http, Icmp, Icmp.DestinationUnreachable, Icmp.Echo, Icmp.EchoReply, Icmp.EchoRequest, Icmp.ParamProblem, Icmp.Redirect, Icmp.Reserved, Icmp.SourceQuench, IEEE802dot1q, IEEE802dot2, IEEE802dot3, IEEESnap, Ip4, Ip4.AddressExtension, Ip4.Encode, Ip4.ExperimentalAccessControl, Ip4.ExperimentalFlowControl, Ip4.ExperimentalMeasurement, Ip4.ExtendedIp, Ip4.IMITrafficDescriptor, Ip4.IpOption, Ip4.LooseSourceRoute, Ip4.MtuProbe, Ip4.MtuReply, Ip4.NoOp, Ip4.RecordRoute, Ip4.RouterAlert, Ip4.Routing, Ip4.Security, Ip4.SelectiveDirectedBroadcastMode, Ip4.StreamId, Ip4.StrictSourceRoute, Ip4.Timestamp, Ip4.Traceroute, Ip6, JHeader, JHeaderMap, JMappedHeader, JSubHeader, L2TP, Payload, PPP, Rip, Rip1, Rip1.EntryV1, Rip2, Rip2.EntryV2, Rtp, Rtp.Extension, Sdp, Sip, SLL, Tcp, Tcp.AlternateChecksum, Tcp.AlternateChecksumRequest, Tcp.MSS, Tcp.NoOp, Tcp.SACK, Tcp.SACK_PERMITTED, Tcp.TcpOption, Tcp.Timestamp, Tcp.WindowScale, Udp, WebImage
public interface JPayloadAccessor
Interface which provides access to payload portion of the packet data. When
considered from a header's perspective, each header has a raw payload
portion, which may be other headers. The remaining, undecoded data at the end
of the packet is simply payload of the last header.
- Author:
- Mark Bednarczyk, Sly Technologies, Inc.
|
Method Summary |
byte[] |
getPayload()
Retrieves the playload data portion of the packet right after the current
header. |
JBuffer |
peerPayloadTo(JBuffer buffer)
Peers, without copy, the user supplied buffer with payload data portion of
the packet right after the current header. |
byte[] |
transferPayloadTo(byte[] buffer)
Copies the payload data portion of the packet right after the current
header to user supplied buffer. |
java.nio.ByteBuffer |
transferPayloadTo(java.nio.ByteBuffer buffer)
Copies into the user supplied buffer, the payload data portion of the
packet right after the current header. |
JBuffer |
transferPayloadTo(JBuffer buffer)
Copies into the user supplied buffer, the payload data portion of the
packet right after the current header. |
getPayload
byte[] getPayload()
- Retrieves the playload data portion of the packet right after the current
header.
- Returns:
- newly allocated byte array containing copy of the contents of the
header's payload from the packet.
transferPayloadTo
byte[] transferPayloadTo(byte[] buffer)
- Copies the payload data portion of the packet right after the current
header to user supplied buffer.
- Parameters:
buffer - buffer where the data will be written to
- Returns:
- the same buffer that was passed in
peerPayloadTo
JBuffer peerPayloadTo(JBuffer buffer)
- Peers, without copy, the user supplied buffer with payload data portion of
the packet right after the current header.
- Parameters:
buffer - buffer to peer the data with
- Returns:
- the same buffer that was passed in
transferPayloadTo
JBuffer transferPayloadTo(JBuffer buffer)
- Copies into the user supplied buffer, the payload data portion of the
packet right after the current header.
- Parameters:
buffer - buffer to copy the data to
- Returns:
- the same buffer that was passed in
transferPayloadTo
java.nio.ByteBuffer transferPayloadTo(java.nio.ByteBuffer buffer)
- Copies into the user supplied buffer, the payload data portion of the
packet right after the current header. The copy will start at the current
ByteBuffer position property.
- Parameters:
buffer - buffer to copy the data to
- Returns:
- the same buffer that was passed in