blob: 0416a6cb50b6de6f554c2aa4d12cfafb1c335c61 [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
17package org.onosproject.drivers.server.devices;
18
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 /**
30 * Returns the ID of this NIC.
31 *
32 * @return NIC ID
33 */
34 String id();
35
36 /**
37 * Returns the port number of this NIC.
38 *
39 * @return integer port number for the NIC
40 */
41 int port();
42
43 /**
44 * Returns the type of the port of this NIC.
45 *
46 * @return port type
47 */
48 Type portType();
49
50 /**
51 * Returns the speed of the NIC in Mbps.
52 *
53 * @return integer NIC speed in Mbps
54 */
55 long speed();
56
57 /**
58 * Returns the current status of the NIC.
59 *
60 * @return boolean NIC status (up=true, down=false)
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 *
74 * @return MacAddress hardware address of the NIC
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}