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