patch #7308
[mldonkey.git] / src / networks / direct_connect / dcOptions.ml
blob5704b144310278fad81a3f6c8693368faf36b030
1 (* Copyright 2001, 2002 b8_bavard, b8_fee_carabine, INRIA *)
2 (*
3 This file is part of mldonkey.
5 mldonkey is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 mldonkey is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mldonkey; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 open Options
21 open CommonOptions
22 open CommonTypes
24 open DcTypes
27 let directconnect_ini = create_options_file "directconnect.ini"
28 let directconnect_section = file_section directconnect_ini ["DirectConnect"] "DirectConnect options"
30 let dc_port = define_option directconnect_section ["client_port"]
31 "The port to bind the client to"
32 port_option 4444
34 let dc_open_slots = define_option directconnect_section ["dc_open_slots"]
35 "How many slots are open to other clients"
36 int_option 2
38 let login = define_option directconnect_section ["login"]
39 "Your login on DC (no spaces !!!)" string_option ""
41 let hubs_passwords = define_option directconnect_section ["hubs_passwords"]
42 "Define here a list of address/passwords/nick triples for hubs in form:
43 [ (\"hubserver.ip.com\", \"nick1\", \"pass1\");
44 (\"somehub.somewhere.org\", \"nick2\", \"pass2\");
45 (\"11.22.333.444\", \"nick3\", \"pass3\");
47 (list_option (tuple3_option (string_option, string_option, string_option)))
50 let default_encoding = define_option directconnect_section ["default_encoding"]
51 "Default encoding to use for communications with hubs (CP1251,UTF-8,ISO-8859-1,etc)"
52 string_option "CP1252"
54 let search_timeout = define_option directconnect_section
55 ["search_timeout"]
56 "The time a search is active"
57 int_option 60
59 let file_search_time = define_option directconnect_section
60 ["file_search_time"]
61 "Minimum time between automated file tth searches in minutes"
62 int_option 60
64 let client_timeout = define_option directconnect_section
65 ["client_timeout"]
66 "In initialization, the time in seconds we wait connection responses from client"
67 int_option 90
69 let client_read_timeout = define_option directconnect_section
70 ["client_read_timeout"]
71 "The maximum time in seconds we wait data from client in downloading"
72 int_option 60
74 let client_write_timeout = define_option directconnect_section
75 ["client_write_timeout"]
76 "The maximum time in seconds we wait to continue pushing data to client in uploading"
77 int_option 60
79 let wait_for_next_upload = define_option directconnect_section
80 ["wait_for_next_upload"]
81 "How many seconds we wait a client to continue slot before closing and freeing the slot"
82 int_option 30
84 let firewalled = define_option directconnect_section ["firewalled"]
85 "Is this client firewalled (use passive searches)"
86 bool_option false
88 let autosearch_by_tth = define_option directconnect_section ["autosearch_by_tth"]
89 "Automatically find alternative sources, if file is unavailable. Also add sources
90 from searches automatically"
91 bool_option true
93 let max_sources_file = define_option directconnect_section ["max_sources_file"]
94 "Maximal number of sources to single file"
95 int_option 5
97 let client_speed = define_option directconnect_section
98 ["client_speed"]
99 "The line speed sent in the MyINFO message
100 eg. Modem, Cable, DSL, Satellite, LAN(T1), LAN(T3)"
101 string_option "DSL"
103 let options_version = define_option directconnect_section ["options_version"]
104 ~internal: true
105 "(internal option)"
106 int_option 0
108 let shortname o =
109 Printf.sprintf "DC-%s" (shortname o)
111 let gui_dc_options_panel =
113 define_option directconnect_section ["gui_dc_options_panel"]
114 "Which options are configurable in the GUI option panel, and in the
115 dc section. Last entry indicates the kind of widget used (B=Boolean,T=Text)"
116 (list_option (tuple3_option (string_option, string_option, string_option)))
119 "Login (nothing for global one)", shortname login, "T";
120 "Port", shortname dc_port, "T";
121 "Search Timeout", shortname search_timeout, "T";
122 "Firewalled", shortname firewalled, "B";
123 "Connection Type", shortname client_speed, "T";