Thomas Vachuska | 7d693f5 | 2014-10-21 19:17:57 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 7d693f5 | 2014-10-21 19:17:57 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Thomas Vachuska | 7d693f5 | 2014-10-21 19:17:57 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame^] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Thomas Vachuska | 7d693f5 | 2014-10-21 19:17:57 -0700 | [diff] [blame] | 15 | */ |
Ray Milkey | 9fdf1ea | 2014-10-21 09:48:02 -0700 | [diff] [blame] | 16 | package org.onlab.onos.cli.net; |
| 17 | |
| 18 | import org.onlab.packet.Ethernet; |
| 19 | |
| 20 | /** |
| 21 | * Allowed values for Ethernet types. Used by the CLI completer for |
| 22 | * connectivity based intent L2 parameters. |
| 23 | */ |
| 24 | public enum EthType { |
| 25 | /** ARP. */ |
| 26 | ARP(Ethernet.TYPE_ARP), |
| 27 | /** RARP. */ |
| 28 | RARP(Ethernet.TYPE_RARP), |
| 29 | /** IPV4. */ |
| 30 | IPV4(Ethernet.TYPE_IPV4), |
| 31 | /** LLDP. */ |
| 32 | LLDP(Ethernet.TYPE_LLDP), |
| 33 | /** BSN. */ |
| 34 | BSN(Ethernet.TYPE_BSN); |
| 35 | |
| 36 | private short value; |
| 37 | |
| 38 | /** |
| 39 | * Constructs an EthType with the given value. |
| 40 | * |
| 41 | * @param value value to use when this EthType is seen. |
| 42 | */ |
| 43 | private EthType(short value) { |
| 44 | this.value = value; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Gets the value to use for this EthType. |
| 49 | * |
| 50 | * @return short value to use for this EthType |
| 51 | */ |
| 52 | public short value() { |
| 53 | return this.value; |
| 54 | } |
| 55 | } |