XRootD
Loading...
Searching...
No Matches
XrdXrootdTransit.cc File Reference
#include <cstring>
#include <unistd.h>
#include <sys/uio.h>
#include "XProtocol/XProtocol.hh"
#include "XrdSec/XrdSecEntity.hh"
#include "Xrd/XrdBuffer.hh"
#include "Xrd/XrdLink.hh"
#include "XrdOuc/XrdOucErrInfo.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdSfs/XrdSfsInterface.hh"
#include "XrdSys/XrdSysAtomics.hh"
#include "XrdXrootd/XrdXrootdStats.hh"
#include "XrdXrootd/XrdXrootdTrace.hh"
#include "XrdXrootd/XrdXrootdTransit.hh"
#include "XrdXrootd/XrdXrootdTransPend.hh"
#include "XrdXrootd/XrdXrootdTransSend.hh"
+ Include dependency graph for XrdXrootdTransit.cc:

Go to the source code of this file.

Macros

#define KXR_INDEX(x)   x-kXR_auth
 
#define TRACELINK   Link
 
#define XRD_GETNUM(x)    ntohl(*(static_cast<unsigned int *>(static_cast<void *>(x))))
 

Variables

XrdSysTrace XrdXrootdTrace
 

Macro Definition Documentation

◆ KXR_INDEX

#define KXR_INDEX (   x)    x-kXR_auth

Definition at line 513 of file XrdXrootdTransit.cc.

◆ TRACELINK

#define TRACELINK   Link

Definition at line 58 of file XrdXrootdTransit.cc.

◆ XRD_GETNUM

#define XRD_GETNUM (   x)     ntohl(*(static_cast<unsigned int *>(static_cast<void *>(x))))

Definition at line 60 of file XrdXrootdTransit.cc.

82{
84
85// Simply return a new transit object masquerading as a bridge
86//
87 if (!(xp = TranStack.Pop())) xp = new XrdXrootdTransit();
88 xp->Init(rsltP, linkP, seceP, nameP, protP);
89 return xp;
90}
91
92/******************************************************************************/
93/* A t t n */
94/******************************************************************************/
95
96int XrdXrootdTransit::Attn(XrdLink *lP, short *theSID, int rcode,
97 const struct iovec *ioV, int ioN, int ioL)
98{
100
101// Find the request
102//
103 if (!(tP = XrdXrootdTransPend::Remove(lP, *theSID)))
104 {TRACE(REQ, "Unable to find request for " <<lP->ID <<" sid=" <<*theSID);
105 return 0;
106 }
107
108// Resume the request as we have been waiting for the response.
109//
110 return tP->bridge->AttnCont(tP, rcode, ioV, ioN, ioL);
111}
112
113/******************************************************************************/
114/* A t t n C o n t */
115/******************************************************************************/
116
117int XrdXrootdTransit::AttnCont(XrdXrootdTransPend *tP, int rcode,
118 const struct iovec *ioV, int ioN, int ioL)
119{
120 int rc;
121
122// Refresh the request structure
123//
124 memcpy(&Request, &(tP->Pend.Request), sizeof(Request));
125 delete tP;
126 runWait = 0;
127
128// Reissue the request if it's a wait 0 response.
129//
130 if (rcode==kXR_wait
131 && (!ioN || XRD_GETNUM(ioV[0].iov_base) == 0))
132 {Sched->Schedule((XrdJob *)&waitJob);
133 return 0;
134 }
135
136// Send off the deferred response
137//
138 rc = Send(rcode, ioV, ioN, ioL);
139
140// Handle end based on current state
141//
142 if (rc >= 0 && !runWait)
143 {if (runDone)
144 {AtomicBeg(runMutex);
145 AtomicZAP(runStatus);
146 AtomicEnd(runMutex);
147 }
148 if (reInvoke) Sched->Schedule((XrdJob *)&respJob);
149 else Link->Enable();
150 }
151
152// All done
153//
154 return rc;
155}
156
157/******************************************************************************/
158/* D i s c */
159/******************************************************************************/
160
162{
163 char buff[128];
164 int rc;
165
166// We do not allow disconnection while we are active
167//
168 AtomicBeg(runMutex);
169 rc = AtomicInc(runStatus);
170 AtomicEnd(runMutex);
171 if (rc) return false;
172
173// Reconnect original protocol to the link
174//
175 Link->setProtocol(realProt);
176
177// Now we need to recycle our xrootd part
178//
179 sprintf(buff, "%s disconnection", pName);
180 XrdXrootdProtocol::Recycle(Link, time(0)-cTime, buff);
181
182// Now just free up our object.
183//
184 TranStack.Push(&TranLink);
185 return true;
186}
187
188/******************************************************************************/
189/* Private: F a i l */
190/******************************************************************************/
191
192bool XrdXrootdTransit::Fail(int ecode, const char *etext)
193{
194 runError = ecode;
195 runEText = etext;
196 return true;
197}
198
199/******************************************************************************/
200/* F a t a l */
201/******************************************************************************/
202
203int XrdXrootdTransit::Fatal(int rc)
204{
207
208 return (respObj->Error(rInfo, runError, runEText) ? rc : -1);
209}
210
211/******************************************************************************/
212/* I n i t */
213/******************************************************************************/
214
215void XrdXrootdTransit::Init(XrdScheduler *schedP, int qMax, int qTTL)
216{
217 TranStack.Set(schedP, &XrdXrootdTrace, TRACE_MEM);
218 TranStack.Set(qMax, qTTL);
219}
220
221/******************************************************************************/
222
224 XrdLink *linkP,
225 XrdSecEntity *seceP,
226 const char *nameP,
227 const char *protP
228 )
229{
230 XrdNetAddrInfo *addrP;
231 const char *who;
232 char uname[sizeof(Request.login.username)+1];
233
234// Set standard stuff
235//
236 runArgs = 0;
237 runALen = 0;
238 runABsz = 0;
239 runError = 0;
240 runStatus = 0;
241 runWait = 0;
242 runWTot = 0;
243 runWMax = 3600;
244 runWCall = false;
245 runDone = false;
246 reInvoke = false;
247 wBuff = 0;
248 wBLen = 0;
249 respObj = respP;
250 pName = protP;
251 mySID = getSID();
252
253// Bind the protocol to the link
254//
255 SI->Bump(SI->Count);
256 Link = linkP;
257 Response.Set(linkP);
258 Response.Set(this);
259 strcpy(Entity.prot, "host");
260 Entity.host = (char *)linkP->Host();
261
262// Develop a trace identifier
263//
264 strncpy(uname, nameP, sizeof(uname)-1);
265 uname[sizeof(uname)-1] = 0;
267 linkP->setID(uname, mySID);
268
269// Place trace identifier everywhere is should be located
270
271// Indicate that this brige supports asynchronous responses
272//
274
275// Mark the client as IPv4 if they came in as IPv4 or mapped IPv4. Note
276// there is no way we can figure out if this is a dual-stack client.
277//
278 addrP = Link->AddrInfo();
279 if (addrP->isIPType(XrdNetAddrInfo::IPv4) || addrP->isMapped())
281
282// Mark the client as being on a private net if the address is private
283//
284 if (addrP->isPrivate()) {clientPV |= XrdOucEI::uPrip; rdType = 1;}
285 else rdType = 0;
286
287// Now tie the security information
288//
289 Client = (seceP ? seceP : &Entity);
290 Client->ueid = mySID;
292 Client->addrInfo = addrP;
293
294// Allocate a monitoring object, if needed for this connection and record login
295//
296 if (Monitor.Ready())
297 {Monitor.Register(linkP->ID, linkP->Host(), protP);
298 if (Monitor.Logins())
299 {if (Monitor.Auths() && seceP) MonAuth();
300 else Monitor.Report(Monitor.Auths() ? "" : 0);
301 }
302 }
303
304// Complete the request ID object
305//
306 ReqID.setID(Request.header.streamid, linkP->FDnum(), linkP->Inst());
307
308// Substitute our protocol for the existing one
309//
310 realProt = linkP->setProtocol(this);
311 linkP->setProtName(protP);
312 linkP->armBridge();
313
314// Document this login
315//
316 who = (seceP && seceP->name ? seceP->name : "nobody");
317 eDest.Log(SYS_LOG_01, "Bridge", Link->ID, "login as", who);
318
319// All done, indicate we are logged in
320//
322 cTime = time(0);
323
324// Propogate a connect through the whole system
325//
327}
328
329/******************************************************************************/
330/* P r o c e e d */
331/******************************************************************************/
332
334{
335 int rc;
336
337// If we were interrupted in a reinvoke state, resume that state.
338//
339 if (reInvoke) rc = Process(Link);
340 else rc = 0;
341
342// Handle ending status
343//
344 if (rc >= 0) Link->Enable();
345 else if (rc != -EINPROGRESS) Link->Close();
346}
347
348/******************************************************************************/
349/* P r o c e s s */
350/******************************************************************************/
351
353{
354 int rc;
355
356// This entry is serialized via link processing and data is now available.
357// One of the following will be returned.
358//
359// < 0 -> Stop getting requests,
360// -EINPROGRESS leave link disabled but otherwise all is well
361// -n Error, disable and close the link
362// = 0 -> OK, get next request, if allowed, o/w enable the link
363// > 0 -> Slow link, stop getting requests and enable the link
364//
365
366// Reflect data is present to the underlying protocol and if Run() has been
367// called we need to dispatch that request. This may be iterative.
368//
369do{rc = realProt->Process((reInvoke ? 0 : lp));
370 if (rc >= 0 && runStatus)
371 {reInvoke = (rc == 0);
372 if (runError) rc = Fatal(rc);
373 else {runDone = false;
375 if (rc >= 0)
376 {if (runWait) rc = -EINPROGRESS;
377 if (!runDone) return rc;
378 AtomicBeg(runMutex);
379 AtomicZAP(runStatus);
380 AtomicEnd(runMutex);
381 }
382 }
383 } else reInvoke = false;
384 } while(rc >= 0 && reInvoke);
385
386// Make sure that we indicate that we are no longer active
387//
388 if (runStatus)
389 {AtomicBeg(runMutex);
390 AtomicZAP(runStatus);
391 AtomicEnd(runMutex);
392 }
393
394// All done
395//
396 return (rc ? rc : 1);
397}
398
399/******************************************************************************/
400/* R e c y c l e */
401/******************************************************************************/
402
403void XrdXrootdTransit::Recycle(XrdLink *lp, int consec, const char *reason)
404{
405
406// Set ourselves as active so we can't get more requests
407//
408 AtomicBeg(runMutex);
409 AtomicInc(runStatus);
410 AtomicEnd(runMutex);
411
412// If we were active then we will need to quiesce before dismantling ourselves.
413// Note that Recycle() can only be called if the link is enabled. So, this bit
414// of code is improbable but we check it anyway.
415//
416 if (runWait > 0) Sched->Cancel(&waitJob);
417
418// First we need to recycle the real protocol
419//
420 if (realProt) realProt->Recycle(lp, consec, reason);
421
422// Now we need to recycle our xrootd part
423//
424 XrdXrootdProtocol::Recycle(lp, consec, reason);
425
426// Release the argument buffer
427//
428 if (runArgs) {free(runArgs); runArgs = 0;}
429
430// Delete all pending requests
431//
433
434// Now just free up our object.
435//
436 TranStack.Push(&TranLink);
437}
438
439/******************************************************************************/
440/* R e d r i v e */
441/******************************************************************************/
442
444{
445 static int eCode = htonl(kXR_NoMemory);
446 static char eText[] = "Insufficent memory to re-issue request";
447 static struct iovec ioV[] = {{(char *)&eCode,sizeof(eCode)},
448 {(char *)&eText,sizeof(eText)}};
449 int rc;
450
451// Do some tracing
452//
453 TRACEP(REQ, "Bridge redrive runStatus="<<runStatus<<" runError="<<runError
454 <<" runWait="<<runWait<<" runWTot="<<runWTot);
455
456// Update wait statistics
457//
458 runWTot += runWait;
459 runWait = 0;
460
461// While we are running asynchronously, there is no way that this object can
462// be deleted while a timer is outstanding as the link has been disabled. So,
463// we can reissue the request with little worry.
464//
465// This is a bit tricky here as a redriven request may result in a wait. If
466// this happens we cannot hand the result off to the real protocol until we
467// wait and successfully redrive. The wait handling occurs asynchronously
468// so all we need to do is honor it here.
469//
470 if (!runALen || RunCopy(runArgs, runALen)) {
471 do{rc = Process2();
472 TRACEP(REQ, "Bridge redrive Process2 rc="<<rc
473 <<" runError="<<runError<<" runWait="<<runWait);
474 if (rc == 0 && !runWait && !runError) {
475 rc = realProt->Process(NULL);
476 TRACEP(REQ, "Bridge redrive callback rc="<<rc
477 <<" runStatus="<<runStatus);
478 }
479 if (runStatus)
480 {AtomicBeg(runMutex);
481 AtomicZAP(runStatus);
482 AtomicEnd(runMutex);
483 }
484 } while((rc == 0) && !runError && !runWait);
485 }
486 else rc = Send(kXR_error, ioV, 2, 0);
487
488// Defer the request if need be
489//
490 if (rc >= 0 && runWait) return;
491 runWTot = 0;
492
493// Indicate we are no longer active
494//
495 if (runStatus)
496 {AtomicBeg(runMutex);
497 AtomicZAP(runStatus);
498 AtomicEnd(runMutex);
499 }
500
501// If the link needs to be terminated, terminate the link. Otherwise, we can
502// enable the link for new requests at this point.
503//
504 if (rc < 0) Link->Close();
505 else Link->Enable();
506}
507
508/******************************************************************************/
509/* R e q T a b l e */
510/******************************************************************************/
511
512#define KXR_INDEX(x) x-kXR_auth
513
514const char *XrdXrootdTransit::ReqTable()
515{
516 static char rTab[kXR_truncate-kXR_auth+1];
517
518// Initialize the table
519//
520 memset(rTab, 0, sizeof(rTab));
521 rTab[KXR_INDEX(kXR_chmod)] = 1;
522 rTab[KXR_INDEX(kXR_close)] = 1;
523 rTab[KXR_INDEX(kXR_dirlist)] = 1;
524 rTab[KXR_INDEX(kXR_locate)] = 1;
525 rTab[KXR_INDEX(kXR_mkdir)] = 1;
526 rTab[KXR_INDEX(kXR_mv)] = 1;
527 rTab[KXR_INDEX(kXR_open)] = 1;
528 rTab[KXR_INDEX(kXR_prepare)] = 1;
529 rTab[KXR_INDEX(kXR_protocol)] = 1;
530 rTab[KXR_INDEX(kXR_query)] = 1;
531 rTab[KXR_INDEX(kXR_read)] = 2;
532 rTab[KXR_INDEX(kXR_readv)] = 2;
533 rTab[KXR_INDEX(kXR_rm)] = 1;
534 rTab[KXR_INDEX(kXR_rmdir)] = 1;
535 rTab[KXR_INDEX(kXR_set)] = 1;
536 rTab[KXR_INDEX(kXR_stat)] = 1;
537 rTab[KXR_INDEX(kXR_statx)] = 1;
538 rTab[KXR_INDEX(kXR_sync)] = 1;
539 rTab[KXR_INDEX(kXR_truncate)] = 1;
540 rTab[KXR_INDEX(kXR_write)] = 2;
541
542// Now return the address
543//
544 return rTab;
545}
546
547/******************************************************************************/
548/* Private: R e q W r i t e */
549/******************************************************************************/
550
551bool XrdXrootdTransit::ReqWrite(char *xdataP, int xdataL)
552{
553
554// Make sure we always transit to the resume point
555//
556 myBlen = 0;
557
558// If nothing was read, then this is a straight-up write
559//
560 if (!xdataL || !xdataP || !Request.header.dlen)
561 {Resume = 0; wBuff = xdataP; wBLen = xdataL;
562 return true;
563 }
564
565// Partial data was read, we may have to split this between a direct write
566// and a network read/write -- somewhat complicated.
567//
568 myBuff = wBuff = xdataP;
569 myBlast = wBLen = xdataL;
571 return true;
572}
573
574/******************************************************************************/
575/* R u n */
576/******************************************************************************/
577
578bool XrdXrootdTransit::Run(const char *xreqP, char *xdataP, int xdataL)
579{
580 int movLen, rc;
581
582// We do not allow re-entry if we are curently processing a request.
583// It will be reset, as need, when a response is effected.
584//
585 AtomicBeg(runMutex);
586 rc = AtomicInc(runStatus);
587 AtomicEnd(runMutex);
588 if (rc)
589 {TRACEP(REQ, "Bridge request failed due to re-entry");
590 return false;
591 }
592
593// Copy the request header
594//
595 memcpy((void *)&Request, (void *)xreqP, sizeof(Request));
596
597// Validate that we can actually handle this request
598//
600 if (Request.header.requestid & 0x8000
602 || !reqTab[Request.header.requestid - kXR_auth])
603 {TRACEP(REQ, "Unsupported bridge request");
604 return Fail(kXR_Unsupported, "Unsupported bridge request");
605 }
606
607// Validate the data length
608//
610 if (Request.header.dlen < 0)
611 {TRACEP(REQ, "Invalid request data length");
612 return Fail(kXR_ArgInvalid, "Invalid request data length");
613 }
614
615// Copy the stream id and trace this request
616//
618 TRACEP(REQ, "Bridge req=" <<Request.header.requestid
619 <<" dlen=" <<Request.header.dlen <<" blen=" <<xdataL);
620
621// If this is a write request, we will need to do a lot more
622//
623 if (Request.header.requestid == kXR_write) return ReqWrite(xdataP, xdataL);
624
625// Obtain any needed buffer and handle any existing data arguments. Also, we
626// need to keep a shadow copy of the request arguments should we get a wait
627// and will need to re-issue the request (the server mangles the args).
628//
629 if (Request.header.dlen)
630 {movLen = (xdataL < Request.header.dlen ? xdataL : Request.header.dlen);
631 if (!RunCopy(xdataP, movLen)) return true;
632 if (!runArgs || movLen > runABsz)
633 {if (runArgs) free(runArgs);
634 if (!(runArgs = (char *)malloc(movLen)))
635 {TRACEP(REQ, "Failed to allocate memory");
636 return Fail(kXR_NoMemory, "Insufficient memory");
637 }
638 runABsz = movLen;
639 }
640 memcpy(runArgs, xdataP, movLen); runALen = movLen;
641 if ((myBlen = Request.header.dlen - movLen))
642 {myBuff = argp->buff + movLen;
644 return true;
645 }
646 } else runALen = 0;
647
648// If we have all the data, indicate request accepted.
649//
650 runError = 0;
651 Resume = 0;
652 return true;
653}
654
655/******************************************************************************/
656/* Privae: R u n C o p y */
657/******************************************************************************/
658
659bool XrdXrootdTransit::RunCopy(char *buffP, int buffL)
660{
661
662// Allocate a buffer if we do not have one or it is too small
663//
664 if (!argp || Request.header.dlen+1 > argp->bsize)
665 {if (argp) BPool->Release(argp);
666 if (!(argp = BPool->Obtain(Request.header.dlen+1)))
667 {Fail(kXR_ArgTooLong, "Request argument too long"); return false;}
668 hcNow = hcPrev; halfBSize = argp->bsize >> 1;
669 }
670
671// Copy the arguments to the buffer
672//
673 memcpy(argp->buff, buffP, buffL);
674 argp->buff[buffL] = 0;
675 return true;
676}
677
678/******************************************************************************/
679/* S e n d */
680/******************************************************************************/
681
682int XrdXrootdTransit::Send(int rcode, const struct iovec *ioV, int ioN, int ioL)
683{
686 const char *eMsg;
687 int rc;
688 bool aOK;
689
690// Invoke the result object (we initially assume this is the final result)
691//
692 runDone = true;
693 switch(rcode)
694 {case kXR_error:
695 rc = XRD_GETNUM(ioV[0].iov_base);
696 eMsg = (ioN < 2 ? "" : (const char *)ioV[1].iov_base);
697 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
698 aOK = respObj->Error(rInfo, rc, eMsg);
699 break;
700 case kXR_ok:
701 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
702 aOK = (ioN ? respObj->Data(rInfo, ioV, ioN, ioL, true)
703 : respObj->Done(rInfo));
704 break;
705 case kXR_oksofar:
706 aOK = respObj->Data(rInfo, ioV, ioN, ioL, false);
707 runDone = false;
708 break;
709 case kXR_redirect:
710 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
711 rc = XRD_GETNUM(ioV[0].iov_base);
712 aOK = respObj->Redir(rInfo,rc,(const char *)ioV[1].iov_base);
713 break;
714 case kXR_wait:
715 return Wait(rInfo, ioV, ioN, ioL);
716 break;
717 case kXR_waitresp:
718 runDone = false;
719 return WaitResp(rInfo, ioV, ioN, ioL);
720 break;
721 default: if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
722 aOK = respObj->Error(rInfo, kXR_ServerError,
723 "internal logic error");
724 break;
725 };
726
727// All done
728//
729 return (aOK ? 0 : -1);
730}
731
732/******************************************************************************/
733
734int XrdXrootdTransit::Send(long long offset, int dlen, int fdnum)
735{
738 offset, dlen, fdnum);
739
740// Effect callback (this is always a final result)
741//
742 runDone = true;
743 return (respObj->File(sfInfo, dlen) ? 0 : -1);
744}
745
746/******************************************************************************/
747
748int XrdXrootdTransit::Send(XrdOucSFVec *sfvec, int sfvnum, int dlen)
749{
752 sfvec, sfvnum, dlen);
753
754// Effect callback (this is always a final result)
755//
756 runDone = true;
757 return (respObj->File(sfInfo, dlen) ? 0 : -1);
758}
759
760/******************************************************************************/
761/* Private: W a i t */
762/******************************************************************************/
763
764int XrdXrootdTransit::Wait(XrdXrootd::Bridge::Context &rInfo,
765 const struct iovec *ioV, int ioN, int ioL)
766{
767 const char *eMsg;
768
769// Trace this request if need be
770//
771 runWait = XRD_GETNUM(ioV[0].iov_base);
772 eMsg = (ioN < 2 ? "reason unknown" : (const char *)ioV[1].iov_base);
773
774// Check if the protocol wants to handle all waits
775//
776 if (runWMax <= 0)
777 {int wtime = runWait;
778 runWait = 0;
779 return (respObj->Wait(rInfo, wtime, eMsg) ? 0 : -1);
780 }
781
782// Check if we have exceeded the maximum wait time
783//
784 if (runWTot >= runWMax)
785 {runDone = true;
786 runWait = 0;
787 return (respObj->Error(rInfo, kXR_Cancelled, eMsg) ? 0 : -1);
788 }
789
790// Readjust wait time
791//
792 if (runWait > runWMax) runWait = runWMax;
793
794// Check if the protocol wants a wait notification
795//
796 if (runWCall && !(respObj->Wait(rInfo, runWait, eMsg))) return -1;
797
798// All done, schedule the wait
799//
800 TRACEP(REQ, "Bridge delaying request " <<runWait <<" sec (" <<eMsg <<")");
801 Sched->Schedule((XrdJob *)&waitJob, time(0)+runWait);
802 return 0;
803}
804
805/******************************************************************************/
806/* Private: W a i t R e s p */
807/******************************************************************************/
808
809int XrdXrootdTransit::WaitResp(XrdXrootd::Bridge::Context &rInfo,
810 const struct iovec *ioV, int ioN, int ioL)
811{
813 const char *eMsg;
814 int wTime;
815
816// Trace this request if need be
817//
818 wTime = XRD_GETNUM(ioV[0].iov_base);
819 eMsg = (ioN < 2 ? "reason unknown" : (const char *)ioV[1].iov_base);
820 TRACEP(REQ, "Bridge waiting for resp; sid=" <<rInfo.sID.num
821 <<" wt=" <<wTime <<" (" <<eMsg <<")");
822
823// We would issue callback to see how we should handle this. However, we can't
824// predictably handle a waitresp. So that means we will just wait for a resp.
825//
826// XrdXrootd::Bridge::Result *newCBP = respObj->WaitResp(rInfo, runWait, eMsg);
827
828// Save the current state
829//
830 trP = new XrdXrootdTransPend(Link, this, &Request);
831 trP->Queue();
832
833// Effect a wait
834//
835 runWait = -1;
836 return 0;
837}
@ kXR_ArgInvalid
Definition XProtocol.hh:990
@ kXR_Unsupported
@ kXR_Cancelled
@ kXR_ServerError
@ kXR_ArgTooLong
Definition XProtocol.hh:992
@ kXR_NoMemory
Definition XProtocol.hh:998
kXR_char streamid[2]
Definition XProtocol.hh:156
kXR_char username[8]
Definition XProtocol.hh:396
@ kXR_waitresp
Definition XProtocol.hh:906
@ kXR_redirect
Definition XProtocol.hh:904
@ kXR_oksofar
Definition XProtocol.hh:900
@ kXR_ok
Definition XProtocol.hh:899
@ kXR_wait
Definition XProtocol.hh:905
@ kXR_error
Definition XProtocol.hh:903
struct ClientRequestHdr header
Definition XProtocol.hh:846
struct ClientLoginRequest login
Definition XProtocol.hh:857
kXR_unt16 requestid
Definition XProtocol.hh:157
@ kXR_read
Definition XProtocol.hh:125
@ kXR_open
Definition XProtocol.hh:122
@ kXR_readv
Definition XProtocol.hh:137
@ kXR_mkdir
Definition XProtocol.hh:120
@ kXR_sync
Definition XProtocol.hh:128
@ kXR_chmod
Definition XProtocol.hh:114
@ kXR_dirlist
Definition XProtocol.hh:116
@ kXR_rm
Definition XProtocol.hh:126
@ kXR_query
Definition XProtocol.hh:113
@ kXR_write
Definition XProtocol.hh:131
@ kXR_auth
Definition XProtocol.hh:112
@ kXR_set
Definition XProtocol.hh:130
@ kXR_rmdir
Definition XProtocol.hh:127
@ kXR_statx
Definition XProtocol.hh:134
@ kXR_truncate
Definition XProtocol.hh:140
@ kXR_protocol
Definition XProtocol.hh:118
@ kXR_mv
Definition XProtocol.hh:121
@ kXR_stat
Definition XProtocol.hh:129
@ kXR_locate
Definition XProtocol.hh:139
@ kXR_close
Definition XProtocol.hh:115
@ kXR_prepare
Definition XProtocol.hh:133
@ kXR_asyncap
Definition XProtocol.hh:378
@ kXR_ver002
Definition XProtocol.hh:386
unsigned short kXR_unt16
Definition XPtypes.hh:67
unsigned char kXR_char
Definition XPtypes.hh:65
XrdOucTrace * XrdXrootdTrace
#define eMsg(x)
#define AtomicInc(x)
#define AtomicBeg(Mtx)
#define AtomicZAP(x)
#define AtomicEnd(Mtx)
const int SYS_LOG_01
#define TRACE_MEM
Definition XrdTrace.hh:38
#define TRACE(act, x)
Definition XrdTrace.hh:63
#define XRD_LOGGEDIN
#define TRACEP(act, x)
#define XRD_GETNUM(x)
#define KXR_INDEX(x)
void Release(XrdBuffer *bp)
Definition XrdBuffer.cc:221
XrdBuffer * Obtain(int bsz)
Definition XrdBuffer.cc:140
char * buff
Definition XrdBuffer.hh:45
bool isMapped() const
bool isIPType(IPType ipType) const
void Set(int inQMax, time_t agemax=1800)
Definition XrdObject.icc:90
void Push(XrdObject< T > *Node)
Definition XrdObject.hh:101
void Bump(int &val)
static void Sanitize(char *instr, char subc='_')
virtual void Recycle(XrdLink *lp=0, int consec=0, const char *reason=0)=0
virtual int Process(XrdLink *lp)=0
void Schedule(XrdJob *jp)
void Cancel(XrdJob *jp)
const char * pident
Trace identifier (originator)
XrdNetAddrInfo * addrInfo
Entity's connection details.
const char * tident
Trace identifier always preset.
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
char * name
Entity's name.
unsigned int ueid
Unique ID of entity instance.
char * host
Entity's host name dnr dependent.
virtual void Connect(const XrdSecEntity *client=0)
void Log(int mask, const char *esfx, const char *text1, const char *text2=0, const char *text3=0)
void Register(const char *Uname, const char *Hname, const char *Pname, unsigned int xSID=0)
void Report(const char *Info)
static XrdXrootdStats * SI
static XrdSysError & eDest
static unsigned int getSID()
XrdXrootdMonitor::User Monitor
int(XrdXrootdProtocol::* Resume)()
static XrdScheduler * Sched
int Process(XrdLink *lp) override
void Recycle(XrdLink *lp, int consec, const char *reason) override
XrdXrootdResponse Response
static XrdBuffManager * BPool
static XrdSfsFileSystem * osFS
void setID(unsigned long long id)
void Set(XrdLink *lp)
static XrdXrootdTransPend * Remove(XrdLink *lP, short sid)
union XrdXrootdTransPend::@191 Pend
XrdXrootdTransit * bridge
static void Clear(XrdXrootdTransit *trP)
bool Run(const char *xreqP, char *xdataP=0, int xdataL=0)
Inject an xrootd request into the protocol stack.
static const char * ReqTable()
Initialize the valid request table.
void Redrive()
Redrive a request after a wait.
int Send(int rcode, const struct iovec *ioVec, int ioNum, int ioLen)
Handle request data response.
void Recycle(XrdLink *lp, int consec, const char *reason)
Handle link shutdown.
static void Init(XrdScheduler *schedP, int qMax, int qTTL)
Perform one-time initialization.
static int Attn(XrdLink *lP, short *theSID, int rcode, const struct iovec *ioVec, int ioNum, int ioLen)
Handle attention response (i.e. async response)
void Proceed()
Resume processing after a waitresp completion.
bool Disc()
Handle dismantlement.
int Process(XrdLink *lp)
Handle link activation (replaces parent activation).
union XrdXrootd::Bridge::Context::@164 sID
associated request stream ID
virtual int File(Bridge::Context &info, int dlen)=0
virtual bool Data(Bridge::Context &info, const struct iovec *iovP, int iovN, int iovL, bool final)=0
virtual bool Error(Bridge::Context &info, int ecode, const char *etext)=0
virtual bool Done(Bridge::Context &info)=0
the result context
virtual bool Redir(Bridge::Context &info, int port, const char *hname)=0
virtual bool Wait(Bridge::Context &info, int wtime, const char *wtext)
virtual void Free(Bridge::Context &info, char *buffP, int buffL)
static const int uIPv4
ucap: Supports read redirects
static const int uPrip

Variable Documentation

◆ XrdXrootdTrace

XrdSysTrace XrdXrootdTrace
extern

Definition at line 96 of file XrdFrmAdminMain.cc.