package frenetic
Install
Dune Dependency
Authors
Maintainers
Sources
md5=baf754df13a759c32f2c86a1b6f328da
sha512=80140900e7009ccab14b25e244fe7edab87d858676f8a4b3799b4fea16825013cf68363fe5faec71dd54ba825bb4ea2f812c2c666390948ab217ffa75d9cbd29
doc/frenetic.kernel/Frenetic_kernel/OpenFlow0x04/index.html
Module Frenetic_kernel.OpenFlow0x04
Source
type errorTyp =
| HelloFailed of helloFailed
| BadRequest of badRequest
| BadAction of badAction
| BadInstruction of badInstruction
| BadMatch of badMatch
| FlowModFailed of flowModFailed
| GroupModFailed of groupModFailed
| PortModFailed of portModFailed
| TableModFailed of tableModFailed
| QueueOpFailed of queueOpFailed
| SwitchConfigFailed of switchConfigFailed
| RoleReqFailed of roleReqFailed
| MeterModFailed of meterModFailed
| TableFeatFailed of tableFeatFailed
| ExperimenterFailed of experimenterFailed
type oxmIPv6ExtHdr = {
noext : bool;
esp : bool;
auth : bool;
dest : bool;
frac : bool;
router : bool;
hop : bool;
unrep : bool;
unseq : bool;
}
type oxm =
| OxmInPort of portId
| OxmInPhyPort of portId
| OxmMetadata of int64 mask
| OxmEthType of Packet.int16
| OxmEthDst of Packet.int48 mask
| OxmEthSrc of Packet.int48 mask
| OxmVlanVId of int12 mask
| OxmVlanPcp of Packet.int8
| OxmIPProto of Packet.int8
| OxmIPDscp of Packet.int8
| OxmIPEcn of Packet.int8
| OxmIP4Src of int32 mask
| OxmIP4Dst of int32 mask
| OxmTCPSrc of Packet.int16
| OxmTCPDst of Packet.int16
| OxmARPOp of Packet.int16
| OxmARPSpa of int32 mask
| OxmARPTpa of int32 mask
| OxmARPSha of Packet.int48 mask
| OxmARPTha of Packet.int48 mask
| OxmICMPType of Packet.int8
| OxmICMPCode of Packet.int8
| OxmMPLSLabel of int32
| OxmMPLSTc of Packet.int8
| OxmTunnelId of int64 mask
| OxmUDPSrc of Packet.int16
| OxmUDPDst of Packet.int16
| OxmSCTPSrc of Packet.int16
| OxmSCTPDst of Packet.int16
| OxmIPv6Src of int128 mask
| OxmIPv6Dst of int128 mask
| OxmIPv6FLabel of int32 mask
| OxmICMPv6Type of Packet.int8
| OxmICMPv6Code of Packet.int8
| OxmIPv6NDTarget of int128 mask
| OxmIPv6NDSll of Packet.int48
| OxmIPv6NDTll of Packet.int48
| OxmMPLSBos of bool
| OxmPBBIsid of int24 mask
| OxmIPv6ExtHdr of oxmIPv6ExtHdr mask
Convenient Functions
marshal_payload buf pkt
serializes pkt, where buf
is an optional buffer ID.
type pseudoPort =
| PhysicalPort of portId
| InPort
(*Send the packet out the input port. This reserved port must be explicitly used in order to send back out of the input port.
*)| Table
(*Submit the packet to the first flow table NB: This destination port can only be used in packet-out messages.
*)| Normal
(*Process with normal L2/L3 switching.
*)| Flood
(*All physical ports in VLAN, except input port and those blocked or link down.
*)| AllPorts
(*All physical ports except input port.
*)| Controller of Packet.int16
(*Send to controller along with
*)n
(max 1024) bytes of the packet| Local
(*Local openflow "port".
*)| Any
(*Wildcard port used only for flow mod (delete) and flow stats requests. Selects all flows regardless of output port (including flows with no output port).
*)
A pseudo-port, as described by the ofp_port_no
enumeration in Section A.2.1 of the OpenFlow 1.3.0 specification.
type action =
| Output of pseudoPort
| Group of groupId
| PopVlan
| PushVlan of Packet.int16
| PopMpls of Packet.int16
| PushMpls of Packet.int16
| SetField of oxm
| CopyTtlOut
| CopyTtlIn
| SetNwTtl of Packet.int8
| DecNwTtl
| PushPbb of Packet.int16
| PopPbb
| SetMplsTtl of Packet.int8
| DecMplsTtl
| SetQueue of int32
| Experimenter of int32
type instruction =
| GotoTable of tableId
| ApplyActions of actionSequence
| WriteActions of actionSequence
| WriteMetadata of int64 mask
| Clear
| Meter of int32
| Experimenter of int32
type bucket = {
bu_weight : Packet.int16;
bu_watch_port : portId option;
bu_watch_group : groupId option;
bu_actions : actionSequence;
}
type flowModFlags = {
fmf_send_flow_rem : bool;
fmf_check_overlap : bool;
fmf_reset_counts : bool;
fmf_no_pkt_counts : bool;
fmf_no_byt_counts : bool;
}
type flowMod = {
mfCookie : int64 mask;
mfTable_id : tableId;
mfCommand : flowModCommand;
mfIdle_timeout : timeout;
mfHard_timeout : timeout;
mfPriority : Packet.int16;
mfBuffer_id : bufferId option;
mfOut_port : pseudoPort option;
mfOut_group : groupId option;
mfFlags : flowModFlags;
mfOfp_match : oxmMatch;
mfInstructions : instruction list;
}
val add_flow :
tbl:tableId ->
prio:Packet.int16 ->
pat:oxmMatch ->
insts:instruction list ->
flowMod
type packetIn = {
pi_total_len : Packet.int16;
pi_reason : packetInReason;
pi_table_id : tableId;
pi_ofp_match : oxmMatch;
pi_payload : payload;
}
type flowRemoved = {
priority : Packet.int16;
reason : flowReason;
table_id : tableId;
duration_sec : int32;
duration_nsec : int32;
idle_timeout : timeout;
hard_timeout : timeout;
packet_count : int64;
byte_count : int64;
oxm : oxmMatch;
}
type capabilities = {
flow_stats : bool;
table_stats : bool;
port_stats : bool;
group_stats : bool;
ip_reasm : bool;
queue_stats : bool;
port_blocked : bool;
}
type portFeatures = {
rate_10mb_hd : bool;
rate_10mb_fd : bool;
rate_100mb_hd : bool;
rate_100mb_fd : bool;
rate_1gb_hd : bool;
rate_1gb_fd : bool;
rate_10gb_fd : bool;
rate_40gb_fd : bool;
rate_100gb_fd : bool;
rate_1tb_fd : bool;
other : bool;
copper : bool;
fiber : bool;
autoneg : bool;
pause : bool;
pause_asym : bool;
}
type portDesc = {
port_no : portId;
hw_addr : Packet.int48;
name : string;
config : portConfig;
state : portState;
curr : portFeatures;
advertised : portFeatures;
supported : portFeatures;
peer : portFeatures;
curr_speed : int32;
max_speed : int32;
}
type portMod = {
mpPortNo : portId;
mpHw_addr : Packet.int48;
mpConfig : portConfig;
mpMask : int32;
mpAdvertise : portFeatures;
}
type packetOut = {
po_payload : payload;
po_port_id : portId option;
po_actions : actionSequence;
}
type meterBand =
| Drop of rate * burst
| DscpRemark of rate * burst * Packet.int8
| ExpMeter of rate * burst * experimenterId
type meterMod = {
command : meterCommand;
flags : meterFlags;
meter_id : int32;
bands : meterBand list;
}
type tableFeatureProp =
| TfpInstruction of instructionHdr list
| TfpInstructionMiss of instructionHdr list
| TfpNextTable of tableId list
| TfpNextTableMiss of tableId list
| TfpWriteAction of actionHdr list
| TfpWriteActionMiss of actionHdr list
| TfpApplyAction of actionHdr list
| TfpApplyActionMiss of actionHdr list
| TfpMatch of oxm list
| TfpWildcard of oxm list
| TfpWriteSetField of oxm list
| TfpWriteSetFieldMiss of oxm list
| TfpApplySetField of oxm list
| TfpApplySetFieldMiss of oxm list
| TfpExperimenter of experimenter * Cstruct.t
| TfpExperimenterMiss of experimenter * Cstruct.t
type tableFeatures = {
length : Packet.int16;
table_id : tableId;
name : string;
metadata_match : int64;
metadata_write : int64;
config : tableConfig;
max_entries : int32;
feature_prop : tableFeatureProp list;
}
type multipartType =
| SwitchDescReq
| PortsDescReq
| FlowStatsReq of flowRequest
| AggregFlowStatsReq of flowRequest
| TableStatsReq
| PortStatsReq of portId
| QueueStatsReq of queueRequest
| GroupStatsReq of int32
| GroupDescReq
| GroupFeatReq
| MeterStatsReq of int32
| MeterConfReq of int32
| MeterFeatReq
| TableFeatReq of tableFeatures list option
| ExperimentReq of experimenter
type flowStats = {
table_id : tableId;
duration_sec : int32;
duration_nsec : int32;
priority : Packet.int16;
idle_timeout : timeout;
hard_timeout : timeout;
flags : flowModFlags;
packet_count : int64;
byte_count : int64;
ofp_match : oxmMatch;
instructions : instruction list;
}
type portStats = {
psPort_no : portId;
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;
duration_sec : int32;
duration_nsec : int32;
}
type groupStats = {
length : Packet.int16;
group_id : int32;
ref_count : int32;
packet_count : int64;
byte_count : int64;
duration_sec : int32;
duration_nsec : int32;
bucket_stats : bucketStats list;
}
type groupDesc = {
length : Packet.int16;
typ : groupType;
group_id : int32;
bucket : bucket list;
}
type actionTypeMap = {
output : bool;
copy_ttl_out : bool;
copy_ttl_in : bool;
set_mpls_ttl : bool;
dec_mpls_ttl : bool;
push_vlan : bool;
pop_vlan : bool;
push_mpls : bool;
pop_mpls : bool;
set_queue : bool;
group : bool;
set_nw_ttl : bool;
dec_nw_ttl : bool;
set_field : bool;
push_pbb : bool;
pop_pbb : bool;
}
type groupFeatures = {
typ : groupTypeMap;
capabilities : groupCapabilities;
max_groups_all : int32;
max_groups_select : int32;
max_groups_indirect : int32;
max_groups_ff : int32;
actions_all : actionTypeMap;
actions_select : actionTypeMap;
actions_indirect : actionTypeMap;
actions_ff : actionTypeMap;
}
type meterStats = {
meter_id : int32;
len : Packet.int16;
flow_count : int32;
packet_in_count : int64;
byte_in_count : int64;
duration_sec : int32;
duration_nsec : int32;
band : meterBandStats list;
}
type meterConfig = {
length : length;
flags : meterFlags;
meter_id : int32;
bands : meterBand list;
}
type meterFeatures = {
max_meter : int32;
band_typ : meterBandMaps;
capabilities : meterFlags;
max_band : Packet.int8;
max_color : Packet.int8;
}
type multipartReplyTyp =
| PortsDescReply of portDesc list
| SwitchDescReply of switchDesc
| FlowStatsReply of flowStats list
| AggregateReply of aggregStats
| TableReply of tableStats list
| TableFeaturesReply of tableFeatures list
| PortStatsReply of portStats list
| QueueStatsReply of queueStats list
| GroupStatsReply of groupStats list
| GroupDescReply of groupDesc list
| GroupFeaturesReply of groupFeatures
| MeterReply of meterStats list
| MeterConfig of meterConfig list
| MeterFeaturesReply of meterFeatures
type queueDesc = {
queue_id : int32;
port : portId;
len : Packet.int16;
properties : queueProp list;
}
type asyncConfig = {
packet_in : packetInReasonMap asyncMask;
port_status : portReasonMap asyncMask;
flow_removed : flowReasonMask asyncMask;
}
type msg_code =
| HELLO
| ERROR
| ECHO_REQ
| ECHO_RESP
| VENDOR
| FEATURES_REQ
| FEATURES_RESP
| GET_CONFIG_REQ
| GET_CONFIG_RESP
| SET_CONFIG
| PACKET_IN
| FLOW_REMOVED
| PORT_STATUS
| PACKET_OUT
| FLOW_MOD
| GROUP_MOD
| PORT_MOD
| TABLE_MOD
| MULTIPART_REQ
| MULTIPART_RESP
| BARRIER_REQ
| BARRIER_RESP
| QUEUE_GET_CONFIG_REQ
| QUEUE_GET_CONFIG_RESP
| ROLE_REQ
| ROLE_RESP
| GET_ASYNC_REQ
| GET_ASYNC_REP
| SET_ASYNC
| METER_MOD
See the ofp_port_config
enumeration in section 7.2.1 of the OpenFlow 1.3.4 specification
See the ofp_port_features
enumeration in section 7.2.1 of the OpenFlow 1.3.4 specification
Flow Match Fields structure. See the section 7.2.3.2 of the OpenFlow 1.3.4 specification
Queue Description structure. See the section 7.2.2 of the OpenFlow 1.3.4 specification
Switch Configuration structure. See the section 7.3.2 of the OpenFlow 1.3.4 specification
Flow Match structure. See the section 7.2.3.1 of the OpenFlow 1.3.4 specification
Action structure. See the section 7.2.5 of the OpenFlow 1.3.4 specification
Bucket structure for use in groups. See the section 7.3.4.2 of OpenFlow 1.3.4 specification
Modify Flow message structure. See the section 7.3.4.1 of the OpenFlow 1.3.4 specification
See the ofp_group_type
enumeration in section 7.3.4.2 of the OpenFlow 1.3.4 specification
Modify Group message structure. See the section 7.3.4.2 of the OpenFlow 1.3.4 specification
Modify Port message structure. See the section 7.3.4.3 of the OpenFlow 1.3.4 specification
Modify Meter message structure. See the section 7.3.4.4 of the OpenFlow 1.3.4 specification
Flow Instruction structure. See the section 7.2.4 of the OpenFlow 1.3.4 specification
Modify flow message structure. See the section 7.3.4.1 of the OpenFlow 1.3.4 specification
See the ofp_capabilities
enumeration in section 7.3.1 of OpenFlow 1.3.4 specification
type switchFeatures = {
datapath_id : int64;
num_buffers : int32;
num_tables : Packet.int8;
aux_id : Packet.int8;
supported_capabilities : capabilities;
}
Switch Features structure. See the section 7.3.1 of the OpenFlow 1.3.4 specification
See the ofp_port_state
enumeration in section 7.2.1 of the OpenFlow 1.3.4 specification
Description of a port structure. See the section 7.3.1 of the OpenFlow 1.3.4 specification
Port Status structure. See the section 7.4.3 of the OpenFlow 1.3.4 specification
Packet received by the datapath and sent to the controller structure. See the section 7.4.1 of the OpenFlow 1.3.4 specification
Packet send out of the datapath structure. See the section 7.3.7 of the OpenFlow 1.3.4 specification
Meter bands structure. See the section 7.3.4.4 of the OpenFlow 1.3.4 specification
Flow Removed structure. See the section 7.4.2 of the OpenFlow 1.3.4 specification
Flow Statistics request structure. See the section 7.3.5.2 of the OpenFlow 1.3.4 specification this structure is the same for indidual and aggregate flow request
Queue Statistics request structure. See the section 7.3.5.8 of the OpenFlow 1.3.4 specification
Table Features property structure. See the section 7.3.5.5.2 of the OpenFlow 1.3.4 specification
Table Feature structure. See the section 7.3.5.5.1 of the OpenFlow 1.3.4 specification
Multipart request message structure. See the section 7.3.5 of the OpenFlow 1.3.4 specification
Group statistics structure. See the section 7.3.5.9 of the OpenFlow 1.3.4 specification
Switch Description structure. See the section 7.3.5.1 of the OpenFlow 1.3.4 specification
Individual Flow Statistics structure. See the section 7.3.5.2 of the OpenFlow 1.3.4 specification
Aggregate Flow Statistics structure. See the section 7.3.5.3 of the OpenFlow 1.3.4 specification
Table Statistics structure. See the section 7.3.5.4 of the OpenFlow 1.3.4 specification
Port Statistics structure. See the section 7.3.5.6 of the OpenFlow 1.3.4 specification
Queue Statistics structure. See the section 7.3.5.8 of the OpenFlow 1.3.4 specification
Group Description structure. See the section 7.3.5.10 of the OpenFlow 1.3.4 specification
Group Features structure. See the section 7.3.5.10 of the OpenFlow 1.3.4 specification
Meter Statistics structure. See the section 7.3.5.12 of the OpenFlow 1.3.4 specification
Meter Configuration structure. See the section 7.3.5.13 of the OpenFlow 1.3.4 specification
Meter Features structure. See the section 7.3.5.14 of the OpenFlow 1.3.4 specification
Multipart reply message structure. See the section 7.3.5 of the OpenFlow 1.3.4 specification
Modify Table message structure. See the section 7.3.3 of the OpenFlow 1.3.4 specification
Queue Configuration request message structure. See the section 7.3.6 of the OpenFlow 1.3.4 specification
Queue Configuration respond message structure. See the section 7.3.6 of the OpenFlow 1.3.4 specification
Error message structure. See the section 7.4.4 of the OpenFlow 1.3.4 specification
Role Request message structure. See the section 7.3.9 of OpenFlow 1.3.4 specification
Hello message structure. See the section 7.5.1 of the OpenFlow 1.3.4 specification
Set Asynchronous message structure. See the section 7.3.10 of OpenFlow 1.3.4 specification