* 2 if duplicate of out-of-order D-SACK block.
*/
int
-tcp_sack_ndsack_blocks(struct raw_sackblock *blocks, const int numblocks,
- tcp_seq snd_una)
+tcp_sack_ndsack_blocks(const struct raw_sackblock *blocks, const int numblocks,
+ tcp_seq snd_una)
{
if (numblocks == 0)
return 0;
#ifdef DEBUG_SACK_BLOCKS
static void
-tcp_sack_dump_blocks(struct scoreboard *scb)
+tcp_sack_dump_blocks(const struct scoreboard *scb)
{
- struct sackblock *sb;
+ const struct sackblock *sb;
kprintf("%d blocks:", scb->nblocks);
TAILQ_FOREACH(sb, &scb->sackblocks, sblk_list)
}
#else
static __inline void
-tcp_sack_dump_blocks(struct scoreboard *scb)
+tcp_sack_dump_blocks(const struct scoreboard *scb)
{
}
#endif
* Return whether the given sequence number is considered lost.
*/
boolean_t
-tcp_sack_islost(struct scoreboard *scb, tcp_seq seqnum)
+tcp_sack_islost(const struct scoreboard *scb, tcp_seq seqnum)
{
return SEQ_LT(seqnum, scb->lostseq);
}
* True if at least "amount" has been SACKed. Used by Early Retransmit.
*/
boolean_t
-tcp_sack_has_sacked(struct scoreboard *scb, u_int amount)
+tcp_sack_has_sacked(const struct scoreboard *scb, u_int amount)
{
- struct sackblock *sb;
+ const struct sackblock *sb;
int bytes_sacked = 0;
TAILQ_FOREACH(sb, &scb->sackblocks, sblk_list) {
* Number of bytes SACKed below seq.
*/
int
-tcp_sack_bytes_below(struct scoreboard *scb, tcp_seq seq)
+tcp_sack_bytes_below(const struct scoreboard *scb, tcp_seq seq)
{
- struct sackblock *sb;
+ const struct sackblock *sb;
int bytes_sacked = 0;
sb = TAILQ_FIRST(&scb->sackblocks);
* Return estimate of the number of bytes outstanding in the network.
*/
uint32_t
-tcp_sack_compute_pipe(struct tcpcb *tp)
+tcp_sack_compute_pipe(const struct tcpcb *tp)
{
- struct scoreboard *scb = &tp->scb;
- struct sackblock *sb;
+ const struct scoreboard *scb = &tp->scb;
+ const struct sackblock *sb;
int nlost, nretransmitted;
tcp_seq end;
* The length of the first amount of unSACKed data
*/
uint32_t
-tcp_sack_first_unsacked_len(struct tcpcb *tp)
+tcp_sack_first_unsacked_len(const struct tcpcb *tp)
{
- struct sackblock *sb;
+ const struct sackblock *sb;
sb = TAILQ_FIRST(&tp->scb.sackblocks);
if (sb == NULL)
#ifdef DEBUG_SACK_HISTORY
static void
-tcp_sack_dump_history(char *msg, struct tcpcb *tp)
+tcp_sack_dump_history(const char *msg, const struct tcpcb *tp)
{
int i;
static int ndumped;
}
#else
static __inline void
-tcp_sack_dump_history(char *msg, struct tcpcb *tp)
+tcp_sack_dump_history(const char *msg, const struct tcpcb *tp)
{
}
#endif
struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int);
struct rtentry *
tcp_rtlookup (struct in_conninfo *);
-int tcp_sack_bytes_below(struct scoreboard *scb, tcp_seq seq);
+int tcp_sack_bytes_below(const struct scoreboard *scb, tcp_seq seq);
void tcp_sack_destroy(struct scoreboard *scb);
void tcp_sack_cleanup(struct scoreboard *scb);
void tcp_sack_report_cleanup(struct tcpcb *tp);
-int tcp_sack_ndsack_blocks(struct raw_sackblock *blocks,
+int tcp_sack_ndsack_blocks(const struct raw_sackblock *blocks,
const int numblocks, tcp_seq snd_una);
void tcp_sack_fill_report(struct tcpcb *tp, u_char *opt, u_int *plen);
boolean_t
- tcp_sack_has_sacked(struct scoreboard *scb, u_int amount);
+ tcp_sack_has_sacked(const struct scoreboard *scb, u_int amount);
void tcp_sack_tcpcb_init(struct tcpcb *tp);
-uint32_t tcp_sack_compute_pipe(struct tcpcb *tp);
+uint32_t tcp_sack_compute_pipe(const struct tcpcb *tp);
boolean_t
tcp_sack_nextseg(struct tcpcb *tp, tcp_seq *nextrexmt, uint32_t *len,
boolean_t *rescue);
boolean_t
- tcp_sack_islost(struct scoreboard *scb, tcp_seq seq);
+ tcp_sack_islost(const struct scoreboard *scb, tcp_seq seq);
void tcp_sack_update_lostseq(struct scoreboard *scb, tcp_seq snd_una,
u_int maxseg, int rxtthresh);
#ifdef later
void tcp_sack_save_scoreboard(struct scoreboard *scb);
#endif
void tcp_sack_skip_sacked(struct scoreboard *scb, tcp_seq *prexmt);
-uint32_t tcp_sack_first_unsacked_len(struct tcpcb *tp);
+uint32_t tcp_sack_first_unsacked_len(const struct tcpcb *tp);
void tcp_sack_update_scoreboard(struct tcpcb *tp, struct tcpopt *to);
void tcp_save_congestion_state(struct tcpcb *tp);
void tcp_revert_congestion_state(struct tcpcb *tp);