use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.p2p.rev130819.tunnel.p2p.path.cfg.attributes.ExplicitHops in project bgpcep by opendaylight.
the class TunnelProgrammingTest method createExplicitHop.
private static ExplicitHops createExplicitHop(final String ipv4Prefix) {
final ExplicitHopsBuilder explcitHopsBuilder = new ExplicitHopsBuilder();
explcitHopsBuilder.addAugmentation(ExplicitHops1.class, new ExplicitHops1Builder().setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix(ipv4Prefix))).build()).build()).build());
return explcitHopsBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.p2p.rev130819.tunnel.p2p.path.cfg.attributes.ExplicitHops in project bgpcep by opendaylight.
the class TunelProgrammingUtil method buildEro.
public static Ero buildEro(final List<ExplicitHops> explicitHops) {
final EroBuilder b = new EroBuilder();
if (!explicitHops.isEmpty()) {
final List<Subobject> subobjs = new ArrayList<>(explicitHops.size());
for (final ExplicitHops h : explicitHops) {
final ExplicitHops1 h1 = h.getAugmentation(ExplicitHops1.class);
if (h1 != null) {
final SubobjectBuilder sb = new SubobjectBuilder();
sb.fieldsFrom(h1);
sb.setLoose(h.isLoose());
subobjs.add(sb.build());
} else {
LOG.debug("Ignoring unhandled explicit hop {}", h);
}
}
b.setSubobject(subobjs);
}
return b.build();
}
Aggregations