use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.tunnel.optional.params.TunnelOptionsBuilder in project genius by opendaylight.
the class ItmUtils method buildTunnelOptions.
public static List<TunnelOptions> buildTunnelOptions(TunnelEndPoints tep, ItmConfig itmConfig) {
List<TunnelOptions> tunOptions = new ArrayList<>();
String tos = tep.getOptionTunnelTos();
if (tos == null) {
tos = itmConfig.getDefaultTunnelTos();
}
/* populate tos option only if its not default value of 0 */
if (tos != null && !tos.equals("0")) {
TunnelOptionsBuilder optionsBuilder = new TunnelOptionsBuilder();
optionsBuilder.setKey(new TunnelOptionsKey("tos"));
optionsBuilder.setTunnelOption("tos");
optionsBuilder.setValue(tos);
tunOptions.add(optionsBuilder.build());
}
if (tep.getTunnelType() == TunnelTypeVxlan.class && itmConfig.isGpeExtensionEnabled()) {
TunnelOptionsBuilder optionsBuilder = new TunnelOptionsBuilder();
optionsBuilder.setKey(new TunnelOptionsKey("exts"));
optionsBuilder.setTunnelOption("exts");
optionsBuilder.setValue("gpe");
tunOptions.add(optionsBuilder.build());
}
return tunOptions.isEmpty() ? null : tunOptions;
}
Aggregations