diff --git a/TODO b/TODO index 7aaf7a6..c0e6c4d 100644 --- a/TODO +++ b/TODO @@ -14,7 +14,7 @@ readSize checks if size is in limits of size_t? // TODO not only first // TODO minor version // TODO what to do if there is no channel, do not search in a loop!!! do this in other thread...! - searchResponse(CAConstants.CA_MINOR_PROTOCOL_REVISION, addresses[0]); + searchResponse(PVAConstants.PVA_MINOR_PROTOCOL_REVISION, addresses[0]); void transportUnresponsive() { not implemented (also in Java) diff --git a/pvAccessApp/Makefile b/pvAccessApp/Makefile index 37e758d..5bf90aa 100644 --- a/pvAccessApp/Makefile +++ b/pvAccessApp/Makefile @@ -4,11 +4,11 @@ include $(TOP)/configure/CONFIG PVACCESS = $(TOP)/pvAccessApp/ -SRC_DIRS += $(PVACCESS)/ca -INC += caConstants.h -INC += pvVersion.h +SRC_DIRS += $(PVACCESS)/pva +INC += pvaConstants.h +INC += pvaVersion.h INC += clientFactory.h -LIBSRCS += pvVersion.cpp +LIBSRCS += pvaVersion.cpp LIBSRCS += clientFactory.cpp diff --git a/pvAccessApp/client/pvAccess.h b/pvAccessApp/client/pvAccess.h index 1755dc2..db3e427 100644 --- a/pvAccessApp/client/pvAccess.h +++ b/pvAccessApp/client/pvAccess.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/pvAccessApp/ca/clientFactory.cpp b/pvAccessApp/pva/clientFactory.cpp similarity index 100% rename from pvAccessApp/ca/clientFactory.cpp rename to pvAccessApp/pva/clientFactory.cpp diff --git a/pvAccessApp/ca/clientFactory.h b/pvAccessApp/pva/clientFactory.h similarity index 100% rename from pvAccessApp/ca/clientFactory.h rename to pvAccessApp/pva/clientFactory.h diff --git a/pvAccessApp/ca/caConstants.h b/pvAccessApp/pva/pvaConstants.h similarity index 62% rename from pvAccessApp/ca/caConstants.h rename to pvAccessApp/pva/pvaConstants.h index 60fc1e6..d453540 100644 --- a/pvAccessApp/ca/caConstants.h +++ b/pvAccessApp/pva/pvaConstants.h @@ -4,34 +4,34 @@ * in file LICENSE that is included with this distribution. */ -#ifndef CONSTANTS_H_ -#define CONSTANTS_H_ +#ifndef PVACONSTANTS_H_ +#define PVACONSTANTS_H_ #include namespace epics { namespace pvAccess { - /** CA protocol magic number */ - const epics::pvData::int8 CA_MAGIC = 0xCA; + /** PVA protocol magic number */ + const epics::pvData::int8 PVA_MAGIC = 0xCA; - /** CA protocol revision (implemented by this library). */ - const epics::pvData::int8 CA_PROTOCOL_REVISION = 0; + /** PVA protocol revision (implemented by this library). */ + const epics::pvData::int8 PVA_PROTOCOL_REVISION = 0; - /** CA version signature used to report this implementation version in header. */ - const epics::pvData::int8 CA_VERSION = CA_PROTOCOL_REVISION; + /** PVA version signature used to report this implementation version in header. */ + const epics::pvData::int8 PVA_VERSION = PVA_PROTOCOL_REVISION; - /** Default CA server port. */ - const epics::pvData::int32 CA_SERVER_PORT = 5075; + /** Default PVA server port. */ + const epics::pvData::int32 PVA_SERVER_PORT = 5075; - /** Default CA beacon port. */ - const epics::pvData::int32 CA_BROADCAST_PORT = 5076; + /** Default PVA beacon port. */ + const epics::pvData::int32 PVA_BROADCAST_PORT = 5076; - /** CA protocol message header size. */ - const epics::pvData::int16 CA_MESSAGE_HEADER_SIZE = 8; + /** PVA protocol message header size. */ + const epics::pvData::int16 PVA_MESSAGE_HEADER_SIZE = 8; /** All messages must be aligned to 8-bytes (64-bit). */ - const epics::pvData::int32 CA_ALIGNMENT = 1; // TODO + const epics::pvData::int32 PVA_ALIGNMENT = 1; // TODO /** * UDP maximum send message size. @@ -54,7 +54,7 @@ namespace pvAccess { const epics::pvData::int32 MAX_SEARCH_BATCH_COUNT = 0x7FFF; // 32767 /** Default priority (corresponds to POSIX SCHED_OTHER) */ - const epics::pvData::int16 CA_DEFAULT_PRIORITY = 0; + const epics::pvData::int16 PVA_DEFAULT_PRIORITY = 0; /** Unreasonable channel name length. */ const epics::pvData::uint32 MAX_CHANNEL_NAME_LENGTH = 500; @@ -65,12 +65,12 @@ namespace pvAccess { /** Invalid IOID. */ const epics::pvData::int32 INVALID_IOID = 0; - /** Default CA provider name. */ + /** Default PVA provider name. */ const epics::pvData::String PVACCESS_DEFAULT_PROVIDER = "local"; /** Name of the system env. variable to turn on debugging. */ - const epics::pvData::String PVACCESS_DEBUG = "PVACCESS_DEBUG"; + const epics::pvData::String PVACCESS_DEBUG = "EPICS_PVA_DEBUG"; } } -#endif /* CONSTANTS_H_ */ +#endif /* PVACONSTANTS_H_ */ diff --git a/pvAccessApp/ca/pvVersion.cpp b/pvAccessApp/pva/pvaVersion.cpp similarity index 98% rename from pvAccessApp/ca/pvVersion.cpp rename to pvAccessApp/pva/pvaVersion.cpp index 423e5b1..0b0dd4b 100644 --- a/pvAccessApp/ca/pvVersion.cpp +++ b/pvAccessApp/pva/pvaVersion.cpp @@ -6,7 +6,7 @@ #include -#include +#include using std::stringstream; using epics::pvData::String; diff --git a/pvAccessApp/ca/pvVersion.h b/pvAccessApp/pva/pvaVersion.h similarity index 100% rename from pvAccessApp/ca/pvVersion.h rename to pvAccessApp/pva/pvaVersion.h diff --git a/pvAccessApp/remote/beaconHandler.h b/pvAccessApp/remote/beaconHandler.h index 9b74f1b..a1683a0 100644 --- a/pvAccessApp/remote/beaconHandler.h +++ b/pvAccessApp/remote/beaconHandler.h @@ -28,7 +28,7 @@ namespace pvAccess { /** * Constructor. * @param transport transport to be used to send beacons. - * @param context CA context. + * @param context PVA context. */ BeaconHandler(Context::shared_pointer const & context, const osiSockAddr* responseFrom); /** diff --git a/pvAccessApp/remote/blockingServerTCPTransport.cpp b/pvAccessApp/remote/blockingServerTCPTransport.cpp index b8a5aec..fb448b0 100644 --- a/pvAccessApp/remote/blockingServerTCPTransport.cpp +++ b/pvAccessApp/remote/blockingServerTCPTransport.cpp @@ -23,7 +23,7 @@ namespace pvAccess { BlockingServerTCPTransport::BlockingServerTCPTransport( Context::shared_pointer const & context, SOCKET channel, auto_ptr& responseHandler, int receiveBufferSize) : - BlockingTCPTransport(context, channel, responseHandler, receiveBufferSize, CA_DEFAULT_PRIORITY), + BlockingTCPTransport(context, channel, responseHandler, receiveBufferSize, PVA_DEFAULT_PRIORITY), _lastChannelSID(0) { // for performance testing @@ -109,9 +109,9 @@ namespace pvAccess { // set byte order control message // - control->ensureBuffer(CA_MESSAGE_HEADER_SIZE); - buffer->putByte(CA_MAGIC); - buffer->putByte(CA_VERSION); + control->ensureBuffer(PVA_MESSAGE_HEADER_SIZE); + buffer->putByte(PVA_MAGIC); + buffer->putByte(PVA_VERSION); buffer->putByte(0x01 | ((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00)); // control + big endian buffer->putByte(2); // set byte order buffer->putInt(0); diff --git a/pvAccessApp/remote/blockingTCP.h b/pvAccessApp/remote/blockingTCP.h index 8af5f0f..a9d1f8c 100644 --- a/pvAccessApp/remote/blockingTCP.h +++ b/pvAccessApp/remote/blockingTCP.h @@ -7,7 +7,7 @@ #ifndef BLOCKINGTCP_H_ #define BLOCKINGTCP_H_ -#include +#include #include #include #include @@ -57,7 +57,7 @@ namespace epics { } virtual epics::pvData::int8 getRevision() const { - return CA_PROTOCOL_REVISION; + return PVA_PROTOCOL_REVISION; } virtual void setRemoteRevision(epics::pvData::int8 revision) { @@ -256,7 +256,7 @@ namespace epics { // TODO to be implemeneted /** - * CAS response handler. + * PVAS response handler. */ std::auto_ptr _responseHandler; @@ -759,7 +759,7 @@ namespace epics { } /** - * CA connection validation request. + * PVA connection validation request. * A server sends a validate connection message when it receives a new connection. * The message indicates that the server is ready to receive requests; the client must * not send any messages on the connection until it has received the validate connection message @@ -830,7 +830,7 @@ namespace epics { * @param context * @param port * @param receiveBufferSize - * @throws CAException + * @throws PVAException */ BlockingTCPAcceptor(Context::shared_pointer const & context, ResponseHandlerFactory::shared_pointer const & responseHandlerFactory, diff --git a/pvAccessApp/remote/blockingTCPAcceptor.cpp b/pvAccessApp/remote/blockingTCPAcceptor.cpp index 365fe8f..becc4f1 100644 --- a/pvAccessApp/remote/blockingTCPAcceptor.cpp +++ b/pvAccessApp/remote/blockingTCPAcceptor.cpp @@ -162,7 +162,7 @@ namespace pvAccess { if(newClient!=INVALID_SOCKET) { // accept succeeded ipAddrToDottedIP(&address.ia, ipAddrStr, sizeof(ipAddrStr)); - LOG(logLevelDebug, "Accepted connection from CA client: %s", ipAddrStr); + LOG(logLevelDebug, "Accepted connection from PVA client: %s", ipAddrStr); // enable TCP_NODELAY (disable Nagle's algorithm) int optval = 1; // true @@ -198,12 +198,12 @@ namespace pvAccess { transport->close(); LOG( logLevelDebug, - "Connection to CA client %s failed to be validated, closing it.", + "Connection to PVA client %s failed to be validated, closing it.", ipAddrStr); return; } - LOG(logLevelDebug, "Serving to CA client: %s", ipAddrStr); + LOG(logLevelDebug, "Serving to PVA client: %s", ipAddrStr); }// accept succeeded else diff --git a/pvAccessApp/remote/blockingTCPConnector.cpp b/pvAccessApp/remote/blockingTCPConnector.cpp index 6e71945..56f3788 100644 --- a/pvAccessApp/remote/blockingTCPConnector.cpp +++ b/pvAccessApp/remote/blockingTCPConnector.cpp @@ -42,7 +42,7 @@ namespace epics { for(int tryCount = 0; tryCount(tt); if(transport.get()) { LOG(logLevelDebug, - "Reusing existing connection to CA server: %s", + "Reusing existing connection to PVA server: %s", ipAddrStr); if (transport->acquire(client)) return transport; @@ -96,26 +96,26 @@ namespace epics { transport = std::tr1::static_pointer_cast(tt); if(transport.get()) { LOG(logLevelDebug, - "Reusing existing connection to CA server: %s", + "Reusing existing connection to PVA server: %s", ipAddrStr); if (transport->acquire(client)) return transport; } - LOG(logLevelDebug, "Connecting to CA server: %s", ipAddrStr); + LOG(logLevelDebug, "Connecting to PVA server: %s", ipAddrStr); socket = tryConnect(address, 3); // verify if(socket==INVALID_SOCKET) { LOG(logLevelDebug, - "Connection to CA server %s failed.", ipAddrStr); + "Connection to PVA server %s failed.", ipAddrStr); std::ostringstream temp; temp<<"Failed to verify TCP connection to '"<verify(3000)) { LOG( logLevelDebug, - "Connection to CA server %s failed to be validated, closing it.", + "Connection to PVA server %s failed to be validated, closing it.", ipAddrStr); std::ostringstream temp; @@ -159,7 +159,7 @@ namespace epics { // TODO send security token - LOG(logLevelDebug, "Connected to CA server: %s", ipAddrStr); + LOG(logLevelDebug, "Connected to PVA server: %s", ipAddrStr); _namedLocker.releaseSynchronizationObject(&address); return transport; diff --git a/pvAccessApp/remote/blockingTCPTransport.cpp b/pvAccessApp/remote/blockingTCPTransport.cpp index ee0bfc7..62c85f3 100644 --- a/pvAccessApp/remote/blockingTCPTransport.cpp +++ b/pvAccessApp/remote/blockingTCPTransport.cpp @@ -7,7 +7,7 @@ #define __STDC_LIMIT_MACROS 1 #include #include -#include +#include #include #include #include @@ -137,7 +137,7 @@ namespace pvAccess { unsigned int bufferSize = max((int)(MAX_TCP_RECV+MAX_ENSURE_DATA_BUFFER_SIZE), receiveBufferSize); // size must be "aligned" - bufferSize = (bufferSize + (CA_ALIGNMENT - 1)) & (~(CA_ALIGNMENT - 1)); + bufferSize = (bufferSize + (PVA_ALIGNMENT - 1)) & (~(PVA_ALIGNMENT - 1)); _socketBuffer = new ByteBuffer(bufferSize); _socketBuffer->setPosition(_socketBuffer->getLimit()); @@ -145,7 +145,7 @@ namespace pvAccess { // allocate buffer _sendBuffer = new ByteBuffer(bufferSize); - _maxPayloadSize = _sendBuffer->getSize() - 2*CA_MESSAGE_HEADER_SIZE; // one for header, one for flow control + _maxPayloadSize = _sendBuffer->getSize() - 2*PVA_MESSAGE_HEADER_SIZE; // one for header, one for flow control // get TCP send buffer size osiSocklen_t intLen = sizeof(int); @@ -242,7 +242,7 @@ namespace pvAccess { // NOTE: take care that nextMarkerPosition is set right // fix position to be correct when buffer is cleared // do not include pre-buffered flow control message; not 100% correct, but OK - _nextMarkerPosition -= _sendBuffer->getPosition() - CA_MESSAGE_HEADER_SIZE; + _nextMarkerPosition -= _sendBuffer->getPosition() - PVA_MESSAGE_HEADER_SIZE; #endif _sendQueueMutex.lock(); @@ -255,8 +255,8 @@ namespace pvAccess { #if FLOW_CONTROL // prepare ACK marker - _sendBuffer->putByte(CA_MAGIC); - _sendBuffer->putByte(CA_VERSION); + _sendBuffer->putByte(PVA_MAGIC); + _sendBuffer->putByte(PVA_VERSION); _sendBuffer->putByte(0x01 | _byteOrderFlag); // control data _sendBuffer->putByte(1); // marker ACK _sendBuffer->putInt(0); @@ -347,10 +347,10 @@ namespace pvAccess { void BlockingTCPTransport::startMessage(int8 command, size_t ensureCapacity) { _lastMessageStartPosition = -1; - ensureBuffer(CA_MESSAGE_HEADER_SIZE+ensureCapacity); + ensureBuffer(PVA_MESSAGE_HEADER_SIZE+ensureCapacity); _lastMessageStartPosition = _sendBuffer->getPosition(); - _sendBuffer->putByte(CA_MAGIC); - _sendBuffer->putByte(CA_VERSION); + _sendBuffer->putByte(PVA_MAGIC); + _sendBuffer->putByte(PVA_VERSION); _sendBuffer->putByte(_lastSegmentedMessageType | _byteOrderFlag); // data + endianess _sendBuffer->putByte(command); // command _sendBuffer->putInt(0); // temporary zero payload @@ -391,10 +391,10 @@ namespace pvAccess { if(likely(_lastMessageStartPosition>=0)) { // align - // alignBuffer(CA_ALIGNMENT); + // alignBuffer(PVA_ALIGNMENT); // set paylaod size - const size_t payloadSize = _sendBuffer->getPosition()-_lastMessageStartPosition-CA_MESSAGE_HEADER_SIZE; + const size_t payloadSize = _sendBuffer->getPosition()-_lastMessageStartPosition-PVA_MESSAGE_HEADER_SIZE; // TODO by spec? // ignore empty segmented messages @@ -441,12 +441,12 @@ namespace pvAccess { int bytesLeft = _sendBuffer->getRemaining(); if(unlikely(position>=_nextMarkerPosition && - bytesLeft>=CA_MESSAGE_HEADER_SIZE)) { - _sendBuffer->putByte(CA_MAGIC); - _sendBuffer->putByte(CA_VERSION); + bytesLeft>=PVA_MESSAGE_HEADER_SIZE)) { + _sendBuffer->putByte(PVA_MAGIC); + _sendBuffer->putByte(PVA_VERSION); _sendBuffer->putByte(0x01 | _byteOrderFlag); // control data _sendBuffer->putByte(0); // marker - s_sendBuffer->putInt((int)(_totalBytesSent+position+CA_MESSAGE_HEADER_SIZE)); + s_sendBuffer->putInt((int)(_totalBytesSent+position+PVA_MESSAGE_HEADER_SIZE)); _nextMarkerPosition = position+_markerPeriodBytes; } #endif @@ -737,7 +737,7 @@ namespace pvAccess { #endif // preserve alignment int currentStartPosition = _startPosition = - MAX_ENSURE_DATA_BUFFER_SIZE; // "TODO uncomment align" + (unsigned int)currentPosition % CA_ALIGNMENT; + MAX_ENSURE_DATA_BUFFER_SIZE; // "TODO uncomment align" + (unsigned int)currentPosition % PVA_ALIGNMENT; // copy remaining bytes, if any int remainingBytes = _socketBuffer->getRemaining(); @@ -814,15 +814,15 @@ namespace pvAccess { // reveal what's already in buffer _socketBuffer->setLimit(_storedLimit); - // ensure CAConstants.CA_MESSAGE_HEADER_SIZE bytes of data - if(unlikely(((int)_socketBuffer->getRemaining())getRemaining())getByte(); _version = _socketBuffer->getByte(); - if(unlikely(magic != CA_MAGIC)) + if(unlikely(magic != PVA_MAGIC)) { // error... disconnect LOG( @@ -867,7 +867,7 @@ namespace pvAccess { { #if FLOW_CONTROL _flowControlMutex.lock(); - int difference = (int)_totalBytesSent-_payloadSize+CA_MESSAGE_HEADER_SIZE; + int difference = (int)_totalBytesSent-_payloadSize+PVA_MESSAGE_HEADER_SIZE; // overrun check if(difference<0) difference += INT_MAX; _remoteBufferFreeSpace @@ -980,7 +980,7 @@ namespace pvAccess { _markerToSend = 0; _flowControlMutex.unlock(); if(markerValue==0) - _sendBufferSentPosition = CA_MESSAGE_HEADER_SIZE; + _sendBufferSentPosition = PVA_MESSAGE_HEADER_SIZE; else _sendBuffer->putInt(4, markerValue); #endif @@ -1142,9 +1142,9 @@ namespace pvAccess { if(_flushStrategy==DELAYED) { if(_delay>0) epicsThreadSleep(_delay); if(unlikely(_sendQueue.empty())) { - // if (hasMonitors || sendBuffer.position() > CAConstants.CA_MESSAGE_HEADER_SIZE) + // if (hasMonitors || sendBuffer.position() > PVAConstants.PVA_MESSAGE_HEADER_SIZE) #if FLOW_CONTROL - if(((int)_sendBuffer->getPosition())>CA_MESSAGE_HEADER_SIZE) + if(((int)_sendBuffer->getPosition())>PVA_MESSAGE_HEADER_SIZE) #else if(((int)_sendBuffer->getPosition())>0) #endif @@ -1222,7 +1222,7 @@ namespace pvAccess { Transport::shared_pointer ptr = obj->shared_from_this(); // hold reference try{ - obj->processReadCached(false, UNDEFINED_STAGE, CA_MESSAGE_HEADER_SIZE); + obj->processReadCached(false, UNDEFINED_STAGE, PVA_MESSAGE_HEADER_SIZE); } catch (...) { printf("rcvThreadRunnner exception\n"); } diff --git a/pvAccessApp/remote/blockingUDP.h b/pvAccessApp/remote/blockingUDP.h index c2d2f6b..e3cac85 100644 --- a/pvAccessApp/remote/blockingUDP.h +++ b/pvAccessApp/remote/blockingUDP.h @@ -8,7 +8,7 @@ #define BLOCKINGUDP_H_ #include -#include +#include #include #include @@ -70,11 +70,11 @@ namespace epics { virtual std::size_t getSocketReceiveBufferSize() const; virtual epics::pvData::int16 getPriority() const { - return CA_DEFAULT_PRIORITY; + return PVA_DEFAULT_PRIORITY; } virtual epics::pvData::int8 getRevision() const { - return CA_PROTOCOL_REVISION; + return PVA_PROTOCOL_REVISION; } virtual void setRemoteRevision(epics::pvData::int8 /*revision*/) { @@ -83,12 +83,12 @@ namespace epics { virtual void setRemoteTransportReceiveBufferSize( std::size_t /*receiveBufferSize*/) { - // noop for UDP (limited by 64k; MAX_UDP_SEND for CA) + // noop for UDP (limited by 64k; MAX_UDP_SEND for PVA) } virtual void setRemoteTransportSocketReceiveBufferSize( std::size_t /*socketReceiveBufferSize*/) { - // noop for UDP (limited by 64k; MAX_UDP_SEND for CA) + // noop for UDP (limited by 64k; MAX_UDP_SEND for PVA) } virtual void aliveNotification() { diff --git a/pvAccessApp/remote/blockingUDPTransport.cpp b/pvAccessApp/remote/blockingUDPTransport.cpp index da634ec..95f0fa8 100644 --- a/pvAccessApp/remote/blockingUDPTransport.cpp +++ b/pvAccessApp/remote/blockingUDPTransport.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include @@ -153,8 +153,8 @@ inline int sendto(int s, const char *buf, size_t len, int flags, const struct so void BlockingUDPTransport::startMessage(int8 command, size_t /*ensureCapacity*/) { _lastMessageStartPosition = _sendBuffer->getPosition(); - _sendBuffer->putByte(CA_MAGIC); - _sendBuffer->putByte(CA_VERSION); + _sendBuffer->putByte(PVA_MAGIC); + _sendBuffer->putByte(PVA_VERSION); _sendBuffer->putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess _sendBuffer->putByte(command); // command _sendBuffer->putInt(0); // temporary zero payload @@ -162,10 +162,10 @@ inline int sendto(int s, const char *buf, size_t len, int flags, const struct so void BlockingUDPTransport::endMessage() { //we always (for now) send by packet, so no need for this here... - //alignBuffer(CA_ALIGNMENT); + //alignBuffer(PVA_ALIGNMENT); _sendBuffer->putInt( _lastMessageStartPosition+(sizeof(int16)+2), - _sendBuffer->getPosition()-_lastMessageStartPosition-CA_MESSAGE_HEADER_SIZE); + _sendBuffer->getPosition()-_lastMessageStartPosition-PVA_MESSAGE_HEADER_SIZE); } void BlockingUDPTransport::processRead() { @@ -259,14 +259,14 @@ inline int sendto(int s, const char *buf, size_t len, int flags, const struct so bool BlockingUDPTransport::processBuffer(Transport::shared_pointer const & thisTransport, osiSockAddr& fromAddress, ByteBuffer* receiveBuffer) { // handle response(s) - while(likely((int)receiveBuffer->getRemaining()>=CA_MESSAGE_HEADER_SIZE)) { + while(likely((int)receiveBuffer->getRemaining()>=PVA_MESSAGE_HEADER_SIZE)) { // // read header // - // first byte is CA_MAGIC + // first byte is PVA_MAGIC int8 magic = receiveBuffer->getByte(); - if(unlikely(magic != CA_MAGIC)) + if(unlikely(magic != PVA_MAGIC)) return false; // second byte version diff --git a/pvAccessApp/remote/channelSearchManager.h b/pvAccessApp/remote/channelSearchManager.h index d90c554..8908c6b 100644 --- a/pvAccessApp/remote/channelSearchManager.h +++ b/pvAccessApp/remote/channelSearchManager.h @@ -30,7 +30,7 @@ class SearchInstance { /** * Search response from server (channel found). - * @param minorRevision server minor CA revision. + * @param minorRevision server minor PVA revision. * @param serverAddress server address. */ // TODO make serverAddress an URI or similar @@ -69,7 +69,7 @@ class ChannelSearchManager { * Search response from server (channel found). * @param cid client channel ID. * @param seqNo search sequence number. - * @param minorRevision server minor CA revision. + * @param minorRevision server minor PVA revision. * @param serverAddress server address. */ virtual void searchResponse(pvAccessID cid, int32_t seqNo, int8_t minorRevision, osiSockAddr* serverAddress) = 0; diff --git a/pvAccessApp/remote/remote.h b/pvAccessApp/remote/remote.h index aac0956..20ad918 100644 --- a/pvAccessApp/remote/remote.h +++ b/pvAccessApp/remote/remote.h @@ -7,7 +7,7 @@ #ifndef REMOTE_H_ #define REMOTE_H_ -#include +#include #include #include diff --git a/pvAccessApp/remote/serializationHelper.h b/pvAccessApp/remote/serializationHelper.h index b755499..73a4ae5 100644 --- a/pvAccessApp/remote/serializationHelper.h +++ b/pvAccessApp/remote/serializationHelper.h @@ -8,7 +8,7 @@ #ifndef SERIALIZATIONHELPER_H_ #define SERIALIZATIONHELPER_H_ -#include +#include #include #include diff --git a/pvAccessApp/remote/simpleChannelSearchManagerImpl.cpp b/pvAccessApp/remote/simpleChannelSearchManagerImpl.cpp index 2f17254..96502c5 100644 --- a/pvAccessApp/remote/simpleChannelSearchManagerImpl.cpp +++ b/pvAccessApp/remote/simpleChannelSearchManagerImpl.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include @@ -20,7 +20,7 @@ using namespace epics::pvData; namespace epics { namespace pvAccess { -const int SimpleChannelSearchManagerImpl::DATA_COUNT_POSITION = CA_MESSAGE_HEADER_SIZE + sizeof(int32)/sizeof(int8) + 1; +const int SimpleChannelSearchManagerImpl::DATA_COUNT_POSITION = PVA_MESSAGE_HEADER_SIZE + sizeof(int32)/sizeof(int8) + 1; const int SimpleChannelSearchManagerImpl::PAYLOAD_POSITION = sizeof(int16)/sizeof(int8) + 2; // 225ms +/- 25ms random @@ -166,8 +166,8 @@ void SimpleChannelSearchManagerImpl::initializeSendBuffer() // new buffer m_sendBuffer.clear(); - m_sendBuffer.putByte(CA_MAGIC); - m_sendBuffer.putByte(CA_VERSION); + m_sendBuffer.putByte(PVA_MAGIC); + m_sendBuffer.putByte(PVA_VERSION); m_sendBuffer.putByte((EPICS_BYTE_ORDER == EPICS_ENDIAN_BIG) ? 0x80 : 0x00); // data + 7-bit endianess m_sendBuffer.putByte((int8_t)3); // search m_sendBuffer.putInt(sizeof(int32_t)/sizeof(int8_t) + 1); // "zero" payload @@ -214,7 +214,7 @@ bool SimpleChannelSearchManagerImpl::generateSearchRequestMessage(SearchInstance requestMessage->putInt(channel->getSearchInstanceID()); SerializeHelper::serializeString(name, requestMessage, control); - requestMessage->putInt(PAYLOAD_POSITION, requestMessage->getPosition() - CA_MESSAGE_HEADER_SIZE); + requestMessage->putInt(PAYLOAD_POSITION, requestMessage->getPosition() - PVA_MESSAGE_HEADER_SIZE); requestMessage->putShort(DATA_COUNT_POSITION, dataCount); return true; } diff --git a/pvAccessApp/remote/simpleChannelSearchManagerImpl.h b/pvAccessApp/remote/simpleChannelSearchManagerImpl.h index c793f28..aaced5a 100644 --- a/pvAccessApp/remote/simpleChannelSearchManagerImpl.h +++ b/pvAccessApp/remote/simpleChannelSearchManagerImpl.h @@ -81,7 +81,7 @@ class SimpleChannelSearchManagerImpl : * Search response from server (channel found). * @param cid client channel ID. * @param seqNo search sequence number. - * @param minorRevision server minor CA revision. + * @param minorRevision server minor PVA revision. * @param serverAddress server address. */ void searchResponse(pvAccessID cid, int32_t seqNo, int8_t minorRevision, osiSockAddr* serverAddress); diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index 0f40e37..07ec597 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -1852,7 +1852,7 @@ namespace epics { virtual MonitorElement::shared_pointer poll() { Lock guard(m_mutex); - // TODO CAS when available + // TODO PVAS when available bool gotMonitor = m_gotMonitor; m_gotMonitor = false; if (gotMonitor) @@ -1930,7 +1930,7 @@ namespace epics { virtual MonitorElement::shared_pointer poll() { Lock guard(m_mutex); - // TODO CAS when available + // TODO PVAS when available bool gotMonitor = m_gotMonitor; m_gotMonitor = false; if (gotMonitor) @@ -2899,7 +2899,7 @@ namespace epics { /** - * CA response handler - main handler which dispatches responses to appripriate handlers. + * PVA response handler - main handler which dispatches responses to appripriate handlers. * @author Matej Sekoranja */ class ClientResponseHandler : public ResponseHandler, private epics::pvData::NoDefaultMethods { @@ -3139,7 +3139,7 @@ namespace epics { /** - * Implementation of CAJ JCA Channel. + * Implementation of PVAJ JCA Channel. */ class InternalChannelImpl : public ChannelImpl, @@ -3206,7 +3206,7 @@ namespace epics { int m_references; /* ****************** */ - /* CA protocol fields */ + /* PVA protocol fields */ /* ****************** */ /** @@ -3237,7 +3237,7 @@ namespace epics { * @param context * @param name * @param listener - * @throws CAException + * @throws PVAException */ InternalChannelImpl( ClientContextImpl::shared_pointer const & context, @@ -3528,7 +3528,7 @@ namespace epics { /** * Actual destroy method, to be called CAJContext. * @param force force destruction regardless of reference count - * @throws CAException + * @throws PVAException * @throws std::runtime_error * @throws IOException */ @@ -3623,7 +3623,7 @@ namespace epics { // TODO not only first // TODO minor version // TODO what to do if there is no channel, do not search in a loop!!! do this in other thread...! - searchResponse(CAConstants.CA_MINOR_PROTOCOL_REVISION, addresses[0]); + searchResponse(CAConstants.PVA_MINOR_PROTOCOL_REVISION, addresses[0]); */ } @@ -3715,7 +3715,7 @@ namespace epics { // TODO 2 types of disconnected state - distinguish them otherwise disconnect will handle connection loss right setConnectionState(DISCONNECTED); - // ... CA notifies also w/ no access rights callback, although access right are not changed + // ... PVA notifies also w/ no access rights callback, although access right are not changed } } @@ -3987,7 +3987,7 @@ namespace epics { InternalClientContextImpl() : m_addressList(""), m_autoAddressList(true), m_connectionTimeout(30.0f), m_beaconPeriod(15.0f), - m_broadcastPort(CA_BROADCAST_PORT), m_receiveBufferSize(MAX_TCP_RECV), + m_broadcastPort(PVA_BROADCAST_PORT), m_receiveBufferSize(MAX_TCP_RECV), m_namedLocker(), m_lastCID(0), m_lastIOID(0), m_version("pvAccess Client", "cpp", 1, 2, 0, true), m_contextState(CONTEXT_NOT_INITIALIZED), @@ -4200,8 +4200,8 @@ TODO auto_ptr broadcastConnector(new BlockingUDPConnector(true, true)); m_broadcastTransport = static_pointer_cast(broadcastConnector->connect( nullTransportClient, clientResponseHandler, - listenLocalAddress, CA_PROTOCOL_REVISION, - CA_DEFAULT_PRIORITY)); + listenLocalAddress, PVA_PROTOCOL_REVISION, + PVA_DEFAULT_PRIORITY)); if (!m_broadcastTransport.get()) return false; m_broadcastTransport->setBroadcastAddresses(broadcastAddresses.get()); @@ -4216,8 +4216,8 @@ TODO auto_ptr searchConnector(new BlockingUDPConnector(false, true)); m_searchTransport = static_pointer_cast(searchConnector->connect( nullTransportClient, clientResponseHandler, - undefinedAddress, CA_PROTOCOL_REVISION, - CA_DEFAULT_PRIORITY)); + undefinedAddress, PVA_PROTOCOL_REVISION, + PVA_DEFAULT_PRIORITY)); if (!m_searchTransport.get()) return false; m_searchTransport->setBroadcastAddresses(broadcastAddresses.get()); @@ -4235,7 +4235,7 @@ TODO // cleanup // - // this will also close all CA transports + // this will also close all PVA transports destroyAllChannels(); // stop UDPs @@ -4507,7 +4507,7 @@ TODO * Destroy channel. * @param channel * @param force - * @throws CAException + * @throws PVAException * @throws std::runtime_error */ void destroyChannel(ChannelImpl::shared_pointer const & channel, bool force) { @@ -4628,13 +4628,13 @@ TODO BlockingUDPTransport::shared_pointer m_searchTransport; /** - * CA connector (creates CA virtual circuit). + * PVA connector (creates PVA virtual circuit). */ auto_ptr m_connector; /** - * CA transport (virtual circuit) registry. - * This registry contains all active transports - connections to CA servers. + * PVA transport (virtual circuit) registry. + * This registry contains all active transports - connections to PVA servers. */ TransportRegistry::shared_pointer m_transportRegistry; diff --git a/pvAccessApp/server/beaconEmitter.cpp b/pvAccessApp/server/beaconEmitter.cpp index 0e5c7b9..7208ce8 100644 --- a/pvAccessApp/server/beaconEmitter.cpp +++ b/pvAccessApp/server/beaconEmitter.cpp @@ -21,17 +21,17 @@ using namespace epics::pvData; namespace epics { namespace pvAccess { -const float BeaconEmitter::EPICS_CA_MIN_BEACON_PERIOD = 1.0; -const float BeaconEmitter::EPICS_CA_MIN_BEACON_COUNT_LIMIT = 3.0; +const float BeaconEmitter::EPICS_PVA_MIN_BEACON_PERIOD = 1.0; +const float BeaconEmitter::EPICS_PVA_MIN_BEACON_COUNT_LIMIT = 3.0; //BeaconEmitter::BeaconEmitter(Transport::shared_pointer const & transport, ServerContextImpl::shared_pointer const & context) : BeaconEmitter::BeaconEmitter(Transport::shared_pointer const & transport, std::tr1::shared_ptr& context) : _transport(transport), _beaconSequenceID(0), _startupTime(), - _fastBeaconPeriod(std::max(context->getBeaconPeriod(), EPICS_CA_MIN_BEACON_PERIOD)), + _fastBeaconPeriod(std::max(context->getBeaconPeriod(), EPICS_PVA_MIN_BEACON_PERIOD)), _slowBeaconPeriod(std::max(180.0, _fastBeaconPeriod)), // TODO configurable - _beaconCountLimit((int16)std::max(10.0f, EPICS_CA_MIN_BEACON_COUNT_LIMIT)), // TODO configurable + _beaconCountLimit((int16)std::max(10.0f, EPICS_PVA_MIN_BEACON_COUNT_LIMIT)), // TODO configurable _serverAddress(*(context->getServerInetAddress())), _serverPort(context->getServerPort()), _serverStatusProvider(context->getBeaconServerStatusProvider()), @@ -44,7 +44,7 @@ BeaconEmitter::BeaconEmitter(Transport::shared_pointer const & transport, const _transport(transport), _beaconSequenceID(0), _startupTime(), - _fastBeaconPeriod(EPICS_CA_MIN_BEACON_PERIOD), + _fastBeaconPeriod(EPICS_PVA_MIN_BEACON_PERIOD), _slowBeaconPeriod(180.0), _beaconCountLimit(10), _serverAddress(serverAddress), diff --git a/pvAccessApp/server/beaconEmitter.h b/pvAccessApp/server/beaconEmitter.h index 5a7d40b..dd40761 100644 --- a/pvAccessApp/server/beaconEmitter.h +++ b/pvAccessApp/server/beaconEmitter.h @@ -38,7 +38,7 @@ namespace epics { namespace pvAccess { /** * Constructor. * @param transport transport to be used to send beacons. - * @param context CA context. + * @param context PVA context. */ // BeaconEmitter(Transport::shared_pointer const & transport, ServerContextImpl::shared_pointer const & context); BeaconEmitter(Transport::shared_pointer const & transport, std::tr1::shared_ptr& context); @@ -78,14 +78,14 @@ namespace epics { namespace pvAccess { private: /** - * Minimal (initial) CA beacon period (in seconds). + * Minimal (initial) PVA beacon period (in seconds). */ - static const float EPICS_CA_MIN_BEACON_PERIOD; + static const float EPICS_PVA_MIN_BEACON_PERIOD; /** - * Minimal CA beacon count limit. + * Minimal PVA beacon count limit. */ - static const float EPICS_CA_MIN_BEACON_COUNT_LIMIT; + static const float EPICS_PVA_MIN_BEACON_COUNT_LIMIT; /** * Transport. diff --git a/pvAccessApp/server/beaconServerStatusProvider.h b/pvAccessApp/server/beaconServerStatusProvider.h index 08f6ab3..4273cf5 100644 --- a/pvAccessApp/server/beaconServerStatusProvider.h +++ b/pvAccessApp/server/beaconServerStatusProvider.h @@ -41,7 +41,7 @@ namespace pvAccess { public: /** * Constructor. - * @param context CA context. + * @param context PVA context. */ // DefaultBeaconServerStatusProvider(ServerContext::shared_pointer const & context); DefaultBeaconServerStatusProvider(std::tr1::shared_ptr const & context); diff --git a/pvAccessApp/server/responseHandlers.cpp b/pvAccessApp/server/responseHandlers.cpp index 0991f4d..1e75912 100644 --- a/pvAccessApp/server/responseHandlers.cpp +++ b/pvAccessApp/server/responseHandlers.cpp @@ -87,7 +87,7 @@ void ServerResponseHandler::handleResponse(osiSockAddr* responseFrom, // TODO remove debug output std::ostringstream name; - name<<"Invalid CA header "<getArray(), diff --git a/pvAccessApp/server/responseHandlers.h b/pvAccessApp/server/responseHandlers.h index eadca46..9cbe959 100644 --- a/pvAccessApp/server/responseHandlers.h +++ b/pvAccessApp/server/responseHandlers.h @@ -47,7 +47,7 @@ namespace pvAccess { }; /** - * CAS request handler - main handler which dispatches requests to appropriate handlers. + * PVAS request handler - main handler which dispatches requests to appropriate handlers. */ class ServerResponseHandler : public ResponseHandler { public: diff --git a/pvAccessApp/server/serverContext.cpp b/pvAccessApp/server/serverContext.cpp index d8b5d31..729b295 100644 --- a/pvAccessApp/server/serverContext.cpp +++ b/pvAccessApp/server/serverContext.cpp @@ -26,8 +26,8 @@ ServerContextImpl::ServerContextImpl(): _ignoreAddressList(), _autoBeaconAddressList(true), _beaconPeriod(15.0), - _broadcastPort(CA_BROADCAST_PORT), - _serverPort(CA_SERVER_PORT), + _broadcastPort(PVA_BROADCAST_PORT), + _serverPort(PVA_SERVER_PORT), _receiveBufferSize(MAX_TCP_RECV), _timer(), _broadcastTransport(), @@ -209,8 +209,8 @@ void ServerContextImpl::initializeBroadcastTransport() auto_ptr responseHandler = createResponseHandler(); _broadcastTransport = static_pointer_cast(broadcastConnector->connect( nullTransportClient, responseHandler, - listenLocalAddress, CA_PROTOCOL_REVISION, - CA_DEFAULT_PRIORITY)); + listenLocalAddress, PVA_PROTOCOL_REVISION, + PVA_DEFAULT_PRIORITY)); _broadcastTransport->setBroadcastAddresses(broadcastAddresses.get()); // set ignore address list diff --git a/pvAccessApp/server/serverContext.h b/pvAccessApp/server/serverContext.h index 5036bde..d395eb0 100644 --- a/pvAccessApp/server/serverContext.h +++ b/pvAccessApp/server/serverContext.h @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -21,7 +21,7 @@ namespace epics { namespace pvAccess { /** - * The class representing a CA Server context. + * The class representing a PVA Server context. */ class ServerContext { @@ -313,7 +313,7 @@ private: epics::pvData::int32 _serverPort; /** - * Length in bytes of the maximum buffer (payload) size that may pass through CA. + * Length in bytes of the maximum buffer (payload) size that may pass through PVA. */ epics::pvData::int32 _receiveBufferSize; @@ -333,13 +333,13 @@ private: BeaconEmitter::shared_pointer _beaconEmitter; /** - * CAS acceptor (accepts CA virtual circuit). + * PVAS acceptor (accepts PVA virtual circuit). */ BlockingTCPAcceptor::shared_pointer _acceptor; /** - * CA transport (virtual circuit) registry. - * This registry contains all active transports - connections to CA servers. + * PVA transport (virtual circuit) registry. + * This registry contains all active transports - connections to PVA servers. */ TransportRegistry::shared_pointer _transportRegistry; diff --git a/pvAccessCPP.files b/pvAccessCPP.files index 7cb59e4..07ceeac 100644 --- a/pvAccessCPP.files +++ b/pvAccessCPP.files @@ -9,11 +9,11 @@ configure/RULES_TOP documentation/pvAccessCPP.html documentation/README jenkins/cloudbees_build -pvAccessApp/ca/caConstants.h -pvAccessApp/ca/clientFactory.cpp -pvAccessApp/ca/clientFactory.h -pvAccessApp/ca/pvVersion.cpp -pvAccessApp/ca/pvVersion.h +pvAccessApp/pva/pvaConstants.h +pvAccessApp/pva/clientFactory.cpp +pvAccessApp/pva/clientFactory.h +pvAccessApp/pva/pvaVersion.cpp +pvAccessApp/pva/pvaVersion.h pvAccessApp/client/pvAccess.cpp pvAccessApp/client/pvAccess.h pvAccessApp/client/pvAccess.h.orig diff --git a/testApp/client/MockClientImpl.cpp b/testApp/client/MockClientImpl.cpp index 60b4e2b..9914bff 100644 --- a/testApp/client/MockClientImpl.cpp +++ b/testApp/client/MockClientImpl.cpp @@ -637,7 +637,7 @@ class MockClientContext : public ClientContext { public: - MockClientContext() : m_version(new Version("Mock CA Client", "cpp", 1, 0, 0, 0)) + MockClientContext() : m_version(new Version("Mock PVA Client", "cpp", 1, 0, 0, 0)) { initialize(); } diff --git a/testApp/remote/eget.cpp b/testApp/remote/eget.cpp index f85e6f8..51ffcde 100644 --- a/testApp/remote/eget.cpp +++ b/testApp/remote/eget.cpp @@ -1111,7 +1111,7 @@ public: * Function: main * * Description: eget main() - * Evaluate command line options, set up CA, connect the + * Evaluate command line options, set up PVA, connect the * channels, print the data as requested * * Arg(s) In: [options] ... @@ -1142,7 +1142,7 @@ int main (int argc, char *argv[]) case 'h': /* Print usage */ usage(); return 0; - case 'w': /* Set CA timeout value */ + case 'w': /* Set PVA timeout value */ if(epicsScanDouble(optarg, &timeOut) != 1) { fprintf(stderr, "'%s' is not a valid timeout value " diff --git a/testApp/remote/pvget.cpp b/testApp/remote/pvget.cpp index 9f05029..b237a78 100644 --- a/testApp/remote/pvget.cpp +++ b/testApp/remote/pvget.cpp @@ -327,7 +327,7 @@ class MonitorRequesterImpl : public MonitorRequester * Function: main * * Description: pvget main() - * Evaluate command line options, set up CA, connect the + * Evaluate command line options, set up PVA, connect the * channels, print the data as requested * * Arg(s) In: [options] ... @@ -352,7 +352,7 @@ int main (int argc, char *argv[]) case 'h': /* Print usage */ usage(); return 0; - case 'w': /* Set CA timeout value */ + case 'w': /* Set PVA timeout value */ if(epicsScanDouble(optarg, &timeOut) != 1 || timeOut <= 0.0) { fprintf(stderr, "'%s' is not a valid timeout value " @@ -360,7 +360,7 @@ int main (int argc, char *argv[]) timeOut = DEFAULT_TIMEOUT; } break; - case 'r': /* Set CA timeout value */ + case 'r': /* Set PVA timeout value */ request = optarg; // do not override terse mode if (mode == ValueOnlyMode) mode = StructureMode; diff --git a/testApp/remote/pvinfo.cpp b/testApp/remote/pvinfo.cpp index 49fccd0..6501bd7 100644 --- a/testApp/remote/pvinfo.cpp +++ b/testApp/remote/pvinfo.cpp @@ -46,7 +46,7 @@ void usage (void) * Function: main * * Description: pvinfo main() - * Evaluate command line options, set up CA, connect the + * Evaluate command line options, set up PVA, connect the * channels, print the data as requested * * Arg(s) In: [options] ... @@ -70,7 +70,7 @@ int main (int argc, char *argv[]) case 'h': /* Print usage */ usage(); return 0; - case 'w': /* Set CA timeout value */ + case 'w': /* Set PVA timeout value */ if(epicsScanDouble(optarg, &timeOut) != 1 || timeOut <= 0.0) { fprintf(stderr, "'%s' is not a valid timeout value " diff --git a/testApp/remote/pvput.cpp b/testApp/remote/pvput.cpp index cdc9750..35b892b 100644 --- a/testApp/remote/pvput.cpp +++ b/testApp/remote/pvput.cpp @@ -758,7 +758,7 @@ class ChannelPutRequesterImpl : public ChannelPutRequester * Function: main * * Description: pvput main() - * Evaluate command line options, set up CA, connect the + * Evaluate command line options, set up PVA, connect the * channels, print the data as requested * * Arg(s) In: [options] ... @@ -781,7 +781,7 @@ int main (int argc, char *argv[]) case 'h': /* Print usage */ usage(); return 0; - case 'w': /* Set CA timeout value */ + case 'w': /* Set PVA timeout value */ if(epicsScanDouble(optarg, &timeOut) != 1) { fprintf(stderr, "'%s' is not a valid timeout value " @@ -789,7 +789,7 @@ int main (int argc, char *argv[]) timeOut = DEFAULT_TIMEOUT; } break; - case 'r': /* Set CA timeout value */ + case 'r': /* Set PVA timeout value */ request = optarg; // do not override terse mode if (mode == ValueOnlyMode) mode = StructureMode; diff --git a/testApp/remote/testBlockingTCPClnt.cpp b/testApp/remote/testBlockingTCPClnt.cpp index 4b528c3..41dd1e1 100644 --- a/testApp/remote/testBlockingTCPClnt.cpp +++ b/testApp/remote/testBlockingTCPClnt.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -144,14 +144,14 @@ void testBlockingTCPSender() { osiSockAddr srvAddr; //srvAddr.ia.sin_family = AF_INET; - if(aToIPAddr("localhost", CA_SERVER_PORT, &srvAddr.ia)<0) { + if(aToIPAddr("localhost", PVA_SERVER_PORT, &srvAddr.ia)<0) { cout<<"error in aToIPAddr(...)"<createPVStructure(getFieldCreate()->createStructure(fieldNames, fields)); configuration->getIntField("strategy")->put(bulkMode ? USER_CONTROLED : DELAYED); provider->configure(configuration); + */ vector channelNames; char buf[64]; @@ -412,7 +414,7 @@ int main (int argc, char *argv[]) case 'h': // Print usage usage(); return 0; - case 'w': // Set CA timeout value + case 'w': // Set PVA timeout value if(epicsScanDouble(optarg, &timeOut) != 1) { fprintf(stderr, "'%s' is not a valid timeout value "