2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.compatibility
10 import org.opendaylight.controller.sal.packet.IPluginOutDataPacketService
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived
13 import org.opendaylight.controller.sal.packet.RawPacket
15 class DataPacketAdapter implements PacketProcessingListener {
18 IPluginOutDataPacketService dataPacketPublisher;
20 override onPacketReceived(PacketReceived packet) {
21 val RawPacket inPacket = packet.toRawPacket();
22 dataPacketPublisher.receiveDataPacket(inPacket);
25 public static def RawPacket toRawPacket(PacketReceived received) {
26 val ret = new RawPacket(received.payload);
27 ret.setIncomingNodeConnector(NodeMapping.toADNodeConnector(received.ingress))