ns-allinone-2.35/tcp/tcp-full.cc
int
SackFullTcpAgent::build_options(hdr_tcp* tcph)
{
	int total = FullTcpAgent::build_options(tcph);

        if (!rq_.empty()) {
                int nblk = rq_.gensack(&tcph->sa_left(0), max_sack_blocks_);
                tcph->sa_length() = nblk;
		total += (nblk * sack_block_size_) + sack_option_size_;
        } else {
                tcph->sa_length() = 0;
        }
	return (total);
}
//
// receiver side: if there are things in the reassembly queue,
// build the appropriate SACK blocks to carry in the SACK
//
receiver side: if there are things in the reassembly queue,
build the appropriate SACK blocks to carry in the SACK
receiver side : if there are things in the reassembly queue build the appropriate SACK blocks to carry in the SACK
int
SackFullTcpAgent::build_options(hdr_tcp* tcph)
{
	int total = FullTcpAgent::build_options(tcph);
        if (!rq_.empty()) {
                int nblk = rq_.gensack(&tcph->sa_left(0), max_sack_blocks_);
                tcph->sa_length() = nblk;
		total += (nblk * sack_block_size_) + sack_option_size_;
        } else {
                tcph->sa_length() = 0;
        }
	return (total);
}
int SackFullTcpAgent :: build_options ( hdr_tcp * tcph ) { int total = FullTcpAgent :: build_options ( tcph ) ; if ( ! rq_ . empty ( ) ) { int nblk = rq_ . gensack ( & tcph -> sa_left ( 0 ) , max_sack_blocks_ ) ; tcph -> sa_length ( ) = nblk ; total += ( nblk * sack_block_size_ ) + sack_option_size_ ; } else { tcph -> sa_length ( ) = 0 ; } return ( total ) ; }
receiver side: if there are things in the reassembly queue,
build the appropriate SACK blocks to carry in the SACK
receiver side : if there are things in the reassembly queue build the appropriate SACK blocks to carry in the SACK