Module Frenetic_kernel.OpenFlow_Header

The first fields of every OpenFlow message, no matter what the version, have the same shape. This is unlikely to change in subsequent OpenFlow versions because there needs to be some standard way to determine the version of each message. So we define that here.

Types and exceptions
type xid = Core.Int32.t
include sig ... end
val xid_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> xid
val sexp_of_xid : xid ‑> Ppx_sexp_conv_lib.Sexp.t
type t = {
version : int;
type_code : int;
length : int;
xid : xid;
}
include sig ... end
val t_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> t
val sexp_of_t : t ‑> Ppx_sexp_conv_lib.Sexp.t
Accessors
val size : int

size returns size of standard OpenFlow header in bytes

Conversion
val parse : Cstruct.t ‑> t

parse pkt takes a message buffer and returns a OpenFlow_Header.t. The message buffer can be a complete OpenFlow raw message yanked from the wire - not just the header.

val marshal : Cstruct.t ‑> t ‑> unit

marshal pkt hdr fills a message buffer with the header fields of a OpenFlow_Header.t. The message buffer can be a complete OpenFlow raw message, with the other stuff possibly filled in.

val to_string : t ‑> string

to_string hdr gives a human-readable, printable rep of a OpenFlow_Header.t