package frenetic
Install
Dune Dependency
Authors
Maintainers
Sources
md5=baf754df13a759c32f2c86a1b6f328da
sha512=80140900e7009ccab14b25e244fe7edab87d858676f8a4b3799b4fea16825013cf68363fe5faec71dd54ba825bb4ea2f812c2c666390948ab217ffa75d9cbd29
doc/frenetic.kernel/Frenetic_kernel/OpenFlow0x01/index.html
Module Frenetic_kernel.OpenFlow0x01
Source
Unparsable msg
signals an error in parsing, such as when a bit sequence has been corrupted.
Ignored 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 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
type flowMod = {
command : flowModCommand;
pattern : pattern;
priority : Packet.int16;
actions : action list;
idle_timeout : timeout;
hard_timeout : timeout;
notify_when_removed : bool;
apply_to_packet : int32 option;
out_port : pseudoPort option;
check_overlap : bool;
}
type packetIn = {
input_payload : payload;
total_len : Packet.int16;
port : portId;
reason : packetInReason;
}
type flowRemoved = {
pattern : pattern;
priority : Packet.int16;
reason : flowRemovedReason;
duration_sec : int32;
duration_nsec : int32;
idle_timeout : timeout;
packet_count : int64;
byte_count : int64;
}
type statsReq = {
sr_of_match : pattern;
sr_table_id : Packet.int8;
sr_out_port : pseudoPort option;
}
type request =
| DescriptionRequest
| FlowTableStatsRequest
| IndividualRequest of statsReq
| AggregateRequest of statsReq
| PortRequest of pseudoPort option
type 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;
packet_count : int64;
byte_count : int64;
actions : action list;
}
type 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
type wildcards = {
in_port : bool;
dl_vlan : bool;
dl_src : bool;
dl_dst : bool;
dl_type : bool;
nw_proto : bool;
tp_src : bool;
tp_dst : bool;
nw_src : int;
nw_dst : int;
dl_vlan_pcp : bool;
nw_tos : bool;
}
type portConfig = {
down : bool;
no_stp : bool;
no_recv : bool;
no_recv_stp : bool;
no_flood : bool;
no_fwd : bool;
no_packet_in : bool;
}
type portFeatures = {
f_10MBHD : bool;
f_10MBFD : bool;
f_100MBHD : bool;
f_100MBFD : bool;
f_1GBHD : bool;
f_1GBFD : bool;
f_10GBFD : bool;
copper : bool;
fiber : bool;
autoneg : bool;
pause : bool;
pause_asym : bool;
}
type portDescription = {
port_no : portId;
hw_addr : Packet.dlAddr;
name : string;
config : portConfig;
state : portState;
curr : portFeatures;
advertised : portFeatures;
supported : portFeatures;
peer : portFeatures;
}
Switch features data structure. See Section 5.3.1 of the OpenFlow 1.0 specification.
An error message. See Section 5.4.4 of the OpenFlow 1.0 specification.
A VENDOR message. See Section 5.5.4 of the OpenFlow 1.0 specification.
A subset of the OpenFlow 1.0 messages defined in Section 5.1 of the specification.
Pretty printing
In general, each submodule contains pretty-printing functions for the types defined therein. This section defines pretty printers for top-level types.
Parsing exceptions
These exceptions may occur when parsing OpenFlow messages.
Convenient Functions
marshal_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 ->
flowMod
add_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.