exception Unparsable of stringUnparsable msg signals an error in parsing, such as when a bit sequence
has been corrupted.
exception Ignored of stringIgnored msg signals the arrival of a valid OpenFlow message that the
parser is not yet equipped to handle.
type pattern = {dlSrc : Packet.dlAddr option; |
dlDst : Packet.dlAddr option; |
dlTyp : Packet.dlTyp option; |
dlVlan : Packet.dlVlan option; |
dlVlanPcp : Packet.dlVlanPcp option; |
nwSrc : Packet.nwAddr mask option; |
nwDst : Packet.nwAddr mask option; |
nwProto : Packet.nwProto option; |
nwTos : Packet.nwTos option; |
tpSrc : Packet.tpPort option; |
tpDst : Packet.tpPort option; |
inPort : portId option; |
}type pseudoPort = | PhysicalPort of portId |
| InPort |
| Table |
| Normal |
| Flood |
| AllPorts |
| Controller of int |
| Local |
include sig ... endval pseudoPort_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> pseudoPortval sexp_of_pseudoPort : pseudoPort ‑> Ppx_sexp_conv_lib.Sexp.ttype action = | Output of pseudoPort |
| SetDlVlan of Packet.dlVlan |
| SetDlVlanPcp of Packet.dlVlanPcp |
| SetDlSrc of Packet.dlAddr |
| SetDlDst of Packet.dlAddr |
| SetNwSrc of Packet.nwAddr |
| SetNwDst of Packet.nwAddr |
| SetNwTos of Packet.nwTos |
| SetTpSrc of Packet.tpPort |
| SetTpDst of Packet.tpPort |
| Enqueue of pseudoPort * queueId |
include sig ... endval flowModCommand_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> flowModCommandval sexp_of_flowModCommand : flowModCommand ‑> Ppx_sexp_conv_lib.Sexp.ttype flowMod = {command : flowModCommand; |
pattern : pattern; |
priority : Packet.int16; |
actions : action list; |
cookie : int64; |
idle_timeout : timeout; |
hard_timeout : timeout; |
notify_when_removed : bool; |
apply_to_packet : int32 option; |
out_port : pseudoPort option; |
check_overlap : bool; |
}include sig ... endval packetInReason_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> packetInReasonval sexp_of_packetInReason : packetInReason ‑> Ppx_sexp_conv_lib.Sexp.ttype packetIn = {input_payload : payload; |
total_len : Packet.int16; |
port : portId; |
reason : packetInReason; |
}include sig ... endval flowRemovedReason_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> flowRemovedReasonval sexp_of_flowRemovedReason : flowRemovedReason ‑> Ppx_sexp_conv_lib.Sexp.ttype flowRemoved = {pattern : pattern; |
cookie : int64; |
priority : Packet.int16; |
reason : flowRemovedReason; |
duration_sec : int32; |
duration_nsec : int32; |
idle_timeout : timeout; |
packet_count : int64; |
byte_count : int64; |
}include sig ... endval flowRemoved_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> flowRemovedval sexp_of_flowRemoved : flowRemoved ‑> Ppx_sexp_conv_lib.Sexp.ttype request = | DescriptionRequest |
| FlowTableStatsRequest |
| IndividualRequest of statsReq |
| AggregateRequest of statsReq |
| PortRequest of pseudoPort option |
include sig ... endval descriptionStats_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> descriptionStatsval sexp_of_descriptionStats : descriptionStats ‑> Ppx_sexp_conv_lib.Sexp.ttype individualStats = {table_id : Packet.int8; |
of_match : pattern; |
duration_sec : int32; |
duration_nsec : int32; |
priority : Packet.int16; |
idle_timeout : Packet.int16; |
hard_timeout : Packet.int16; |
cookie : int64; |
packet_count : int64; |
byte_count : int64; |
actions : action list; |
}include sig ... endval individualStats_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> individualStatsval sexp_of_individualStats : individualStats ‑> Ppx_sexp_conv_lib.Sexp.tinclude sig ... endval aggregateStats_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> aggregateStatsval sexp_of_aggregateStats : aggregateStats ‑> Ppx_sexp_conv_lib.Sexp.ttype portStats = {port_no : Packet.int16; |
rx_packets : int64; |
tx_packets : int64; |
rx_bytes : int64; |
tx_bytes : int64; |
rx_dropped : int64; |
tx_dropped : int64; |
rx_errors : int64; |
tx_errors : int64; |
rx_frame_err : int64; |
rx_over_err : int64; |
rx_crc_err : int64; |
collisions : int64; |
}type reply = | DescriptionRep of descriptionStats |
| IndividualFlowRep of individualStats list |
| AggregateFlowRep of aggregateStats |
| PortRep of portStats list |
include sig ... endval portConfig_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> portConfigval sexp_of_portConfig : portConfig ‑> Ppx_sexp_conv_lib.Sexp.tinclude sig ... endval portFeatures_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> portFeaturesval sexp_of_portFeatures : portFeatures ‑> Ppx_sexp_conv_lib.Sexp.ttype portDescription = {port_no : portId; |
hw_addr : Packet.dlAddr; |
name : string; |
config : portConfig; |
state : portState; |
curr : portFeatures; |
advertised : portFeatures; |
supported : portFeatures; |
peer : portFeatures; |
}include sig ... endval portDescription_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> portDescriptionval sexp_of_portDescription : portDescription ‑> Ppx_sexp_conv_lib.Sexp.tmodule Wildcards : sig ... endmodule Match : sig ... endmodule PseudoPort : sig ... endmodule Timeout : sig ... endmodule Action : sig ... endmodule FlowMod : sig ... endmodule FlowRemoved : sig ... endmodule PacketOut : sig ... endmodule PortDescription : sig ... endmodule PortStatus : sig ... endmodule SwitchFeatures : sig ... endSwitch features data structure. See Section 5.3.1 of the OpenFlow 1.0 specification.
module SwitchConfig : sig ... endmodule StatsRequest : sig ... endmodule StatsReply : sig ... endmodule Message : sig ... endA subset of the OpenFlow 1.0 messages defined in Section 5.1 of the specification.
In general, each submodule contains pretty-printing functions for the types defined therein. This section defines pretty printers for top-level types.
These exceptions may occur when parsing OpenFlow messages.
val parse_payload : payload ‑> Packet.packetval marshal_payload : int32 option ‑> Packet.packet ‑> payloadmarshal_payload buf pkt serializes pkt, where buf is an optional
buffer ID.
val add_flow : Packet.int16 ‑> pattern ‑> ?idle_to:timeout ‑> ?notify_removed:bool ‑> action list ‑> flowModadd_flow priority pattern action_sequence creates a
FlowMod.t instruction that adds a new flow table entry with
the specified priority, pattern, and action_sequence.
The entry is permanent (i.e., does not timeout), its cookie is zero, etc.
val delete_flow_strict : Packet.int16 ‑> pattern ‑> pseudoPort option ‑> flowModval delete_all_flows : flowModval packetIn_to_string : packetIn ‑> stringval reply_to_string : reply ‑> string