Skip to content
Sathyanarayanan Gunasekaran edited this page Oct 29, 2013 · 7 revisions

Interface for encoding/decoding modules

For the encoding modules on the upstream side

Init()

  • Called on each of the encoding modules
  • Performs any initialization actions that are necessary.
  • Expected to be very basic.

Register()

  • Called on each of the encoding modules at initialization
  • Provides encoding decision module information it needs to decide
  • Returns:
    • Minimum size - likely to be 1 byte for URLs and ~4-30k for an image
    • Maximum size - likely to be 1000 bytes for URLs and MBs for an image

Send()

  • Returns errors
  • takes in a buffer that is to be encoded
  • takes in size of data to be encoded
  • Sends all the data that's requested, either in one or many outbound packets (many URLs for instance)

For the encoding modules on the downstream side

Receive()

  • Returns errors
  • Takes a buffer that is to be decoded
  • Takes in size of data to be decoded

For the decision part of HTPT on the upstream side

ReceiveCallback()

  • Takes a list of decoded data
  • passes it up to Tor

GetSequenceAndIncrement()

  • Returns sequence number and increments
  • Used by the various encode/decode modules that implement Send()

For the decision part of HTPT on the downstream side

SendData()

  • Sends data
  • Called by the various encode/decode modules

Clone this wiki locally