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

Function bbr_get_sockopt

freebsd/netinet/tcp_stacks/bbr.c:14685–14830  ·  view source on GitHub ↗

* return 0 on success, error-num on failure */

Source from the content-addressed store, hash-verified

14683 * return 0 on success, error-num on failure
14684 */
14685static int
14686bbr_get_sockopt(struct socket *so, struct sockopt *sopt,
14687 struct inpcb *inp, struct tcpcb *tp, struct tcp_bbr *bbr)
14688{
14689 int32_t error, optval;
14690
14691 /*
14692 * Because all our options are either boolean or an int, we can just
14693 * pull everything into optval and then unlock and copy. If we ever
14694 * add a option that is not a int, then this will have quite an
14695 * impact to this routine.
14696 */
14697 switch (sopt->sopt_name) {
14698 case TCP_BBR_PACE_PER_SEC:
14699 optval = bbr->r_ctl.bbr_hptsi_per_second;
14700 break;
14701 case TCP_BBR_PACE_DEL_TAR:
14702 optval = bbr->r_ctl.bbr_hptsi_segments_delay_tar;
14703 break;
14704 case TCP_BBR_PACE_SEG_MAX:
14705 optval = bbr->r_ctl.bbr_hptsi_segments_max;
14706 break;
14707 case TCP_BBR_MIN_TOPACEOUT:
14708 optval = bbr->no_pacing_until;
14709 break;
14710 case TCP_BBR_PACE_SEG_MIN:
14711 optval = bbr->r_ctl.bbr_hptsi_bytes_min;
14712 break;
14713 case TCP_BBR_PACE_CROSS:
14714 optval = bbr->r_ctl.bbr_cross_over;
14715 break;
14716 case TCP_BBR_ALGORITHM:
14717 optval = bbr->rc_use_google;
14718 break;
14719 case TCP_BBR_TSLIMITS:
14720 optval = bbr->rc_use_ts_limit;
14721 break;
14722 case TCP_BBR_IWINTSO:
14723 optval = bbr->rc_init_win;
14724 break;
14725 case TCP_BBR_STARTUP_PG:
14726 optval = bbr->r_ctl.rc_startup_pg;
14727 break;
14728 case TCP_BBR_DRAIN_PG:
14729 optval = bbr->r_ctl.rc_drain_pg;
14730 break;
14731 case TCP_BBR_PROBE_RTT_INT:
14732 optval = bbr->r_ctl.rc_probertt_int;
14733 break;
14734 case TCP_BBR_PROBE_RTT_LEN:
14735 optval = (bbr->r_ctl.rc_rttprop.cur_time_limit / USECS_IN_SECOND);
14736 break;
14737 case TCP_BBR_PROBE_RTT_GAIN:
14738 optval = bbr->r_ctl.bbr_rttprobe_gain_val;
14739 break;
14740 case TCP_BBR_STARTUP_LOSS_EXIT:
14741 optval = bbr->rc_loss_exit;
14742 break;

Callers 1

bbr_ctloutputFunction · 0.85

Calls 2

tcp_default_ctloutputFunction · 0.85
sooptcopyoutFunction · 0.85

Tested by

no test coverage detected