173-getinfo-option-expansion.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Filename: 173-getinfo-option-expansion.txt
  2. Title: GETINFO Option Expansion
  3. Author: Damian Johnson
  4. Created: 02-June-2010
  5. Status: Accepted
  6. Overview:
  7. Over the course of developing arm there's been numerous hacks and
  8. workarounds to gleam pieces of basic, desirable information about the tor
  9. process. As per Roger's request I've compiled a list of these pain points
  10. to try and improve the control protocol interface.
  11. Motivation:
  12. The purpose of this proposal is to expose additional process and relay
  13. related information that is currently unavailable in a convenient,
  14. dependable, and/or platform independent way. Examples of this are...
  15. - The relay's total contributed bandwidth. This is a highly requested
  16. piece of information and, based on the following patch from pipe, looks
  17. trivial to include.
  18. http://www.mail-archive.com/or-talk@freehaven.net/msg13085.html
  19. - The process ID of the tor process. There is a high degree of guess work
  20. in obtaining this. Arm for instance uses pidof, netstat, and ps yet
  21. still fails on some platforms, and Orbot recently got a ticket about
  22. its own attempt to fetch it with ps:
  23. https://trac.torproject.org/projects/tor/ticket/1388
  24. This just includes the pieces of missing information I've noticed
  25. (suggestions or questions of their usefulness are welcome!).
  26. Security Implications:
  27. None that I'm aware of. From a security standpoint this seems decently
  28. innocuous.
  29. Specification:
  30. The following addition would be made to the control-spec's GETINFO section:
  31. "relay/bw-limit" -- Effective relayed bandwidth limit.
  32. "relay/burst-limit" -- Effective relayed burst limit.
  33. "relay/read-total" -- Total bytes relayed (download).
  34. "relay/write-total" -- Total bytes relayed (upload).
  35. "relay/flags" -- Space separated listing of flags currently held by the
  36. relay as repored by the currently cached consensus.
  37. "process/user" -- Username under which the tor process is running,
  38. providing an empty string if none exists.
  39. "process/pid" -- Process id belonging to the main tor process, -1 if none
  40. exists for the platform.
  41. "process/uptime" -- Total uptime of the tor process (in seconds).
  42. "process/uptime-reset" -- Time since last reset (startup, sighup, or RELOAD
  43. signal, in seconds).
  44. "process/descriptors-used" -- Count of file descriptors used.
  45. "process/descriptor-limit" -- File descriptor limit (getrlimit results).
  46. "ns/authority" -- Router status info (v2 directory style) for all
  47. recognized directory authorities, joined by newlines.
  48. "state/names" -- A space-separated list of all the keys supported by this
  49. version of Tor's state.
  50. "state/val/<key>" -- Provides the current state value belonging to the
  51. given key. If undefined, this provides the key's default value.
  52. "status/ports-seen" -- A summary of which ports we've seen connections
  53. circuits connect to recently, formatted the same as the EXITS_SEEN status
  54. event described in Section 4.1.XX. This GETINFO option is currently
  55. available only for exit relays.
  56. 4.1.XX. Per-port exit stats
  57. The syntax is:
  58. "650" SP "EXITS_SEEN" SP TimeStarted SP PortSummary CRLF
  59. We just generated a new summary of which ports we've seen exiting circuits
  60. connecting to recently. The controller could display this for the user, e.g.
  61. in their "relay" configuration window, to give them a sense of how they're
  62. being used (popularity of the various ports they exit to). Currently only
  63. exit relays will receive this event.
  64. TimeStarted is a quoted string indicating when the reported summary
  65. counts from (in GMT).
  66. The PortSummary keyword has as its argument a comma-separated, possibly
  67. empty set of "port=count" pairs. For example (without linebreak),
  68. 650-EXITS_SEEN TimeStarted="2008-12-25 23:50:43"
  69. PortSummary=80=16,443=8