Package org.onosproject.net.intf
Class Interface
- java.lang.Object
-
- org.onosproject.net.intf.Interface
-
public class Interface extends Object
An Interface maps network configuration information (such as addresses and vlans) to a port in the network.
-
-
Field Summary
Fields Modifier and Type Field Description static String
NO_INTERFACE_NAME
-
Constructor Summary
Constructors Constructor Description Interface(String name, ConnectPoint connectPoint, List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan)
Creates new Interface with the provided configuration.Interface(String name, ConnectPoint connectPoint, List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan, org.onlab.packet.VlanId vlanUntagged, Set<org.onlab.packet.VlanId> vlanTagged, org.onlab.packet.VlanId vlanNative)
Creates new Interface with the provided configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectPoint
connectPoint()
Retrieves the connection point that this interface maps to.boolean
equals(Object other)
int
hashCode()
List<InterfaceIpAddress>
ipAddressesList()
Retrieves a list of IP addresses that are assigned to the interface in the order that they were configured.org.onlab.packet.MacAddress
mac()
Retrieves the MAC address that is assigned to the interface.String
name()
Retrieves the name of the interface.String
toString()
org.onlab.packet.VlanId
vlan()
Retrieves the VLAN ID that is assigned to the interface.org.onlab.packet.VlanId
vlanNative()
Retrieves the VLAN ID that is assigned to untagged packets on this tagged interface.Set<org.onlab.packet.VlanId>
vlanTagged()
Retrieves the set of VLAN IDs that are allowed on this interface.org.onlab.packet.VlanId
vlanUntagged()
Retrieves the VLAN ID that is assigned to untagged packets.
-
-
-
Field Detail
-
NO_INTERFACE_NAME
public static final String NO_INTERFACE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Interface
public Interface(String name, ConnectPoint connectPoint, List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan)
Creates new Interface with the provided configuration.- Parameters:
name
- name of the interfaceconnectPoint
- the connect point this interface maps toipAddresses
- list of IP addressesmacAddress
- MAC addressvlan
- VLAN ID
-
Interface
public Interface(String name, ConnectPoint connectPoint, List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan, org.onlab.packet.VlanId vlanUntagged, Set<org.onlab.packet.VlanId> vlanTagged, org.onlab.packet.VlanId vlanNative)
Creates new Interface with the provided configuration.- Parameters:
name
- name of the interfaceconnectPoint
- the connect point this interface maps toipAddresses
- list of IP addressesmacAddress
- MAC addressvlan
- VLAN IDvlanUntagged
- untagged VLAN. Cannot be used with vlanTagged or vlanNative.vlanTagged
- tagged VLANs. Cannot be used with vlanUntagged.vlanNative
- native vLAN. Optional. Can only be used when vlanTagged is specified. Cannot be used with vlanUntagged.
-
-
Method Detail
-
name
public String name()
Retrieves the name of the interface.- Returns:
- name
-
connectPoint
public ConnectPoint connectPoint()
Retrieves the connection point that this interface maps to.- Returns:
- the connection point
-
ipAddressesList
public List<InterfaceIpAddress> ipAddressesList()
Retrieves a list of IP addresses that are assigned to the interface in the order that they were configured.- Returns:
- list of IP addresses
-
mac
public org.onlab.packet.MacAddress mac()
Retrieves the MAC address that is assigned to the interface.- Returns:
- the MAC address
-
vlan
public org.onlab.packet.VlanId vlan()
Retrieves the VLAN ID that is assigned to the interface.- Returns:
- the VLAN ID
-
vlanUntagged
public org.onlab.packet.VlanId vlanUntagged()
Retrieves the VLAN ID that is assigned to untagged packets.- Returns:
- the VLAN ID
-
vlanTagged
public Set<org.onlab.packet.VlanId> vlanTagged()
Retrieves the set of VLAN IDs that are allowed on this interface.- Returns:
- the VLAN ID
-
vlanNative
public org.onlab.packet.VlanId vlanNative()
Retrieves the VLAN ID that is assigned to untagged packets on this tagged interface.- Returns:
- the VLAN ID
-
-