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 492 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) runStatus.store(0, std::memory_order_release);
144 if (reInvoke) Sched->Schedule((XrdJob *)&respJob);
145 else Link->Enable();
146 }
147
148// All done
149//
150 return rc;
151}
152
153/******************************************************************************/
154/* D i s c */
155/******************************************************************************/
156
158{
159 char buff[128];
160
161// We do not allow disconnection while we are active
162//
163 if (runStatus.fetch_add(1, std::memory_order_acq_rel)) return false;
164
165// Reconnect original protocol to the link
166//
167 Link->setProtocol(realProt);
168
169// Now we need to recycle our xrootd part
170//
171 sprintf(buff, "%s disconnection", pName);
172 XrdXrootdProtocol::Recycle(Link, time(0)-cTime, buff);
173
174// Now just free up our object.
175//
176 TranStack.Push(&TranLink);
177 return true;
178}
179
180/******************************************************************************/
181/* Private: F a i l */
182/******************************************************************************/
183
184bool XrdXrootdTransit::Fail(int ecode, const char *etext)
185{
186 runError = ecode;
187 runEText = etext;
188 return true;
189}
190
191/******************************************************************************/
192/* F a t a l */
193/******************************************************************************/
194
195int XrdXrootdTransit::Fatal(int rc)
196{
199
200 return (respObj->Error(rInfo, runError, runEText) ? rc : -1);
201}
202
203/******************************************************************************/
204/* I n i t */
205/******************************************************************************/
206
207void XrdXrootdTransit::Init(XrdScheduler *schedP, int qMax, int qTTL)
208{
209 TranStack.Set(schedP, &XrdXrootdTrace, TRACE_MEM);
210 TranStack.Set(qMax, qTTL);
211}
212
213/******************************************************************************/
214
216 XrdLink *linkP,
217 XrdSecEntity *seceP,
218 const char *nameP,
219 const char *protP
220 )
221{
222 XrdNetAddrInfo *addrP;
223 const char *who;
224 char uname[sizeof(Request.login.username)+1];
225
226// Set standard stuff
227//
228 runArgs = 0;
229 runALen = 0;
230 runABsz = 0;
231 runError = 0;
232 runStatus.store(0, std::memory_order_release);
233 runWait = 0;
234 runWTot = 0;
235 runWMax = 3600;
236 runWCall = false;
237 runDone = false;
238 reInvoke = false;
239 wBuff = 0;
240 wBLen = 0;
241 respObj = respP;
242 pName = protP;
243 mySID = getSID();
244
245// Bind the protocol to the link
246//
247 SI->Bump(SI->Count);
248 Link = linkP;
249 Response.Set(linkP);
250 Response.Set(this);
251 strcpy(Entity.prot, "host");
252 Entity.host = (char *)linkP->Host();
253
254// Develop a trace identifier
255//
256 strncpy(uname, nameP, sizeof(uname)-1);
257 uname[sizeof(uname)-1] = 0;
259 linkP->setID(uname, mySID);
260
261// Place trace identifier everywhere is should be located
262
263// Indicate that this brige supports asynchronous responses
264//
266
267// Mark the client as IPv4 if they came in as IPv4 or mapped IPv4. Note
268// there is no way we can figure out if this is a dual-stack client.
269//
270 addrP = Link->AddrInfo();
271 if (addrP->isIPType(XrdNetAddrInfo::IPv4) || addrP->isMapped())
273
274// Mark the client as being on a private net if the address is private
275//
276 if (addrP->isPrivate()) {clientPV |= XrdOucEI::uPrip; rdType = 1;}
277 else rdType = 0;
278
279// Now tie the security information
280//
281 Client = (seceP ? seceP : &Entity);
282 Client->ueid = mySID;
284 Client->addrInfo = addrP;
285
286// Allocate a monitoring object, if needed for this connection and record login
287//
288 if (Monitor.Ready())
289 {Monitor.Register(linkP->ID, linkP->Host(), protP);
290 if (Monitor.Logins())
291 {if (Monitor.Auths() && seceP) MonAuth();
292 else Monitor.Report(Monitor.Auths() ? "" : 0);
293 }
294 }
295
296// Complete the request ID object
297//
298 ReqID.setID(Request.header.streamid, linkP->FDnum(), linkP->Inst());
299
300// Substitute our protocol for the existing one
301//
302 realProt = linkP->setProtocol(this);
303 linkP->setProtName(protP);
304 linkP->armBridge();
305
306// Document this login
307//
308 who = (seceP && seceP->name ? seceP->name : "nobody");
309 eDest.Log(SYS_LOG_01, "Bridge", Link->ID, "login as", who);
310
311// All done, indicate we are logged in
312//
314 cTime = time(0);
315
316// Propogate a connect through the whole system
317//
319}
320
321/******************************************************************************/
322/* P r o c e e d */
323/******************************************************************************/
324
326{
327 int rc;
328
329// If we were interrupted in a reinvoke state, resume that state.
330//
331 if (reInvoke) rc = Process(Link);
332 else rc = 0;
333
334// Handle ending status
335//
336 if (rc >= 0) Link->Enable();
337 else if (rc != -EINPROGRESS) Link->Close();
338}
339
340/******************************************************************************/
341/* P r o c e s s */
342/******************************************************************************/
343
345{
346 int rc;
347
348// This entry is serialized via link processing and data is now available.
349// One of the following will be returned.
350//
351// < 0 -> Stop getting requests,
352// -EINPROGRESS leave link disabled but otherwise all is well
353// -n Error, disable and close the link
354// = 0 -> OK, get next request, if allowed, o/w enable the link
355// > 0 -> Slow link, stop getting requests and enable the link
356//
357
358// Reflect data is present to the underlying protocol and if Run() has been
359// called we need to dispatch that request. This may be iterative.
360//
361do{rc = realProt->Process((reInvoke ? 0 : lp));
362 if (rc >= 0 && runStatus.load(std::memory_order_acquire))
363 {reInvoke = (rc == 0);
364 if (runError) rc = Fatal(rc);
365 else {runDone = false;
367 if (rc >= 0)
368 {if (runWait) rc = -EINPROGRESS;
369 if (!runDone) return rc;
370 runStatus.store(0, std::memory_order_release);
371 }
372 }
373 } else reInvoke = false;
374 } while(rc >= 0 && reInvoke);
375
376// Make sure that we indicate that we are no longer active
377//
378 runStatus.store(0, std::memory_order_release);
379
380// All done
381//
382 return (rc ? rc : 1);
383}
384
385/******************************************************************************/
386/* R e c y c l e */
387/******************************************************************************/
388
389void XrdXrootdTransit::Recycle(XrdLink *lp, int consec, const char *reason)
390{
391
392// Set ourselves as active so we can't get more requests
393//
394 runStatus.fetch_add(1, std::memory_order_acq_rel);
395
396// If we were active then we will need to quiesce before dismantling ourselves.
397// Note that Recycle() can only be called if the link is enabled. So, this bit
398// of code is improbable but we check it anyway.
399//
400 if (runWait > 0) {
401 TRACEP(EMSG, "WARNING: Recycle is canceling wait job; the wait job might already be running during recycle.");
402 Sched->Cancel(&waitJob);
403 }
404
405// First we need to recycle the real protocol
406//
407 if (realProt) realProt->Recycle(lp, consec, reason);
408
409// Now we need to recycle our xrootd part
410//
411 XrdXrootdProtocol::Recycle(lp, consec, reason);
412
413// Release the argument buffer
414//
415 if (runArgs) {free(runArgs); runArgs = 0;}
416
417// Delete all pending requests
418//
420
421// Now just free up our object.
422//
423 TranStack.Push(&TranLink);
424}
425
426/******************************************************************************/
427/* R e d r i v e */
428/******************************************************************************/
429
431{
432 static int eCode = htonl(kXR_NoMemory);
433 static char eText[] = "Insufficent memory to re-issue request";
434 static struct iovec ioV[] = {{(char *)&eCode,sizeof(eCode)},
435 {(char *)&eText,sizeof(eText)}};
436 int rc;
437
438// Do some tracing
439//
440 TRACEP(REQ, "Bridge redrive runStatus="<<runStatus.load(std::memory_order_acquire)
441 <<" runError="<<runError
442 <<" runWait="<<runWait<<" runWTot="<<runWTot);
443
444// Update wait statistics
445//
446 runWTot += runWait;
447 runWait = 0;
448
449// While we are running asynchronously, there is no way that this object can
450// be deleted while a timer is outstanding as the link has been disabled. So,
451// we can reissue the request with little worry.
452//
453// This is a bit tricky here as a redriven request may result in a wait. If
454// this happens we cannot hand the result off to the real protocol until we
455// wait and successfully redrive. The wait handling occurs asynchronously
456// so all we need to do is honor it here.
457//
458 if (!runALen || RunCopy(runArgs, runALen)) {
459 do{rc = Process2();
460 TRACEP(REQ, "Bridge redrive Process2 rc="<<rc
461 <<" runError="<<runError<<" runWait="<<runWait);
462 if (rc == 0 && !runWait && !runError) {
463 rc = realProt->Process(NULL);
464 TRACEP(REQ, "Bridge redrive callback rc="<<rc
465 <<" runStatus="<<runStatus.load(std::memory_order_acquire));
466 }
467 } while((rc == 0) && !runError && !runWait);
468 }
469 else rc = Send(kXR_error, ioV, 2, 0);
470
471// Defer the request if need be
472//
473 if (rc >= 0 && runWait) return;
474 runWTot = 0;
475
476// Indicate we are no longer active
477//
478 runStatus.store(0, std::memory_order_release);
479
480// If the link needs to be terminated, terminate the link. Otherwise, we can
481// enable the link for new requests at this point.
482//
483 if (rc < 0) Link->Close();
484 else Link->Enable();
485}
486
487/******************************************************************************/
488/* R e q T a b l e */
489/******************************************************************************/
490
491#define KXR_INDEX(x) x-kXR_auth
492
493const char *XrdXrootdTransit::ReqTable()
494{
495 static char rTab[kXR_truncate-kXR_auth+1];
496
497// Initialize the table
498//
499 memset(rTab, 0, sizeof(rTab));
500 rTab[KXR_INDEX(kXR_chmod)] = 1;
501 rTab[KXR_INDEX(kXR_close)] = 1;
502 rTab[KXR_INDEX(kXR_dirlist)] = 1;
503 rTab[KXR_INDEX(kXR_locate)] = 1;
504 rTab[KXR_INDEX(kXR_mkdir)] = 1;
505 rTab[KXR_INDEX(kXR_mv)] = 1;
506 rTab[KXR_INDEX(kXR_open)] = 1;
507 rTab[KXR_INDEX(kXR_prepare)] = 1;
508 rTab[KXR_INDEX(kXR_protocol)] = 1;
509 rTab[KXR_INDEX(kXR_query)] = 1;
510 rTab[KXR_INDEX(kXR_read)] = 2;
511 rTab[KXR_INDEX(kXR_readv)] = 2;
512 rTab[KXR_INDEX(kXR_rm)] = 1;
513 rTab[KXR_INDEX(kXR_rmdir)] = 1;
514 rTab[KXR_INDEX(kXR_set)] = 1;
515 rTab[KXR_INDEX(kXR_stat)] = 1;
516 rTab[KXR_INDEX(kXR_statx)] = 1;
517 rTab[KXR_INDEX(kXR_sync)] = 1;
518 rTab[KXR_INDEX(kXR_truncate)] = 1;
519 rTab[KXR_INDEX(kXR_write)] = 2;
520
521// Now return the address
522//
523 return rTab;
524}
525
526/******************************************************************************/
527/* Private: R e q W r i t e */
528/******************************************************************************/
529
530bool XrdXrootdTransit::ReqWrite(char *xdataP, int xdataL)
531{
532
533// Make sure we always transit to the resume point
534//
535 myBlen = 0;
536
537// If nothing was read, then this is a straight-up write
538//
539 if (!xdataL || !xdataP || !Request.header.dlen)
540 {Resume = 0; wBuff = xdataP; wBLen = xdataL;
541 return true;
542 }
543
544// Partial data was read, we may have to split this between a direct write
545// and a network read/write -- somewhat complicated.
546//
547 myBuff = wBuff = xdataP;
548 myBlast = wBLen = xdataL;
550 return true;
551}
552
553/******************************************************************************/
554/* R u n */
555/******************************************************************************/
556
557bool XrdXrootdTransit::Run(const char *xreqP, char *xdataP, int xdataL)
558{
559 int movLen;
560
561// We do not allow re-entry if we are curently processing a request.
562// It will be reset, as need, when a response is effected.
563//
564
565 if (runStatus.fetch_add(1, std::memory_order_acq_rel))
566 {TRACEP(REQ, "Bridge request failed due to re-entry");
567 return false;
568 }
569
570// Copy the request header
571//
572 memcpy((void *)&Request, (void *)xreqP, sizeof(Request));
573
574// Validate that we can actually handle this request
575//
577 if (Request.header.requestid & 0x8000
579 || !reqTab[Request.header.requestid - kXR_auth])
580 {TRACEP(REQ, "Unsupported bridge request");
581 return Fail(kXR_Unsupported, "Unsupported bridge request");
582 }
583
584// Validate the data length
585//
587 if (Request.header.dlen < 0)
588 {TRACEP(REQ, "Invalid request data length");
589 return Fail(kXR_ArgInvalid, "Invalid request data length");
590 }
591
592// Copy the stream id and trace this request
593//
595 TRACEP(REQ, "Bridge req=" <<Request.header.requestid
596 <<" dlen=" <<Request.header.dlen <<" blen=" <<xdataL);
597
598// If this is a write request, we will need to do a lot more
599//
600 if (Request.header.requestid == kXR_write) return ReqWrite(xdataP, xdataL);
601
602// Obtain any needed buffer and handle any existing data arguments. Also, we
603// need to keep a shadow copy of the request arguments should we get a wait
604// and will need to re-issue the request (the server mangles the args).
605//
606 if (Request.header.dlen)
607 {movLen = (xdataL < Request.header.dlen ? xdataL : Request.header.dlen);
608 if (!RunCopy(xdataP, movLen)) return true;
609 if (!runArgs || movLen > runABsz)
610 {if (runArgs) free(runArgs);
611 if (!(runArgs = (char *)malloc(movLen)))
612 {TRACEP(REQ, "Failed to allocate memory");
613 return Fail(kXR_NoMemory, "Insufficient memory");
614 }
615 runABsz = movLen;
616 }
617 memcpy(runArgs, xdataP, movLen); runALen = movLen;
618 if ((myBlen = Request.header.dlen - movLen))
619 {myBuff = argp->buff + movLen;
621 return true;
622 }
623 } else runALen = 0;
624
625// If we have all the data, indicate request accepted.
626//
627 runError = 0;
628 Resume = 0;
629 return true;
630}
631
632/******************************************************************************/
633/* Privae: R u n C o p y */
634/******************************************************************************/
635
636bool XrdXrootdTransit::RunCopy(char *buffP, int buffL)
637{
638
639// Allocate a buffer if we do not have one or it is too small
640//
641 if (!argp || Request.header.dlen+1 > argp->bsize)
642 {if (argp) BPool->Release(argp);
643 if (!(argp = BPool->Obtain(Request.header.dlen+1)))
644 {Fail(kXR_ArgTooLong, "Request argument too long"); return false;}
645 hcNow = hcPrev; halfBSize = argp->bsize >> 1;
646 }
647
648// Copy the arguments to the buffer
649//
650 memcpy(argp->buff, buffP, buffL);
651 argp->buff[buffL] = 0;
652 return true;
653}
654
655/******************************************************************************/
656/* S e n d */
657/******************************************************************************/
658
659int XrdXrootdTransit::Send(int rcode, const struct iovec *ioV, int ioN, int ioL)
660{
663 const char *eMsg;
664 int rc;
665 bool aOK;
666
667// Invoke the result object (we initially assume this is the final result)
668//
669 runDone = true;
670 switch(rcode)
671 {case kXR_error:
672 rc = XRD_GETNUM(ioV[0].iov_base);
673 eMsg = (ioN < 2 ? "" : (const char *)ioV[1].iov_base);
674 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
675 aOK = respObj->Error(rInfo, rc, eMsg);
676 break;
677 case kXR_ok:
678 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
679 aOK = (ioN ? respObj->Data(rInfo, ioV, ioN, ioL, true)
680 : respObj->Done(rInfo));
681 break;
682 case kXR_oksofar:
683 aOK = respObj->Data(rInfo, ioV, ioN, ioL, false);
684 runDone = false;
685 break;
686 case kXR_redirect:
687 if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
688 rc = XRD_GETNUM(ioV[0].iov_base);
689 aOK = respObj->Redir(rInfo,rc,(const char *)ioV[1].iov_base);
690 break;
691 case kXR_wait:
692 return Wait(rInfo, ioV, ioN, ioL);
693 break;
694 case kXR_waitresp:
695 runDone = false;
696 return WaitResp(rInfo, ioV, ioN, ioL);
697 break;
698 default: if (wBuff) respObj->Free(rInfo, wBuff, wBLen);
699 aOK = respObj->Error(rInfo, kXR_ServerError,
700 "internal logic error");
701 break;
702 };
703
704// All done
705//
706 return (aOK ? 0 : -1);
707}
708
709/******************************************************************************/
710
711int XrdXrootdTransit::Send(long long offset, int dlen, int fdnum)
712{
715 offset, dlen, fdnum);
716
717// Effect callback (this is always a final result)
718//
719 runDone = true;
720 return (respObj->File(sfInfo, dlen) ? 0 : -1);
721}
722
723/******************************************************************************/
724
725int XrdXrootdTransit::Send(XrdOucSFVec *sfvec, int sfvnum, int dlen)
726{
729 sfvec, sfvnum, dlen);
730
731// Effect callback (this is always a final result)
732//
733 runDone = true;
734 return (respObj->File(sfInfo, dlen) ? 0 : -1);
735}
736
737/******************************************************************************/
738/* Private: W a i t */
739/******************************************************************************/
740
741int XrdXrootdTransit::Wait(XrdXrootd::Bridge::Context &rInfo,
742 const struct iovec *ioV, int ioN, int ioL)
743{
744 const char *eMsg;
745
746// Trace this request if need be
747//
748 runWait = XRD_GETNUM(ioV[0].iov_base);
749 eMsg = (ioN < 2 ? "reason unknown" : (const char *)ioV[1].iov_base);
750
751// Check if the protocol wants to handle all waits
752//
753 if (runWMax <= 0)
754 {int wtime = runWait;
755 runWait = 0;
756 return (respObj->Wait(rInfo, wtime, eMsg) ? 0 : -1);
757 }
758
759// Check if we have exceeded the maximum wait time
760//
761 if (runWTot >= runWMax)
762 {runDone = true;
763 runWait = 0;
764 return (respObj->Error(rInfo, kXR_Cancelled, eMsg) ? 0 : -1);
765 }
766
767// Readjust wait time
768//
769 if (runWait > runWMax) runWait = runWMax;
770
771// Check if the protocol wants a wait notification
772//
773 if (runWCall && !(respObj->Wait(rInfo, runWait, eMsg))) return -1;
774
775// All done, schedule the wait
776//
777 TRACEP(REQ, "Bridge delaying request " <<runWait <<" sec (" <<eMsg <<")");
778 Sched->Schedule((XrdJob *)&waitJob, time(0)+runWait);
779 return 0;
780}
781
782/******************************************************************************/
783/* Private: W a i t R e s p */
784/******************************************************************************/
785
786int XrdXrootdTransit::WaitResp(XrdXrootd::Bridge::Context &rInfo,
787 const struct iovec *ioV, int ioN, int ioL)
788{
790 const char *eMsg;
791 int wTime;
792
793// Trace this request if need be
794//
795 wTime = XRD_GETNUM(ioV[0].iov_base);
796 eMsg = (ioN < 2 ? "reason unknown" : (const char *)ioV[1].iov_base);
797 TRACEP(REQ, "Bridge waiting for resp; sid=" <<rInfo.sID.num
798 <<" wt=" <<wTime <<" (" <<eMsg <<")");
799
800// We would issue callback to see how we should handle this. However, we can't
801// predictably handle a waitresp. So that means we will just wait for a resp.
802//
803// XrdXrootd::Bridge::Result *newCBP = respObj->WaitResp(rInfo, runWait, eMsg);
804
805// Save the current state
806//
807 trP = new XrdXrootdTransPend(Link, this, &Request);
808 trP->Queue();
809
810// Effect a wait
811//
812 runWait = -1;
813 return 0;
814}
@ 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
#define EMSG(x)
XrdOucTrace * XrdXrootdTrace
#define eMsg(x)
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.