1 /*******************************************************************************
2 * Copyright (c) 2014 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
.linuxtools
.pcap
.core
.util
;
16 // TODO map to protocol instead of string? that would make more sense imo.
19 * Helper that is used to help mapping a certain linktype to a particular
20 * protocol (i.e. ethernet).
22 * See http://www.tcpdump.org/linktypes.html
24 * @author Vincent Perot
26 public final class LinkTypeHelper
{
29 public static final int LINKTYPE_NULL
= 0;
31 /** Linktype Ethernet II */
32 public static final int LINKTYPE_ETHERNET
= 1;
35 public static final int LINKTYPE_AX25
= 3;
37 /** Linktype IEEE802.5 */
38 public static final int LINKTYPE_IEEE802_5
= 6;
41 public static final int LINKTYPE_RAW
= 101;
43 /** Linktype IEEE802.11 */
44 public static final int LINKTYPE_IEEE802_11
= 105;
46 /** Linktype Linux SLL */
47 public static final int LINKTYPE_LINUX_SLL
= 113;
49 private LinkTypeHelper() {}
52 * Method that match the linktype as an int to a protocol as a string.
55 * The linkType as an int.
56 * @return The protocol as a string.
58 public static String
toString(int linkType
) {
61 return "null"; //$NON-NLS-1$
62 case LINKTYPE_ETHERNET
:
63 return "ethernet"; //$NON-NLS-1$
65 return "ax25"; //$NON-NLS-1$
66 case LINKTYPE_IEEE802_5
:
67 return "ieee802.5"; //$NON-NLS-1$
69 return "raw"; //$NON-NLS-1$
70 case LINKTYPE_IEEE802_11
:
71 return "ieee802.11"; //$NON-NLS-1$
72 case LINKTYPE_LINUX_SLL
:
73 return "linux_sll"; //$NON-NLS-1$
75 return "unknown"; //$NON-NLS-1$
This page took 0.034937 seconds and 5 git commands to generate.