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