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();
}
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();
}
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();
}
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();
}
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;
}
Aggregations