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 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.tmf
.pcap
.core
.protocol
;
15 import org
.eclipse
.tracecompass
.internal
.pcap
.core
.protocol
.PcapProtocol
;
18 * Enumeration as a TMF wrapper of the different Protocols. To register a
19 * protocol in TMF, it must be present in {@link PcapProtocol} and must have the
22 * @author Vincent Perot
24 public enum TmfPcapProtocol
{
28 * The Pcap Protocol is not a real protocol but is used as an helper to
29 * generate Pcap packets.
31 PCAP(PcapProtocol
.PCAP
),
34 // Should always be empty.
38 * The description of the Ethernet II Protocol.
40 ETHERNET_II(PcapProtocol
.ETHERNET_II
),
44 * The description of the Internet Protocol Version 4.
46 IPV4(PcapProtocol
.IPV4
),
50 * The description of the Transmission Control Protocol.
52 TCP(PcapProtocol
.TCP
),
54 * The description of the User Datagram Protocol.
56 UDP(PcapProtocol
.UDP
),
64 * This protocol is used as an helper if the protocol of a packet is not
65 * recognized. Since all its data goes into payload, it can also be seen as
66 * a "payload packet". This is considered to be on layer 7 since its always
67 * the most encapsulated packet if present.
69 UNKNOWN(PcapProtocol
.UNKNOWN
);
71 private final String fName
;
72 private final String fShortName
;
73 private final boolean fSupportsStream
;
75 private TmfPcapProtocol(PcapProtocol pcapProto
) {
76 fName
= pcapProto
.getName();
77 fShortName
= pcapProto
.getShortName();
78 fSupportsStream
= pcapProto
.supportsStream();
82 * Getter method for the long name of the protocol.
84 * @return The long name of the protocol, as a string.
86 public String
getName() {
91 * Getter method for the short name of the protocol.
93 * @return The short name of the protocol, as a string.
95 public String
getShortName() {
100 * Getter method that indicates if the protocol supports streams.
102 * @return Whether the protocol supports streams or not.
104 public boolean supportsStream() {
105 return fSupportsStream
;
This page took 0.038992 seconds and 5 git commands to generate.