Class OpenflowPortsUtil
java.lang.Object
org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil
Class which integrates the port constants defined and used by MDSAL and the ports defined in openflow java
This class is responsible for converting MDSAL given logical names to port numbers and back.
Any newer version of openflow can have a similar mapping or can/should be extended.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkPortValidity
(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) Checks port validity.static org.opendaylight.yangtools.yang.common.Uint32
getMaxPortForVersion
(OpenflowVersion ofVersion) static String
getPortLogicalName
(OpenflowVersion ofVersion, Long portNumber) static String
getPortLogicalName
(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) static String
getPortLogicalName
(org.opendaylight.yangtools.yang.common.Uint8 ofVersion, Long portNumber) static String
getPortLogicalName
(org.opendaylight.yangtools.yang.common.Uint8 ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) static PortNumberUni
getProtocolAgnosticPort
(OpenflowVersion ofVersion, Long portNumber) static PortNumberUni
getProtocolAgnosticPort
(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri
getProtocolAgnosticPortUri
(org.opendaylight.yangtools.yang.common.Uint8 version, long portNumber) Converts port number to Uri.static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri
getProtocolAgnosticPortUri
(org.opendaylight.yangtools.yang.common.Uint8 version, org.opendaylight.yangtools.yang.common.Uint32 portNumber) Converts port number to Uri.static org.opendaylight.yangtools.yang.common.Uint32
getProtocolPortNumber
(OpenflowVersion ofVersion, PortNumberUni port) static boolean
isPortReserved
(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) static String
portNumberToString
(PortNumberUni portNumber) Converts a port number to a string.
-
Method Details
-
getPortLogicalName
-
getPortLogicalName
public static String getPortLogicalName(org.opendaylight.yangtools.yang.common.Uint8 ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) -
getPortLogicalName
-
getPortLogicalName
public static String getPortLogicalName(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) -
getProtocolAgnosticPort
-
getProtocolAgnosticPort
public static PortNumberUni getProtocolAgnosticPort(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) -
getProtocolPortNumber
public static org.opendaylight.yangtools.yang.common.Uint32 getProtocolPortNumber(OpenflowVersion ofVersion, PortNumberUni port) -
getMaxPortForVersion
public static org.opendaylight.yangtools.yang.common.Uint32 getMaxPortForVersion(OpenflowVersion ofVersion) -
isPortReserved
public static boolean isPortReserved(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) -
checkPortValidity
public static boolean checkPortValidity(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber) Checks port validity.- Parameters:
ofVersion
- OpenFlow version of the switchportNumber
- port number- Returns:
- true if port number is valid for given protocol version
-
portNumberToString
Converts a port number to a string.- Parameters:
portNumber
- port number- Returns:
- string containing number or logical name
-
getProtocolAgnosticPortUri
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri getProtocolAgnosticPortUri(org.opendaylight.yangtools.yang.common.Uint8 version, long portNumber) Converts port number to Uri.- Parameters:
version
- openflow versionportNumber
- port number- Returns:
- port number uri
-
getProtocolAgnosticPortUri
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri getProtocolAgnosticPortUri(org.opendaylight.yangtools.yang.common.Uint8 version, org.opendaylight.yangtools.yang.common.Uint32 portNumber) Converts port number to Uri.- Parameters:
version
- openflow versionportNumber
- port number- Returns:
- port number uri
-