Class OpenflowPortsUtil
- java.lang.Object
-
- org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil
-
public final class OpenflowPortsUtil extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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(short ofVersion, Long portNumber)
static String
getPortLogicalName(short ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber)
static String
getPortLogicalName(OpenflowVersion ofVersion, Long portNumber)
static String
getPortLogicalName(OpenflowVersion 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(short 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(short 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 Detail
-
getPortLogicalName
public static String getPortLogicalName(short ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber)
-
getPortLogicalName
public static String getPortLogicalName(OpenflowVersion ofVersion, Long portNumber)
-
getPortLogicalName
public static String getPortLogicalName(OpenflowVersion ofVersion, org.opendaylight.yangtools.yang.common.Uint32 portNumber)
-
getProtocolAgnosticPort
public static PortNumberUni getProtocolAgnosticPort(OpenflowVersion ofVersion, Long portNumber)
-
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
public static String portNumberToString(PortNumberUni portNumber)
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(short 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(short version, org.opendaylight.yangtools.yang.common.Uint32 portNumber)
Converts port number to Uri.- Parameters:
version
- openflow versionportNumber
- port number- Returns:
- port number uri
-
-