Package org.onosproject.net.intf
Class Interface
- java.lang.Object
-
- org.onosproject.net.intf.Interface
-
public class Interface extends java.lang.ObjectAn 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 java.lang.StringNO_INTERFACE_NAME
-
Constructor Summary
Constructors Constructor Description Interface(java.lang.String name, ConnectPoint connectPoint, java.util.List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan)Creates new Interface with the provided configuration.Interface(java.lang.String name, ConnectPoint connectPoint, java.util.List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan, org.onlab.packet.VlanId vlanUntagged, java.util.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 ConnectPointconnectPoint()Retrieves the connection point that this interface maps to.booleanequals(java.lang.Object other)inthashCode()java.util.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.MacAddressmac()Retrieves the MAC address that is assigned to the interface.java.lang.Stringname()Retrieves the name of the interface.java.lang.StringtoString()org.onlab.packet.VlanIdvlan()Retrieves the VLAN ID that is assigned to the interface.org.onlab.packet.VlanIdvlanNative()Retrieves the VLAN ID that is assigned to untagged packets on this tagged interface.java.util.Set<org.onlab.packet.VlanId>vlanTagged()Retrieves the set of VLAN IDs that are allowed on this interface.org.onlab.packet.VlanIdvlanUntagged()Retrieves the VLAN ID that is assigned to untagged packets.
-
-
-
Field Detail
-
NO_INTERFACE_NAME
public static final java.lang.String NO_INTERFACE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Interface
public Interface(java.lang.String name, ConnectPoint connectPoint, java.util.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(java.lang.String name, ConnectPoint connectPoint, java.util.List<InterfaceIpAddress> ipAddresses, org.onlab.packet.MacAddress macAddress, org.onlab.packet.VlanId vlan, org.onlab.packet.VlanId vlanUntagged, java.util.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 java.lang.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 java.util.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 java.util.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
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-