forked from team-unstablers/ulalaca-xrdp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
XrdpTransport.hpp
56 lines (37 loc) · 1.28 KB
/
XrdpTransport.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// Created by Gyuhwan Park on 2022/04/30.
//
#ifndef ULALACA_XRDPTRANSPORT_HPP
#define ULALACA_XRDPTRANSPORT_HPP
#include <memory>
#include <vector>
extern "C" {
#include "trans.h"
};
#include "XrdpStream.hpp"
class XrdpTransport {
public:
using Transport = trans;
using TransportDeleter = std::function<void(Transport *)>;
using TransportBus = tbus;
template <typename T>
using List = std::vector<T>;
XrdpTransport(int mode, int inSize, int outSize);
std::unique_ptr<List<TransportBus>> getWaitObjs();
int forceReadS(XrdpStream &inStream, size_t size);
int forceWriteS(XrdpStream &outStream);
int forceRead(size_t size);
int forceWrite();
int writeCopy();
int writeCopyS(XrdpStream &outStream);
int connect(std::string server, std::string port, int timeout);
int listenAddress(std::string port, std::string address);
XrdpStream &getInStream();
XrdpStream &getOutStream(size_t size);
int setTLSMode(std::string key, std::string cert, long sslProtocols, std::string tlsCiphers);
int shutdownTLSMode();
int tcpForceReadS(XrdpStream &inStream, size_t size);
private:
std::unique_ptr<Transport, TransportDeleter> _transport;
};
#endif //ULALACA_XRDPTRANSPORT_HPP