diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/netliba/v6/ib_cs.h | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/netliba/v6/ib_cs.h')
-rw-r--r-- | library/cpp/netliba/v6/ib_cs.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/library/cpp/netliba/v6/ib_cs.h b/library/cpp/netliba/v6/ib_cs.h new file mode 100644 index 0000000000..932f2880dc --- /dev/null +++ b/library/cpp/netliba/v6/ib_cs.h @@ -0,0 +1,57 @@ +#pragma once + +#include "udp_address.h" +#include "block_chain.h" +#include "net_request.h" +#include <util/generic/guid.h> +#include <util/system/hp_timer.h> + +namespace NNetliba { + struct TIBConnectInfo { + TGUID SocketId; + ui64 Subnet, Interface; + int LID; + int QPN; + }; + + struct TRCQueuePairHandshake { + int QPN, PSN; + }; + + using TIBMsgHandle = i64; + + struct TIBSendResult { + TIBMsgHandle Handle; + bool Success; + TIBSendResult() + : Handle(0) + , Success(false) + { + } + TIBSendResult(TIBMsgHandle handle, bool success) + : Handle(handle) + , Success(success) + { + } + }; + + struct IIBPeer: public TThrRefBase { + enum EState { + CONNECTING, + OK, + FAILED, + }; + virtual EState GetState() = 0; + }; + + struct IIBClientServer: public TThrRefBase { + virtual TRequest* GetRequest() = 0; + virtual TIBMsgHandle Send(TPtrArg<IIBPeer> peer, TRopeDataPacket* data, const TGUID& packetGuid) = 0; + virtual bool GetSendResult(TIBSendResult* res) = 0; + virtual bool Step(NHPTimer::STime tCurrent) = 0; + virtual IIBPeer* ConnectPeer(const TIBConnectInfo& info, const TUdpAddress& peerAddr, const TUdpAddress& myAddr) = 0; + virtual const TIBConnectInfo& GetConnectInfo() = 0; + }; + + IIBClientServer* CreateIBClientServer(); +} |