blob: c3de14eb91348cb6ae8f391b7ad2e9943fde2fe5 [file] [log] [blame]
Georgios Katsikas83600982017-05-28 20:41:45 +02001/*
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 Katsikas2ebd8a02018-06-27 18:32:50 +020017package org.onosproject.drivers.server.devices.nic;
Georgios Katsikas83600982017-05-28 20:41:45 +020018
19import org.onlab.packet.MacAddress;
20
21import static org.onosproject.net.Port.Type;
22
23/**
24 * Represents an abstraction of a
25 * network interface card (NIC) device in ONOS.
26 */
27public interface NicDevice extends Comparable {
28
29 /**
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020030 * Returns the name of this NIC.
Georgios Katsikas83600982017-05-28 20:41:45 +020031 *
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020032 * @return NIC name
Georgios Katsikas83600982017-05-28 20:41:45 +020033 */
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020034 String name();
Georgios Katsikas83600982017-05-28 20:41:45 +020035
36 /**
37 * Returns the port number of this NIC.
38 *
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020039 * @return NIC port number
Georgios Katsikas83600982017-05-28 20:41:45 +020040 */
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020041 long portNumber();
Georgios Katsikas83600982017-05-28 20:41:45 +020042
43 /**
44 * Returns the type of the port of this NIC.
45 *
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020046 * @return NIC port type
Georgios Katsikas83600982017-05-28 20:41:45 +020047 */
48 Type portType();
49
50 /**
51 * Returns the speed of the NIC in Mbps.
52 *
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020053 * @return NIC speed in Mbps
Georgios Katsikas83600982017-05-28 20:41:45 +020054 */
55 long speed();
56
57 /**
58 * Returns the current status of the NIC.
59 *
Georgios Katsikas80e0b9f2018-07-21 20:29:18 +020060 * @return NIC status (up=true, down=false)
Georgios Katsikas83600982017-05-28 20:41:45 +020061 */
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 Katsikas80e0b9f2018-07-21 20:29:18 +020074 * @return hardware address of the NIC
Georgios Katsikas83600982017-05-28 20:41:45 +020075 */
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}