MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ctf_fixed_maxseg

Function ctf_fixed_maxseg

freebsd/netinet/tcp_stacks/rack_bbr_common.c:817–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815}
816
817uint32_t
818ctf_fixed_maxseg(struct tcpcb *tp)
819{
820 int optlen;
821
822 if (tp->t_flags & TF_NOOPT)
823 return (tp->t_maxseg);
824
825 /*
826 * Here we have a simplified code from tcp_addoptions(),
827 * without a proper loop, and having most of paddings hardcoded.
828 * We only consider fixed options that we would send every
829 * time I.e. SACK is not considered.
830 *
831 */
832#define PAD(len) ((((len) / 4) + !!((len) % 4)) * 4)
833 if (TCPS_HAVEESTABLISHED(tp->t_state)) {
834 if (tp->t_flags & TF_RCVD_TSTMP)
835 optlen = TCPOLEN_TSTAMP_APPA;
836 else
837 optlen = 0;
838#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)
839 if (tp->t_flags & TF_SIGNATURE)
840 optlen += PAD(TCPOLEN_SIGNATURE);
841#endif
842 } else {
843 if (tp->t_flags & TF_REQ_TSTMP)
844 optlen = TCPOLEN_TSTAMP_APPA;
845 else
846 optlen = PAD(TCPOLEN_MAXSEG);
847 if (tp->t_flags & TF_REQ_SCALE)
848 optlen += PAD(TCPOLEN_WINDOW);
849#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)
850 if (tp->t_flags & TF_SIGNATURE)
851 optlen += PAD(TCPOLEN_SIGNATURE);
852#endif
853 if (tp->t_flags & TF_SACK_PERMIT)
854 optlen += PAD(TCPOLEN_SACK_PERMITTED);
855 }
856#undef PAD
857 optlen = min(optlen, TCP_MAXOLEN);
858 return (tp->t_maxseg - optlen);
859}
860
861void
862ctf_log_sack_filter(struct tcpcb *tp, int num_sack_blks, struct sackblk *sack_blocks)

Callers 15

rc_init_windowFunction · 0.85
rack_get_measure_windowFunction · 0.85
rack_enter_proberttFunction · 0.85
rack_exit_proberttFunction · 0.85
rack_ack_receivedFunction · 0.85
rack_cong_signalFunction · 0.85
rack_calc_thresh_tlpFunction · 0.85
rack_timer_startFunction · 0.85
rack_timeout_rackFunction · 0.85
rack_timeout_tlpFunction · 0.85

Calls 1

minFunction · 0.85

Tested by

no test coverage detected