When I read source code of Tor,I found a concept called origin circuit, which appears a lot in the source code. I think it refers to the circuit from OP to OR.Is that correct? And what are the differences among origin_circuit_t, or_circuit_t and circuit_t? Thank you very much!
These circuit objects link connections together. An
origin_circuit_t represents the beginning of a circuit. It links application connections (for example, SOCKS connections from a web browser) to the first relay connection (for example a connection to the guard). An
or_circuit_t is used where most other connections need to be linked. For example at a relay which links a relay connection (from a client or relay) to a relay connection to some other relay, or a relay connection to edge connections (connections leaving the tor network).
or_circuit_t contain a
circuit_t. In an OOP sense,
or_circuit_t "inherit" from
circuit_t and so are subtypes of
circuit_t. You can use
TO_CIRCUIT() to cast either to a