Search in sources :

Example 1 with PacketProgrammable

use of org.onosproject.net.packet.PacketProgrammable in project onos by opennetworkinglab.

the class P4RuntimePacketProvider method emit.

@Override
public void emit(OutboundPacket packet) {
    if (packet != null) {
        DeviceId deviceId = packet.sendThrough();
        Device device = deviceService.getDevice(deviceId);
        if (device.is(PacketProgrammable.class) && mastershipService.isLocalMaster(deviceId)) {
            PacketProgrammable packetProgrammable = device.as(PacketProgrammable.class);
            packetProgrammable.emit(packet);
        } else {
            log.warn("No PacketProgrammable behavior for device {}", deviceId);
        }
    }
}
Also used : DeviceId(org.onosproject.net.DeviceId) Device(org.onosproject.net.Device) PacketProgrammable(org.onosproject.net.packet.PacketProgrammable)

Aggregations

Device (org.onosproject.net.Device)1 DeviceId (org.onosproject.net.DeviceId)1 PacketProgrammable (org.onosproject.net.packet.PacketProgrammable)1