xrootd
XrdClientConst.hh
Go to the documentation of this file.
1 
2 // //
3 // XrdClientConst //
4 // //
5 // Author: Fabrizio Furano (INFN Padova, 2004) //
6 // Adapted from TXNetFile (root.cern.ch) originally done by //
7 // Alvise Dorigo, Fabrizio Furano //
8 // INFN Padova, 2003 //
9 // //
10 // Constants for Xrd //
11 // //
13 
14 
15 // $Id$
16 
17 
18 #ifndef _XRC_CONST_H
19 #define _XRC_CONST_H
20 
21 #define DFLT_CONNECTTIMEOUT 120
22 #define NAME_CONNECTTIMEOUT (char *)"ConnectTimeout"
23 
24 #define DFLT_REQUESTTIMEOUT 300
25 #define NAME_REQUESTTIMEOUT (char *)"RequestTimeout"
26 
27 #define DFLT_MAXREDIRECTCOUNT 16
28 #define NAME_MAXREDIRECTCOUNT (char *)"MaxRedirectcount"
29 
30 #define DFLT_DEBUG 0
31 #define NAME_DEBUG (char *)"DebugLevel"
32 
33 #define DFLT_RECONNECTWAIT 5
34 #define NAME_RECONNECTWAIT (char *)"ReconnectWait"
35 
36 #define DFLT_REDIRCNTTIMEOUT 36000
37 #define NAME_REDIRCNTTIMEOUT (char *)"RedirCntTimeout"
38 
39 #define DFLT_FIRSTCONNECTMAXCNT 8
40 #define NAME_FIRSTCONNECTMAXCNT (char *)"FirstConnectMaxCnt"
41 
42 #define DFLT_TRANSACTIONTIMEOUT 28800
43 #define NAME_TRANSACTIONTIMEOUT (char *)"TransactionTimeout"
44 
45 
46 #define TXSOCK_ERR_TIMEOUT -1
47 #define TXSOCK_ERR -2
48 #define TXSOCK_ERR_INTERRUPT -3
49 
50 // the default number of parallel streams PER physical connection
51 // 0 means that the multistream support is disabled
52 #define DFLT_MULTISTREAMCNT 0
53 #define NAME_MULTISTREAMCNT (char *)"ParStreamsPerPhyConn"
54 
55 // The minimum size to use to split big single requests
56 // through multiple streams
57 #define DFLT_MULTISTREAMSPLITSIZE (4*1024*1024)
58 
59 // keep/dont-keep the socket open (required by optimized rootd fallback)
60 #define DFLT_KEEPSOCKOPENIFNOTXRD 0
61 #define NAME_KEEPSOCKOPENIFNOTXRD (char *)"KeepSockOpenIfNotXrd"
62 
63 // Printable version
64 #define XRD_CLIENT_VERSION (char *)"kXR_ver002+kXR_asyncap"
65 
66 // Version and capabilities sent to the server
67 #define XRD_CLIENT_CURRENTVER (kXR_ver002)
68 #define XRD_CLIENT_CAPVER ((kXR_char)kXR_asyncap | XRD_CLIENT_CURRENTVER)
69 
70 // Defaults for ReadAhead and Cache
71 #define DFLT_READCACHESIZE 0
72 #define NAME_READCACHESIZE (char *)"ReadCacheSize"
73 
74 // 0 = LRU
75 // 1 = Remove least offest
76 #define DFLT_READCACHEBLKREMPOLICY 0
77 #define NAME_READCACHEBLKREMPOLICY (char *)"ReadCacheBlkRemPolicy"
78 
79 #define DFLT_READAHEADSIZE (0)
80 #define NAME_READAHEADSIZE (char *)"ReadAheadSize"
81 
82 // Align all the read requests to multiples of a number
83 #define DFLT_READTRIMBLKSZ (0)
84 #define NAME_READTRIMBLKSZ (char *)"ReadTrimBlockSize"
85 
86 // The default read ahead strategy to use
87 #define DFLT_READAHEADSTRATEGY (1) // This is the sequential readahead
88 #define NAME_READAHEADSTRATEGY (char *)"ReadAheadStrategy"
89 
90 
91 // To be used in copy-like apps when the data is to be accessed only once
92 // ... to reduce additional cache overhead
93 #define DFLT_REMUSEDCACHEBLKS 0
94 #define NAME_REMUSEDCACHEBLKS (char *)"RemoveUsedCacheBlocks"
95 
96 // When writing async, purge immediately the written blocks from the cache
97 #define DFLT_PURGEWRITTENBLOCKS 0
98 #define NAME_PURGEWRITTENBLOCKS (char *)"PurgeWrittenBlocks"
99 
100 #define NAME_REDIRDOMAINALLOW_RE (char *)"RedirDomainAllowRE"
101 #define NAME_REDIRDOMAINDENY_RE (char *)"RedirDomainDenyRE"
102 #define NAME_CONNECTDOMAINALLOW_RE (char *)"ConnectDomainAllowRE"
103 #define NAME_CONNECTDOMAINDENY_RE (char *)"ConnectDomainDenyRE"
104 
105 #define PROTO (char *)"root"
106 
107 // The max number of threads spawned to do parallel opens
108 // Note for dummies: this is not the max number of parallel opens
109 #define DFLT_MAXCONCURRENTOPENS 100
110 
111 #define READV_MAXCHUNKS 512
112 #define READV_MAXCHUNKSIZE (1024*192)
113 
114 // SOCKS4 support
115 #define NAME_SOCKS4HOST (char *)"Socks4Server"
116 #define NAME_SOCKS4PORT (char *)"Socks4Port"
117 
118 // Default TCP windows size
119 // A value of '0' implies "use the default OS settings"
120 // which enables window scaling on some platforms (linux, MacOsX)
121 // but may be to small on others (solaris); the preprocessor macro
122 // is set based on the platform information found in configure
123 #if defined(__linux__) || defined(__macos__)
124 #define DFLT_DFLTTCPWINDOWSIZE (0)
125 #else
126 #define DFLT_DFLTTCPWINDOWSIZE (262144)
127 #endif
128 #define NAME_DFLTTCPWINDOWSIZE (char *)"DfltTcpWindowSize"
129 
130 // A connection towards a data server timeouts quickly
131 #define DFLT_DATASERVERCONN_TTL 300
132 #define NAME_DATASERVERCONN_TTL (char *)"DataServerConn_ttl"
133 
134 // A connection towards a Load Balancer timeouts after many seconds of no use
135 #define DFLT_LBSERVERCONN_TTL 1200
136 #define NAME_LBSERVERCONN_TTL (char *)"LBServerConn_ttl"
137 
138 // Switch on/off the fork handlers
139 #define DFLT_ENABLE_FORK_HANDLERS 0
140 #define NAME_ENABLE_FORK_HANDLERS (char *)"EnableForkHandlers"
141 
142 // Use TCP keepalive
143 #define DFLT_ENABLE_TCP_KEEPALIVE 0
144 #define NAME_ENABLE_TCP_KEEPALIVE (char *)"EnableTCPKeepAlive"
145 
146 // Tweak the TCP keepalive - these are only meaningful on Linux
147 
148 // Interval (in seconds) between the last data packet and the first probe
149 #define DFLT_TCP_KEEPALIVE_TIME 7200
150 #define NAME_TCP_KEEPALIVE_TIME (char *)"TCPKeepAliveTime"
151 
152 // Interval (in seconds) between the probes
153 #define DFLT_TCP_KEEPALIVE_INTERVAL 75
154 #define NAME_TCP_KEEPALIVE_INTERVAL (char *)"TCPKeepAliveInterval"
155 
156 // Number of probes lost to consider the connection broken
157 #define DFLT_TCP_KEEPALIVE_PROBES 9
158 #define NAME_TCP_KEEPALIVE_PROBES (char *)"TCPKeepAliveProbes"
159 
160 // Enable/disable the file size hint in xrdcp
161 #define DFLT_XRDCP_SIZE_HINT 1
162 #define NAME_XRDCP_SIZE_HINT (char *)"XrdCpSizeHint"
163 
164 // Enable/disable redirection printing
165 #define DFLT_PRINT_REDIRECTS 0
166 #define NAME_PRINT_REDIRECTS (char *)"PrintRedirects"
167 
168 #define TRUE 1
169 #define FALSE 0
170 
171 #define xrdmin(a, b) (a < b ? a : b)
172 #define xrdmax(a, b) (a > b ? a : b)
173 
174 #endif
175