22 #define BOOTSTRAP_MSG_LEN 1024
34 { BOOTSTRAP_STATUS_UNDEF,
"undef",
"Undefined" },
35 { BOOTSTRAP_STATUS_STARTING,
"starting",
"Starting" },
39 { BOOTSTRAP_STATUS_CONN_PT,
"conn_pt",
"Connecting to pluggable transport" },
40 { BOOTSTRAP_STATUS_CONN_DONE_PT,
"conn_done_pt",
41 "Connected to pluggable transport" },
42 { BOOTSTRAP_STATUS_CONN_PROXY,
"conn_proxy",
"Connecting to proxy" },
43 { BOOTSTRAP_STATUS_CONN_DONE_PROXY,
"conn_done_proxy",
44 "Connected to proxy" },
45 { BOOTSTRAP_STATUS_CONN,
"conn",
"Connecting to a relay" },
46 { BOOTSTRAP_STATUS_CONN_DONE,
"conn_done",
"Connected to a relay" },
47 { BOOTSTRAP_STATUS_HANDSHAKE,
"handshake",
48 "Handshaking with a relay" },
49 { BOOTSTRAP_STATUS_HANDSHAKE_DONE,
"handshake_done",
50 "Handshake with a relay done" },
54 { BOOTSTRAP_STATUS_ONEHOP_CREATE,
"onehop_create",
55 "Establishing an encrypted directory connection" },
56 { BOOTSTRAP_STATUS_REQUESTING_STATUS,
"requesting_status",
57 "Asking for networkstatus consensus" },
58 { BOOTSTRAP_STATUS_LOADING_STATUS,
"loading_status",
59 "Loading networkstatus consensus" },
60 { BOOTSTRAP_STATUS_LOADING_KEYS,
"loading_keys",
61 "Loading authority key certs" },
62 { BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS,
"requesting_descriptors",
63 "Asking for relay descriptors" },
64 { BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
"loading_descriptors",
65 "Loading relay descriptors" },
66 { BOOTSTRAP_STATUS_ENOUGH_DIRINFO,
"enough_dirinfo",
67 "Loaded enough directory info to build circuits" },
71 { BOOTSTRAP_STATUS_AP_CONN_PT,
"ap_conn_pt",
72 "Connecting to pluggable transport to build circuits" },
73 { BOOTSTRAP_STATUS_AP_CONN_DONE_PT,
"ap_conn_done_pt",
74 "Connected to pluggable transport to build circuits" },
75 { BOOTSTRAP_STATUS_AP_CONN_PROXY,
"ap_conn_proxy",
76 "Connecting to proxy to build circuits" },
77 { BOOTSTRAP_STATUS_AP_CONN_DONE_PROXY,
"ap_conn_done_proxy",
78 "Connected to proxy to build circuits" },
79 { BOOTSTRAP_STATUS_AP_CONN,
"ap_conn",
80 "Connecting to a relay to build circuits" },
81 { BOOTSTRAP_STATUS_AP_CONN_DONE,
"ap_conn_done",
82 "Connected to a relay to build circuits" },
83 { BOOTSTRAP_STATUS_AP_HANDSHAKE,
"ap_handshake",
84 "Finishing handshake with a relay to build circuits" },
85 { BOOTSTRAP_STATUS_AP_HANDSHAKE_DONE,
"ap_handshake_done",
86 "Handshake finished with a relay to build circuits" },
90 { BOOTSTRAP_STATUS_CIRCUIT_CREATE,
"circuit_create",
91 "Establishing a Tor circuit" },
92 { BOOTSTRAP_STATUS_DONE,
"done",
"Done" },
94 #define N_BOOT_TO_STR (sizeof(boot_to_str_tab)/sizeof(boot_to_str_tab[0]))
100 const char **summary)
102 for (
size_t i = 0; i < N_BOOT_TO_STR; i++) {
110 *tag = *summary =
"unknown";
140 #define BOOTSTRAP_PROBLEM_THRESHOLD 10
146 #define BOOTSTRAP_PCT_INCREMENT 5
156 const char *tag, *summary;
164 "Bootstrapped %d%% (%s): %s", status, tag, summary);
166 "BOOTSTRAP PROGRESS=%d TAG=%s SUMMARY=\"%s\"",
167 status, tag, summary);
175 control_get_bootstrap_percent(
void)
272 const char *tag =
"", *summary =
"";
274 const char *recommendation =
"ignore";
276 char *or_id = NULL, *hostaddr = NULL;
300 recommendation =
"warn";
307 or_id = tor_strdup(
"?");
313 hostaddr = tor_strdup(
"?");
316 LD_CONTROL,
"Problem bootstrapping. Stuck at %d%% (%s): %s. (%s; %s; "
317 "count %d; recommendation %s; host %s at %s)",
318 status, tag, summary, warn, reason,
325 "BOOTSTRAP PROGRESS=%d TAG=%s SUMMARY=\"%s\" WARNING=\"%s\" REASON=%s "
326 "COUNT=%d RECOMMENDATION=%s HOSTID=\"%s\" HOSTADDR=\"%s\"",
368 if (reason == END_OR_CONN_REASON_NO_ROUTE)