@@ -6636,6 +6636,75 @@ end
6636
6636
6637
6637
module AsyncConfig = struct
6638
6638
6639
+ module PacketIn = struct
6640
+ type t = packetInReasonMap
6641
+
6642
+ let to_string (t : t ) =
6643
+ Format. sprintf " { table_miss = %B; apply_action = %B; invalid_ttl = %B }"
6644
+ t.table_miss
6645
+ t.apply_action
6646
+ t.invalid_ttl
6647
+
6648
+ let marshal (t : t ) : int8 =
6649
+ (if t.table_miss then 1 lsl 0 else 0 ) lor
6650
+ (if t.apply_action then 1 lsl 1 else 0 ) lor
6651
+ (if t.invalid_ttl then 1 lsl 2 else 0 )
6652
+
6653
+ let parse bits : t =
6654
+ { table_miss = test_bit16 0 bits
6655
+ ; apply_action = test_bit16 1 bits
6656
+ ; invalid_ttl = test_bit16 2 bits}
6657
+
6658
+ end
6659
+
6660
+ module PortStatus = struct
6661
+
6662
+ type t = portReasonMap
6663
+
6664
+ let to_string (t : t ) =
6665
+ Format. sprintf " { add = %B; delete = %B; modify = %B }"
6666
+ t.add
6667
+ t.delete
6668
+ t.modify
6669
+
6670
+ let marshal (t : t ) : int8 =
6671
+ (if t.add then 1 lsl 0 else 0 ) lor
6672
+ (if t.delete then 1 lsl 1 else 0 ) lor
6673
+ (if t.modify then 1 lsl 2 else 0 )
6674
+
6675
+ let parse bits : t =
6676
+ { add = test_bit16 0 bits
6677
+ ; delete = test_bit16 1 bits
6678
+ ; modify = test_bit16 2 bits }
6679
+
6680
+ end
6681
+
6682
+ module FlowRemoved = struct
6683
+
6684
+ type t = flowReasonMask
6685
+
6686
+ let to_string (t : t ) =
6687
+ Format. sprintf " { idle_timeout = %B; hard_timeout = %B; delete = %B; \
6688
+ group_delete = %B }"
6689
+ t.idle_timeout
6690
+ t.hard_timeout
6691
+ t.delete
6692
+ t.group_delete
6693
+
6694
+ let marshal (t : t ) : int8 =
6695
+ (if t.idle_timeout then 1 lsl 0 else 0 ) lor
6696
+ (if t.hard_timeout then 1 lsl 1 else 0 ) lor
6697
+ (if t.delete then 1 lsl 2 else 0 ) lor
6698
+ (if t.group_delete then 1 lsl 3 else 0 )
6699
+
6700
+ let parse bits : t =
6701
+ { idle_timeout = test_bit16 0 bits
6702
+ ; hard_timeout = test_bit16 1 bits
6703
+ ; delete = test_bit16 2 bits
6704
+ ; group_delete = test_bit16 3 bits }
6705
+
6706
+ end
6707
+
6639
6708
cstruct ofp_async_config {
6640
6709
uint32_t packet_in_mask0;
6641
6710
uint32_t packet_in_mask1;
@@ -6654,29 +6723,29 @@ module AsyncConfig = struct
6654
6723
Format. sprintf " { packet_in reason (master/slave) = %s/%s; \
6655
6724
port_status reason (master/slave) = %s/%s; \
6656
6725
flow_removed reason (master/slave) = %s/%s }"
6657
- (PacketIn.Reason. to_string async.packet_in.m_master)
6658
- (PacketIn.Reason. to_string async.packet_in.m_slave)
6659
- (PortStatus.Reason. to_string async.port_status.m_master)
6660
- (PortStatus.Reason. to_string async.port_status.m_slave)
6661
- (FlowRemoved.RemovedReason. to_string async.flow_removed.m_master)
6662
- (FlowRemoved.RemovedReason. to_string async.flow_removed.m_slave)
6726
+ (PacketIn. to_string async.packet_in.m_master)
6727
+ (PacketIn. to_string async.packet_in.m_slave)
6728
+ (PortStatus. to_string async.port_status.m_master)
6729
+ (PortStatus. to_string async.port_status.m_slave)
6730
+ (FlowRemoved. to_string async.flow_removed.m_master)
6731
+ (FlowRemoved. to_string async.flow_removed.m_slave)
6663
6732
6664
6733
let marshal (buf : Cstruct.t ) (async : asyncConfig ) : int =
6665
- set_ofp_async_config_packet_in_mask0 buf (Int32. of_int (PacketIn.Reason. marshal async.packet_in.m_master));
6666
- set_ofp_async_config_packet_in_mask1 buf (Int32. of_int (PacketIn.Reason. marshal async.packet_in.m_slave));
6667
- set_ofp_async_config_port_status_mask0 buf (Int32. of_int (PortStatus.Reason. marshal async.port_status.m_master));
6668
- set_ofp_async_config_port_status_mask1 buf (Int32. of_int (PortStatus.Reason. marshal async.port_status.m_slave));
6669
- set_ofp_async_config_flow_removed_mask0 buf (Int32. of_int (FlowRemoved.RemovedReason. marshal async.flow_removed.m_master));
6670
- set_ofp_async_config_flow_removed_mask1 buf (Int32. of_int (FlowRemoved.RemovedReason. marshal async.flow_removed.m_slave));
6734
+ set_ofp_async_config_packet_in_mask0 buf (Int32. of_int (PacketIn. marshal async.packet_in.m_master));
6735
+ set_ofp_async_config_packet_in_mask1 buf (Int32. of_int (PacketIn. marshal async.packet_in.m_slave));
6736
+ set_ofp_async_config_port_status_mask0 buf (Int32. of_int (PortStatus. marshal async.port_status.m_master));
6737
+ set_ofp_async_config_port_status_mask1 buf (Int32. of_int (PortStatus. marshal async.port_status.m_slave));
6738
+ set_ofp_async_config_flow_removed_mask0 buf (Int32. of_int (FlowRemoved. marshal async.flow_removed.m_master));
6739
+ set_ofp_async_config_flow_removed_mask1 buf (Int32. of_int (FlowRemoved. marshal async.flow_removed.m_slave));
6671
6740
sizeof_ofp_async_config
6672
6741
6673
6742
let parse (bits : Cstruct.t ) : asyncConfig =
6674
- let packet_in = { m_master = PacketIn.Reason. parse (Int32. to_int (get_ofp_async_config_packet_in_mask0 bits));
6675
- m_slave = PacketIn.Reason. parse (Int32. to_int (get_ofp_async_config_packet_in_mask1 bits))} in
6676
- let port_status = { m_master = PortStatus.Reason. parse (Int32. to_int (get_ofp_async_config_port_status_mask0 bits));
6677
- m_slave = PortStatus.Reason. parse (Int32. to_int (get_ofp_async_config_port_status_mask1 bits))} in
6678
- let flow_removed = { m_master = FlowRemoved.RemovedReason. parse (Int32. to_int (get_ofp_async_config_flow_removed_mask0 bits));
6679
- m_slave = FlowRemoved.RemovedReason. parse (Int32. to_int (get_ofp_async_config_flow_removed_mask1 bits))} in
6743
+ let packet_in = { m_master = PacketIn. parse (Int32. to_int (get_ofp_async_config_packet_in_mask0 bits));
6744
+ m_slave = PacketIn. parse (Int32. to_int (get_ofp_async_config_packet_in_mask1 bits))} in
6745
+ let port_status = { m_master = PortStatus. parse (Int32. to_int (get_ofp_async_config_port_status_mask0 bits));
6746
+ m_slave = PortStatus. parse (Int32. to_int (get_ofp_async_config_port_status_mask1 bits))} in
6747
+ let flow_removed = { m_master = FlowRemoved. parse (Int32. to_int (get_ofp_async_config_flow_removed_mask0 bits));
6748
+ m_slave = FlowRemoved. parse (Int32. to_int (get_ofp_async_config_flow_removed_mask1 bits))} in
6680
6749
{ packet_in; port_status; flow_removed }
6681
6750
6682
6751
end
0 commit comments