prefs.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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 A2_V_TRUE;
  44. extern const std::string A2_V_FALSE;
  45. extern const std::string A2_V_DEFAULT;
  46. extern const std::string V_NONE;
  47. extern const std::string V_MEM;
  48. extern const std::string V_ALL;
  49. extern const std::string A2_V_FULL;
  50. extern const std::string A2_V_GEOM;
  51. /**
  52. * General preferences
  53. */
  54. // values: 1*digit
  55. extern const std::string PREF_TIMEOUT;
  56. // values: 1*digit
  57. extern const std::string PREF_DNS_TIMEOUT;
  58. // values: 1*digit
  59. extern const std::string PREF_CONNECT_TIMEOUT;
  60. // values: 1*digit
  61. extern const std::string PREF_MAX_TRIES;
  62. // values: 1*digit
  63. extern const std::string PREF_AUTO_SAVE_INTERVAL;
  64. // values: a string that your file system recognizes as a file name.
  65. extern const std::string PREF_LOG;
  66. // values: a string that your file system recognizes as a directory.
  67. extern const std::string PREF_DIR;
  68. // values: a string that your file system recognizes as a file name.
  69. extern const std::string PREF_OUT;
  70. // values: 1*digit
  71. extern const std::string PREF_SPLIT;
  72. // value: true | false
  73. extern const std::string PREF_DAEMON;
  74. // value: a string
  75. extern const std::string PREF_REFERER;
  76. // value: 1*digit
  77. extern const std::string PREF_LOWEST_SPEED_LIMIT;
  78. // value: 1*digit
  79. extern const std::string PREF_SEGMENT_SIZE;
  80. // value: 1*digit
  81. extern const std::string PREF_MAX_DOWNLOAD_LIMIT;
  82. // value: 1*digit
  83. extern const std::string PREF_STARTUP_IDLE_TIME;
  84. // value: prealloc | falloc | none
  85. extern const std::string PREF_FILE_ALLOCATION;
  86. extern const std::string V_PREALLOC;
  87. extern const std::string V_FALLOC;
  88. // value: 1*digit
  89. extern const std::string PREF_NO_FILE_ALLOCATION_LIMIT;
  90. // value: true | false
  91. extern const std::string PREF_ALLOW_OVERWRITE;
  92. // value: true | false
  93. extern const std::string PREF_REALTIME_CHUNK_CHECKSUM;
  94. // value: true | false
  95. extern const std::string PREF_CHECK_INTEGRITY;
  96. // value: string that your file system recognizes as a file name.
  97. extern const std::string PREF_NETRC_PATH;
  98. // value:
  99. extern const std::string PREF_CONTINUE;
  100. // value:
  101. extern const std::string PREF_NO_NETRC;
  102. // value: 1*digit
  103. extern const std::string PREF_MAX_OVERALL_DOWNLOAD_LIMIT;
  104. // value: 1*digit
  105. extern const std::string PREF_MAX_DOWNLOADS;
  106. // value: string that your file system recognizes as a file name.
  107. extern const std::string PREF_INPUT_FILE;
  108. // value: 1*digit
  109. extern const std::string PREF_MAX_CONCURRENT_DOWNLOADS;
  110. // value: true | false
  111. extern const std::string PREF_FORCE_SEQUENTIAL;
  112. // value: true | false
  113. extern const std::string PREF_AUTO_FILE_RENAMING;
  114. // value: true | false
  115. extern const std::string PREF_PARAMETERIZED_URI;
  116. // value: true | false
  117. extern const std::string PREF_ENABLE_DIRECT_IO;
  118. // value: true | false
  119. extern const std::string PREF_ALLOW_PIECE_LENGTH_CHANGE;
  120. // value: true | false
  121. extern const std::string PREF_NO_CONF;
  122. // value: string
  123. extern const std::string PREF_CONF_PATH;
  124. // value: 1*digit
  125. extern const std::string PREF_STOP;
  126. // value: true | false
  127. extern const std::string PREF_QUIET;
  128. // value: true | false
  129. extern const std::string PREF_ASYNC_DNS;
  130. // value: 1*digit
  131. extern const std::string PREF_SUMMARY_INTERVAL;
  132. // value: debug, info, notice, warn, error
  133. extern const std::string PREF_LOG_LEVEL;
  134. extern const std::string V_DEBUG;
  135. extern const std::string V_INFO;
  136. extern const std::string V_NOTICE;
  137. extern const std::string V_WARN;
  138. extern const std::string V_ERROR;
  139. // value: inorder | feedback | adaptive
  140. extern const std::string PREF_URI_SELECTOR;
  141. extern const std::string V_INORDER;
  142. extern const std::string V_FEEDBACK;
  143. extern const std::string V_ADAPTIVE;
  144. // value: 1*digit
  145. extern const std::string PREF_SERVER_STAT_TIMEOUT;
  146. // value: string that your file system recognizes as a file name.
  147. extern const std::string PREF_SERVER_STAT_IF;
  148. // value: string that your file system recognizes as a file name.
  149. extern const std::string PREF_SERVER_STAT_OF;
  150. // value: true | false
  151. extern const std::string PREF_REMOTE_TIME;
  152. // value: 1*digit
  153. extern const std::string PREF_MAX_FILE_NOT_FOUND;
  154. // value: epoll | select
  155. extern const std::string PREF_EVENT_POLL;
  156. extern const std::string V_EPOLL;
  157. extern const std::string V_KQUEUE;
  158. extern const std::string V_PORT;
  159. extern const std::string V_POLL;
  160. extern const std::string V_SELECT;
  161. // value: true | false
  162. extern const std::string PREF_ENABLE_RPC;
  163. // value: 1*digit
  164. extern const std::string PREF_RPC_LISTEN_PORT;
  165. // value: string
  166. extern const std::string PREF_RPC_USER;
  167. // value: string
  168. extern const std::string PREF_RPC_PASSWD;
  169. // value: 1*digit
  170. extern const std::string PREF_RPC_MAX_REQUEST_SIZE;
  171. // value: true | false
  172. extern const std::string PREF_RPC_LISTEN_ALL;
  173. // value: true | false
  174. extern const std::string PREF_RPC_ALLOW_ORIGIN_ALL;
  175. // value: true | false
  176. extern const std::string PREF_DRY_RUN;
  177. // value: true | false
  178. extern const std::string PREF_REUSE_URI;
  179. // value: string
  180. extern const std::string PREF_ON_DOWNLOAD_START;
  181. extern const std::string PREF_ON_DOWNLOAD_PAUSE;
  182. extern const std::string PREF_ON_DOWNLOAD_STOP;
  183. extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
  184. extern const std::string PREF_ON_DOWNLOAD_ERROR;
  185. // value: string
  186. extern const std::string PREF_INTERFACE;
  187. // value: true | false
  188. extern const std::string PREF_DISABLE_IPV6;
  189. // value: true | false
  190. extern const std::string PREF_HUMAN_READABLE;
  191. // value: true | false
  192. extern const std::string PREF_REMOVE_CONTROL_FILE;
  193. // value: true | false
  194. extern const std::string PREF_ALWAYS_RESUME;
  195. // value: 1*digit
  196. extern const std::string PREF_MAX_RESUME_FAILURE_TRIES;
  197. // value: string that your file system recognizes as a file name.
  198. extern const std::string PREF_SAVE_SESSION;
  199. // value: 1*digit
  200. extern const std::string PREF_MAX_CONNECTION_PER_SERVER;
  201. // value: 1*digit
  202. extern const std::string PREF_MIN_SPLIT_SIZE;
  203. // value: true | false
  204. extern const std::string PREF_CONDITIONAL_GET;
  205. // value: true | false
  206. extern const std::string PREF_SELECT_LEAST_USED_HOST;
  207. // value: true | false
  208. extern const std::string PREF_ENABLE_ASYNC_DNS6;
  209. // value: 1*digit
  210. extern const std::string PREF_MAX_DOWNLOAD_RESULT;
  211. // value: 1*digit
  212. extern const std::string PREF_RETRY_WAIT;
  213. // value: string
  214. extern const std::string PREF_ASYNC_DNS_SERVER;
  215. // value: true | false
  216. extern const std::string PREF_SHOW_CONSOLE_READOUT;
  217. // value: default | inorder | geom
  218. extern const std::string PREF_STREAM_PIECE_SELECTOR;
  219. // value: true | false
  220. extern const std::string PREF_TRUNCATE_CONSOLE_READOUT;
  221. // value: true | false
  222. extern const std::string PREF_PAUSE;
  223. // value: default | full
  224. extern const std::string PREF_DOWNLOAD_RESULT;
  225. // value: true | false
  226. extern const std::string PREF_HASH_CHECK_ONLY;
  227. /**
  228. * FTP related preferences
  229. */
  230. extern const std::string PREF_FTP_USER;
  231. extern const std::string PREF_FTP_PASSWD;
  232. // values: binary | ascii
  233. extern const std::string PREF_FTP_TYPE;
  234. extern const std::string V_BINARY;
  235. extern const std::string V_ASCII;
  236. // values: true | false
  237. extern const std::string PREF_FTP_PASV;
  238. // values: true | false
  239. extern const std::string PREF_FTP_REUSE_CONNECTION;
  240. // values: hashType=digest
  241. extern const std::string PREF_CHECKSUM;
  242. /**
  243. * HTTP related preferences
  244. */
  245. extern const std::string PREF_HTTP_USER;
  246. extern const std::string PREF_HTTP_PASSWD;
  247. // values: string
  248. extern const std::string PREF_USER_AGENT;
  249. // value: string that your file system recognizes as a file name.
  250. extern const std::string PREF_LOAD_COOKIES;
  251. // value: string that your file system recognizes as a file name.
  252. extern const std::string PREF_SAVE_COOKIES;
  253. // values: true | false
  254. extern const std::string PREF_ENABLE_HTTP_KEEP_ALIVE;
  255. // values: true | false
  256. extern const std::string PREF_ENABLE_HTTP_PIPELINING;
  257. // value: 1*digit
  258. extern const std::string PREF_MAX_HTTP_PIPELINING;
  259. // value: string
  260. extern const std::string PREF_HEADER;
  261. // value: string that your file system recognizes as a file name.
  262. extern const std::string PREF_CERTIFICATE;
  263. // value: string that your file system recognizes as a file name.
  264. extern const std::string PREF_PRIVATE_KEY;
  265. // value: string that your file system recognizes as a file name.
  266. extern const std::string PREF_CA_CERTIFICATE;
  267. // value: true | false
  268. extern const std::string PREF_CHECK_CERTIFICATE;
  269. // value: true | false
  270. extern const std::string PREF_USE_HEAD;
  271. // value: true | false
  272. extern const std::string PREF_HTTP_AUTH_CHALLENGE;
  273. // value: true | false
  274. extern const std::string PREF_HTTP_NO_CACHE;
  275. // value: true | false
  276. extern const std::string PREF_HTTP_ACCEPT_GZIP;
  277. /**;
  278. * Proxy related preferences
  279. */
  280. extern const std::string PREF_HTTP_PROXY;
  281. extern const std::string PREF_HTTPS_PROXY;
  282. extern const std::string PREF_FTP_PROXY;
  283. extern const std::string PREF_ALL_PROXY;
  284. // values: comma separeted hostname or domain
  285. extern const std::string PREF_NO_PROXY;
  286. // values: get | tunnel
  287. extern const std::string PREF_PROXY_METHOD;
  288. extern const std::string V_GET;
  289. extern const std::string V_TUNNEL;
  290. extern const std::string PREF_HTTP_PROXY_USER;
  291. extern const std::string PREF_HTTP_PROXY_PASSWD;
  292. extern const std::string PREF_HTTPS_PROXY_USER;
  293. extern const std::string PREF_HTTPS_PROXY_PASSWD;
  294. extern const std::string PREF_FTP_PROXY_USER;
  295. extern const std::string PREF_FTP_PROXY_PASSWD;
  296. extern const std::string PREF_ALL_PROXY_USER;
  297. extern const std::string PREF_ALL_PROXY_PASSWD;
  298. /**
  299. * BitTorrent related preferences
  300. */
  301. // values: 1*digit
  302. extern const std::string PREF_PEER_CONNECTION_TIMEOUT;
  303. // values: 1*digit
  304. extern const std::string PREF_BT_TIMEOUT;
  305. // values: 1*digit
  306. extern const std::string PREF_BT_REQUEST_TIMEOUT;
  307. // values: true | false
  308. extern const std::string PREF_SHOW_FILES;
  309. // values: 1*digit
  310. extern const std::string PREF_MAX_OVERALL_UPLOAD_LIMIT;
  311. // values: 1*digit
  312. extern const std::string PREF_MAX_UPLOAD_LIMIT;
  313. // values: a string that your file system recognizes as a file name.
  314. extern const std::string PREF_TORRENT_FILE;
  315. // values: 1*digit
  316. extern const std::string PREF_LISTEN_PORT;
  317. // values: true | false | mem
  318. extern const std::string PREF_FOLLOW_TORRENT;
  319. // values: 1*digit *( (,|-) 1*digit)
  320. extern const std::string PREF_SELECT_FILE;
  321. // values: 1*digit
  322. extern const std::string PREF_SEED_TIME;
  323. // values: 1*digit ['.' [ 1*digit ] ]
  324. extern const std::string PREF_SEED_RATIO;
  325. // values: 1*digit
  326. extern const std::string PREF_BT_KEEP_ALIVE_INTERVAL;
  327. // values: a string, less than or equals to 20 bytes length
  328. extern const std::string PREF_PEER_ID_PREFIX;
  329. // values: true | false
  330. extern const std::string PREF_ENABLE_PEER_EXCHANGE;
  331. // values: true | false
  332. extern const std::string PREF_ENABLE_DHT;
  333. // values: a string
  334. extern const std::string PREF_DHT_LISTEN_ADDR;
  335. // values: 1*digit
  336. extern const std::string PREF_DHT_LISTEN_PORT;
  337. // values: a string
  338. extern const std::string PREF_DHT_ENTRY_POINT_HOST;
  339. // values: 1*digit
  340. extern const std::string PREF_DHT_ENTRY_POINT_PORT;
  341. // values: a string (hostname:port)
  342. extern const std::string PREF_DHT_ENTRY_POINT;
  343. // values: a string
  344. extern const std::string PREF_DHT_FILE_PATH;
  345. // values: true | false
  346. extern const std::string PREF_ENABLE_DHT6;
  347. // values: a string
  348. extern const std::string PREF_DHT_LISTEN_ADDR6;
  349. // values: a string
  350. extern const std::string PREF_DHT_ENTRY_POINT_HOST6;
  351. // values: 1*digit
  352. extern const std::string PREF_DHT_ENTRY_POINT_PORT6;
  353. // values: a string (hostname:port)
  354. extern const std::string PREF_DHT_ENTRY_POINT6;
  355. // values: a string
  356. extern const std::string PREF_DHT_FILE_PATH6;
  357. // values: plain | arc4
  358. extern const std::string PREF_BT_MIN_CRYPTO_LEVEL;
  359. extern const std::string V_PLAIN;
  360. extern const std::string V_ARC4;
  361. // values:: true | false
  362. extern const std::string PREF_BT_REQUIRE_CRYPTO;
  363. // values: 1*digit
  364. extern const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT;
  365. // values: 1*digit
  366. extern const std::string PREF_BT_MAX_OPEN_FILES;
  367. // values: true | false
  368. extern const std::string PREF_BT_SEED_UNVERIFIED;
  369. // values: true | false
  370. extern const std::string PREF_BT_HASH_CHECK_SEED;
  371. // values: 1*digit
  372. extern const std::string PREF_BT_MAX_PEERS;
  373. // values: a string (IP address)
  374. extern const std::string PREF_BT_EXTERNAL_IP;
  375. // values: 1*digit '=' a string that your file system recognizes as a file name.
  376. extern const std::string PREF_INDEX_OUT;
  377. // values: 1*digit
  378. extern const std::string PREF_BT_TRACKER_INTERVAL;
  379. // values: 1*digit
  380. extern const std::string PREF_BT_STOP_TIMEOUT;
  381. // values: head[=SIZE]|tail[=SIZE], ...
  382. extern const std::string PREF_BT_PRIORITIZE_PIECE;
  383. // values: true | false
  384. extern const std::string PREF_BT_SAVE_METADATA;
  385. // values: true | false
  386. extern const std::string PREF_BT_METADATA_ONLY;
  387. // values: true | false
  388. extern const std::string PREF_BT_ENABLE_LPD;
  389. // values: string
  390. extern const std::string PREF_BT_LPD_INTERFACE;
  391. // values: 1*digit
  392. extern const std::string PREF_BT_TRACKER_TIMEOUT;
  393. // values: 1*digit
  394. extern const std::string PREF_BT_TRACKER_CONNECT_TIMEOUT;
  395. // values: 1*digit
  396. extern const std::string PREF_DHT_MESSAGE_TIMEOUT;
  397. // values: string
  398. extern const std::string PREF_ON_BT_DOWNLOAD_COMPLETE;
  399. // values: string
  400. extern const std::string PREF_BT_TRACKER;
  401. // values: string
  402. extern const std::string PREF_BT_EXCLUDE_TRACKER;
  403. /**
  404. * Metalink related preferences
  405. */
  406. // values: a string that your file system recognizes as a file name.
  407. extern const std::string PREF_METALINK_FILE;
  408. // values: a string
  409. extern const std::string PREF_METALINK_VERSION;
  410. // values: a string
  411. extern const std::string PREF_METALINK_LANGUAGE;
  412. // values: a string
  413. extern const std::string PREF_METALINK_OS;
  414. // values: a string
  415. extern const std::string PREF_METALINK_LOCATION;
  416. // values: 1*digit
  417. extern const std::string PREF_METALINK_SERVERS;
  418. // values: true | false | mem
  419. extern const std::string PREF_FOLLOW_METALINK;
  420. // values: http | https | ftp | none
  421. extern const std::string PREF_METALINK_PREFERRED_PROTOCOL;
  422. extern const std::string V_HTTP;
  423. extern const std::string V_HTTPS;
  424. extern const std::string V_FTP;
  425. // values: true | false
  426. extern const std::string PREF_METALINK_ENABLE_UNIQUE_PROTOCOL;
  427. // values: a string
  428. extern const std::string PREF_METALINK_BASE_URI;
  429. } // namespace aria2
  430. #endif // D_PREFS_H