code: func EncodeSACKBlocks(sackBlocks []SACKBlock, b []byte) int {
  	if len(sackBlocks) == 0 {
  		return 0
  	}
  	l := len(sackBlocks)
  	if l > TCPMaxSACKBlocks {
  		l = TCPMaxSACKBlocks
  	}
  	if ll := (len(b) - 2) / 8; ll < l {
  		l = ll
  	}
  	if l == 0 {
  		// There is not enough space in the provided buffer to add
  		// any SACK blocks.
  		return 0
  	}
  	b[0] = TCPOptionSACK
  	b[1] = byte(l*8 + 2)
  	for i := 0; i < l; i++ {
  		binary.BigEndian.PutUint32(b[i*8+2:], uint32(sackBlocks[i].Start))
  		binary.BigEndian.PutUint32(b[i*8+6:], uint32(sackBlocks[i].End))
  	}
  	return int(b[1])
  }
docs: // EncodeSACKBlocks encodes the provided SACK blocks as a TCP SACK option block
  // in the provided slice. It tries to fit in as many blocks as possible based on
  // number of bytes available in the provided buffer. It returns the number of
  // bytes written to the provided buffer.