Class MetaDataUtil
- java.lang.Object
-
- org.opendaylight.genius.mdsalutil.MetaDataUtil
-
public final class MetaDataUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.opendaylight.yangtools.yang.common.Uint64
METADA_MASK_TUNNEL_ID
static org.opendaylight.yangtools.yang.common.Uint64
METADA_MASK_VALID_TUNNEL_ID_BIT_AND_TUNNEL_ID
static int
METADATA_ELAN_TAG_BITLEN
static int
METADATA_ELAN_TAG_OFFSET
static int
METADATA_LPORT_TAG_BITLEN
static int
METADATA_LPORT_TAG_OFFSET
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_ACL_CONNTRACK_CLASSIFIER_TYPE
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_ACL_DROP
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_ELAN_SUBNET_ROUTE
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_LABEL_ITM
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_LPORT_TAG
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_LPORT_TAG_SH_FLAG
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_POLICY_CLASSIFER_ID
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_REMOTE_ACL_TAG
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_SERVICE
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_SERVICE_INDEX
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_SERVICE_SH_FLAG
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_SH_FLAG
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_SUBNET_ROUTE
static org.opendaylight.yangtools.yang.common.Uint64
METADATA_MASK_VRFID
static int
METADATA_VPN_ID_BITLEN
static int
METADATA_VPN_ID_OFFSET
static int
REG6_END_INDEX
static org.opendaylight.yangtools.yang.common.Uint64
REG6_MASK_REMOTE_DPN
static int
REG6_START_INDEX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opendaylight.yangtools.yang.common.Uint64
getAclConntrackClassifierTypeFromMetaData(org.opendaylight.yangtools.yang.common.Uint64 conntrackClassifierType)
Gets the ACL conntrack classifier type from meta data.
Second bit in metadata is used for this purpose.static org.opendaylight.yangtools.yang.common.Uint64
getAclDropMetaData(org.opendaylight.yangtools.yang.common.Uint64 dropFlag)
static long
getElanMaskForReg()
static int
getElanTagFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static org.opendaylight.yangtools.yang.common.Uint64
getElanTagMetadata(long elanTag)
static org.opendaylight.yangtools.yang.common.Uint64
getInterfaceTypeForReg6(int tunnelType)
static org.opendaylight.yangtools.yang.common.Uint64
getLportFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static org.opendaylight.yangtools.yang.common.Uint64
getLportTagForReg6(int lportTag)
static long
getLportTagMaskForReg6()
static org.opendaylight.yangtools.yang.common.Uint64
getLportTagMetaData(int lportTag)
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataForLPortDispatcher(int lportTag, short serviceIndex)
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, org.opendaylight.yangtools.yang.common.Uint64 serviceMetaData)
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, org.opendaylight.yangtools.yang.common.Uint64 serviceMetaData, boolean isSHFlagSet)
static org.opendaylight.yangtools.yang.common.Uint64
getMetadataLPort(int portTag)
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataMaskForLPortDispatcher()
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataMaskForLPortDispatcher(org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForLPortTag)
static org.opendaylight.yangtools.yang.common.Uint64
getMetaDataMaskForLPortDispatcher(org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForServiceIndex, org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForLPortTag, org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForService)
static long
getNatRouterIdFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static long
getPolicyClassifierFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static org.opendaylight.yangtools.yang.common.Uint64
getPolicyClassifierMetaData(long classifier)
static long
getReg6ValueForLPortDispatcher(int lportTag, short serviceIndex)
static long
getReg6ValueForLPortDispatcher(int lportTag, short serviceIndex, short interfaceType)
Utility to fetch the register value for lport dispatcher table.static long
getRemoteDpnMaskForEgressTunnelTable()
static long
getRemoteDpnMetadatForEgressTunnelTable(long remoteDpnId)
static org.opendaylight.yangtools.yang.common.Uint64
getServiceIndexForReg6(int serviceIndex)
static org.opendaylight.yangtools.yang.common.Uint64
getServiceIndexMetaData(int serviceIndex)
static int
getServiceTagFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static org.opendaylight.yangtools.yang.common.Uint64
getTunnelIdWithValidVniBitAndVniSet(int vni)
For the tunnel id with VNI and valid-vni-flag set, the most significant byte should have 08.static long
getVpnIdFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
static long
getVpnIdMaskForReg()
static org.opendaylight.yangtools.yang.common.Uint64
getVpnIdMetadata(long vrfId)
static org.opendaylight.yangtools.yang.common.Uint64
getWriteMetaDataMaskForDispatcherTable()
static org.opendaylight.yangtools.yang.common.Uint64
getWriteMetaDataMaskForEgressDispatcherTable()
static org.opendaylight.yangtools.yang.common.Uint64
mergeMetadataMask(org.opendaylight.yangtools.yang.common.Uint64 mask, org.opendaylight.yangtools.yang.common.Uint64 mask2)
static org.opendaylight.yangtools.yang.common.Uint64
mergeMetadataValues(org.opendaylight.yangtools.yang.common.Uint64 metadata, org.opendaylight.yangtools.yang.common.Uint64 metadata2)
-
-
-
Field Detail
-
METADATA_MASK_LPORT_TAG
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_LPORT_TAG
-
METADATA_MASK_SERVICE
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_SERVICE
-
METADATA_MASK_SERVICE_INDEX
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_SERVICE_INDEX
-
METADATA_MASK_VRFID
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_VRFID
-
METADATA_MASK_REMOTE_ACL_TAG
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_REMOTE_ACL_TAG
-
METADATA_MASK_POLICY_CLASSIFER_ID
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_POLICY_CLASSIFER_ID
-
METADA_MASK_VALID_TUNNEL_ID_BIT_AND_TUNNEL_ID
public static final org.opendaylight.yangtools.yang.common.Uint64 METADA_MASK_VALID_TUNNEL_ID_BIT_AND_TUNNEL_ID
-
METADATA_MASK_LABEL_ITM
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_LABEL_ITM
-
METADA_MASK_TUNNEL_ID
public static final org.opendaylight.yangtools.yang.common.Uint64 METADA_MASK_TUNNEL_ID
-
METADATA_MASK_SERVICE_SH_FLAG
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_SERVICE_SH_FLAG
-
METADATA_MASK_LPORT_TAG_SH_FLAG
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_LPORT_TAG_SH_FLAG
-
METADATA_MASK_SH_FLAG
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_SH_FLAG
-
METADATA_MASK_ELAN_SUBNET_ROUTE
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_ELAN_SUBNET_ROUTE
-
METADATA_MASK_SUBNET_ROUTE
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_SUBNET_ROUTE
-
METADATA_MASK_ACL_CONNTRACK_CLASSIFIER_TYPE
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_ACL_CONNTRACK_CLASSIFIER_TYPE
-
METADATA_MASK_ACL_DROP
public static final org.opendaylight.yangtools.yang.common.Uint64 METADATA_MASK_ACL_DROP
-
REG6_MASK_REMOTE_DPN
public static final org.opendaylight.yangtools.yang.common.Uint64 REG6_MASK_REMOTE_DPN
-
METADATA_LPORT_TAG_OFFSET
public static final int METADATA_LPORT_TAG_OFFSET
- See Also:
- Constant Field Values
-
METADATA_LPORT_TAG_BITLEN
public static final int METADATA_LPORT_TAG_BITLEN
- See Also:
- Constant Field Values
-
METADATA_ELAN_TAG_OFFSET
public static final int METADATA_ELAN_TAG_OFFSET
- See Also:
- Constant Field Values
-
METADATA_ELAN_TAG_BITLEN
public static final int METADATA_ELAN_TAG_BITLEN
- See Also:
- Constant Field Values
-
METADATA_VPN_ID_OFFSET
public static final int METADATA_VPN_ID_OFFSET
- See Also:
- Constant Field Values
-
METADATA_VPN_ID_BITLEN
public static final int METADATA_VPN_ID_BITLEN
- See Also:
- Constant Field Values
-
REG6_START_INDEX
public static final int REG6_START_INDEX
- See Also:
- Constant Field Values
-
REG6_END_INDEX
public static final int REG6_END_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMetaDataForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataForLPortDispatcher(int lportTag, short serviceIndex)
-
getMetaDataForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, org.opendaylight.yangtools.yang.common.Uint64 serviceMetaData)
-
getMetaDataForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, org.opendaylight.yangtools.yang.common.Uint64 serviceMetaData, boolean isSHFlagSet)
-
getPolicyClassifierMetaData
public static org.opendaylight.yangtools.yang.common.Uint64 getPolicyClassifierMetaData(long classifier)
-
getServiceIndexMetaData
public static org.opendaylight.yangtools.yang.common.Uint64 getServiceIndexMetaData(int serviceIndex)
-
getLportTagMetaData
public static org.opendaylight.yangtools.yang.common.Uint64 getLportTagMetaData(int lportTag)
-
getMetaDataMaskForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataMaskForLPortDispatcher()
-
getMetaDataMaskForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataMaskForLPortDispatcher(org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForLPortTag)
-
getMetaDataMaskForLPortDispatcher
public static org.opendaylight.yangtools.yang.common.Uint64 getMetaDataMaskForLPortDispatcher(org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForServiceIndex, org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForLPortTag, org.opendaylight.yangtools.yang.common.Uint64 metadataMaskForService)
-
getMetadataLPort
public static org.opendaylight.yangtools.yang.common.Uint64 getMetadataLPort(int portTag)
-
getLportFromMetadata
public static org.opendaylight.yangtools.yang.common.Uint64 getLportFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getElanTagFromMetadata
public static int getElanTagFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getPolicyClassifierFromMetadata
public static long getPolicyClassifierFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getElanTagMetadata
public static org.opendaylight.yangtools.yang.common.Uint64 getElanTagMetadata(long elanTag)
-
getServiceTagFromMetadata
public static int getServiceTagFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getTunnelIdWithValidVniBitAndVniSet
public static org.opendaylight.yangtools.yang.common.Uint64 getTunnelIdWithValidVniBitAndVniSet(int vni)
For the tunnel id with VNI and valid-vni-flag set, the most significant byte should have 08. So, shifting 08 to 7 bytes (56 bits) and the result is OR-ed with VNI being shifted to 1 byte.- Parameters:
vni
- virtual network id- Returns:
- TunnelId
-
getNatRouterIdFromMetadata
public static long getNatRouterIdFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getAclConntrackClassifierTypeFromMetaData
public static org.opendaylight.yangtools.yang.common.Uint64 getAclConntrackClassifierTypeFromMetaData(org.opendaylight.yangtools.yang.common.Uint64 conntrackClassifierType)
Gets the ACL conntrack classifier type from meta data.
Second bit in metadata is used for this purpose.
Conntrack supported traffic is identified by value 0 (0000 in binary) i.e., 0x0/0x2
Non-conntrack supported traffic is identified by value 2 (0010 in binary) i.e., 0x2/0x2- Parameters:
conntrackClassifierType
- the conntrack classifier flag- Returns:
- the acl conntrack classifier flag from meta data
-
getAclDropMetaData
public static org.opendaylight.yangtools.yang.common.Uint64 getAclDropMetaData(org.opendaylight.yangtools.yang.common.Uint64 dropFlag)
-
getVpnIdMetadata
public static org.opendaylight.yangtools.yang.common.Uint64 getVpnIdMetadata(long vrfId)
-
getVpnIdFromMetadata
public static long getVpnIdFromMetadata(org.opendaylight.yangtools.yang.common.Uint64 metadata)
-
getWriteMetaDataMaskForDispatcherTable
public static org.opendaylight.yangtools.yang.common.Uint64 getWriteMetaDataMaskForDispatcherTable()
-
getWriteMetaDataMaskForEgressDispatcherTable
public static org.opendaylight.yangtools.yang.common.Uint64 getWriteMetaDataMaskForEgressDispatcherTable()
-
getLportTagForReg6
public static org.opendaylight.yangtools.yang.common.Uint64 getLportTagForReg6(int lportTag)
-
getServiceIndexForReg6
public static org.opendaylight.yangtools.yang.common.Uint64 getServiceIndexForReg6(int serviceIndex)
-
getInterfaceTypeForReg6
public static org.opendaylight.yangtools.yang.common.Uint64 getInterfaceTypeForReg6(int tunnelType)
-
getReg6ValueForLPortDispatcher
public static long getReg6ValueForLPortDispatcher(int lportTag, short serviceIndex)
-
getReg6ValueForLPortDispatcher
public static long getReg6ValueForLPortDispatcher(int lportTag, short serviceIndex, short interfaceType)
Utility to fetch the register value for lport dispatcher table. Register6 used for service binding will have first 4 bits of service-index, next 20 bits for lportTag, and next 4 bits for interface-type- Parameters:
lportTag
- lport tag of interfaceserviceIndex
- serviceIndex of interfaceinterfaceType
- type of interface- Returns:
- reg6 value of lport dispatcher
-
getRemoteDpnMetadatForEgressTunnelTable
public static long getRemoteDpnMetadatForEgressTunnelTable(long remoteDpnId)
-
getRemoteDpnMaskForEgressTunnelTable
public static long getRemoteDpnMaskForEgressTunnelTable()
-
getLportTagMaskForReg6
public static long getLportTagMaskForReg6()
-
getElanMaskForReg
public static long getElanMaskForReg()
-
getVpnIdMaskForReg
public static long getVpnIdMaskForReg()
-
mergeMetadataValues
public static org.opendaylight.yangtools.yang.common.Uint64 mergeMetadataValues(org.opendaylight.yangtools.yang.common.Uint64 metadata, org.opendaylight.yangtools.yang.common.Uint64 metadata2)
-
mergeMetadataMask
public static org.opendaylight.yangtools.yang.common.Uint64 mergeMetadataMask(org.opendaylight.yangtools.yang.common.Uint64 mask, org.opendaylight.yangtools.yang.common.Uint64 mask2)
-
-