xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdTpcPMarkManager.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of XrdTpcTPC
3 //
4 // Copyright (c) 2023 by European Organization for Nuclear Research (CERN)
5 // Author: Cedric Caffy <ccaffy@cern.ch>
6 // File Date: Oct 2023
7 //------------------------------------------------------------------------------
8 // XRootD is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Lesser General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // XRootD is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public License
19 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
20 //------------------------------------------------------------------------------
21 #ifndef XROOTD_PMARKMANAGER_HH
22 #define XROOTD_PMARKMANAGER_HH
23 
24 #include "XrdNet/XrdNetPMark.hh"
25 #include "XrdSec/XrdSecEntity.hh"
26 #include "XrdNet/XrdNetAddrInfo.hh"
27 #include "XrdNet/XrdNetAddr.hh"
29 
30 #include <map>
31 #include <memory>
32 #include <queue>
33 
46 namespace XrdTpc
47 {
48 class PMarkManager {
49 public:
50 
58  class SocketInfo {
59  public:
60  SocketInfo(int fd, const struct sockaddr * sockP);
63  };
64 
65  PMarkManager(XrdNetPMark * pmark);
74  void addFd(int fd, const struct sockaddr * sockP);
75 
82  void startTransfer(XrdHttpExtReq * req);
88  void beginPMarks();
89 
96  void endPmark(int fd);
97 
98  virtual ~PMarkManager() = default;
99 private:
100  // The queue of socket information from which we will create the packet marking handles
101  std::queue<SocketInfo> mSocketInfos;
102  // The map of socket FD and packet marking handles
103  std::map<int,std::unique_ptr<XrdNetPMark::Handle>> mPmarkHandles;
104  // The instance of the packet marking functionality
106  // Is true when startTransfer(...) has been called
108  // The XrdHttpTPC request information
110 };
111 } // namespace XrdTpc
112 
113 #endif //XROOTD_PMARKMANAGER_HH
XrdNetPMark * mPmark
Definition: XrdTpcPMarkManager.hh:105
SocketInfo(int fd, const struct sockaddr *sockP)
XrdHttpExtReq * mReq
Definition: XrdTpcPMarkManager.hh:109
bool mTransferWillStart
Definition: XrdTpcPMarkManager.hh:107
Definition: XrdNetPMark.hh:38
Definition: XrdTpcPMarkManager.hh:48
Definition: XrdTpcPMarkManager.hh:58
PMarkManager(XrdNetPMark *pmark)
std::map< int, std::unique_ptr< XrdNetPMark::Handle > > mPmarkHandles
Definition: XrdTpcPMarkManager.hh:103
XrdSecEntity client
Definition: XrdTpcPMarkManager.hh:62
std::queue< SocketInfo > mSocketInfos
Definition: XrdTpcPMarkManager.hh:101
Definition: XrdNetAddr.hh:41
void endPmark(int fd)
void startTransfer(XrdHttpExtReq *req)
virtual ~PMarkManager()=default
void addFd(int fd, const struct sockaddr *sockP)
Definition: XrdSecEntity.hh:64
XrdNetAddr netAddr
Definition: XrdTpcPMarkManager.hh:61
Definition: XrdHttpExtHandler.hh:47