19 #ifndef SCI_Transporter_H
20 #define SCI_Transporter_H
21 #include "Transporter.hpp"
22 #include "SHM_Buffer.hpp"
25 #include <sisci_api.h>
26 #include <sisci_error.h>
27 #include <sisci_types.h>
29 #include <ndb_types.h>
105 Uint32
hostSegmentId(Uint16 localNodeId, Uint16 remoteNodeId);
130 const char *local_host,
131 const char *remote_host,
133 bool isMgmConnection,
137 Uint16 remoteSciNodeId0,
138 Uint16 remoteSciNodeId1,
144 Uint32 reportFreq = 4096);
156 Uint32 m_failCounter;
171 volatile Uint32 * m_localStatusFlag;
172 volatile Uint32 * m_remoteStatusFlag;
173 volatile Uint32 * m_remoteStatusFlag2;
185 Uint32 m_numberOfRemoteNodes;
187 Uint16 m_remoteNodes[2];
189 typedef struct SciAdapter {
191 Uint32 localSciNodeId;
195 SciAdapter* sciAdapters;
196 Uint32 m_ActiveAdapterId;
197 Uint32 m_StandbyAdapterId;
199 typedef struct sourceSegm {
200 sci_local_segment_t localHandle;
206 volatile void *mappedMemory;
209 typedef struct targetSegm {
211 sci_remote_segment_t remoteHandle;
215 sci_sequence_status_t m_SequenceStatus;
216 sci_sequence_t sequence;
217 volatile void * mappedMemory;
221 sci_sequence_status_t m_SequenceStatus;
225 sci_desc_t activeSCIDescriptor;
227 sourceSegm* m_SourceSegm;
228 targetSegm* m_TargetSegm;
230 Uint32 m_LocalAdapterId;
231 Uint16 m_LocalSciNodeId;
232 Uint16 m_LocalSciNodeId1;
233 Uint16 m_RemoteSciNodeId;
234 Uint16 m_RemoteSciNodeId1;
256 bool hasDataToRead()
const {
257 return reader->empty() ==
false;
264 bool disconnectLocal();
270 bool disconnectRemote();
272 void resetToInitialState();
274 void getReceivePtr(Uint32 ** ptr, Uint32 ** eod){
278 void updateReceivePtr(Uint32 *ptr){
287 void setupLocalSegment();
292 void setupRemoteSegment();
302 void setDisconnect();
310 bool getLinkStatus(Uint32 adapterNo);
316 void failoverShmWriter();
321 bool send_limit_reached(
int bufsize) {
return (bufsize > m_PacketSize); }
322 bool send_is_possible(
int timeout_millisec)
const {
return 1; }
333 bool connect_client_impl(NDB_SOCKET_TYPE sockfd);
343 static bool initSCI();
353 Uint16 SciRemoteNodeId) {
355 return (SciLocalNodeId << 16) | SciRemoteNodeId;
364 Uint16 SciRemoteNodeId) {
366 return (SciRemoteNodeId << 16) | SciLocalNodeId;