xrootd
XProtocol.hh
Go to the documentation of this file.
1 #ifndef __XPROTOCOL_H
2 #define __XPROTOCOL_H
3 /******************************************************************************/
4 /* */
5 /* X P r o t o c o l . h h */
6 /* */
7 /* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* The XRoot protocol definition, documented in this file, is distributed */
20 /* under a modified BSD license and may be freely used to reimplement it. */
21 /* Any references to "source" in this license refers to this file or any */
22 /* other file that specifically contains the following license. */
23 /* */
24 /* Redistribution and use in source and binary forms, with or without */
25 /* modification, are permitted provided that the following conditions */
26 /* are met: */
27 /* */
28 /* 1. Redistributions of source code must retain the above copyright notice, */
29 /* this list of conditions and the following disclaimer. */
30 /* */
31 /* 2. Redistributions in binary form must reproduce the above copyright */
32 /* notice, this list of conditions and the following disclaimer in the */
33 /* documentation and/or other materials provided with the distribution. */
34 /* */
35 /* 3. Neither the name of the copyright holder nor the names of its */
36 /* contributors may be used to endorse or promote products derived from */
37 /* this software without specific prior written permission. */
38 /* */
39 /* 4. Derived software may not use the name XRootD or cmsd (regardless of */
40 /* capitilization) in association with the derived work if the protocol */
41 /* documented in this file is changed in any way. */
42 /* */
43 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
44 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
45 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
46 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
47 /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
48 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
49 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
50 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
51 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
52 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
53 /******************************************************************************/
54 
55 #ifdef __CINT__
56 #define __attribute__(x)
57 #endif
58 
59 #include "XProtocol/XPtypes.hh"
60 
61 /******************************************************************************/
62 /* P r o t o c o l V e r s i o n D e f i n i t i o n s */
63 /******************************************************************************/
64 
65 // The following is the binary representation of the protocol version here.
66 // Protocol version is repesented as three base10 digits x.y.z with x having no
67 // upper limit (i.e. n.9.9 + 1 -> n+1.0.0). The kXR_PROTSIGNVERSION defines the
68 // protocol version where request signing became available.
69 //
70 #define kXR_PROTOCOLVERSION 0x00000500
71 #define kXR_PROTXATTVERSION 0x00000500
72 #define kXR_PROTTLSVERSION 0x00000500
73 #define kXR_PROTSIGNVERSION 0x00000310
74 #define kXR_PROTOCOLVSTRING "5.0.0"
75 
76 /******************************************************************************/
77 /* C l i e n t - S e r v e r H a n d s h a k e */
78 /******************************************************************************/
79 
80 // The fields to be sent as initial handshake
81 //
88 };
89 
90 // The body received after the first handshake's header
91 //
96 };
97 
98 /******************************************************************************/
99 /* C l i e n t R e q u e s t s */
100 /******************************************************************************/
101 
102 // G.Ganis: All the following structures never need padding bytes:
103 // no need of packing options like __attribute__((packed))
104 //
105 // All binary data is sent in network byte order.
106 
107 // Client request codes
108 //
111  kXR_auth = 3000,
112  kXR_query, // 3001
113  kXR_chmod, // 3002
114  kXR_close, // 3003
115  kXR_dirlist, // 3004
116  kXR_gpfile, // 3005 was kXR_getfile
117  kXR_protocol,// 3006
118  kXR_login, // 3007
119  kXR_mkdir, // 3008
120  kXR_mv, // 3009
121  kXR_open, // 3010
122  kXR_ping, // 3011
123  kXR_chkpoint,// 3012 was kXR_putfile
124  kXR_read, // 3013
125  kXR_rm, // 3014
126  kXR_rmdir, // 3015
127  kXR_sync, // 3016
128  kXR_stat, // 3017
129  kXR_set, // 3018
130  kXR_write, // 3019
131  kXR_fattr, // 3020 was kXR_admin
132  kXR_prepare, // 3021
133  kXR_statx, // 3022
134  kXR_endsess, // 3023
135  kXR_bind, // 3024
136  kXR_readv, // 3025
137  kXR_pgwrite, // 3026 was kXR_verifyw
138  kXR_locate, // 3027
139  kXR_truncate,// 3028
140  kXR_sigver, // 3029
141  kXR_pgread, // 3030 was kXR_decrypt
142  kXR_writev, // 3031
143  kXR_REQFENCE // Always last valid request code +1
144 };
145 
146 // Virtual client request codes
147 //
150 };
151 
152 // All client requests use a header with the following format
153 //
159 };
160 
161 /******************************************************************************/
162 /* k X R _ a u t h R e q u e s t */
163 /******************************************************************************/
164 
171 };
172 
173 /******************************************************************************/
174 /* k X R _ b i n d R e q u e s t */
175 /******************************************************************************/
176 
182 };
183 
184 /******************************************************************************/
185 /* k X R _ c h m o d R e q u e s t */
186 /******************************************************************************/
187 
192  kXR_unt16 mode; // See XOpenRequestMode
194 };
195 
196 /******************************************************************************/
197 /* k X R _ c h k p o i n t R e q u e s t */
198 /******************************************************************************/
199 
203  kXR_char fhandle[4]; // For Create, Delete, Query, or Restore
205  kXR_char opcode; // One of kXR_ckpxxxx actions
207 };
208 
209 // Actions
210 //
211 static const int kXR_ckpBegin = 0; // Begin checkpoint
212 static const int kXR_ckpCommit = 1; // Commit changes
213 static const int kXR_ckpQuery = 2; // Query checkpoint limits
214 static const int kXR_ckpRollback= 3; // Rollback changes
215 static const int kXR_ckpXeq = 4; // Execute trunc, write, or writev
216 
217 // The minimum size of a checkpoint data limit
218 //
219 static const int kXR_ckpMinMax = 104857604; // 10 MB
220 
221 /******************************************************************************/
222 /* k X R _ c l o s e R e q u e s t */
223 /******************************************************************************/
224 
231 };
232 
233 /******************************************************************************/
234 /* k X R _ d i r l i s t R e q u e s t */
235 /******************************************************************************/
236 
240  kXR_dcksm = 4 // dcksm implies dstat irrespective of dstat setting
241 };
242 
247  kXR_char options[1]; // See XDirlistRequestOption enum
249 };
250 
251 /******************************************************************************/
252 /* k X R _ e n d s e s s R e q u e s t */
253 /******************************************************************************/
254 
260 };
261 
262 /******************************************************************************/
263 /* k X R _ f a t t r R e q u e s t */
264 /******************************************************************************/
265 
266 // kXR_fattr subcodes
267 //
273  kXR_fatrrMaxSC = 3 // Highest valid subcode
274 };
275 
276 // kXR_fattr limits
277 //
278 enum xfaLimits {
279  kXR_faMaxVars = 16, // Maximum variables per request
280  kXR_faMaxNlen = 248, // Maximum length of variable name
281  kXR_faMaxVlen = 65536 // Maximum length of variable value
282 };
283 
288  kXR_char subcode; // See xfaSubCode enum
290  kXR_char options; // See valid options below
293 
294 // Valid options:
295 //
296  static const int isNew = 0x01; // For set, the variable must not exist
297  static const int aData = 0x10; // For list, return attribute value
298 
299 // Add an attribute name to nvec (the buffer has to be sufficiently big)
300 //
301  static char* NVecInsert( const char *name, char *buffer );
302 
303 // Add an attribute name to vvec (the buffer has to be sufficiently big)
304 //
305  static char* VVecInsert( const char *value, char *buffer );
306 
307 // Read error code from nvec
308 //
309  static char* NVecRead( char* buffer, kXR_unt16 &rc );
310 
311 // Read attribute name from nvec, should be deallocated with free()
312 //
313  static char* NVecRead( char* buffer, char *&name );
314 
315 // Read value length from vvec
316 //
317  static char* VVecRead( char* buffer, kXR_int32 &len );
318 
319 // Read attribute value from vvec, should be deallocated with free()
320 //
321  static char* VVecRead( char* buffer, kXR_int32 len, char *&value );
322 
323 };
324 
325 /******************************************************************************/
326 /* k X R _ g p f i l e R e q u e s t */
327 /******************************************************************************/
328 
329 struct ClientGPfileRequest { // ??? This is all wrong now
331  kXR_unt16 requestid; // kXR_gpfile
336 };
337 
338 /******************************************************************************/
339 /* k X R _ l o c a t e R e q u e s t */
340 /******************************************************************************/
341 
345  kXR_unt16 options; // See XOpenRequestOption enum tagged for locate
348 };
349 
350 /******************************************************************************/
351 /* k X R _ l o g i n R e q u e s t */
352 /******************************************************************************/
353 
354 // this is a bitmask
365 };
366 
367 // this iss a bitmask
371 };
372 
373 // this is a bitmask (note that XLoginVersion resides in lower bits)
378 };
379 
380 // this is a single number that is or'd into capver as the version
381 //
383  kXR_ver000 = 0, // Old clients predating history
384  kXR_ver001 = 1, // Generally implemented 2005 protocol
385  kXR_ver002 = 2, // Same as 1 but adds asyncresp recognition
386  kXR_ver003 = 3, // The 2011-2012 rewritten client
387  kXR_ver004 = 4, // The 2016 sign-capable client
388  kXR_ver005 = 5 // The 2019 TLS-capable client
389 };
390 
396  kXR_char ability2; // See XLoginAbility2 enum flags
397  kXR_char ability; // See XLoginAbility enum flags
398  kXR_char capver[1]; // See XLoginCapVer enum flags
401 };
402 
403 /******************************************************************************/
404 /* k X R _ m k d i r R e q u e s t */
405 /******************************************************************************/
406 
410 };
411 
417  kXR_unt16 mode; // See XOpenRequestMode
419 };
420 
421 /******************************************************************************/
422 /* k X R _ m v R e q u e s t */
423 /******************************************************************************/
424 
431 };
432 
433 /******************************************************************************/
434 /* k X R _ o p e n R e q u e s t */
435 /******************************************************************************/
436 
437 // OPEN MODE FOR A REMOTE FILE
439  kXR_ur = 0x100,
440  kXR_uw = 0x080,
441  kXR_ux = 0x040,
442  kXR_gr = 0x020,
443  kXR_gw = 0x010,
444  kXR_gx = 0x008,
445  kXR_or = 0x004,
446  kXR_ow = 0x002,
447  kXR_ox = 0x001
448 };
449 
451  kXR_compress = 1, // also locate (return unique hosts)
454  kXR_new = 8,
457  kXR_async = 64,
458  kXR_refresh = 128, // also locate
459  kXR_mkpath = 256,
460  kXR_prefname = 256, // only locate
462  kXR_retstat = 1024,
463  kXR_4dirlist = 1024, // for locate intending a dirlist
464  kXR_replica = 2048,
465  kXR_posc = 4096,
466  kXR_nowait = 8192, // also locate
467  kXR_seqio =16384,
469 };
470 
478 };
479 
480 /******************************************************************************/
481 /* k X R _ p g r e a d R e q u e s t */
482 /******************************************************************************/
483 
484 // The page size for pgread and pgwrite and the maximum transmission size
485 //
486 namespace XrdProto // Always use this namespace for new additions
487 {
488 static const int kXR_pgPageSZ = 4096; // Length of a page
489 static const int kXR_pgPageBL = 12; // log2(page length)
490 static const int kXR_pgUnitSZ = kXR_pgPageSZ + sizeof(kXR_unt32);
491 static const int kXR_pgMaxEpr = 128; // Max checksum errs per request
492 static const int kXR_pgMaxEos = 256; // Max checksum errs outstanding
493 
494 // kXR_pgread/write options
495 //
496 static const kXR_char kXR_AnyPath = 0xff; // In pathid
497 static const int kXR_pgRetry = 0x01; // In reqflags
498 }
499 
506  kXR_int32 dlen; // Request data length must be 0 unless args present
507 };
508 
510  kXR_char pathid; // Request data length must be 1
511  kXR_char reqflags; // Request data length must be 2
512 };
513 
514 namespace
515 {
516 }
517 
518 /******************************************************************************/
519 /* k X R _ p r w r i t e R e q u e s t */
520 /******************************************************************************/
521 
531 // kXR_char data[dlen];
532 };
533 
534 /******************************************************************************/
535 /* k X R _ p i n g R e q u e s t */
536 /******************************************************************************/
537 
543 };
544 
545 /******************************************************************************/
546 /* k X R _ p r o t o c o l R e q u e s t */
547 /******************************************************************************/
548 
552  kXR_int32 clientpv; // 2.9.7 or higher
553  kXR_char flags; // 3.1.0 or higher
554  kXR_char expect; // 4.0.0 or higher
557 
559  kXR_secreqs = 0x01, // Options: Return security requirements
560  kXR_ableTLS = 0x02, // Options: Client is TLS capable
561  kXR_wantTLS = 0x04 // Options: Change connection to use TLS
562 };
563 
565  kXR_ExpMask = 0x0f, // Isolate the relevant expect enumeration value
566  kXR_ExpNone = 0x00,
567  kXR_ExpBind = 0x01,
568  kXR_ExpGPF = 0x02,
569  kXR_ExpLogin = 0x03,
570  kXR_ExpTPC = 0x04,
571  kXR_ExpGPFA = 0x08
572 };
573 };
574 
575 /******************************************************************************/
576 /* k X R _ p r e p a r e R e q u e s t */
577 /******************************************************************************/
578 
584  kXR_wmode = 16,
585  kXR_coloc = 32,
586  kXR_fresh = 64,
587  kXR_usetcp = 128,
588 
589  kXR_evict = 0x0001 // optionsX: file no longer useful
590 };
591 
597  kXR_unt16 port; // 2.9.9 or higher
598  kXR_unt16 optionX; // Extended options
601 };
602 
603 /******************************************************************************/
604 /* k X R _ q u e r y R e q u e s t */
605 /******************************************************************************/
606 
619 };
620 
624  kXR_unt16 infotype; // See XQueryType enum
629 };
630 
631 /******************************************************************************/
632 /* k X R _ r e a d R e q u e s t */
633 /******************************************************************************/
634 
642 // Optionally followed by read_args
643 };
644 
645 struct read_args {
648 // This struct may be followed by an array of readahead_list
649 };
650 
655 };
656 
657 /******************************************************************************/
658 /* k X R _ r e a d v R e q u e s t */
659 /******************************************************************************/
660 
667 // This struct followed by the read_list
668 };
669 
670 namespace XrdProto // Always use this namespace for new additions
671 {
672 struct read_list {
676 };
677 static const int rlItemLen = sizeof(read_list);
678 static const int maxRvecln = 16384;
679 static const int maxRvecsz = maxRvecln/rlItemLen;
680 }
681 
682 /******************************************************************************/
683 /* k X R _ r m R e q u e s t */
684 /******************************************************************************/
685 
691 };
692 
693 /******************************************************************************/
694 /* k X R _ r m d i r R e q u e s t */
695 /******************************************************************************/
696 
702 };
703 
704 /******************************************************************************/
705 /* k X R _ s e t R e q u e s t */
706 /******************************************************************************/
707 
712  kXR_char modifier; // For security purposes, should be zero
714 };
715 
716 /******************************************************************************/
717 /* k X R _ s i g v e r R e q u e s t */
718 /******************************************************************************/
719 
720 // Cryptography used for kXR_sigver SigverRequest::crypto
722  kXR_SHA256 = 0x01, // Hash used
723  kXR_HashMask = 0x0f, // Mak to extract the hash type
724  kXR_rsaKey = 0x80 // The rsa key was used
725 };
726 
727 // Flags for kXR_sigver
728 enum XSecFlags {
729  kXR_nodata = 1 // Request payload was not hashed
730 };
731 
732 // Version number
735 };
736 
740  kXR_unt16 expectrid; // Request code of subsequent request
741  kXR_char version; // Security version being used (see XSecVersion)
742  kXR_char flags; // One or more flags defined in enum (see XSecFlags)
743  kXR_unt64 seqno; // Monotonically increasing number (part of hash)
744  kXR_char crypto; // Cryptography used (see XSecCrypto)
747 };
748 
749 /******************************************************************************/
750 /* k X R _ s t a t R e q u e s t */
751 /******************************************************************************/
752 
755 };
756 
760  kXR_char options; // See XStatRequestOption
764 };
765 
766 /******************************************************************************/
767 /* k X R _ s y n c R e q u e s t */
768 /******************************************************************************/
769 
776 };
777 
778 /******************************************************************************/
779 /* k X R _ t r u n c a t e R e q u e s t */
780 /******************************************************************************/
781 
789 };
790 
791 /******************************************************************************/
792 /* k X R _ w r i t e R e q u e s t */
793 /******************************************************************************/
794 
803 };
804 
805 /******************************************************************************/
806 /* k X R _ w r i t e v R e q u e s t */
807 /******************************************************************************/
808 
812  kXR_char options; // See static const ints below
815 // This struct followed by the write_list
816 
817  static const kXR_int32 doSync = 0x01;
818 };
819 
820 namespace XrdProto // Always use this namespace for new additions
821 {
822 struct write_list {
826 };
827 static const int wlItemLen = sizeof(write_list);
828 static const int maxWvecln = 16384;
829 static const int maxWvecsz = maxWvecln/wlItemLen;
830 }
831 
832 /******************************************************************************/
833 /* U n i o n o f a l l C l i e n t R e q u e s t s */
834 /******************************************************************************/
835 
836 typedef union {
837  struct ClientRequestHdr header;
838  struct ClientAuthRequest auth;
839  struct ClientBindRequest bind;
840  struct ClientChkPointRequest chkpoint;
841  struct ClientChmodRequest chmod;
843  struct ClientDirlistRequest dirlist;
844  struct ClientEndsessRequest endsess;
845  struct ClientFattrRequest fattr;
846  struct ClientGPfileRequest gpfile;
847  struct ClientLocateRequest locate;
848  struct ClientLoginRequest login;
850  struct ClientMvRequest mv;
852  struct ClientPgReadRequest pgread;
853  struct ClientPgWriteRequest pgwrite;
854  struct ClientPingRequest ping;
855  struct ClientPrepareRequest prepare;
856  struct ClientProtocolRequest protocol;
857  struct ClientQueryRequest query;
860  struct ClientRmRequest rm;
862  struct ClientSetRequest set;
863  struct ClientSigverRequest sigver;
865  struct ClientSyncRequest sync;
869 } ClientRequest;
870 
871 typedef union {
872  struct ClientRequestHdr header;
873  struct ClientSigverRequest sigver;
875 
876 /******************************************************************************/
877 /* S e r v e r R e s p o n s e s */
878 /******************************************************************************/
879 
880 // Nice header for the server response.
881 // Note that the protocol specifies these values to be in network
882 // byte order when sent
883 //
884 // G.Ganis: The following structures never need padding bytes:
885 // no need of packing options
886 
887 // Server response codes
888 //
890  kXR_ok = 0,
891  kXR_oksofar = 4000,
892  kXR_attn, // 4001
893  kXR_authmore,// 4002
894  kXR_error, // 4003
895  kXR_redirect,// 4004
896  kXR_wait, // 4005
897  kXR_waitresp,// 4006
898  kXR_status, // 4007
900 };
901 
902 // All serer responses start with the same header
903 //
908 };
909 
910 // This is a bit of wierdness held over from the very old days, sigh.
911 //
913  char data[4096];
914 };
915 
916 /******************************************************************************/
917 /* k X R _ a t t n R e s p o n s e */
918 /******************************************************************************/
919 
921  kXR_asyncab = 5000, // No longer supported
922  kXR_asyncdi, // 5001 No longer supported
923  kXR_asyncms = 5002,
924  kXR_asyncrd, // 5003 No longer supported
925  kXR_asyncwt, // 5004 No longer supported
926  kXR_asyncav, // 5005 No longer supported
927  kXR_asynunav, // 5006 No longer supported
928  kXR_asyncgo, // 5007 No longer supported
930 };
931 
933  kXR_int32 actnum; // See XActionCode enum
934  char parms[4096]; // Should be sufficient for every use
935 };
936 
938  kXR_int32 actnum; // XActionCode::kXR_asyncms
939  char reserved[4];
941  char respdata[4096];
942 };
943 
945  kXR_int32 actnum; // XActionCode::kXR_asynresp
946  char reserved[4];
948  char respdata[4096];
949 };
950 
951 /******************************************************************************/
952 /* k X R _ a u t h m o r e R e s p o n s e */
953 /******************************************************************************/
954 
956  char data[4096];
957 };
958 
959 /******************************************************************************/
960 /* k X R _ b i n d R e s p o n s e */
961 /******************************************************************************/
962 
965 };
966 
967 /******************************************************************************/
968 /* k X R _ c h k p o i n t R e s p o n s e */
969 /******************************************************************************/
970 
971 struct ServerResponseBody_ChkPoint { // Only for kXR_ckpQMax
972  kXR_unt32 maxCkpSize; // Maximum number of bytes including overhead
973  kXR_unt32 useCkpSize; // The number of bytes already being used
974 };
975 
976 /******************************************************************************/
977 /* k X R _ e r r o r R e s p o n s e */
978 /******************************************************************************/
979 
982  kXR_ArgMissing, // 3001
983  kXR_ArgTooLong, // 3002
984  kXR_FileLocked, // 3003
986  kXR_FSError, // 3005
988  kXR_IOError, // 3007
989  kXR_NoMemory, // 3008
990  kXR_NoSpace, // 3009
992  kXR_NotFound, // 3011
995  kXR_noserver, // 3014
996  kXR_NotFile, // 3015
998  kXR_Cancelled, // 3017
999  kXR_ItExists, // 3018
1000  kXR_ChkSumErr, // 3019
1002  kXR_overQuota, // 3021
1003  kXR_SigVerErr, // 3022
1013  kXR_Conflict, // 3032
1015  kXR_ERRFENCE, // Always last valid errcode + 1
1017 };
1018 
1020  kXR_int32 errnum; // See XErrorCode enu
1021  char errmsg[4096]; // Should be sufficient for every use
1022 };
1023 
1024 /******************************************************************************/
1025 /* k X R _ l o g i n R e s p o n s e */
1026 /******************************************************************************/
1027 
1030  kXR_char sec[4096]; // Should be sufficient for every use
1031 };
1032 
1033 /******************************************************************************/
1034 /* k X R _ o p e n R e s p o n s e */
1035 /******************************************************************************/
1036 
1039  kXR_int32 cpsize; // cpsize & cptype returned if kXR_compress *or*
1040  kXR_char cptype[4]; // kXR_retstat is specified
1041 }; // info will follow if kXR_retstat is specified
1042 
1043 /******************************************************************************/
1044 /* k X R _ p g r e a d R e s p o n s e */
1045 /******************************************************************************/
1046 
1048  kXR_int64 offset; // info[]: File offset of data that follows
1049 // kXR_char data[dlen];
1050 };
1051 
1052 /******************************************************************************/
1053 /* k X R _ p g w r i t e R e s p o n s e */
1054 /******************************************************************************/
1055 
1057  kXR_int64 offset; // info[]: File offset of data written
1058 };
1059 
1060 
1061 // The following structure is appended to ServerResponseBody_pgWrite if one or
1062 // more checksum errors occured and need to be retransmitted.
1063 //
1065  kXR_unt32 cseCRC; // crc32c of all following bits
1066  kXR_int16 dlFirst; // Data length at first offset in list
1067  kXR_int16 dlLast; // Data length at last offset in list
1068 // kXR_int64 bof[(dlen-8)/8]; // List of offsets of pages in error
1069 };
1070 
1071 /******************************************************************************/
1072 /* k X R _ p r o t o c o l R e s p o n s e */
1073 /******************************************************************************/
1074 
1075 // The following information is returned in the response body when kXR_secreqs
1076 // is set in ClientProtocolRequest::flags. Note that the size of secvec is
1077 // defined by secvsz and will not be present when secvsz == 0.
1078 //
1080  kXR_char reqindx; // Request index
1081  kXR_char reqsreq; // Request signing requirement
1082 };
1083 
1085  kXR_char theTag; // Always the character 'S' to identify struct
1086  kXR_char rsvd; // Reserved for the future (always 0 for now)
1087  kXR_char secver; // Security version
1088  kXR_char secopt; // Security options
1089  kXR_char seclvl; // Security level when secvsz == 0
1090  kXR_char secvsz; // Number of items in secvec (i.e. its length/2)
1092 };
1093 
1094 // Options reflected in protocol response ServerResponseReqs_Protocol::secopt
1095 //
1096 #define kXR_secOData 0x01
1097 #define kXR_secOFrce 0x02
1098 
1099 // Security level definitions (these are predefined but can be over-ridden)
1100 //
1101 #define kXR_secNone 0
1102 #define kXR_secCompatible 1
1103 #define kXR_secStandard 2
1104 #define kXR_secIntense 3
1105 #define kXR_secPedantic 4
1106 
1107 // Requirements one of which set in each ServerResponseReqs_Protocol::secvec
1108 //
1109 #define kXR_signIgnore 0
1110 #define kXR_signLikely 1
1111 #define kXR_signNeeded 2
1112 
1113 // Version used for kXR_sigver and is set in SigverRequest::version,
1114 // ServerResponseReqs_Protocol::secver
1115 //
1116 #define kXR_secver_0 0
1117 
1118 // KINDS of SERVERS (no longer used by new clients)
1119 //
1120 #define kXR_DataServer 1
1121 #define kXR_LBalServer 0
1122 
1123 // The below are defined for protocol version 2.9.7 or higher
1124 // These are the flag values in the kXR_protool response
1125 //
1126 #define kXR_isManager 0x00000002
1127 #define kXR_isServer 0x00000001
1128 #define kXR_attrMeta 0x00000100
1129 #define kXR_attrProxy 0x00000200
1130 #define kXR_attrSuper 0x00000400
1131 #define kXR_attrVirtRdr 0x00000800
1132 
1133 // Virtual options set on redirect
1134 //
1135 #define kXR_recoverWrts 0x00001000
1136 #define kXR_collapseRedir 0x00002000
1137 #define kXR_ecRedir 0x00004000
1138 
1139 // Things the server supports
1140 //
1141 #define kXR_anongpf 0x00800000
1142 #define kXR_supgpf 0x00400000
1143 #define kXR_suppgrw 0x00200000
1144 #define kXR_supposc 0x00100000
1145 
1146 // TLS requirements
1147 //
1148 #define kXR_haveTLS 0x80000000
1149 #define kXR_gotoTLS 0x40000000
1150 #define kXR_tlsAny 0x1f000000
1151 #define kXR_tlsData 0x01000000
1152 #define kXR_tlsGPF 0x02000000
1153 #define kXR_tlsLogin 0x04000000
1154 #define kXR_tlsSess 0x08000000
1155 #define kXR_tlsTPC 0x10000000
1156 #define kXR_tlsGPFA 0x20000000
1157 
1158 // Body for the kXR_protocol response... useful
1159 //
1163  ServerResponseReqs_Protocol secreq; // Only for V3.1.0+ && if requested
1164 };
1165 
1166 // Handy definition of the size of the protocol response when the security
1167 // information is not present.
1168 //
1169 #define kXR_ShortProtRespLen sizeof(ServerResponseBody_Protocol)-\
1170  sizeof(ServerResponseReqs_Protocol)
1171 
1172 /******************************************************************************/
1173 /* k X R _ r e d i r e c t R e s p o n s e */
1174 /******************************************************************************/
1175 
1178  char host[4096]; // Should be sufficient for every use
1179 };
1180 
1181 /******************************************************************************/
1182 /* k X R _ s t a t R e s p o n s e */
1183 /******************************************************************************/
1184 
1185 // The following bits are encoded in the "flags" token in the response
1186 //
1197 };
1198 
1199 /******************************************************************************/
1200 /* k X R _ s t a t u s R e s p o n s e */
1201 /******************************************************************************/
1202 
1203 struct ServerResponseBody_Status { // Always preceeded by ServerResponseHeader
1204  kXR_unt32 crc32c; // IETF RFC 7143 standard
1205  kXR_char streamID[2]; // Identical to streamid[2] in ServerResponseHeader
1206  kXR_char requestid; // requestcode - kXR_1stRequest
1207  kXR_char resptype; // See RespType enum below
1210 // kXR_char info[ServerResponseHeader::dlen-sizeof(ServerResponseBody_Status)];
1211 // kXR_char data[dlen];
1212 };
1213 
1214 namespace XrdProto
1215 {
1216 enum RespType {
1217 
1221 };
1222 
1223  // This is the minimum size of ServerResponseHeader::dlen for kXR_status
1224  //
1225  static const int kXR_statusBodyLen = sizeof(ServerResponseBody_Status);
1226 }
1227 
1231 };
1232 
1233 /******************************************************************************/
1234 /* k X R _ w a i t R e s p o n s e */
1235 /******************************************************************************/
1236 
1239  char infomsg[4096]; // Should be sufficient for every use
1240 };
1241 
1242 /******************************************************************************/
1243 /* k X R _ w a i t r e s p R e s p o n s e */
1244 /******************************************************************************/
1245 
1248 };
1249 
1250 /******************************************************************************/
1251 /* U n i o n o f a l l S e r v e r R e s p o n s e s */
1252 /******************************************************************************/
1253 
1255 {
1257  union
1258  {
1270  } body;
1271 };
1272 
1273 // The pgread and pgwrite do not fit the union above because they are composed
1274 // of three structs not two as all the above. So, we define the exceptions here.
1275 //
1277 {
1278  ServerResponseStatus status; // status.bdy and status.hdr
1279  union
1280  {
1283  } info;
1284 };
1285 
1286 struct ALIGN_CHECK {char chkszreq[25-sizeof(ClientRequest)];
1287  char chkszrsp[ 9-sizeof(ServerResponseHeader)];
1288 };
1289 
1290 /******************************************************************************/
1291 /* X P r o t o c o l U t i l i t i e s */
1292 /******************************************************************************/
1293 
1294 #include <errno.h>
1295 #if defined(WIN32)
1296 #if !defined(ENOTBLK)
1297 # define ENOTBLK 15
1298 #endif
1299 #if !defined(ETXTBSY)
1300 #define ETXTBSY 26
1301 #endif
1302 #if !defined(ENOBUFS)
1303 #define ENOBUFS 105
1304 #endif
1305 #if !defined(ENETUNREACH)
1306 #define ENETUNREACH 114
1307 #endif
1308 #endif
1309 
1310 #ifndef ENOATTR
1311 #define ENOATTR ENODATA
1312 #endif
1313 
1314 #ifndef EBADRQC
1315 #define EBADRQC EBADRPC
1316 #endif
1317 
1318 #ifndef EAUTH
1319 #define EAUTH EBADE
1320 #endif
1321 
1322 struct stat;
1323 
1325 {
1326 public:
1327 
1328 // mapError() is the official mapping from errno to xroot protocol error.
1329 //
1330 static int mapError(int rc)
1331  {if (rc < 0) rc = -rc;
1332  switch(rc)
1333  {case ENOENT: return kXR_NotFound;
1334  case EINVAL: return kXR_ArgInvalid;
1335  case EPERM: return kXR_NotAuthorized;
1336  case EACCES: return kXR_NotAuthorized;
1337  case EIO: return kXR_IOError;
1338  case ENOMEM: return kXR_NoMemory;
1339  case ENOBUFS: return kXR_NoMemory;
1340  case ENOSPC: return kXR_NoSpace;
1341  case ENAMETOOLONG: return kXR_ArgTooLong;
1342  case ENETUNREACH: return kXR_noserver;
1343  case ENOTBLK: return kXR_NotFile;
1344  case ENOTSUP: return kXR_Unsupported;
1345  case EISDIR: return kXR_isDirectory;
1346  case EEXIST: return kXR_ItExists;
1347  case EBADRQC: return kXR_InvalidRequest;
1348  case ETXTBSY: return kXR_inProgress;
1349  case ENODEV: return kXR_FSError;
1350  case EFAULT: return kXR_ServerError;
1351  case EDOM: return kXR_ChkSumErr;
1352  case EDQUOT: return kXR_overQuota;
1353  case EILSEQ: return kXR_SigVerErr;
1354  case ERANGE: return kXR_DecryptErr;
1355  case EUSERS: return kXR_Overloaded;
1356  case EROFS: return kXR_fsReadOnly;
1357  case ENOATTR: return kXR_AttrNotFound;
1358  case EPROTOTYPE: return kXR_TLSRequired;
1359  case EADDRNOTAVAIL: return kXR_noReplicas;
1360  case EAUTH: return kXR_AuthFailed;
1361  case EIDRM: return kXR_Impossible;
1362  case ENOTTY: return kXR_Conflict;
1363  case ETOOMANYREFS: return kXR_TooManyErrs;
1364  default: return kXR_FSError;
1365  }
1366  }
1367 
1368 static int toErrno( int xerr )
1369 {
1370  switch(xerr)
1371  {case kXR_ArgInvalid: return EINVAL;
1372  case kXR_ArgMissing: return EINVAL;
1373  case kXR_ArgTooLong: return ENAMETOOLONG;
1374  case kXR_FileLocked: return EDEADLK;
1375  case kXR_FileNotOpen: return EBADF;
1376  case kXR_FSError: return ENODEV;
1377  case kXR_InvalidRequest:return EBADRQC;
1378  case kXR_IOError: return EIO;
1379  case kXR_NoMemory: return ENOMEM;
1380  case kXR_NoSpace: return ENOSPC;
1381  case kXR_NotAuthorized: return EACCES;
1382  case kXR_NotFound: return ENOENT;
1383  case kXR_ServerError: return EFAULT;
1384  case kXR_Unsupported: return ENOTSUP;
1385  case kXR_noserver: return EHOSTUNREACH;
1386  case kXR_NotFile: return ENOTBLK;
1387  case kXR_isDirectory: return EISDIR;
1388  case kXR_Cancelled: return ECANCELED;
1389  case kXR_ItExists: return EEXIST;
1390  case kXR_ChkSumErr: return EDOM;
1391  case kXR_inProgress: return EINPROGRESS;
1392  case kXR_overQuota: return EDQUOT;
1393  case kXR_SigVerErr: return EILSEQ;
1394  case kXR_DecryptErr: return ERANGE;
1395  case kXR_Overloaded: return EUSERS;
1396  case kXR_fsReadOnly: return EROFS;
1397  case kXR_BadPayload: return EINVAL;
1398  case kXR_AttrNotFound: return ENOATTR;
1399  case kXR_TLSRequired: return EPROTOTYPE;
1400  case kXR_noReplicas: return EADDRNOTAVAIL;
1401  case kXR_AuthFailed: return EAUTH;
1402  case kXR_Impossible: return EIDRM;
1403  case kXR_Conflict: return ENOTTY;
1404  case kXR_TooManyErrs: return ETOOMANYREFS;
1405  default: return ENOMSG;
1406  }
1407 }
1408 
1409 static const char *errName(kXR_int32 errCode);
1410 
1411 static const char *reqName(kXR_unt16 reqCode);
1412 
1413 /******************************************************************************/
1414 /* O b s o l e t e D e f i n i t i o n s */
1415 /******************************************************************************/
1416 
1417 struct ServerResponseBody_Attn_asyncdi { // No longer supported
1421 };
1422 
1423 struct ServerResponseBody_Attn_asyncrd { // No longer supported
1426  char host[4092];
1427 };
1428 
1429 struct ServerResponseBody_Attn_asyncwt { // No longer supported
1432 };
1433 
1434 // Kind of error inside a XTNetFile's routine (temporary)
1435 //
1437  kGENERICERR = 0, // Generic error
1438  kREAD, // Error while reading from stream
1439  kWRITE, // Error while writing to stream
1440  kREDIRCONNECT, // Error redirecting to a given host
1441  kOK, // Everything seems ok
1442  kNOMORESTREAMS // No more available stream IDs for
1443  // async processing
1444 };
1445 
1447 
1448 #define kXR_maxReqRetry 10
1449 
1450 }; // XProtocol
1451 #endif
Definition: XProtocol.hh:944
unsigned char kXR_char
Definition: XPtypes.hh:65
kXR_int64 offset
Definition: XProtocol.hh:799
static const char * errName(kXR_int32 errCode)
Definition: XProtocol.hh:359
Definition: XProtocol.hh:1160
Definition: XProtocol.hh:1218
kXR_int32 dlen
Definition: XProtocol.hh:802
Definition: XProtocol.hh:459
Definition: XProtocol.hh:1193
Definition: XProtocol.hh:1012
Definition: XProtocol.hh:377
kXR_unt16 options
Definition: XProtocol.hh:475
Definition: XProtocol.hh:895
Definition: XProtocol.hh:613
kXR_unt16 requestid
Definition: XProtocol.hh:257
kXR_unt64 seqno
Definition: XProtocol.hh:743
kXR_char streamid[2]
Definition: XProtocol.hh:905
kXR_char reqflags
Definition: XProtocol.hh:528
kXR_int64 offset
Definition: XProtocol.hh:654
Definition: XProtocol.hh:1064
Definition: XProtocol.hh:585
Definition: XProtocol.hh:955
kXR_char streamid[2]
Definition: XProtocol.hh:244
Definition: XProtocol.hh:1441
Definition: XProtocol.hh:569
Definition: XProtocol.hh:734
static const int maxRvecln
Definition: XProtocol.hh:678
ServerResponseStatus status
Definition: XProtocol.hh:1278
static const kXR_int32 doSync
Definition: XProtocol.hh:817
#define truncate(a, b)
Definition: XrdPosix.hh:106
kXR_int32 dlen
Definition: XProtocol.hh:666
kXR_int32 port
Definition: XProtocol.hh:1177
kXR_char sessid[16]
Definition: XProtocol.hh:258
#define EAUTH
Definition: XProtocol.hh:1319
Definition: XProtocol.hh:583
Definition: XProtocol.hh:456
kXR_char fhandle[4]
Definition: XProtocol.hh:1038
kXR_char reserved[7]
Definition: XProtocol.hh:647
XMkdirOptions
Definition: XProtocol.hh:407
kXR_char streamid[2]
Definition: XProtocol.hh:550
char reserved[4]
Definition: XProtocol.hh:939
kXR_char flags
Definition: XProtocol.hh:742
kXR_char ability
Definition: XProtocol.hh:397
kXR_unt16 requestid
Definition: XProtocol.hh:637
kXR_unt16 requestid
Definition: XProtocol.hh:551
Definition: XProtocol.hh:446
kXR_int32 pid
Definition: XProtocol.hh:394
kXR_char streamid[2]
Definition: XProtocol.hh:201
kXR_char username[8]
Definition: XProtocol.hh:395
Definition: XProtocol.hh:982
Definition: XProtocol.hh:538
Definition: XProtocol.hh:929
Definition: XProtocol.hh:1006
kXR_int32 actnum
Definition: XProtocol.hh:938
kXR_int32 dlen
Definition: XProtocol.hh:556
Definition: XProtocol.hh:1219
kXR_char options[1]
Definition: XProtocol.hh:415
static const int kXR_pgMaxEpr
Definition: XProtocol.hh:491
Definition: XProtocol.hh:375
Definition: XProtocol.hh:132
Definition: XProtocol.hh:444
ServerResponseBody_Waitresp waitresp
Definition: XProtocol.hh:1269
kXR_char streamid[2]
Definition: XProtocol.hh:687
xfaSubCode
Definition: XProtocol.hh:268
Definition: XProtocol.hh:1195
ServerResponseBody_Wait wait
Definition: XProtocol.hh:1268
#define writev(a, b, c)
Definition: XrdPosix.hh:112
Definition: XProtocol.hh:890
kXR_int32 dlen
Definition: XProtocol.hh:193
char reserved[4]
Definition: XProtocol.hh:946
Definition: XProtocol.hh:1084
char infomsg[4096]
Definition: XProtocol.hh:1239
Definition: XProtocol.hh:225
Definition: XProtocol.hh:651
Definition: XProtocol.hh:455
Definition: XProtocol.hh:356
kXR_char rsvd
Definition: XProtocol.hh:1086
Definition: XProtocol.hh:1196
ServerResponseBody_Bind bind
Definition: XProtocol.hh:1261
kXR_char streamid[2]
Definition: XProtocol.hh:796
Definition: XProtocol.hh:471
Definition: XProtocol.hh:995
kXR_unt16 requestid
Definition: XProtocol.hh:331
kXR_char reserved[16]
Definition: XProtocol.hh:541
kXR_char streamid[2]
Definition: XProtocol.hh:166
Definition: XProtocol.hh:581
kXR_unt16 requestid
Definition: XProtocol.hh:739
Definition: XProtocol.hh:342
kXR_char fhandle[4]
Definition: XProtocol.hh:798
Definition: XProtocol.hh:1011
XReqErrorType
Definition: XProtocol.hh:1436
Definition: XProtocol.hh:981
kXR_unt16 optionX
Definition: XProtocol.hh:598
kXR_unt16 requestid
Definition: XProtocol.hh:502
Definition: XProtocol.hh:984
kXR_int32 dlen
Definition: XProtocol.hh:690
ExpectFlags
Definition: XProtocol.hh:564
Definition: XProtocol.hh:985
kXR_unt16 requestid
Definition: XProtocol.hh:227
kXR_char reserved[16]
Definition: XProtocol.hh:689
XOpenRequestMode
Definition: XProtocol.hh:438
Definition: XProtocol.hh:1015
char host[4092]
Definition: XProtocol.hh:1426
kXR_char fhandle[4]
Definition: XProtocol.hh:773
unsigned short kXR_unt16
Definition: XPtypes.hh:67
kXR_int32 third
Definition: XProtocol.hh:85
kXR_char credtype[4]
Definition: XProtocol.hh:169
Definition: XProtocol.hh:123
kXR_char streamid[2]
Definition: XProtocol.hh:523
kXR_int32 msgval
Definition: XProtocol.hh:95
Definition: XProtocol.hh:143
Definition: XProtocol.hh:1438
char data[4096]
Definition: XProtocol.hh:956
Definition: XProtocol.hh:614
Definition: XProtocol.hh:1423
Definition: XProtocol.hh:989
kXR_char prty
Definition: XProtocol.hh:596
kXR_int16 arg1len
Definition: XProtocol.hh:429
Definition: XProtocol.hh:1002
kXR_char pathid
Definition: XProtocol.hh:665
Definition: XProtocol.hh:927
kXR_int32 actnum
Definition: XProtocol.hh:1430
Definition: XProtocol.hh:445
kXR_char expect
Definition: XProtocol.hh:554
Definition: XProtocol.hh:120
kXR_char sessid[16]
Definition: XProtocol.hh:180
Definition: XProtocol.hh:129
kXR_char fhandle[4]
Definition: XProtocol.hh:503
kXR_unt16 requestid
Definition: XProtocol.hh:245
Definition: XProtocol.hh:121
Definition: XProtocol.hh:723
kXR_int32 dlen
Definition: XProtocol.hh:248
Definition: XProtocol.hh:130
kXR_char pathid
Definition: XProtocol.hh:510
kXR_unt16 requestid
Definition: XProtocol.hh:759
Definition: XProtocol.hh:549
kXR_unt16 requestid
Definition: XProtocol.hh:393
Definition: XProtocol.hh:1192
kXR_char streamid[2]
Definition: XProtocol.hh:709
#define ENOATTR
Definition: XProtocol.hh:1311
kXR_int32 options
Definition: XProtocol.hh:332
kXR_int32 rlen
Definition: XProtocol.hh:653
Definition: XProtocol.hh:408
Definition: XProtocol.hh:615
ServerResponseBody_pgWrite pgwrite
Definition: XProtocol.hh:1282
ServerResponseBody_pgRead pgread
Definition: XProtocol.hh:1281
Definition: XProtocol.hh:697
Definition: XProtocol.hh:383
static const kXR_char kXR_AnyPath
Definition: XProtocol.hh:496
Definition: XProtocol.hh:376
Definition: XProtocol.hh:177
kXR_unt16 requestid
Definition: XProtocol.hh:156
Definition: XProtocol.hh:1220
Definition: XProtocol.hh:370
kXR_unt16 requestid
Definition: XProtocol.hh:427
Definition: XProtocol.hh:592
Definition: XProtocol.hh:912
kXR_char streamid[2]
Definition: XProtocol.hh:330
kXR_unt16 status
Definition: XProtocol.hh:906
XLoginAbility2
Definition: XProtocol.hh:368
Definition: XProtocol.hh:1010
XSecCrypto
Definition: XProtocol.hh:721
kXR_char secopt
Definition: XProtocol.hh:1088
kXR_int32 rlen
Definition: XProtocol.hh:505
kXR_char reserved[8]
Definition: XProtocol.hh:333
kXR_int32 actnum
Definition: XProtocol.hh:1418
Definition: XProtocol.hh:240
Definition: XProtocol.hh:584
char respdata[4096]
Definition: XProtocol.hh:941
static int mapError(int rc)
Definition: XProtocol.hh:1330
kXR_char reserved[3]
Definition: XProtocol.hh:801
Definition: XProtocol.hh:522
kXR_unt16 requestid
Definition: XProtocol.hh:344
Definition: XProtocol.hh:754
kXR_unt16 infotype
Definition: XProtocol.hh:624
kXR_char capver[1]
Definition: XProtocol.hh:398
XResponseType
Definition: XProtocol.hh:889
Definition: XProtocol.hh:1429
kXR_char substreamid
Definition: XProtocol.hh:964
Definition: XProtocol.hh:608
static const int kXR_ckpXeq
Definition: XProtocol.hh:215
Definition: XProtocol.hh:1014
kXR_char reserved[14]
Definition: XProtocol.hh:191
Definition: XProtocol.hh:116
kXR_char streamid[2]
Definition: XProtocol.hh:810
kXR_int32 dlen
Definition: XProtocol.hh:814
kXR_int32 wsec
Definition: XProtocol.hh:1419
kXR_char streamid[2]
Definition: XProtocol.hh:226
kXR_char reserved[10]
Definition: XProtocol.hh:599
Definition: XProtocol.hh:568
kXR_char reserved[16]
Definition: XProtocol.hh:700
kXR_char fhandle[4]
Definition: XProtocol.hh:203
XQueryType
Definition: XProtocol.hh:607
Definition: XProtocol.hh:1417
Definition: XProtocol.hh:133
Definition: XProtocol.hh:1228
Definition: XProtocol.hh:387
kXR_int32 rlen
Definition: XProtocol.hh:640
kXR_int64 offset
Definition: XProtocol.hh:675
static const int kXR_ckpCommit
Definition: XProtocol.hh:212
Definition: XProtocol.hh:570
Definition: XProtocol.hh:442
struct ServerResponseBody_Status bdy
Definition: XProtocol.hh:1230
Definition: XProtocol.hh:567
Definition: XProtocol.hh:269
kXR_char seclvl
Definition: XProtocol.hh:1089
kXR_unt16 requestid
Definition: XProtocol.hh:772
Definition: XProtocol.hh:1008
kXR_int32 dlen
Definition: XProtocol.hh:641
static char * VVecRead(char *buffer, kXR_int32 &len)
Definition: XProtocol.hh:111
Definition: XProtocol.hh:112
static const int kXR_ckpMinMax
Definition: XProtocol.hh:219
kXR_int32 dlen
Definition: XProtocol.hh:530
ServerResponseBody_Login login
Definition: XProtocol.hh:1264
Definition: XProtocol.hh:1037
kXR_unt16 requestid
Definition: XProtocol.hh:473
static char * NVecInsert(const char *name, char *buffer)
static const int kXR_pgRetry
Definition: XProtocol.hh:497
kXR_char streamid[2]
Definition: XProtocol.hh:178
Definition: XProtocol.hh:1276
kXR_unt16 requestid
Definition: XProtocol.hh:784
Definition: XProtocol.hh:509
kXR_char reserved[9]
Definition: XProtocol.hh:291
kXR_char reserved1[2]
Definition: XProtocol.hh:625
kXR_char version
Definition: XProtocol.hh:741
Definition: XProtocol.hh:899
kXR_int32 dlen
Definition: XProtocol.hh:713
kXR_int32 dlen
Definition: XProtocol.hh:701
kXR_char reserved2[8]
Definition: XProtocol.hh:627
static const int wlItemLen
Definition: XProtocol.hh:827
Definition: XProtocol.hh:279
kXR_unt16 requestid
Definition: XProtocol.hh:699
Definition: XProtocol.hh:385
Definition: XProtocol.hh:1194
ServerResponseBody_Error error
Definition: XProtocol.hh:1263
Definition: XProtocol.hh:165
Definition: XProtocol.hh:364
kXR_int32 fourth
Definition: XProtocol.hh:86
kXR_int32 wlen
Definition: XProtocol.hh:824
kXR_int32 dlen
Definition: XProtocol.hh:600
kXR_int64 offset
Definition: XProtocol.hh:1048
Definition: XProtocol.hh:466
Definition: XProtocol.hh:1190
Definition: XProtocol.hh:126
XLoginVersion
Definition: XProtocol.hh:382
Definition: XProtocol.hh:998
Definition: XProtocol.hh:122
kXR_char cptype[4]
Definition: XProtocol.hh:1040
Definition: XProtocol.hh:795
char host[4096]
Definition: XProtocol.hh:1178
Definition: XProtocol.hh:645
kXR_char reserved[15]
Definition: XProtocol.hh:813
unsigned long long kXR_unt64
Definition: XPtypes.hh:99
kXR_int32 rlen
Definition: XProtocol.hh:674
Definition: XProtocol.hh:621
Definition: XProtocol.hh:1005
Definition: XProtocol.hh:200
kXR_int32 errnum
Definition: XProtocol.hh:1020
Definition: XProtocol.hh:114
kXR_int16 dlLast
Definition: XProtocol.hh:1067
kXR_int32 dlen
Definition: XProtocol.hh:628
kXR_char reserved[4]
Definition: XProtocol.hh:787
Definition: XProtocol.hh:386
kXR_char streamID[2]
Definition: XProtocol.hh:1205
kXR_char options
Definition: XProtocol.hh:595
kXR_char opcode
Definition: XProtocol.hh:205
Definition: XProtocol.hh:561
Definition: XProtocol.hh:1440
kXR_char reqindx
Definition: XProtocol.hh:1080
ServerResponseSVec_Protocol secvec
Definition: XProtocol.hh:1091
static const int kXR_pgPageBL
Definition: XProtocol.hh:489
kXR_int32 ServerResponseType
Definition: XProtocol.hh:1446
Definition: XProtocol.hh:722
kXR_char reserved[13]
Definition: XProtocol.hh:416
Definition: XProtocol.hh:1028
Definition: XProtocol.hh:1189
Definition: XProtocol.hh:441
char chkszreq[25-sizeof(ClientRequest)]
Definition: XProtocol.hh:1286
kXR_char streamid[2]
Definition: XProtocol.hh:783
Definition: XProtocol.hh:118
Definition: XProtocol.hh:986
kXR_char streamid[2]
Definition: XProtocol.hh:426
kXR_char streamid[2]
Definition: XProtocol.hh:256
kXR_unt32 maxCkpSize
Definition: XProtocol.hh:972
kXR_char options
Definition: XProtocol.hh:812
Definition: XProtocol.hh:443
Definition: XProtocol.hh:500
kXR_int32 second
Definition: XProtocol.hh:84
Definition: XProtocol.hh:894
kXR_char streamid[2]
Definition: XProtocol.hh:413
Definition: XProtocol.hh:724
static const int maxWvecln
Definition: XProtocol.hh:828
Definition: XProtocol.hh:239
Definition: XProtocol.hh:369
Definition: XProtocol.hh:892
kXR_char streamid[2]
Definition: XProtocol.hh:189
char data[4096]
Definition: XProtocol.hh:913
static const int maxWvecsz
Definition: XProtocol.hh:829
#define write(a, b, c)
Definition: XrdPosix.hh:110
kXR_int32 dlen
Definition: XProtocol.hh:1209
kXR_char pathid
Definition: XProtocol.hh:646
kXR_int32 dlen
Definition: XProtocol.hh:335
Definition: XProtocol.hh:238
kXR_unt16 requestid
Definition: XProtocol.hh:710
kXR_int32 msglen
Definition: XProtocol.hh:93
Definition: XProtocol.hh:616
kXR_unt16 requestid
Definition: XProtocol.hh:663
Definition: XProtocol.hh:357
kXR_unt32 crc32c
Definition: XProtocol.hh:1204
ServerResponseBody_Status status
Definition: XProtocol.hh:1267
Definition: XProtocol.hh:1013
char respdata[4096]
Definition: XProtocol.hh:948
kXR_char fhandle[4]
Definition: XProtocol.hh:638
Definition: XProtocol.hh:871
kXR_char reserved[12]
Definition: XProtocol.hh:168
kXR_int64 offset
Definition: XProtocol.hh:639
Definition: XProtocol.hh:467
Definition: XProtocol.hh:770
Definition: XProtocol.hh:618
kXR_int32 port
Definition: XProtocol.hh:1425
kXR_unt16 requestid
Definition: XProtocol.hh:797
kXR_char ability2
Definition: XProtocol.hh:396
Definition: XProtocol.hh:463
Definition: XProtocol.hh:1324
Definition: XProtocol.hh:937
Definition: XProtocol.hh:110
Definition: XProtocol.hh:1007
Definition: XProtocol.hh:439
kXR_int32 cpsize
Definition: XProtocol.hh:1039
XErrorCode
Definition: XProtocol.hh:980
Definition: XProtocol.hh:1286
kXR_int32 dlen
Definition: XProtocol.hh:292
Definition: XProtocol.hh:243
kXR_char streamid[2]
Definition: XProtocol.hh:698
Definition: XProtocol.hh:566
kXR_int32 dlen
Definition: XProtocol.hh:158
Definition: XProtocol.hh:1439
Definition: XProtocol.hh:1188
Definition: XProtocol.hh:963
kXR_unt16 requestid
Definition: XProtocol.hh:190
Definition: XProtocol.hh:896
XLoginCapVer
Definition: XProtocol.hh:374
Definition: XProtocol.hh:988
kXR_int64 offset
Definition: XProtocol.hh:1057
Definition: XProtocol.hh:999
ServerResponseBody_Protocol protocol
Definition: XProtocol.hh:1265
kXR_int64 offset
Definition: XProtocol.hh:526
Definition: XProtocol.hh:384
kXR_char streamid[2]
Definition: XProtocol.hh:758
static const int kXR_ckpBegin
Definition: XProtocol.hh:211
static const int kXR_pgMaxEos
Definition: XProtocol.hh:492
static const int kXR_pgPageSZ
Definition: XProtocol.hh:488
Definition: XProtocol.hh:1203
Definition: XProtocol.hh:113
Definition: XProtocol.hh:708
Definition: XProtocol.hh:358
kXR_unt16 requestid
Definition: XProtocol.hh:540
XSecVersion
Definition: XProtocol.hh:733
Definition: XProtocol.hh:729
static const int aData
Definition: XProtocol.hh:297
kXR_char reserved[15]
Definition: XProtocol.hh:711
kXR_unt16 mode
Definition: XProtocol.hh:417
kXR_int32 pval
Definition: XProtocol.hh:1161
Definition: XProtocol.hh:617
Definition: XProtocol.hh:273
kXR_int32 dlen
Definition: XProtocol.hh:542
XSecFlags
Definition: XProtocol.hh:728
static const int rlItemLen
Definition: XProtocol.hh:677
kXR_unt16 expectrid
Definition: XProtocol.hh:740
Definition: XProtocol.hh:893
kXR_char fhandle[4]
Definition: XProtocol.hh:673
Definition: XProtocol.hh:391
Definition: XProtocol.hh:425
Definition: XProtocol.hh:131
ServerResponseBody_Redirect redirect
Definition: XProtocol.hh:1266
Definition: XProtocol.hh:612
Definition: XProtocol.hh:138
Definition: XProtocol.hh:125
kXR_char requestid
Definition: XProtocol.hh:1206
kXR_int32 dlen
Definition: XProtocol.hh:400
Definition: XProtocol.hh:928
kXR_char streamid[2]
Definition: XProtocol.hh:738
kXR_unt16 requestid
Definition: XProtocol.hh:202
kXR_int32 dlen
Definition: XProtocol.hh:347
Definition: XProtocol.hh:1003
kXR_char body[16]
Definition: XProtocol.hh:157
kXR_char reserved[4]
Definition: XProtocol.hh:1208
Definition: XProtocol.hh:141
Definition: XProtocol.hh:119
Definition: XProtocol.hh:188
kXR_char secver
Definition: XProtocol.hh:1087
Definition: XProtocol.hh:127
unsigned int kXR_unt32
Definition: XPtypes.hh:90
kXR_char streamid[2]
Definition: XProtocol.hh:771
Definition: XProtocol.hh:388
Definition: XProtocol.hh:1254
kXR_int32 dlen
Definition: XProtocol.hh:746
kXR_char reserved[12]
Definition: XProtocol.hh:229
kXR_int64 offset
Definition: XProtocol.hh:786
kXR_char reserved[12]
Definition: XProtocol.hh:476
kXR_int32 flags
Definition: XProtocol.hh:1162
static const int kXR_ckpQuery
Definition: XProtocol.hh:213
Definition: XProtocol.hh:1246
kXR_unt16 requestid
Definition: XProtocol.hh:623
kXR_char streamid[2]
Definition: XProtocol.hh:662
Definition: XProtocol.hh:154
Definition: XProtocol.hh:672
kXR_int32 actnum
Definition: XProtocol.hh:1424
Definition: XProtocol.hh:904
static char * VVecInsert(const char *value, char *buffer)
RespType
Definition: XProtocol.hh:1216
Definition: XProtocol.hh:891
kXR_char reserved[10]
Definition: XProtocol.hh:555
Definition: XProtocol.hh:486
Definition: XProtocol.hh:454
Definition: XProtocol.hh:440
kXR_char secvsz
Definition: XProtocol.hh:1090
kXR_unt16 requestid
Definition: XProtocol.hh:414
Definition: XProtocol.hh:360
Definition: XProtocol.hh:447
Definition: XProtocol.hh:1079
kXR_char options
Definition: XProtocol.hh:760
RequestFlags
Definition: XProtocol.hh:558
kXR_char fhandle[4]
Definition: XProtocol.hh:652
Definition: XProtocol.hh:457
Definition: XProtocol.hh:996
Definition: XProtocol.hh:922
Definition: XProtocol.hh:983
kXR_int32 fifth
Definition: XProtocol.hh:87
kXR_unt16 requestid
Definition: XProtocol.hh:524
xfaLimits
Definition: XProtocol.hh:278
XLoginAbility
Definition: XProtocol.hh:355
char parms[4096]
Definition: XProtocol.hh:934
Definition: XProtocol.hh:329
kXR_int32 dlen
Definition: XProtocol.hh:477
Definition: XProtocol.hh:587
kXR_unt16 requestid
Definition: XProtocol.hh:167
kXR_char reserved[2]
Definition: XProtocol.hh:529
Definition: XProtocol.hh:362
kXR_int32 dlen
Definition: XProtocol.hh:788
Definition: XProtocol.hh:452
ServerResponseReqs_Protocol secreq
Definition: XProtocol.hh:1163
kXR_char reserved[14]
Definition: XProtocol.hh:428
kXR_unt32 cseCRC
Definition: XProtocol.hh:1065
Definition: XProtocol.hh:409
Definition: XProtocol.hh:462
Definition: XProtocol.hh:1016
ServerResponseHeader resphdr
Definition: XProtocol.hh:947
Definition: XProtocol.hh:686
Definition: XProtocol.hh:1009
Definition: XProtocol.hh:923
struct ServerResponseHeader hdr
Definition: XProtocol.hh:1229
XRequestTypes
Definition: XProtocol.hh:109
Definition: XProtocol.hh:609
#define stat(a, b)
Definition: XrdPosix.hh:96
kXR_char streamid[2]
Definition: XProtocol.hh:539
kXR_int32 first
Definition: XProtocol.hh:83
kXR_char reqsreq
Definition: XProtocol.hh:1081
#define EBADRQC
Definition: XProtocol.hh:1315
Definition: XProtocol.hh:560
Definition: XProtocol.hh:137
kXR_char reserved[15]
Definition: XProtocol.hh:246
kXR_char fhandle[4]
Definition: XProtocol.hh:823
Definition: XProtocol.hh:992
kXR_int32 dlen
Definition: XProtocol.hh:430
kXR_char streamid[2]
Definition: XProtocol.hh:636
kXR_int32 dlen
Definition: XProtocol.hh:907
Definition: XProtocol.hh:926
static const char * reqName(kXR_unt16 reqCode)
Definition: XProtocol.hh:993
Definition: XProtocol.hh:635
kXR_char streamid[2]
Definition: XProtocol.hh:622
Definition: XProtocol.hh:1442
Definition: XProtocol.hh:255
kXR_char sec[4096]
Definition: XProtocol.hh:1030
kXR_char streamid[2]
Definition: XProtocol.hh:501
kXR_char theTag
Definition: XProtocol.hh:1085
kXR_int32 seconds
Definition: XProtocol.hh:1247
Definition: XProtocol.hh:582
Definition: XProtocol.hh:128
kXR_char reserved2
Definition: XProtocol.hh:399
kXR_char streamid[2]
Definition: XProtocol.hh:285
static const int isNew
Definition: XProtocol.hh:296
Definition: XProtocol.hh:363
#define close(a)
Definition: XrdPosix.hh:43
XPrepRequestOption
Definition: XProtocol.hh:579
kXR_int64 offset
Definition: XProtocol.hh:825
kXR_char flags
Definition: XProtocol.hh:553
kXR_char streamid[2]
Definition: XProtocol.hh:593
Definition: XProtocol.hh:580
Definition: XProtocol.hh:987
kXR_char modifier
Definition: XProtocol.hh:712
kXR_char streamid[2]
Definition: XProtocol.hh:392
Definition: XProtocol.hh:451
Definition: XProtocol.hh:921
kXR_char streamid[2]
Definition: XProtocol.hh:155
Definition: XProtocol.hh:586
Definition: XProtocol.hh:1237
union ServerResponseV2::@1 info
Definition: XProtocol.hh:464
XActionCode
Definition: XProtocol.hh:920
kXR_char streamid[2]
Definition: XProtocol.hh:472
kXR_int32 dlen
Definition: XProtocol.hh:775
static const int kXR_statusBodyLen
Definition: XProtocol.hh:1225
Definition: XProtocol.hh:661
kXR_int64 offset
Definition: XProtocol.hh:504
kXR_char pathid
Definition: XProtocol.hh:527
Definition: XProtocol.hh:589
kXR_char streamid[2]
Definition: XProtocol.hh:343
Definition: XProtocol.hh:361
Definition: XProtocol.hh:971
kXR_char reserved[14]
Definition: XProtocol.hh:346
Definition: XProtocol.hh:1437
Definition: XProtocol.hh:117
Definition: XProtocol.hh:115
Definition: XProtocol.hh:897
XOpenRequestOption
Definition: XProtocol.hh:450
#define open
Definition: XrdPosix.hh:71
kXR_char resptype
Definition: XProtocol.hh:1207
Definition: XProtocol.hh:142
Definition: XProtocol.hh:281
Definition: XProtocol.hh:924
ServerResponseBody_Attn attn
Definition: XProtocol.hh:1259
kXR_char fhandle[4]
Definition: XProtocol.hh:287
Definition: XProtocol.hh:465
kXR_char fhandle[4]
Definition: XProtocol.hh:228
XDirlistRequestOption
Definition: XProtocol.hh:237
int kXR_int32
Definition: XPtypes.hh:89
Definition: XProtocol.hh:458
kXR_unt32 useCkpSize
Definition: XProtocol.hh:973
Definition: XProtocol.hh:82
ServerResponseHeader hdr
Definition: XProtocol.hh:1256
Definition: XProtocol.hh:611
kXR_int32 actnum
Definition: XProtocol.hh:945
kXR_char fhandle[4]
Definition: XProtocol.hh:525
Definition: XProtocol.hh:1056
kXR_char reserved[11]
Definition: XProtocol.hh:761
kXR_unt16 requestid
Definition: XProtocol.hh:179
kXR_int32 dlen
Definition: XProtocol.hh:181
kXR_unt16 mode
Definition: XProtocol.hh:474
Definition: XProtocol.hh:272
kXR_int32 dlen
Definition: XProtocol.hh:763
kXR_char numattr
Definition: XProtocol.hh:289
Definition: XProtocol.hh:468
Definition: XProtocol.hh:994
static char * NVecRead(char *buffer, kXR_unt16 &rc)
Definition: XProtocol.hh:140
kXR_int32 protover
Definition: XProtocol.hh:94
Definition: XProtocol.hh:149
kXR_int32 dlen
Definition: XProtocol.hh:259
Definition: XProtocol.hh:836
kXR_char reserved[12]
Definition: XProtocol.hh:774
kXR_unt16 requestid
Definition: XProtocol.hh:811
#define read(a, b, c)
Definition: XrdPosix.hh:77
kXR_int32 buffsz
Definition: XProtocol.hh:334
Definition: XProtocol.hh:757
Definition: XProtocol.hh:92
Definition: XProtocol.hh:280
Definition: XProtocol.hh:990
Definition: XProtocol.hh:991
Definition: XProtocol.hh:460
Definition: XProtocol.hh:271
Definition: XProtocol.hh:1019
ServerResponseBody_Buffer buffer
Definition: XProtocol.hh:1262
Definition: XProtocol.hh:559
char errmsg[4096]
Definition: XProtocol.hh:1021
kXR_char rsvd2[3]
Definition: XProtocol.hh:745
kXR_char subcode
Definition: XProtocol.hh:288
kXR_char options[1]
Definition: XProtocol.hh:247
kXR_char reserved[11]
Definition: XProtocol.hh:204
Definition: XProtocol.hh:1004
static const int kXR_ckpRollback
Definition: XProtocol.hh:214
kXR_char options
Definition: XProtocol.hh:290
kXR_unt16 port
Definition: XProtocol.hh:597
Definition: XProtocol.hh:270
kXR_char pathid
Definition: XProtocol.hh:800
Definition: XProtocol.hh:571
Definition: XProtocol.hh:1000
kXR_int32 msec
Definition: XProtocol.hh:1420
ServerResponseHeader resphdr
Definition: XProtocol.hh:940
kXR_int32 dlen
Definition: XProtocol.hh:506
XStatRespFlags
Definition: XProtocol.hh:1187
static const int maxRvecsz
Definition: XProtocol.hh:679
kXR_unt16 requestid
Definition: XProtocol.hh:594
kXR_int32 dlen
Definition: XProtocol.hh:418
kXR_int32 dlen
Definition: XProtocol.hh:206
static const int kXR_pgUnitSZ
Definition: XProtocol.hh:490
XVirtRequestTypes
Definition: XProtocol.hh:148
Definition: XProtocol.hh:134
kXR_int32 wsec
Definition: XProtocol.hh:1431
kXR_char reserved[15]
Definition: XProtocol.hh:664
#define mkdir(a, b)
Definition: XrdPosix.hh:69
Definition: XProtocol.hh:1001
Definition: XProtocol.hh:461
Definition: XProtocol.hh:124
kXR_char reqflags
Definition: XProtocol.hh:511
kXR_int32 seconds
Definition: XProtocol.hh:1238
Definition: XProtocol.hh:898
Definition: XProtocol.hh:997
Definition: XProtocol.hh:284
long long kXR_int64
Definition: XPtypes.hh:98
Definition: XProtocol.hh:610
kXR_char crypto
Definition: XProtocol.hh:744
kXR_int32 actnum
Definition: XProtocol.hh:933
Definition: XProtocol.hh:453
kXR_int32 dlen
Definition: XProtocol.hh:170
XStatRequestOption
Definition: XProtocol.hh:753
#define rmdir(a)
Definition: XrdPosix.hh:92
Definition: XProtocol.hh:136
Definition: XProtocol.hh:737
kXR_unt16 requestid
Definition: XProtocol.hh:286
kXR_unt16 mode
Definition: XProtocol.hh:192
kXR_int16 dlFirst
Definition: XProtocol.hh:1066
kXR_int32 dlen
Definition: XProtocol.hh:230
Definition: XProtocol.hh:782
kXR_char sessid[16]
Definition: XProtocol.hh:1029
Definition: XProtocol.hh:932
static int toErrno(int xerr)
Definition: XProtocol.hh:1368
char chkszrsp[9-sizeof(ServerResponseHeader)]
Definition: XProtocol.hh:1287
kXR_char fhandle[4]
Definition: XProtocol.hh:762
Definition: XProtocol.hh:925
kXR_unt16 options
Definition: XProtocol.hh:345
Definition: XProtocol.hh:412
Definition: XProtocol.hh:135
ServerResponseBody_Authmore authmore
Definition: XProtocol.hh:1260
#define readv(a, b, c)
Definition: XrdPosix.hh:79
Definition: XProtocol.hh:565
Definition: XProtocol.hh:1191
kXR_char fhandle[4]
Definition: XProtocol.hh:785
short kXR_int16
Definition: XPtypes.hh:66
Definition: XProtocol.hh:1176
union ServerResponse::@0 body
kXR_unt16 requestid
Definition: XProtocol.hh:688
Definition: XProtocol.hh:1047
Definition: XProtocol.hh:809
kXR_char fhandle[4]
Definition: XProtocol.hh:626
Definition: XProtocol.hh:822
Definition: XProtocol.hh:139
kXR_int32 clientpv
Definition: XProtocol.hh:552