Class MetaDataUtil


  • public final class MetaDataUtil
    extends java.lang.Object
    • 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
    • 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 interface
        serviceIndex - serviceIndex of interface
        interfaceType - 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)