1 /*******************************************************************************
2 * Copyright (c) 2014, 2015 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Vincent Perot - Initial API and implementation
11 * Alexandre Montplaisir - Update to new ITmfEventAspect API
12 * Patrick Tasse - Make pcap aspects singletons
13 *******************************************************************************/
15 package org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.core
.event
.aspect
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.core
.event
.PcapEvent
;
19 import org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.core
.protocol
.TmfPcapProtocol
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
.ITmfEventAspect
;
24 * The "packet protocol" aspect for pcap events
26 * @author Alexandre Montplaisir
28 public class PcapProtocolAspect
implements ITmfEventAspect
<String
> {
30 /** Singleton instance */
31 public static final PcapProtocolAspect INSTANCE
= new PcapProtocolAspect();
33 private PcapProtocolAspect() {
37 public String
getName() {
38 return Messages
.getMessage(Messages
.PcapAspectName_Protocol
);
42 public String
getHelpText() {
47 public @Nullable String
resolve(ITmfEvent event
) {
48 if (!(event
instanceof PcapEvent
)) {
51 PcapEvent pcapEvent
= (PcapEvent
) event
;
52 TmfPcapProtocol protocol
= pcapEvent
.getMostEncapsulatedProtocol();
53 return protocol
.getShortName().toUpperCase();