Search in sources :

Example 1 with TunnelDescription

use of org.onosproject.net.behaviour.TunnelDescription in project onos by opennetworkinglab.

the class DefaultK8sNodeHandler method createTunnelInterface.

/**
 * Creates a tunnel interface in a given kubernetes node.
 *
 * @param k8sNode       kubernetes node
 */
private void createTunnelInterface(K8sNode k8sNode, String type, String intfName) {
    if (isIntfEnabled(k8sNode, intfName)) {
        return;
    }
    Device device = deviceService.getDevice(k8sNode.ovsdb());
    if (device == null || !device.is(InterfaceConfig.class)) {
        log.error("Failed to create tunnel interface on {}", k8sNode.ovsdb());
        return;
    }
    TunnelDescription tunnelDesc = buildTunnelDesc(k8sNode, type, intfName);
    InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
    ifaceConfig.addTunnelMode(intfName, tunnelDesc);
}
Also used : InterfaceConfig(org.onosproject.net.behaviour.InterfaceConfig) Device(org.onosproject.net.Device) DefaultTunnelDescription(org.onosproject.net.behaviour.DefaultTunnelDescription) TunnelDescription(org.onosproject.net.behaviour.TunnelDescription)

Example 2 with TunnelDescription

use of org.onosproject.net.behaviour.TunnelDescription in project onos by opennetworkinglab.

the class DefaultK8sHostHandler method createTunnelInterface.

private void createTunnelInterface(DeviceId ovsdb, K8sTunnelBridge bridge, String type, String intfName) {
    if (isTunPortEnabled(bridge, intfName)) {
        return;
    }
    Device device = deviceService.getDevice(ovsdb);
    if (device == null || !device.is(InterfaceConfig.class)) {
        log.error("Failed to create tunnel interface on {}", ovsdb);
        return;
    }
    TunnelDescription tunnelDesc = buildTunnelDesc(bridge, type, intfName);
    InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
    ifaceConfig.addTunnelMode(intfName, tunnelDesc);
}
Also used : InterfaceConfig(org.onosproject.net.behaviour.InterfaceConfig) Device(org.onosproject.net.Device) DefaultTunnelDescription(org.onosproject.net.behaviour.DefaultTunnelDescription) TunnelDescription(org.onosproject.net.behaviour.TunnelDescription)

Example 3 with TunnelDescription

use of org.onosproject.net.behaviour.TunnelDescription in project onos by opennetworkinglab.

the class DefaultKubevirtNodeHandler method createTunnelInterface.

/**
 * Creates a tunnel interface in a given kubernetes node.
 *
 * @param node       kubevirt node
 * @param type       kubevirt type
 * @param intfName   tunnel interface name
 */
private void createTunnelInterface(KubevirtNode node, String type, String intfName) {
    if (isIntfEnabled(node, intfName)) {
        return;
    }
    Device device = deviceService.getDevice(node.ovsdb());
    if (device == null || !device.is(InterfaceConfig.class)) {
        log.error("Failed to create tunnel interface on {}", node.ovsdb());
        return;
    }
    TunnelDescription tunnelDesc = buildTunnelDesc(type, intfName);
    InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
    ifaceConfig.addTunnelMode(intfName, tunnelDesc);
}
Also used : InterfaceConfig(org.onosproject.net.behaviour.InterfaceConfig) Device(org.onosproject.net.Device) DefaultTunnelDescription(org.onosproject.net.behaviour.DefaultTunnelDescription) TunnelDescription(org.onosproject.net.behaviour.TunnelDescription)

Example 4 with TunnelDescription

use of org.onosproject.net.behaviour.TunnelDescription in project onos by opennetworkinglab.

the class DefaultOpenstackNodeHandler method createTunnelInterface.

/**
 * Creates a tunnel interface in a given openstack node.
 *
 * @param osNode openstack node
 */
private void createTunnelInterface(OpenstackNode osNode, String type, String intfName) {
    if (isIntfEnabled(osNode, intfName)) {
        return;
    }
    Device device = deviceService.getDevice(osNode.ovsdb());
    if (device == null || !device.is(InterfaceConfig.class)) {
        log.error("Failed to create tunnel interface on {}", osNode.ovsdb());
        return;
    }
    TunnelDescription tunnelDesc = buildTunnelDesc(type, intfName);
    InterfaceConfig ifaceConfig = device.as(InterfaceConfig.class);
    ifaceConfig.addTunnelMode(intfName, tunnelDesc);
}
Also used : InterfaceConfig(org.onosproject.net.behaviour.InterfaceConfig) Device(org.onosproject.net.Device) DefaultTunnelDescription(org.onosproject.net.behaviour.DefaultTunnelDescription) TunnelDescription(org.onosproject.net.behaviour.TunnelDescription)

Aggregations

Device (org.onosproject.net.Device)4 DefaultTunnelDescription (org.onosproject.net.behaviour.DefaultTunnelDescription)4 InterfaceConfig (org.onosproject.net.behaviour.InterfaceConfig)4 TunnelDescription (org.onosproject.net.behaviour.TunnelDescription)4