Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 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 |
| 7 | * |
| 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. |
| 15 | */ |
| 16 | |
Georgios Katsikas | 2ebd8a0 | 2018-06-27 18:32:50 +0200 | [diff] [blame] | 17 | package org.onosproject.drivers.server.devices.nic; |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 18 | |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | |
| 21 | import static org.onosproject.net.Port.Type; |
| 22 | |
| 23 | /** |
| 24 | * Represents an abstraction of a |
| 25 | * network interface card (NIC) device in ONOS. |
| 26 | */ |
| 27 | public interface NicDevice extends Comparable { |
| 28 | |
| 29 | /** |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 30 | * Returns the name of this NIC. |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 31 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 32 | * @return NIC name |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 33 | */ |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 34 | String name(); |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Returns the port number of this NIC. |
| 38 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 39 | * @return NIC port number |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 40 | */ |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 41 | long portNumber(); |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Returns the type of the port of this NIC. |
| 45 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 46 | * @return NIC port type |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 47 | */ |
| 48 | Type portType(); |
| 49 | |
| 50 | /** |
| 51 | * Returns the speed of the NIC in Mbps. |
| 52 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 53 | * @return NIC speed in Mbps |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 54 | */ |
| 55 | long speed(); |
| 56 | |
| 57 | /** |
| 58 | * Returns the current status of the NIC. |
| 59 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 60 | * @return NIC status (up=true, down=false) |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 61 | */ |
| 62 | boolean status(); |
| 63 | |
| 64 | /** |
| 65 | * Sets the current status of the NIC. |
| 66 | * |
| 67 | * @param status boolean NIC status (up=true, down=false) |
| 68 | */ |
| 69 | void setStatus(boolean status); |
| 70 | |
| 71 | /** |
| 72 | * Returns the MAC address of the NIC. |
| 73 | * |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame^] | 74 | * @return hardware address of the NIC |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 75 | */ |
| 76 | MacAddress macAddress(); |
| 77 | |
| 78 | /** |
| 79 | * Returns the Rx filter mechanisms supported by the NIC. |
| 80 | * |
| 81 | * @return Rx filter mechanisms |
| 82 | */ |
| 83 | NicRxFilter rxFilterMechanisms(); |
| 84 | |
| 85 | /** |
| 86 | * Sets the Rx filter mechanisms supported by the NIC. |
| 87 | * |
| 88 | * @param rxFilterMechanisms Rx filter mechanisms |
| 89 | */ |
| 90 | void setRxFilterMechanisms(NicRxFilter rxFilterMechanisms); |
| 91 | |
| 92 | /** |
| 93 | * Adds a new Rx filter to the NIC. |
| 94 | * |
| 95 | * @param rxFilter an Rx filter to be added to the set |
| 96 | */ |
| 97 | void addRxFilterMechanism(NicRxFilter.RxFilter rxFilter); |
| 98 | |
| 99 | } |