Hi there,
We would like to implement some specific protocol in Tor as an implementation project.
Our one of pseudo codes that we have to take into account is the one mentioned on the paper under the link http://www.cypherpunks.ca/~iang/pubs/UC-OR.pdf , page 5, figure 2.
I would like to know how can I connect or relate this pseudo code with the Tor source code to help us understand where we should insert our desired modification on the source code of the Tor. 
For instance in the first of the pseudo code line we have  "upon an input (setup):". And know in which file/lines of the Tor source code we have this?