protocol_server 2.4 KB

  1. The tor process will launch the pirserver process, and hold pipes to the
  2. pirserver's stdin, stdout, and stderr. All communication between the
  3. processes is over those pipes. Anything the pirserver outputs over the
  4. stderr pipe should be logged by the tor process. If the pirserver finds
  5. its stdin has reached EOF, it should terminate.
  6. The general format of request messages (tor -> pirserver) is:
  7. request_id: 8 bytes
  8. request_type: 1 byte
  9. body_len: 4 bytes (big-endian unsigned int)
  10. body: (body_len) bytes
  11. The general format of response messages (pirserver -> tor) is:
  12. request_id: 8 bytes (must match the request_id being responded to)
  13. response_type: 1 byte
  14. body_len: 4 bytes (big-endian unsigned int)
  15. body: (body_len) bytes
  16. There are three request types:
  18. Request the current pirserver params data
  19. The body_len must be 0. The pirserver will respond with
  20. PIRSERVER_RESPONSE_PARAMS. (TODO: do we want to allow for an error
  21. response to this request?)
  23. Store an object with a given 32-byte key
  24. The body_len must be at least 32. The first 32 bytes of the body
  25. are the key under which to store the object, and the remaining bytes
  26. are the object. If body_len is exactly 32, it means to remove the
  27. object with the specified key. Storing an object with an
  28. already-existing key will overwrite the old object with that key.
  29. This request does not elicit a response from the pirserver.
  31. Privately look up an object
  32. The body_len will depend on the details of the particular private
  33. lookup scheme (XPIR, ZeroTrace, trivial, etc.).
  34. There are three response types:
  36. Reply with the current pirserver params data
  37. The body is the params data, which will be sent to the client either
  38. in an HTTP 200 reply to an explicit params request, or else in a
  39. special cell piggybacked on the creation of the directory lookup
  40. circuit. The body_len will depend on the details on the particular
  41. private lookup scheme.
  43. Response to a successful lookup
  44. The body is the result of the private lookup requested by the
  45. corresponding PIRSERVER_REQUEST_LOOKUP. The body_len will depend on
  46. the details on the particular private lookup scheme.
  48. Response to a failed lookup
  49. The body_len must be 0.