prefs.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /* <!-- copyright */
  2. /*
  3. * aria2 - The high speed download utility
  4. *
  5. * Copyright (C) 2006 Tatsuhiro Tsujikawa
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * In addition, as a special exception, the copyright holders give
  22. * permission to link the code of portions of this program with the
  23. * OpenSSL library under certain conditions as described in each
  24. * individual source file, and distribute linked combinations
  25. * including the two.
  26. * You must obey the GNU General Public License in all respects
  27. * for all of the code used other than OpenSSL. If you modify
  28. * file(s) with this exception, you may extend this exception to your
  29. * version of the file(s), but you are not obligated to do so. If you
  30. * do not wish to do so, delete this exception statement from your
  31. * version. If you delete this exception statement from all source
  32. * files in the program, then also delete it here.
  33. */
  34. /* copyright --> */
  35. #ifndef _D_PREFS_H_
  36. #define _D_PREFS_H_
  37. #include "common.h"
  38. #include <string>
  39. namespace aria2 {
  40. /**
  41. * Constants
  42. */
  43. extern const std::string V_TRUE;
  44. extern const std::string V_FALSE;
  45. extern const std::string V_NONE;
  46. extern const std::string V_MEM;
  47. extern const std::string V_ALL;
  48. /**
  49. * General preferences
  50. */
  51. // values: 1*digit
  52. extern const std::string PREF_TIMEOUT;
  53. // values: 1*digit
  54. extern const std::string PREF_DNS_TIMEOUT;
  55. // values: 1*digit
  56. extern const std::string PREF_CONNECT_TIMEOUT;
  57. // values: 1*digit
  58. extern const std::string PREF_MAX_TRIES;
  59. // values: 1*digit
  60. extern const std::string PREF_AUTO_SAVE_INTERVAL;
  61. // values: a string that your file system recognizes as a file name.
  62. extern const std::string PREF_LOG;
  63. // values: a string that your file system recognizes as a directory.
  64. extern const std::string PREF_DIR;
  65. // values: a string that your file system recognizes as a file name.
  66. extern const std::string PREF_OUT;
  67. // values: 1*digit
  68. extern const std::string PREF_SPLIT;
  69. // value: true | false
  70. extern const std::string PREF_DAEMON;
  71. // value: a string
  72. extern const std::string PREF_REFERER;
  73. // value: 1*digit
  74. extern const std::string PREF_LOWEST_SPEED_LIMIT;
  75. // value: 1*digit
  76. extern const std::string PREF_SEGMENT_SIZE;
  77. // value: 1*digit
  78. extern const std::string PREF_MAX_DOWNLOAD_LIMIT;
  79. // value: 1*digit
  80. extern const std::string PREF_STARTUP_IDLE_TIME;
  81. // value: prealloc | falloc | none
  82. extern const std::string PREF_FILE_ALLOCATION;
  83. extern const std::string V_PREALLOC;
  84. extern const std::string V_FALLOC;
  85. // value: 1*digit
  86. extern const std::string PREF_NO_FILE_ALLOCATION_LIMIT;
  87. // value: true | false
  88. extern const std::string PREF_ALLOW_OVERWRITE;
  89. // value: true | false
  90. extern const std::string PREF_REALTIME_CHUNK_CHECKSUM;
  91. // value: true | false
  92. extern const std::string PREF_CHECK_INTEGRITY;
  93. // value: string that your file system recognizes as a file name.
  94. extern const std::string PREF_NETRC_PATH;
  95. // value:
  96. extern const std::string PREF_CONTINUE;
  97. // value:
  98. extern const std::string PREF_NO_NETRC;
  99. // value: 1*digit
  100. extern const std::string PREF_MAX_OVERALL_DOWNLOAD_LIMIT;
  101. // value: 1*digit
  102. extern const std::string PREF_MAX_DOWNLOADS;
  103. // value: string that your file system recognizes as a file name.
  104. extern const std::string PREF_INPUT_FILE;
  105. // value: 1*digit
  106. extern const std::string PREF_MAX_CONCURRENT_DOWNLOADS;
  107. // value: true | false
  108. extern const std::string PREF_FORCE_SEQUENTIAL;
  109. // value: true | false
  110. extern const std::string PREF_AUTO_FILE_RENAMING;
  111. // value: true | false
  112. extern const std::string PREF_PARAMETERIZED_URI;
  113. // value: true | false
  114. extern const std::string PREF_ENABLE_DIRECT_IO;
  115. // value: true | false
  116. extern const std::string PREF_ALLOW_PIECE_LENGTH_CHANGE;
  117. // value: true | false
  118. extern const std::string PREF_NO_CONF;
  119. // value: string
  120. extern const std::string PREF_CONF_PATH;
  121. // value: 1*digit
  122. extern const std::string PREF_STOP;
  123. // value: true | false
  124. extern const std::string PREF_QUIET;
  125. // value: true | false
  126. extern const std::string PREF_ASYNC_DNS;
  127. // value: 1*digit
  128. extern const std::string PREF_SUMMARY_INTERVAL;
  129. // value: debug, info, notice, warn, error
  130. extern const std::string PREF_LOG_LEVEL;
  131. extern const std::string V_DEBUG;
  132. extern const std::string V_INFO;
  133. extern const std::string V_NOTICE;
  134. extern const std::string V_WARN;
  135. extern const std::string V_ERROR;
  136. // value: inorder | feedback | adaptive
  137. extern const std::string PREF_URI_SELECTOR;
  138. extern const std::string V_INORDER;
  139. extern const std::string V_FEEDBACK;
  140. extern const std::string V_ADAPTIVE;
  141. // value: 1*digit
  142. extern const std::string PREF_SERVER_STAT_TIMEOUT;
  143. // value: string that your file system recognizes as a file name.
  144. extern const std::string PREF_SERVER_STAT_IF;
  145. // value: string that your file system recognizes as a file name.
  146. extern const std::string PREF_SERVER_STAT_OF;
  147. // value: true | false
  148. extern const std::string PREF_REMOTE_TIME;
  149. // value: 1*digit
  150. extern const std::string PREF_MAX_FILE_NOT_FOUND;
  151. // value: epoll | select
  152. extern const std::string PREF_EVENT_POLL;
  153. extern const std::string V_EPOLL;
  154. extern const std::string V_KQUEUE;
  155. extern const std::string V_PORT;
  156. extern const std::string V_POLL;
  157. extern const std::string V_SELECT;
  158. // value: 1*digit
  159. extern const std::string PREF_XML_RPC_LISTEN_PORT;
  160. // value: true | false
  161. extern const std::string PREF_ENABLE_XML_RPC;
  162. // value: true | false
  163. extern const std::string PREF_DRY_RUN;
  164. // value: true | false
  165. extern const std::string PREF_REUSE_URI;
  166. // value: string
  167. extern const std::string PREF_XML_RPC_USER;
  168. // value: string
  169. extern const std::string PREF_XML_RPC_PASSWD;
  170. // value: 1*digit
  171. extern const std::string PREF_XML_RPC_MAX_REQUEST_SIZE;
  172. // value: string
  173. extern const std::string PREF_ON_DOWNLOAD_START;
  174. extern const std::string PREF_ON_DOWNLOAD_PAUSE;
  175. extern const std::string PREF_ON_DOWNLOAD_STOP;
  176. extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
  177. extern const std::string PREF_ON_DOWNLOAD_ERROR;
  178. // value: true | false
  179. extern const std::string PREF_XML_RPC_LISTEN_ALL;
  180. // value: string
  181. extern const std::string PREF_INTERFACE;
  182. // value: true | false
  183. extern const std::string PREF_DISABLE_IPV6;
  184. // value: true | false
  185. extern const std::string PREF_HUMAN_READABLE;
  186. // value: true | false
  187. extern const std::string PREF_REMOVE_CONTROL_FILE;
  188. // value: true | false
  189. extern const std::string PREF_ALWAYS_RESUME;
  190. // value: 1*digit
  191. extern const std::string PREF_MAX_RESUME_FAILURE_TRIES;
  192. // value: string that your file system recognizes as a file name.
  193. extern const std::string PREF_SAVE_SESSION;
  194. // value: 1*digit
  195. extern const std::string PREF_MAX_CONNECTION_PER_SERVER;
  196. // value: 1*digit
  197. extern const std::string PREF_MIN_SPLIT_SIZE;
  198. // value: true | false
  199. extern const std::string PREF_CONDITIONAL_GET;
  200. /**
  201. * FTP related preferences
  202. */
  203. extern const std::string PREF_FTP_USER;
  204. extern const std::string PREF_FTP_PASSWD;
  205. // values: binary | ascii
  206. extern const std::string PREF_FTP_TYPE;
  207. extern const std::string V_BINARY;
  208. extern const std::string V_ASCII;
  209. // values: true | false
  210. extern const std::string PREF_FTP_PASV;
  211. // values: true | false
  212. extern const std::string PREF_FTP_REUSE_CONNECTION;
  213. /**
  214. * HTTP related preferences
  215. */
  216. extern const std::string PREF_HTTP_USER;
  217. extern const std::string PREF_HTTP_PASSWD;
  218. // values: string
  219. extern const std::string PREF_USER_AGENT;
  220. // value: string that your file system recognizes as a file name.
  221. extern const std::string PREF_LOAD_COOKIES;
  222. // value: string that your file system recognizes as a file name.
  223. extern const std::string PREF_SAVE_COOKIES;
  224. // values: true | false
  225. extern const std::string PREF_ENABLE_HTTP_KEEP_ALIVE;
  226. // values: true | false
  227. extern const std::string PREF_ENABLE_HTTP_PIPELINING;
  228. // value: 1*digit
  229. extern const std::string PREF_MAX_HTTP_PIPELINING;
  230. // value: string
  231. extern const std::string PREF_HEADER;
  232. // value: string that your file system recognizes as a file name.
  233. extern const std::string PREF_CERTIFICATE;
  234. // value: string that your file system recognizes as a file name.
  235. extern const std::string PREF_PRIVATE_KEY;
  236. // value: string that your file system recognizes as a file name.
  237. extern const std::string PREF_CA_CERTIFICATE;
  238. // value: true | false
  239. extern const std::string PREF_CHECK_CERTIFICATE;
  240. // value: true | false
  241. extern const std::string PREF_USE_HEAD;
  242. // value: true | false
  243. extern const std::string PREF_HTTP_AUTH_CHALLENGE;
  244. // value: true | false
  245. extern const std::string PREF_HTTP_NO_CACHE;
  246. // value: true | false
  247. extern const std::string PREF_HTTP_ACCEPT_GZIP;
  248. /**;
  249. * Proxy related preferences
  250. */
  251. extern const std::string PREF_HTTP_PROXY;
  252. extern const std::string PREF_HTTPS_PROXY;
  253. extern const std::string PREF_FTP_PROXY;
  254. extern const std::string PREF_ALL_PROXY;
  255. // values: comma separeted hostname or domain
  256. extern const std::string PREF_NO_PROXY;
  257. // values: get | tunnel
  258. extern const std::string PREF_PROXY_METHOD;
  259. extern const std::string V_GET;
  260. extern const std::string V_TUNNEL;
  261. extern const std::string PREF_HTTP_PROXY_USER;
  262. extern const std::string PREF_HTTP_PROXY_PASSWD;
  263. extern const std::string PREF_HTTPS_PROXY_USER;
  264. extern const std::string PREF_HTTPS_PROXY_PASSWD;
  265. extern const std::string PREF_FTP_PROXY_USER;
  266. extern const std::string PREF_FTP_PROXY_PASSWD;
  267. extern const std::string PREF_ALL_PROXY_USER;
  268. extern const std::string PREF_ALL_PROXY_PASSWD;
  269. /**
  270. * BitTorrent related preferences
  271. */
  272. // values: 1*digit
  273. extern const std::string PREF_PEER_CONNECTION_TIMEOUT;
  274. // values: 1*digit
  275. extern const std::string PREF_BT_TIMEOUT;
  276. // values: 1*digit
  277. extern const std::string PREF_BT_REQUEST_TIMEOUT;
  278. // values: true | false
  279. extern const std::string PREF_SHOW_FILES;
  280. // values: 1*digit
  281. extern const std::string PREF_MAX_OVERALL_UPLOAD_LIMIT;
  282. // values: 1*digit
  283. extern const std::string PREF_MAX_UPLOAD_LIMIT;
  284. // values: a string that your file system recognizes as a file name.
  285. extern const std::string PREF_TORRENT_FILE;
  286. // values: 1*digit
  287. extern const std::string PREF_LISTEN_PORT;
  288. // values: true | false | mem
  289. extern const std::string PREF_FOLLOW_TORRENT;
  290. // values: 1*digit *( (,|-) 1*digit)
  291. extern const std::string PREF_SELECT_FILE;
  292. // values: 1*digit
  293. extern const std::string PREF_SEED_TIME;
  294. // values: 1*digit ['.' [ 1*digit ] ]
  295. extern const std::string PREF_SEED_RATIO;
  296. // values: 1*digit
  297. extern const std::string PREF_BT_KEEP_ALIVE_INTERVAL;
  298. // values: a string, less than or equals to 20 bytes length
  299. extern const std::string PREF_PEER_ID_PREFIX;
  300. // values: true | false
  301. extern const std::string PREF_ENABLE_PEER_EXCHANGE;
  302. // values: true | false
  303. extern const std::string PREF_ENABLE_DHT;
  304. // values: 1*digit
  305. extern const std::string PREF_DHT_LISTEN_PORT;
  306. // values: a string
  307. extern const std::string PREF_DHT_ENTRY_POINT_HOST;
  308. // values: 1*digit
  309. extern const std::string PREF_DHT_ENTRY_POINT_PORT;
  310. // values: a string (hostname:port)
  311. extern const std::string PREF_DHT_ENTRY_POINT;
  312. // values: a string
  313. extern const std::string PREF_DHT_FILE_PATH;
  314. // values: plain | arc4
  315. extern const std::string PREF_BT_MIN_CRYPTO_LEVEL;
  316. extern const std::string V_PLAIN;
  317. extern const std::string V_ARC4;
  318. // values:: true | false
  319. extern const std::string PREF_BT_REQUIRE_CRYPTO;
  320. // values: 1*digit
  321. extern const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT;
  322. // values: 1*digit
  323. extern const std::string PREF_BT_MAX_OPEN_FILES;
  324. // values: true | false
  325. extern const std::string PREF_BT_SEED_UNVERIFIED;
  326. // values: true | false
  327. extern const std::string PREF_BT_HASH_CHECK_SEED;
  328. // values: 1*digit
  329. extern const std::string PREF_BT_MAX_PEERS;
  330. // values: a string (IP address)
  331. extern const std::string PREF_BT_EXTERNAL_IP;
  332. // values: 1*digit '=' a string that your file system recognizes as a file name.
  333. extern const std::string PREF_INDEX_OUT;
  334. // values: 1*digit
  335. extern const std::string PREF_BT_TRACKER_INTERVAL;
  336. // values: 1*digit
  337. extern const std::string PREF_BT_STOP_TIMEOUT;
  338. // values: head[=SIZE]|tail[=SIZE], ...
  339. extern const std::string PREF_BT_PRIORITIZE_PIECE;
  340. // values: true | false
  341. extern const std::string PREF_BT_SAVE_METADATA;
  342. // values: true | false
  343. extern const std::string PREF_BT_METADATA_ONLY;
  344. // values: true | false
  345. extern const std::string PREF_BT_ENABLE_LPD;
  346. // values: string
  347. extern const std::string PREF_BT_LPD_INTERFACE;
  348. // values: 1*digit
  349. extern const std::string PREF_BT_TRACKER_TIMEOUT;
  350. // values: 1*digit
  351. extern const std::string PREF_BT_TRACKER_CONNECT_TIMEOUT;
  352. // values: 1*digit
  353. extern const std::string PREF_DHT_MESSAGE_TIMEOUT;
  354. // values: string
  355. extern const std::string PREF_ON_BT_DOWNLOAD_COMPLETE;
  356. /**
  357. * Metalink related preferences
  358. */
  359. // values: a string that your file system recognizes as a file name.
  360. extern const std::string PREF_METALINK_FILE;
  361. // values: a string
  362. extern const std::string PREF_METALINK_VERSION;
  363. // values: a string
  364. extern const std::string PREF_METALINK_LANGUAGE;
  365. // values: a string
  366. extern const std::string PREF_METALINK_OS;
  367. // values: a string
  368. extern const std::string PREF_METALINK_LOCATION;
  369. // values: 1*digit
  370. extern const std::string PREF_METALINK_SERVERS;
  371. // values: true | false | mem
  372. extern const std::string PREF_FOLLOW_METALINK;
  373. // values: http | https | ftp | none
  374. extern const std::string PREF_METALINK_PREFERRED_PROTOCOL;
  375. extern const std::string V_HTTP;
  376. extern const std::string V_HTTPS;
  377. extern const std::string V_FTP;
  378. // values: true | false
  379. extern const std::string PREF_METALINK_ENABLE_UNIQUE_PROTOCOL;
  380. } // namespace aria2
  381. #endif // _D_PREFS_H_