@@ -267,7 +267,7 @@ let tcp_output_required now conn =
267
267
cb.State. snd_cwnd
268
268
in
269
269
(* : Calculate the amount of unused send window :*)
270
- let win = min cb.State. snd_wnd snd_cwnd in
270
+ let win = Int. min cb.State. snd_wnd snd_cwnd in
271
271
let snd_wnd_unused = win - (Sequence. window cb.State. snd_nxt cb.State. snd_una) in
272
272
(* : Is it possible that a FIN may need to be sent? :*)
273
273
let fin_required =
@@ -287,7 +287,7 @@ let tcp_output_required now conn =
287
287
let have_data_or_fin_to_send = Sequence. less cb.snd_nxt last_sndq_data_and_fin_seq in
288
288
(* : The amount by which the right edge of the advertised window could be moved :*)
289
289
let window_update_delta =
290
- (min (Params. tcp_maxwin lsl cb.State. rcv_scale))
290
+ (Int. min (Params. tcp_maxwin lsl cb.State. rcv_scale))
291
291
(conn.rcvbufsize - Cstruct. lenv conn.rcvq) -
292
292
Sequence. window cb.State. rcv_adv cb.State. rcv_nxt
293
293
in
@@ -353,7 +353,7 @@ let tcp_output_really_helper now (src, src_port, dst, dst_port) window_probe con
353
353
else
354
354
cb.State. snd_cwnd
355
355
in
356
- let win0 = min cb.State. snd_wnd snd_cwnd in
356
+ let win0 = Int. min cb.State. snd_wnd snd_cwnd in
357
357
let win = if window_probe && win0 = 0 then 1 else win0 in
358
358
let snd_wnd_unused = win - (Sequence. window cb.State. snd_nxt cb.State. snd_una) in
359
359
let fin_required =
@@ -365,15 +365,15 @@ let tcp_output_really_helper now (src, src_port, dst, dst_port) window_probe con
365
365
let data_to_send, more_data_could_be_sent =
366
366
let data' =
367
367
Cstruct. shiftv (List. rev conn.State. sndq)
368
- (max 0
369
- (min (Cstruct. lenv conn.State. sndq)
368
+ (Int. max 0
369
+ (Int. min (Cstruct. lenv conn.State. sndq)
370
370
(Sequence. window cb.State. snd_nxt cb.State. snd_una)))
371
371
(* taking the minimum to avoid exceeding the sndq *)
372
372
in
373
373
let data' = Cstruct. concat data' in
374
- let len_could_be_sent = max 0 snd_wnd_unused in
374
+ let len_could_be_sent = Int. max 0 snd_wnd_unused in
375
375
let dlen = Cstruct. length data' in
376
- Cstruct. sub data' 0 (min dlen (min len_could_be_sent cb.State. t_maxseg)),
376
+ Cstruct. sub data' 0 (Int. min dlen (Int. min len_could_be_sent cb.State. t_maxseg)),
377
377
dlen > cb.t_maxseg && len_could_be_sent > cb.t_maxseg
378
378
in
379
379
let dlen = Cstruct. length data_to_send in
@@ -402,8 +402,8 @@ let tcp_output_really_helper now (src, src_port, dst, dst_port) window_probe con
402
402
| Time_wait -> window_size
403
403
| _ ->
404
404
let rcv_wnd'' = Subr. calculate_bsd_rcv_wnd conn in
405
- max window_size
406
- (min (Params. tcp_maxwin lsl cb.State. rcv_scale)
405
+ Int. max window_size
406
+ (Int. min (Params. tcp_maxwin lsl cb.State. rcv_scale)
407
407
(if rcv_wnd'' < conn.rcvbufsize / 4 && rcv_wnd'' < cb.State. t_maxseg
408
408
then 0 (* : Silly window avoidance: shouldn't advertise a tiny window :*)
409
409
else rcv_wnd''))
@@ -414,7 +414,7 @@ let tcp_output_really_helper now (src, src_port, dst, dst_port) window_probe con
414
414
let seg =
415
415
{ src_port ; dst_port ; seq = snd_nxt;
416
416
ack = Some cb.State. rcv_nxt ; flag ; push ;
417
- window = min (rcv_wnd' lsr cb.rcv_scale) max_win ;
417
+ window = Int. min (rcv_wnd' lsr cb.rcv_scale) max_win ;
418
418
options = [] ; payload = data_to_send
419
419
}
420
420
in
@@ -430,7 +430,7 @@ let tcp_output_really_helper now (src, src_port, dst, dst_port) window_probe con
430
430
in
431
431
(* : Updated values to store in the control block after the segment is output :*)
432
432
let snd_nxt' = Sequence. (addi (addi snd_nxt dlen) (if fin then 1 else 0 )) in
433
- let snd_max = max cb.State. snd_max snd_nxt' in
433
+ let snd_max = Sequence. max cb.State. snd_max snd_nxt' in
434
434
(* : Following a |tcp_output| code walkthrough by SB: :*)
435
435
let tt_rexmt =
436
436
if (State. mode_of cb.tt_rexmt = None ||
@@ -515,7 +515,7 @@ let tcp_output_perhaps now id conn =
515
515
516
516
(* auxFns:1384 *)
517
517
let make_syn_ack cb (src , src_port , dst , dst_port ) =
518
- let window = min cb.State. rcv_wnd max_win in
518
+ let window = Int. min cb.State. rcv_wnd max_win in
519
519
let options =
520
520
MaximumSegmentSize cb.t_advmss ::
521
521
(Option. map (fun sc -> WindowScale sc) cb.request_r_scale |> Option. to_list)
@@ -527,7 +527,7 @@ let make_syn_ack cb (src, src_port, dst, dst_port) =
527
527
528
528
(* auxFns:1333 *)
529
529
let make_syn cb (src , src_port , dst , dst_port ) =
530
- let window = min cb.State. rcv_wnd max_win in
530
+ let window = Int. min cb.State. rcv_wnd max_win in
531
531
let options =
532
532
MaximumSegmentSize cb.State. t_advmss ::
533
533
(Option. map (fun sc -> WindowScale sc) cb.request_r_scale |> Option. to_list)
@@ -539,7 +539,7 @@ let make_syn cb (src, src_port, dst, dst_port) =
539
539
540
540
(* auxFns:1437 *)
541
541
let make_ack cb ~fin (src , src_port , dst , dst_port ) =
542
- let window = min (cb.State. rcv_wnd lsr cb.rcv_scale) max_win in
542
+ let window = Int. min (cb.State. rcv_wnd lsr cb.rcv_scale) max_win in
543
543
(* sack *)
544
544
src, dst,
545
545
{ src_port ; dst_port ;
0 commit comments