blob: 30e3986770c23a27a3e3e638258a0202230959dc [file] [log] [blame]
package net.onrc.onos.core.packetservice;
import java.io.Serializable;
import java.util.Arrays;
/**
* A PacketOutNotification contains data sent between ONOS instances that
* directs other instances to send a packet out a set of ports. This is an
* abstract base class that will be subclassed by specific types of
* notifications.
*/
public abstract class PacketOutNotification implements Serializable {
private static final long serialVersionUID = 1L;
private final byte[] packet;
/**
* Class constructor.
*
* @param packet the packet data to send in the packet-out
*/
public PacketOutNotification() {
packet = null;
}
public PacketOutNotification(byte[] packet) {
this.packet = Arrays.copyOf(packet, packet.length);
}
public byte[] getPacketData() {
return Arrays.copyOf(packet, packet.length);
}
}