diff options
author | Damian Johnson <atagar@torproject.org> | 2013-02-11 08:18:03 -0800 |
---|---|---|
committer | Damian Johnson <atagar@torproject.org> | 2013-02-11 08:28:28 -0800 |
commit | bdfd9f4818ce6ea754f1a5f7230ba91b7f7dcdaf (patch) | |
tree | 0be65c1257961ba41e8b058b8bb92614935fa09f /proposals/218-usage-controller-events.txt | |
parent | 74b96e9dc15346a82d871ec7792d09e9c11e074a (diff) | |
download | torspec-bdfd9f4818ce6ea754f1a5f7230ba91b7f7dcdaf.tar.gz torspec-bdfd9f4818ce6ea754f1a5f7230ba91b7f7dcdaf.zip |
Switching ConnType to be an enum
I'm still not really sure why Karsten wants to use a string field for this.
This has all the hallmarks of being an enumeration and it's trivially easy to
add new connection types as they arise.
Using a string for this field is not just unusual, but makes things a bit
harder for both controller users and anyone trying to build an alternative tor
implementation.
I'm also swapping the enums to be uppercase since that's the present convention
in the control-spec.
Diffstat (limited to 'proposals/218-usage-controller-events.txt')
-rw-r--r-- | proposals/218-usage-controller-events.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/proposals/218-usage-controller-events.txt b/proposals/218-usage-controller-events.txt index b835b69..6a456eb 100644 --- a/proposals/218-usage-controller-events.txt +++ b/proposals/218-usage-controller-events.txt @@ -70,12 +70,11 @@ Target: 0.2.5.x "650" SP "CONN_BW" [ SP "ID=" ConnID ] [ SP "TYPE=" ConnType ] [ SP "READ=" BytesRead ] [ SP "WRITTEN=" BytesWritten ] CRLF - ConnType = 1*( "a" - "z" / "0" - "9" / "_" ) + ConnType = "OR" / "DIR" / "EXIT" BytesRead = 1*DIGIT BytesWritten = 1*DIGIT - ConnType is the lower-case connection type name, which can be "or", - "dir", "exit", or something else. + Controllers MUST tolerate unrecognized connection types. BytesWritten and BytesRead are the number of bytes written and read by Tor since the last CONN_BW event on this connection. @@ -127,17 +126,18 @@ Target: 0.2.5.x [ SP "WRITTEN=" WriteBucketEmpty ] [ SP "LAST=" LastRefill ] CRLF - BucketName = "global" / "relay" / "orconn" + BucketName = "GLOBAL" / "RELAY" / "ORCONN" ReadBucketEmpty = 1*DIGIT WriteBucketEmpty = 1*DIGIT LastRefill = 1*DIGIT This event is generated when refilling a previously empty token - bucket. BucketNames "global" and "relay" keywords are used for the - global or relay token buckets, BucketName "orconn" is used for the - token buckets of an OR connection. + bucket. BucketNames "GLOBAL" and "RELAY" keywords are used for the + global or relay token buckets, BucketName "ORCONN" is used for the + token buckets of an OR connection. Controllers MUST tolerate unrecognized + bucket names. - ConnID is only included if the BucketName is "orconn". + ConnID is only included if the BucketName is "ORCONN". If both global and relay buckets and/or the buckets of one or more OR connections run out of tokens at the same time, multiple separate |