xrootd
Loading...
Searching...
No Matches
PMarkManager.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"
27#include "XrdNet/XrdNetAddr.hh"
29
30#include <map>
31#include <memory>
32#include <queue>
33
47public:
48
56 class SocketInfo {
57 public:
58 SocketInfo(int fd, const struct sockaddr * sockP);
61 };
62
72 void addFd(int fd, const struct sockaddr * sockP);
73
87
94 void endPmark(int fd);
95
96 virtual ~PMarkManager() = default;
97private:
98 // The queue of socket information from which we will create the packet marking handles
99 std::queue<SocketInfo> mSocketInfos;
100 // The map of socket FD and packet marking handles
101 std::map<int,std::unique_ptr<XrdNetPMark::Handle>> mPmarkHandles;
102 // The instance of the packet marking functionality
104 // Is true when startTransfer(...) has been called
106 // The XrdHttpTPC request information
108 // The file descriptor used to create the first packet marking handle
109 int mInitialFD = -1;
110};
111
112
113#endif //XROOTD_PMARKMANAGER_HH
Definition PMarkManager.hh:56
XrdNetAddr netAddr
Definition PMarkManager.hh:59
XrdSecEntity client
Definition PMarkManager.hh:60
SocketInfo(int fd, const struct sockaddr *sockP)
Definition PMarkManager.hh:46
void startTransfer(XrdHttpExtReq *req)
void beginPMarks()
XrdHttpExtReq * mReq
Definition PMarkManager.hh:107
void addFd(int fd, const struct sockaddr *sockP)
std::queue< SocketInfo > mSocketInfos
Definition PMarkManager.hh:99
bool mTransferWillStart
Definition PMarkManager.hh:105
virtual ~PMarkManager()=default
std::map< int, std::unique_ptr< XrdNetPMark::Handle > > mPmarkHandles
Definition PMarkManager.hh:101
int mInitialFD
Definition PMarkManager.hh:109
PMarkManager(XrdNetPMark *pmark)
XrdNetPMark * mPmark
Definition PMarkManager.hh:103
void endPmark(int fd)
Definition XrdHttpExtHandler.hh:47
Definition XrdNetAddr.hh:42
Definition XrdNetPMark.hh:39
Definition XrdSecEntity.hh:65