org.projectfloodlight.openflow.protocol.OFMessageReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openflowj Show documentation
Show all versions of openflowj Show documentation
OpenFlowJ API supporting OpenFlow versions 1.0 through 1.5.1, generated by LoxiGen
The newest version!
package org.projectfloodlight.openflow.protocol;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.projectfloodlight.openflow.exceptions.OFParseError;
import io.netty.buffer.ByteBuf;
public interface OFMessageReader {
/** Read the next available openflow message from the given byte buffer.
*
* Returns null if not enough data is available on the byte buffer. Throws OFParseError if a protocol error occurs.
*
* Byte Buffer post-conditions:
*
* - After a successful read, the byte buffer read position is positioned after the last-read message
* - After the method has returned null (indicating an incomplete message), the buffer read position is
* unchanged from the previous attempt (i.e., they next read will attempt to re-read
* from the same position)
* - After OFParseError is thrown, the read position of the byte buffer is undefined.
*
*
* @param bb input byte buffer
* @return the parsed of message or null if not enough data is available in the buffer
* @throws OFParseError if a protocol error occurs.
*/
@Nullable
T readFrom(@Nonnull ByteBuf bb) throws OFParseError;
}