use of org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent in project tracecompass by tracecompass.
the class PcapDestinationAspect method resolve.
@Override
@Nullable
public String resolve(ITmfEvent event) {
if (!(event instanceof PcapEvent)) {
return null;
}
PcapEvent pcapEvent = (PcapEvent) event;
TmfPcapProtocol protocol = pcapEvent.getMostEncapsulatedProtocol();
return pcapEvent.getDestinationEndpoint(protocol);
}
use of org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent in project tracecompass by tracecompass.
the class PcapProtocolAspect method resolve.
@Override
@Nullable
public String resolve(ITmfEvent event) {
if (!(event instanceof PcapEvent)) {
return null;
}
PcapEvent pcapEvent = (PcapEvent) event;
TmfPcapProtocol protocol = pcapEvent.getMostEncapsulatedProtocol();
return protocol.getShortName().toUpperCase();
}
use of org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent in project tracecompass by tracecompass.
the class PcapSourceAspect method resolve.
@Override
@Nullable
public String resolve(ITmfEvent event) {
if (!(event instanceof PcapEvent)) {
return null;
}
PcapEvent pcapEvent = (PcapEvent) event;
TmfPcapProtocol protocol = pcapEvent.getMostEncapsulatedProtocol();
return pcapEvent.getSourceEndpoint(protocol);
}
use of org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent in project tracecompass by tracecompass.
the class StreamListAnalysis method executeAnalysis.
@Override
protected boolean executeAnalysis(@Nullable IProgressMonitor monitor) throws TmfAnalysisException {
IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor);
ITmfTrace trace = getTrace();
if (trace == null) {
/* This analysis was cancelled in the meantime */
return false;
}
ITmfEventRequest request = fRequest;
if ((request != null) && (!request.isCompleted())) {
request.cancel();
}
request = new TmfEventRequest(PcapEvent.class, TmfTimeRange.ETERNITY, 0L, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND) {
@Override
public void handleData(ITmfEvent data) {
// Called for each event
super.handleData(data);
if (!(data instanceof PcapEvent)) {
return;
}
PcapEvent event = (PcapEvent) data;
for (Map.Entry<TmfPcapProtocol, TmfPacketStreamBuilder> entry : fBuilders.entrySet()) {
entry.getValue().addEventToStream(event);
}
}
};
trace.sendRequest(request);
fRequest = request;
try {
request.waitForCompletion();
} catch (InterruptedException e) {
// Request was canceled.
return false;
}
return !mon.isCanceled() && !request.isCancelled() && !request.isFailed();
}
use of org.eclipse.tracecompass.internal.tmf.pcap.core.event.PcapEvent in project tracecompass by tracecompass.
the class PcapTraceTest method testParseEvent.
/**
* Test the parseEvent() method
*/
@Test
public void testParseEvent() {
ITmfContext ctx = fFixture.seekEvent(0);
fFixture.getNext(ctx);
PcapEvent event = fFixture.parseEvent(ctx);
assertNotNull(event);
}
Aggregations