Class PacketUtils
- java.lang.Object
-
- org.opendaylight.openflowplugin.learningswitch.PacketUtils
-
public abstract class PacketUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef
createNodeConnRef(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeInstId, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey nodeKey, String port)
Returns the port wrapped intoNodeConnectorRef
.static byte[]
extractDstMac(byte[] payload)
Extracts the destination MAC address.static byte[]
extractEtherType(byte[] payload)
Extracts the ethernet type.static byte[]
extractSrcMac(byte[] payload)
Extracts the source MAC address.static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
rawMacToMac(byte[] rawMac)
Converts a raw MAC bytes to a MacAddress.
-
-
-
Method Detail
-
extractDstMac
public static byte[] extractDstMac(byte[] payload)
Extracts the destination MAC address.- Parameters:
payload
- the payload bytes- Returns:
- destination MAC address
-
extractSrcMac
public static byte[] extractSrcMac(byte[] payload)
Extracts the source MAC address.- Parameters:
payload
- the payload bytes- Returns:
- source MAC address
-
extractEtherType
public static byte[] extractEtherType(byte[] payload)
Extracts the ethernet type.- Parameters:
payload
- the payload bytes- Returns:
- source MAC address
-
rawMacToMac
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress rawMacToMac(byte[] rawMac)
Converts a raw MAC bytes to a MacAddress.- Parameters:
rawMac
- the raw bytes- Returns:
MacAddress
wrapping string value, baked upon binary MAC address
-
createNodeConnRef
public static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef createNodeConnRef(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeInstId, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey nodeKey, String port)
Returns the port wrapped intoNodeConnectorRef
.
-
-