*** ../../vanilla3.0/tcp_var.h Tue Apr 28 10:28:03 1998 --- tcp_var.h Tue Sep 15 15:59:42 1998 *************** *** 12,18 **** */ /* ! * Copyright (c) 1982, 1986, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 12,18 ---- */ /* ! * Copyright (c) 1982, 1986, 1993, 1994, 1995, 1998 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 53,58 **** --- 53,75 ---- * Kernel variables for tcp. */ + #ifdef SACK + struct sackblk + { + tcp_seq start; /* start seq no. of sack block */ + tcp_seq end; /* end seq no. */ + }; + + struct sackhole + { + tcp_seq start; /* start seq no. of hole */ + tcp_seq end; /* end seq no. */ + int dups; /* number of dup(s)acks for this hole */ + tcp_seq rxmit; /* next seq. no in hole to be retransmitted */ + struct sackhole *next; /* next in list */ + }; + #endif + /* * Tcp control block, one per tcp; fields: */ *************** *** 93,103 **** --- 110,142 ---- tcp_seq snd_wl2; /* window update seg ack number */ tcp_seq iss; /* initial send sequence number */ u_long snd_wnd; /* send window */ + #ifdef SACK + int sack_disable; /* disable SACK for this connection */ + int snd_numholes; /* number of holes seen by sender */ + struct sackhole *snd_holes; /* linked list of holes (sorted) */ + #if defined(SACK) && defined(FACK) + tcp_seq snd_fack; /* for FACK congestion control */ + u_long snd_awnd; /* snd_nxt - snd_fack + */ + /* retransmitted data */ + int retran_data; /* amount of outstanding retx. data */ + #endif /* FACK */ + #endif /* SACK */ + #if defined(SACK) || defined(NEWRENO) + tcp_seq snd_recover; /* for use in fast recovery */ + #endif /* receive sequence variables */ u_long rcv_wnd; /* receive window */ tcp_seq rcv_nxt; /* receive next */ tcp_seq rcv_up; /* receive urgent pointer */ tcp_seq irs; /* initial receive sequence number */ + #ifdef SACK + tcp_seq rcv_laststart; /* start of last segment recd. */ + tcp_seq rcv_lastend; /* end of ... */ + tcp_seq rcv_lastsack; /* last seq number(+1) sack'd by rcv'r*/ + int rcv_numsacks; /* # distinct sack blks present */ + struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */ + #endif + /* * Additional variables for this implementation. */ *************** *** 404,409 **** --- 443,466 ---- register struct tcpiphdr *, long, u_long)); void syn_cache_timer __P((int)); + #ifdef SACK + int tcp_sack_option __P((struct tcpcb *,struct tcpiphdr *,u_char *,int)); + void tcp_update_sack_list __P((struct tcpcb *tp)); + void tcp_del_sackholes __P((struct tcpcb *, struct tcpiphdr *)); + void tcp_clean_sackreport __P((struct tcpcb *tp)); + void tcp_sack_adjust __P((struct tcpcb *tp)); + struct sackhole * tcp_sack_output __P((struct tcpcb *tp)); + int tcp_sack_partialack __P((struct tcpcb *, struct tcpiphdr *)); + #ifdef DEBUG + void tcp_print_holes __P((struct tcpcb *tp)); + #endif + #endif /* SACK */ + #if defined(NEWRENO) || defined(SACK) + int tcp_newreno __P((struct tcpcb *, struct tcpiphdr *)); #endif + #if defined(SACK) || defined(NEWRENO) + u_long tcp_seq_subtract __P((u_long, u_long )); + #endif /* FACK */ + #endif /* KERNEL */ #endif /* !_NETINET_TCP_VAR_H_ */