use of org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol in project tracecompass by tracecompass.
the class PcapEvent method getDestinationEndpoint.
/**
* Method that returns the destination endpoint at a certain protocol level.
* It returns null if the protocol is inexistent in the PcapEvent.
*
* @param protocol
* The specified protocol
* @return The destination endpoint.
*/
@Nullable
public String getDestinationEndpoint(TmfPcapProtocol protocol) {
PcapProtocol p = ProtocolConversion.unwrap(protocol);
Packet packet = fPacket.getPacket(p);
if (packet == null) {
return null;
}
return packet.getDestinationEndpoint().toString();
}
use of org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol in project tracecompass by tracecompass.
the class PcapEvent method getPayload.
/**
* Method that returns the payload at a certain protocol level. It returns
* null if the protocol is inexistent in the PcapEvent.
*
* @param protocol
* The specified protocol
* @return The payload as a ByteBuffer.
*/
@Nullable
public ByteBuffer getPayload(TmfPcapProtocol protocol) {
PcapProtocol p = ProtocolConversion.unwrap(protocol);
Packet packet = fPacket.getPacket(p);
if (packet == null) {
return null;
}
return packet.getPayload();
}
use of org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol in project tracecompass by tracecompass.
the class PcapEvent method getFields.
/**
* Method that returns an immutable map containing all the fields of a
* packet at a certain protocol. For instance, to get the Source IP Address,
* use:
* <code>event.getFields(TmfProtocol.IPV4).get("Source IP Address");</code>. <br>
* It returns null if the protocol is inexistent in the PcapEvent.
*
* @param protocol
* The specified protocol
* @return A map containing the fields.
*/
@Nullable
public Map<String, String> getFields(TmfPcapProtocol protocol) {
PcapProtocol p = ProtocolConversion.unwrap(protocol);
Packet packet = fPacket.getPacket(p);
if (packet == null) {
return null;
}
return packet.getFields();
}
use of org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol in project tracecompass by tracecompass.
the class PcapEvent method getSourceEndpoint.
/**
* Method that returns the source endpoint at a certain protocol level. It
* returns null if the protocol is inexistent in the PcapEvent.
*
* @param protocol
* The specified protocol
* @return The source endpoint.
*/
@Nullable
public String getSourceEndpoint(TmfPcapProtocol protocol) {
PcapProtocol p = ProtocolConversion.unwrap(protocol);
Packet packet = fPacket.getPacket(p);
if (packet == null) {
return null;
}
return packet.getSourceEndpoint().toString();
}
use of org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol in project tracecompass by tracecompass.
the class PcapEvent method toString.
/**
* Return the signification of the PcapEvent at a specific protocol level.
*
* @param protocol
* The specified protocol.
* @return The signification as a String.
*/
public String toString(TmfPcapProtocol protocol) {
PcapProtocol p = ProtocolConversion.unwrap(protocol);
Packet packet = fPacket.getPacket(p);
if (packet == null) {
return EMPTY_STRING;
}
return packet.getLocalSummaryString();
}
Aggregations