diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-09-25 12:57:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-09-25 15:15:06 -0400 |
commit | 0a438c7daf19228e04cf71a5c68cb9d701685e58 (patch) | |
tree | 03e1f27e79e3cd8f51fe9f53bc36d3a5f1300100 | |
parent | 891b3d8633ba8f82478cd98324cf40361c2964b4 (diff) | |
download | tor-0a438c7daf19228e04cf71a5c68cb9d701685e58.tar.gz tor-0a438c7daf19228e04cf71a5c68cb9d701685e58.zip |
Describe how to regenerate the TLS state name table.
-rw-r--r-- | src/common/tortls_states.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/common/tortls_states.h b/src/common/tortls_states.h index d5efd08771..986b5a8a0d 100644 --- a/src/common/tortls_states.h +++ b/src/common/tortls_states.h @@ -3,9 +3,30 @@ * Copyright (c) 2007-2009, The Tor Project, Inc. */ /* See LICENSE for licensing information */ +/* Helper file: included only in tortls.c */ + #ifndef _TORTLS_STATES_H #define _TORTLS_STATES_H +/* The main body of this file was mechanically generated with this + perl script: + + my %keys = (); + for $fn (@ARGV) { + open(F, $fn); + while (<F>) { + next unless /^#define ((?:SSL|DTLS)\w*_ST_\w*)/; + $keys{$1} = 1; + } + close(F); + } + for $k (sort keys %keys) { + print "#ifdef $k\n S($k),\n#endif\n" + } +*/ + +/** Mapping from allowed value of SSL.state to the name of C macro for that + * state. Used for debugging an openssl connection. */ static const struct { int state; const char *name; } state_map[] = { #define S(state) { state, #state } #ifdef DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A |