use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class PolicyServiceUtil method getTunnelUnderlayNetwork.
public String getTunnelUnderlayNetwork(BigInteger dpId, IpAddress tunnelIp) {
Node ovsdbNode = bridgeManager.getBridgeNode(dpId);
if (ovsdbNode == null) {
LOG.error("Failed to get OVSDB node for DPN {}", dpId);
return null;
}
Map<String, String> localIpMap = bridgeManager.getOpenvswitchOtherConfigMap(ovsdbNode, LOCAL_IPS);
return localIpMap.get(String.valueOf(tunnelIp.getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class QosNeutronUtils method setPortDscpMarking.
public void setPortDscpMarking(Port port, DscpmarkingRules dscpMark) {
if (!qosEosHandler.isQosClusterOwner()) {
LOG.trace("Not Qos Cluster Owner. Ignoring setting DSCP marking");
return;
}
LOG.trace("Setting DSCP value {} on Port {}", port, dscpMark);
BigInteger dpnId = getDpnForInterface(port.getUuid().getValue());
String ifName = port.getUuid().getValue();
IpAddress ipAddress = port.getFixedIps().get(0).getIpAddress();
Short dscpValue = dscpMark.getDscpMark();
if (dpnId.equals(BigInteger.ZERO)) {
LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
return;
}
// 1. OF rules
addFlow(dpnId, dscpValue, ifName, ipAddress, getInterfaceStateFromOperDS(ifName));
if (qosServiceConfiguredPorts.add(port.getUuid())) {
// bind qos service to interface
bindservice(ifName);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class L2GatewayUtils method createItmTunnels.
protected static void createItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName, IpAddress tunnelIp) {
AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
builder.setIpAddress(tunnelIp);
try {
Future<RpcResult<Void>> result = itmRpcService.addL2GwDevice(builder.build());
RpcResult<Void> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
LOG.info("Created ITM tunnels for {}", hwvtepId);
} else {
LOG.error("Failed to create ITM Tunnels: {}", rpcResult.getErrors());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("RPC to create ITM tunnels failed", e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method addPort__Ipv4FixedIps.
@Test
public void addPort__Ipv4FixedIps() throws Exception {
PortBuilder pb = new PortBuilder();
pb.setUuid(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setNetworkId(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
IpAddress ipv4 = new IpAddress(new Ipv4Address("2.2.2.2"));
FixedIpsBuilder fib = new FixedIpsBuilder();
fib.setIpAddress(ipv4);
List<FixedIps> fixedIps = new ArrayList<>();
fixedIps.add(fib.build());
pb.setFixedIps(fixedIps);
Port port = pb.build();
neutronPortChangeListener.add(InstanceIdentifier.create(Port.class), port);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method addPort__Ipv6FixedIps.
@Test
public void addPort__Ipv6FixedIps() throws Exception {
PortBuilder pb = new PortBuilder();
pb.setUuid(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setNetworkId(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
IpAddress ipv6 = new IpAddress(new Ipv6Address("1::1"));
FixedIpsBuilder fib = new FixedIpsBuilder();
fib.setIpAddress(ipv6);
List<FixedIps> fixedIps = new ArrayList<>();
fixedIps.add(fib.build());
pb.setFixedIps(fixedIps);
Port port = pb.build();
neutronPortChangeListener.add(InstanceIdentifier.create(Port.class), port);
}
Aggregations