Java BigInteger Calculate getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, BigInteger serviceMetaData)

Here you can find the source of getMetaDataForLPortDispatcher(int lportTag, short serviceIndex, BigInteger serviceMetaData)

Description

get Meta Data For L Port Dispatcher

License

Open Source License

Declaration

public static BigInteger getMetaDataForLPortDispatcher(int lportTag, short serviceIndex,
            BigInteger serviceMetaData) 

Method Source Code


//package com.java2s;
/*// ww  w . j  a v a  2 s .c  o m
 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

import java.math.BigInteger;

public class Main {
    public static BigInteger getMetaDataForLPortDispatcher(int lportTag, short serviceIndex) {
        return getServiceIndexMetaData(serviceIndex).or(getLportTagMetaData(lportTag));
    }

    public static BigInteger getMetaDataForLPortDispatcher(int lportTag, short serviceIndex,
            BigInteger serviceMetaData) {
        return getServiceIndexMetaData(serviceIndex).or(getLportTagMetaData(lportTag)).or(serviceMetaData);
    }

    public static BigInteger getServiceIndexMetaData(int serviceIndex) {
        return new BigInteger("7", 16).and(BigInteger.valueOf(serviceIndex)).shiftLeft(61);
    }

    public static BigInteger getLportTagMetaData(int lportTag) {
        return new BigInteger("1FFFFF", 16).and(BigInteger.valueOf(lportTag)).shiftLeft(40);
    }
}

Related

  1. getJsonFromBigIntArray(JsonGenerator jg, BigInteger[] array, String pf)
  2. getKeyFromBigInteger(final BigInteger value, final int numBytes)
  3. getKnownDynamicmacFlowRef(short tableId, BigInteger dpId, long lporTag, String macAddress, long elanTag)
  4. getLongAsUnsignedBigInteger(long number)
  5. getMagnitude(BigInteger bi)
  6. getMetaDataMaskForLPortDispatcher(BigInteger metadataMaskForServiceIndex, BigInteger metadataMaskForLPortTag, BigInteger metadataMaskForService)
  7. getN(BigInteger p, BigInteger q)
  8. getNafWeight(BigInteger k)
  9. getNatRouterIdFromMetadata(BigInteger metadata)