XRootD
Loading...
Searching...
No Matches
XrdHttpTpcPMarkManager.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// This file is part of XrdHttpTpcTPC
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
"
28
#include "
XrdHttp/XrdHttpExtHandler.hh
"
29
30
#include <map>
31
#include <memory>
32
#include <queue>
33
34
namespace
TPC
{
35
enum class
TpcType
;
36
}
37
50
namespace
XrdHttpTpc
51
{
52
class
PMarkManager
{
53
public
:
54
62
class
SocketInfo
{
63
public
:
64
SocketInfo
(
int
fd,
const
struct
sockaddr * sockP);
65
XrdNetAddr
netAddr
;
66
XrdSecEntity
client
;
67
};
68
69
PMarkManager
(
XrdHttpExtReq
& req,
const
TPC::TpcType
type);
70
84
bool
connect
(
int
fd,
const
struct
sockaddr * sockP,
size_t
sockPLen, uint32_t timeout_sec, std::stringstream & err);
85
90
bool
isEnabled
()
const
;
91
97
void
startTransfer
();
98
104
void
beginPMarks
();
105
112
void
endPmark
(
int
fd);
113
114
virtual
~PMarkManager
() =
default
;
115
private
:
124
void
addFd(
int
fd,
const
struct
sockaddr * sockP);
125
126
// The queue of socket information from which we will create the packet marking handles
127
std::queue<SocketInfo> mSocketInfos;
128
// The map of socket FD and packet marking handles
129
std::map<int,std::unique_ptr<XrdNetPMark::Handle>> mPmarkHandles;
130
// The instance of the packet marking functionality
131
XrdNetPMark
* mPmark;
132
// The XrdHttpTPC request information
133
XrdHttpExtReq
& mReq;
134
// Is true when startTransfer(...) has been called
135
bool
mTransferWillStart;
136
// Is true if this transfer is a HTTP TPC PULL transfer, false otherwise
137
// by default is true
138
TPC::TpcType
mTpcType;
139
};
140
}
// namespace XrdHttpTpc
141
142
#endif
//XROOTD_PMARKMANAGER_HH
XrdHttpExtHandler.hh
XrdNetAddrInfo.hh
XrdNetAddr.hh
XrdNetPMark.hh
XrdSecEntity.hh
XrdHttpExtReq
Definition
XrdHttpExtHandler.hh:47
XrdHttpTpc::PMarkManager::SocketInfo
Definition
XrdHttpTpcPMarkManager.hh:62
XrdHttpTpc::PMarkManager::SocketInfo::client
XrdSecEntity client
Definition
XrdHttpTpcPMarkManager.hh:66
XrdHttpTpc::PMarkManager::SocketInfo::netAddr
XrdNetAddr netAddr
Definition
XrdHttpTpcPMarkManager.hh:65
XrdHttpTpc::PMarkManager
Definition
XrdHttpTpcPMarkManager.hh:52
XrdHttpTpc::PMarkManager::connect
bool connect(int fd, const struct sockaddr *sockP, size_t sockPLen, uint32_t timeout_sec, std::stringstream &err)
Definition
XrdHttpTpcPMarkManager.cc:44
XrdHttpTpc::PMarkManager::isEnabled
bool isEnabled() const
Definition
XrdHttpTpcPMarkManager.cc:58
XrdHttpTpc::PMarkManager::beginPMarks
void beginPMarks()
Definition
XrdHttpTpcPMarkManager.cc:66
XrdHttpTpc::PMarkManager::startTransfer
void startTransfer()
Definition
XrdHttpTpcPMarkManager.cc:62
XrdHttpTpc::PMarkManager::endPmark
void endPmark(int fd)
Definition
XrdHttpTpcPMarkManager.cc:111
XrdHttpTpc::PMarkManager::~PMarkManager
virtual ~PMarkManager()=default
XrdNetAddr
Definition
XrdNetAddr.hh:42
XrdNetPMark
Definition
XrdNetPMark.hh:41
XrdSecEntity
Definition
XrdSecEntity.hh:65
TPC
Definition
XrdHttpTpcPMarkManager.hh:34
TPC::TpcType
TpcType
Definition
XrdHttpTpcTPC.hh:35
XrdHttpTpc
Definition
XrdHttpTpcPMarkManager.cc:29
XrdHttpTpc
XrdHttpTpcPMarkManager.hh
Generated by
1.9.8