Search in sources :

Example 41 with Order

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.order.tlv.Order in project netvirt by opendaylight.

the class OpenFlow13Utils method createActionNxLoadTunIpv4Dst.

public static Action createActionNxLoadTunIpv4Dst(long value, int order) {
    ActionBuilder ab = createActionBuilder(order);
    ab.setAction(nxLoadRegAction(new DstNxTunIpv4DstCaseBuilder().setNxTunIpv4Dst(Boolean.TRUE).build(), BigInteger.valueOf(value), 31, false));
    return ab.build();
}
Also used : OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) DstNxTunIpv4DstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxTunIpv4DstCaseBuilder)

Example 42 with Order

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.order.tlv.Order in project netvirt by opendaylight.

the class OpenFlow13Utils method createActionNxPushNsh.

public static Action createActionNxPushNsh(int order) {
    NxPushNshBuilder builder = new NxPushNshBuilder();
    NxPushNsh nxPushNsh = builder.build();
    ActionBuilder ab = createActionBuilder(order);
    ab.setAction(new NxActionPushNshNodesNodeTableFlowApplyActionsCaseBuilder().setNxPushNsh(nxPushNsh).build());
    return ab.build();
}
Also used : OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) NxActionPushNshNodesNodeTableFlowApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPushNshNodesNodeTableFlowApplyActionsCaseBuilder) NxPushNsh(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.push.nsh.grouping.NxPushNsh) NxPushNshBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.push.nsh.grouping.NxPushNshBuilder)

Example 43 with Order

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.order.tlv.Order in project netvirt by opendaylight.

the class OpenFlow13Utils method createActionNxLoadNsp.

public static Action createActionNxLoadNsp(int value, int order) {
    ActionBuilder ab = createActionBuilder(order);
    ab.setAction(nxLoadRegAction(new DstNxNspCaseBuilder().setNxNspDst(Boolean.TRUE).build(), BigInteger.valueOf(value), 23, false));
    return ab.build();
}
Also used : OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) DstNxNspCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxNspCaseBuilder)

Example 44 with Order

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.order.tlv.Order in project netvirt by opendaylight.

the class PortChainTranslator method buildServiceFunctionChain.

public static ServiceFunctionChain buildServiceFunctionChain(PortChain portChain, List<ServiceFunction> sfList) {
    ServiceFunctionChainBuilder sfcBuilder = new ServiceFunctionChainBuilder();
    sfcBuilder.setName(new SfcName(portChain.getName()));
    sfcBuilder.setKey(new ServiceFunctionChainKey(sfcBuilder.getName()));
    // By default set it to false. If user specify it in chain parameters, it
    // will be overridden.
    sfcBuilder.setSymmetric(false);
    // Set service functions
    List<SfcServiceFunction> sfcSfList = new ArrayList<>();
    for (ServiceFunction sf : sfList) {
        SfcServiceFunctionBuilder sfcSfBuilder = new SfcServiceFunctionBuilder();
        sfcSfBuilder.setName(sf.getName().getValue());
        sfcSfBuilder.setType(sf.getType());
        sfcSfBuilder.setKey(new SfcServiceFunctionKey(sfcSfBuilder.getName()));
        // NOTE: no explicit order is set.
        sfcSfList.add(sfcSfBuilder.build());
    }
    List<ChainParameters> cpList = portChain.getChainParameters();
    if (cpList != null && !cpList.isEmpty()) {
        for (ChainParameters cp : cpList) {
            if (cp.getChainParameter().equals(SYMMETRIC_PARAM)) {
                // Override the symmetric default value.
                sfcBuilder.setSymmetric(Boolean.valueOf(cp.getChainParameterValue()));
                break;
            }
        }
    }
    sfcBuilder.setSfcServiceFunction(sfcSfList);
    return sfcBuilder.build();
}
Also used : SfcName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfcName) SfcServiceFunctionBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.service.function.chain.SfcServiceFunctionBuilder) SfcServiceFunction(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.service.function.chain.SfcServiceFunction) ServiceFunction(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunction) ServiceFunctionChainBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChainBuilder) ArrayList(java.util.ArrayList) ChainParameters(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.port.chain.attributes.ChainParameters) SfcServiceFunction(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.service.function.chain.SfcServiceFunction) ServiceFunctionChainKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChainKey) SfcServiceFunctionKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.service.function.chain.SfcServiceFunctionKey)

Example 45 with Order

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.order.tlv.Order in project netvirt by opendaylight.

the class Ipv6ServiceUtils method getIpv6SolicitedNodeMcastAddress.

public static Ipv6Address getIpv6SolicitedNodeMcastAddress(Ipv6Address ipv6Address) {
    /* According to RFC 4291, a Solicited Node Multicast Address is derived by adding the 24
           lower order bits with the Solicited Node multicast prefix (i.e., FF02::1:FF00:0/104).
           Example: For IPv6Address of FE80::2AA:FF:FE28:9C5A, the corresponding solicited node
           multicast address would be FF02::1:FF28:9C5A
         */
    byte[] octets;
    try {
        octets = InetAddress.getByName(ipv6Address.getValue()).getAddress();
    } catch (UnknownHostException e) {
        LOG.error("getIpv6SolicitedNodeMcastAddress: Failed to serialize ipv6Address ", e);
        return null;
    }
    // Return the address in its fully expanded format.
    Ipv6Address solictedV6Address = new Ipv6Address(InetAddresses.forString("ff02::1:ff" + StringUtils.leftPad(Integer.toHexString(0xFF & octets[13]), 2, "0") + ":" + StringUtils.leftPad(Integer.toHexString(0xFF & octets[14]), 2, "0") + StringUtils.leftPad(Integer.toHexString(0xFF & octets[15]), 2, "0")).getHostAddress());
    return solictedV6Address;
}
Also used : UnknownHostException(java.net.UnknownHostException) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)

Aggregations

ArrayList (java.util.ArrayList)25 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)19 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder)17 VisibleForTesting (com.google.common.annotations.VisibleForTesting)7 Test (org.junit.Test)6 ItemSyncBox (org.opendaylight.openflowplugin.applications.frsync.util.ItemSyncBox)5 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 Batch (org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.Batch)4 BatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.BatchBuilder)4 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)4 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)4 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 HashMap (java.util.HashMap)3 List (java.util.List)3 ExecutionException (java.util.concurrent.ExecutionException)3 Inject (javax.inject.Inject)3 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)3 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)3 TableKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey)3