use of p4.v1.P4RuntimeOuterClass.StreamMessageRequest in project onos by opennetworkinglab.
the class StreamClientImpl method packetOut.
@Override
public void packetOut(long p4DeviceId, PiPacketOperation packet, PiPipeconf pipeconf) {
checkArgument(this.p4DeviceId == p4DeviceId);
if (!isSessionOpen(p4DeviceId)) {
log.warn("Dropping packet-out request for {}, session is closed", deviceId);
return;
}
if (log.isTraceEnabled()) {
log.trace("Sending packet-out to {}: {}", deviceId, packet);
}
try {
// Encode the PiPacketOperation into a PacketOut
final P4RuntimeOuterClass.PacketOut packetOut = CODECS.packetOut().encode(packet, null, pipeconf);
// Build the request
final StreamMessageRequest packetOutRequest = StreamMessageRequest.newBuilder().setPacket(packetOut).build();
// Send.
streamChannelManager.send(packetOutRequest);
} catch (CodecException e) {
log.error("Unable to send packet-out: {}", e.getMessage());
}
}
Aggregations