Package org.onosproject.net.intf
Interface InterfaceService
-
- All Superinterfaces:
ListenerService<InterfaceEvent,InterfaceListener>
public interface InterfaceService extends ListenerService<InterfaceEvent,InterfaceListener>
Service for interacting with interfaces.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Interface
getInterfaceByName(ConnectPoint connectPoint, java.lang.String name)
Returns the interface with the given name.java.util.Set<Interface>
getInterfaces()
Returns the set of all interfaces in the system.java.util.Set<Interface>
getInterfacesByIp(IpAddress ip)
Returns the set of interfaces with the given IP address.java.util.Set<Interface>
getInterfacesByPort(ConnectPoint port)
Returns the set of interfaces configured on the given port.java.util.Set<Interface>
getInterfacesByVlan(VlanId vlan)
Returns the set of interfaces in the given VLAN.Interface
getMatchingInterface(IpAddress ip)
Returns an interface that has an address that is in the same subnet as the given IP address.java.util.Set<Interface>
getMatchingInterfaces(IpAddress ip)
Returns all interfaces that have an address that is in the same subnet as the given IP address.default VlanId
getNativeVlanId(ConnectPoint connectPoint)
Returns native VLAN configured on given connect point.default java.util.Set<VlanId>
getTaggedVlanId(ConnectPoint connectPoint)
Returns tagged VLAN configured on given connect point.default VlanId
getUntaggedVlanId(ConnectPoint connectPoint)
Returns untagged VLAN configured on given connect point.default boolean
inUse(VlanId vlanId)
Returns true if given vlanId is in use due to configuration on any of the interfaces in the system.default boolean
isConfigured(ConnectPoint connectPoint)
Returns true if given connectPoint has an IP address or vlan configured on any of its interfaces.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
getInterfaces
java.util.Set<Interface> getInterfaces()
Returns the set of all interfaces in the system.- Returns:
- set of interfaces
-
getInterfaceByName
Interface getInterfaceByName(ConnectPoint connectPoint, java.lang.String name)
Returns the interface with the given name.- Parameters:
connectPoint
- connect point of the interfacename
- name of the interface- Returns:
- interface if it exists, otherwise null
-
getInterfacesByPort
java.util.Set<Interface> getInterfacesByPort(ConnectPoint port)
Returns the set of interfaces configured on the given port.- Parameters:
port
- connect point- Returns:
- set of interfaces
-
getInterfacesByIp
java.util.Set<Interface> getInterfacesByIp(IpAddress ip)
Returns the set of interfaces with the given IP address.- Parameters:
ip
- IP address- Returns:
- set of interfaces
-
getInterfacesByVlan
java.util.Set<Interface> getInterfacesByVlan(VlanId vlan)
Returns the set of interfaces in the given VLAN.- Parameters:
vlan
- VLAN ID of the interfaces- Returns:
- set of interfaces
-
getMatchingInterface
Interface getMatchingInterface(IpAddress ip)
Returns an interface that has an address that is in the same subnet as the given IP address.- Parameters:
ip
- IP address to find matching subnet interface for- Returns:
- interface
-
getMatchingInterfaces
java.util.Set<Interface> getMatchingInterfaces(IpAddress ip)
Returns all interfaces that have an address that is in the same subnet as the given IP address.- Parameters:
ip
- IP address to find matching subnet interface for- Returns:
- a set of interfaces
-
getUntaggedVlanId
default VlanId getUntaggedVlanId(ConnectPoint connectPoint)
Returns untagged VLAN configured on given connect point.Only returns the first match if there are multiple untagged VLAN configured on the connect point.
- Parameters:
connectPoint
- connect point- Returns:
- untagged VLAN or null if not configured
-
getTaggedVlanId
default java.util.Set<VlanId> getTaggedVlanId(ConnectPoint connectPoint)
Returns tagged VLAN configured on given connect point.Returns all matches if there are multiple tagged VLAN configured on the connect point.
- Parameters:
connectPoint
- connect point- Returns:
- tagged VLAN or empty set if not configured
-
getNativeVlanId
default VlanId getNativeVlanId(ConnectPoint connectPoint)
Returns native VLAN configured on given connect point.Only returns the first match if there are multiple native VLAN configured on the connect point.
- Parameters:
connectPoint
- connect point- Returns:
- native VLAN or null if not configured
-
isConfigured
default boolean isConfigured(ConnectPoint connectPoint)
Returns true if given connectPoint has an IP address or vlan configured on any of its interfaces.- Parameters:
connectPoint
- the port on a device- Returns:
- true if connectpoint has a configured interface
-
inUse
default boolean inUse(VlanId vlanId)
Returns true if given vlanId is in use due to configuration on any of the interfaces in the system.- Parameters:
vlanId
- the vlan id being queried- Returns:
- true if vlan is configured on any interface
-
-