circpad_negotiation.trunnel 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* These are the padding negotiation commands */
  2. const CIRCPAD_COMMAND_STOP = 1;
  3. const CIRCPAD_COMMAND_START = 2;
  4. /* Responses to commands */
  5. const CIRCPAD_RESPONSE_OK = 1;
  6. const CIRCPAD_RESPONSE_ERR = 2;
  7. /* Built-in machine types */
  8. /* 1) Machine that obscures circuit setup */
  9. const CIRCPAD_MACHINE_CIRC_SETUP = 1;
  10. /**
  11. * This command tells the relay to alter its min and max netflow
  12. * timeout range values, and send padding at that rate (resuming
  13. * if stopped). */
  14. struct circpad_negotiate {
  15. u8 version IN [0];
  16. u8 command IN [CIRCPAD_COMMAND_START, CIRCPAD_COMMAND_STOP];
  17. /** Machine type is left unbounded because we can specify
  18. * new machines in the consensus */
  19. u8 machine_type;
  20. /** If true, send a relay_drop reply.. */
  21. // FIXME-MP-AP: Maybe we just say to transition to the first state
  22. // here instead.. Also what about delay before responding?
  23. u8 echo_request IN [0,1];
  24. };
  25. /**
  26. * This command tells the relay to alter its min and max netflow
  27. * timeout range values, and send padding at that rate (resuming
  28. * if stopped). */
  29. struct circpad_negotiated {
  30. u8 version IN [0];
  31. u8 command IN [CIRCPAD_COMMAND_START, CIRCPAD_COMMAND_STOP];
  32. u8 response IN [CIRCPAD_RESPONSE_OK, CIRCPAD_RESPONSE_ERR];
  33. /** Machine type is left unbounded because we can specify
  34. * new machines in the consensus */
  35. u8 machine_type;
  36. };