m_type => m_dataType

This commit is contained in:
Jeff Hill
2000-06-28 22:52:15 +00:00
parent 1adff7f6c7
commit 5ed27edaa3
8 changed files with 76 additions and 59 deletions

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.12 1998/09/24 20:35:16 jhill
* send exception in correct byte order / block if no space for exception
*
* Revision 1.11 1998/06/16 02:24:24 jhill
* better diagnostics
*
@@ -541,7 +544,7 @@ const char *pformat,
*/
reply[1].m_postsize = htons (curp->m_postsize);
reply[1].m_cmmd = htons (curp->m_cmmd);
reply[1].m_type = htons (curp->m_type);
reply[1].m_dataType = htons (curp->m_dataType);
reply[1].m_count = htons (curp->m_count);
reply[1].m_cid = curp->m_cid;
reply[1].m_available = curp->m_available;
@@ -652,12 +655,12 @@ void casClient::dumpMsg(const caHdr *mp, const void *dp)
pName,
mp->m_cmmd,
pPVName,
mp->m_type,
mp->m_dataType,
mp->m_count,
mp->m_postsize,
mp->m_available);
if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_type==DBR_STRING && dp) {
if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_dataType==DBR_STRING && dp) {
ca_printf("CAS: The string written: %s \n", (char *)dp);
}
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.4 1998/07/08 15:38:04 jhill
* fixed lost monitors during flow control problem
*
* Revision 1.3 1997/08/05 00:47:05 jhill
* fixed warnings
*
@@ -80,7 +83,7 @@ caStatus casClientMon::callBack(gdd &value)
//
msg.m_cmmd = CA_PROTO_EVENT_ADD;
msg.m_postsize = 0u;
msg.m_type = this->getType();
msg.m_dataType = this->getType();
msg.m_count = (ca_uint16_t) this->getCount();
msg.m_cid = this->getChannel().getSID();
msg.m_available = this->getClientId();

View File

@@ -73,7 +73,7 @@ inline void casCtx::setMsg(const char *pBuf)
memcpy (&this->msg, pBuf, sizeof(this->msg));
this->msg.m_cmmd = ntohs (this->msg.m_cmmd);
this->msg.m_postsize = ntohs (this->msg.m_postsize);
this->msg.m_type = ntohs (this->msg.m_type);
this->msg.m_dataType = ntohs (this->msg.m_dataType);
this->msg.m_count = ntohs (this->msg.m_count);
this->msg.m_cid = ntohl (this->msg.m_cid);
this->msg.m_available = ntohl (this->msg.m_available);

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.15 1998/04/20 18:11:01 jhill
* better debug mesg
*
* Revision 1.14 1998/04/10 23:13:14 jhill
* fixed byte swap problems, and use default port if server tool returns PV IP addr, but no port
*
@@ -303,20 +306,20 @@ caStatus casDGClient::searchResponse(const caHdr &msg,
// address redirect (it is never correct to use this
// server's port when it is a redirect).
//
search_reply->m_type = CA_SERVER_PORT;
search_reply->m_dataType = CA_SERVER_PORT;
}
else {
search_reply->m_type = ntohs (ina.sin_port);
search_reply->m_dataType = ntohs (ina.sin_port);
}
}
else {
search_reply->m_cid = ~0U;
search_reply->m_type = this->pOutMsgIO->serverPortNumber();
search_reply->m_dataType = this->pOutMsgIO->serverPortNumber();
}
}
else {
search_reply->m_cid = ~0U;
search_reply->m_type = this->pOutMsgIO->serverPortNumber();
search_reply->m_dataType = this->pOutMsgIO->serverPortNumber();
}
search_reply->m_count = 0ul;

View File

@@ -29,6 +29,11 @@
*
* History
* $Log$
* Revision 1.26 1998/10/28 23:51:01 jhill
* server nolonger throws exception when a poorly formed get/put call back
* request arrives. Instead a get/put call back response is sent which includes
* unsuccessful status
*
* Revision 1.25 1998/09/24 20:40:07 jhill
* o block if unable to get buffer space for the exception message
* o subtle changes related to properly dealing with situations where
@@ -141,7 +146,7 @@ caStatus casStrmClient::verifyRequest (casChannelI *&pChan)
//
// data type out of range ?
//
if (mp->m_type>((unsigned)LAST_BUFFER_TYPE)) {
if (mp->m_dataType>((unsigned)LAST_BUFFER_TYPE)) {
return ECA_BADTYPE;
}
@@ -354,7 +359,7 @@ caStatus casStrmClient::readResponse (casChannelI *pChan, const caHdr &msg,
S_cas_badParameter, ECA_GETFAIL);
}
size = dbr_size_n (msg.m_type, msg.m_count);
size = dbr_size_n (msg.m_dataType, msg.m_count);
localStatus = this->allocMsg(size, &reply);
if (localStatus) {
if (localStatus==S_cas_hugeRequest) {
@@ -374,16 +379,16 @@ caStatus casStrmClient::readResponse (casChannelI *pChan, const caHdr &msg,
// convert gdd to db_access type
// (places the data in network format)
//
mapDBRStatus = gddMapDbr[msg.m_type].conv_dbr((reply+1), msg.m_count, pDesc);
mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr((reply+1), msg.m_count, pDesc);
if (mapDBRStatus<0) {
pDesc->dump();
errPrintf (S_cas_badBounds, __FILE__, __LINE__, "- get notify with PV=%s type=%u count=%u",
pChan->getPVI()->getName(), msg.m_type, msg.m_count);
pChan->getPVI()->getName(), msg.m_dataType, msg.m_count);
return this->sendErrWithEpicsStatus(&msg, S_cas_badBounds, ECA_GETFAIL);
}
#ifdef CONVERSION_REQUIRED
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[msg.m_type])
(* cac_dbr_cvrt[msg.m_dataType])
( reply + 1,
reply + 1,
TRUE, /* host -> net format */
@@ -393,7 +398,7 @@ caStatus casStrmClient::readResponse (casChannelI *pChan, const caHdr &msg,
// force string message size to be the true size rounded to even
// boundary
//
if (msg.m_type == DBR_STRING && msg.m_count == 1u) {
if (msg.m_dataType == DBR_STRING && msg.m_count == 1u) {
/* add 1 so that the string terminator will be shipped */
strcnt = strlen((char *)(reply + 1u)) + 1u;
reply->m_postsize = strcnt;
@@ -479,7 +484,7 @@ caStatus casStrmClient::readNotifyResponseECA_XXX (casChannelI *pChan,
caStatus status;
int strcnt;
size = dbr_size_n (msg.m_type, msg.m_count);
size = dbr_size_n (msg.m_dataType, msg.m_count);
status = this->allocMsg(size, &reply);
if (status) {
if (status==S_cas_hugeRequest) {
@@ -509,11 +514,11 @@ caStatus casStrmClient::readNotifyResponseECA_XXX (casChannelI *pChan,
// convert gdd to db_access type
// (places the data in network format)
//
mapDBRStatus = gddMapDbr[msg.m_type].conv_dbr((reply+1), msg.m_count, pDesc);
mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr((reply+1), msg.m_count, pDesc);
if (mapDBRStatus<0) {
pDesc->dump();
errPrintf (S_cas_badBounds, __FILE__, __LINE__, "- get notify with PV=%s type=%u count=%u",
pChan->getPVI()->getName(), msg.m_type, msg.m_count);
pChan->getPVI()->getName(), msg.m_dataType, msg.m_count);
reply->m_cid = ECA_GETFAIL;
}
else {
@@ -544,7 +549,7 @@ caStatus casStrmClient::readNotifyResponseECA_XXX (casChannelI *pChan,
else {
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[msg.m_type])
(* cac_dbr_cvrt[msg.m_dataType])
( reply + 1,
reply + 1,
TRUE, /* host -> net format */
@@ -556,7 +561,7 @@ caStatus casStrmClient::readNotifyResponseECA_XXX (casChannelI *pChan,
// force string message size to be the true size rounded to even
// boundary
//
if (msg.m_type == DBR_STRING && msg.m_count == 1u) {
if (msg.m_dataType == DBR_STRING && msg.m_count == 1u) {
/* add 1 so that the string terminator will be shipped */
strcnt = strlen((char *)(reply + 1u)) + 1u;
reply->m_postsize = strcnt;
@@ -582,7 +587,7 @@ caStatus casStrmClient::monitorResponse(casChannelI &chan, const caHdr &msg,
int strcnt;
gddStatus gdds;
size = dbr_size_n (msg.m_type, msg.m_count);
size = dbr_size_n (msg.m_dataType, msg.m_count);
status = this->allocMsg(size, &pReply);
if (status) {
if (status==S_cas_hugeRequest) {
@@ -616,7 +621,7 @@ caStatus casStrmClient::monitorResponse(casChannelI &chan, const caHdr &msg,
if (completionStatusCopy == S_cas_success) {
if (pDesc) {
completionStatusCopy = createDBRDD(msg.m_type,
completionStatusCopy = createDBRDD(msg.m_dataType,
msg.m_count, pDBRDD);
if (completionStatusCopy==S_cas_success) {
gdds = gddApplicationTypeTable::
@@ -625,7 +630,7 @@ caStatus casStrmClient::monitorResponse(casChannelI &chan, const caHdr &msg,
errPrintf (status, __FILE__, __LINE__,
"no conversion between event app type=%d and DBR type=%d Element count=%d",
pDesc->applicationType(),
msg.m_type,
msg.m_dataType,
msg.m_count);
completionStatusCopy = S_cas_noConvert;
}
@@ -646,11 +651,11 @@ caStatus casStrmClient::monitorResponse(casChannelI &chan, const caHdr &msg,
// there appears to be no success/fail
// status from this routine
//
gddMapDbr[msg.m_type].conv_dbr ((pReply+1), msg.m_count, pDBRDD);
gddMapDbr[msg.m_dataType].conv_dbr ((pReply+1), msg.m_count, pDBRDD);
#ifdef CONVERSION_REQUIRED
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[msg.m_type])
(* cac_dbr_cvrt[msg.m_dataType])
( pReply + 1,
pReply + 1,
TRUE, /* host -> net format */
@@ -659,7 +664,7 @@ caStatus casStrmClient::monitorResponse(casChannelI &chan, const caHdr &msg,
//
// force string message size to be the true size
//
if (msg.m_type == DBR_STRING && msg.m_count == 1u) {
if (msg.m_dataType == DBR_STRING && msg.m_count == 1u) {
// add 1 so that the string terminator
// will be shipped
strcnt = strlen((char *)(pReply + 1u)) + 1u;
@@ -1146,7 +1151,7 @@ caStatus casStrmClient::createChanResponse(const caHdr &hdr, const pvCreateRetur
*claim_reply = nill_msg;
claim_reply->m_cmmd = CA_PROTO_CLAIM_CIU;
claim_reply->m_type = dbrType;
claim_reply->m_dataType = dbrType;
claim_reply->m_count = pPV->nativeCount();
claim_reply->m_cid = hdr.m_cid;
claim_reply->m_available = pChanI->getSID();
@@ -1339,7 +1344,7 @@ caStatus casStrmClient::eventAddAction ()
if (status==S_cas_success) {
pMonitor = new casClientMon(*pciu, mp->m_available,
mp->m_count, mp->m_type, mask, *this);
mp->m_count, mp->m_dataType, mask, *this);
if (!pMonitor) {
status = this->sendErr(mp, ECA_ALLOCMEM, NULL);
if (status==S_cas_success) {
@@ -1468,7 +1473,7 @@ caStatus casStrmClient::eventCancelAction ()
reply->m_cmmd = CA_PROTO_EVENT_ADD;
reply->m_postsize = 0u;
reply->m_type = pMon->getType ();
reply->m_dataType = pMon->getType ();
reply->m_count = (unsigned short) pMon->getCount ();
reply->m_cid = pciu->getCID ();
reply->m_available = pMon->getClientId ();
@@ -1499,7 +1504,7 @@ caStatus casStrmClient::noReadAccessEvent(casClientMon *pMon)
falseReply.m_cmmd = CA_PROTO_EVENT_ADD;
falseReply.m_postsize = size;
falseReply.m_type = pMon->getType();
falseReply.m_dataType = pMon->getType();
falseReply.m_count = pMon->getCount();
falseReply.m_cid = pMon->getChannel().getCID();
falseReply.m_available = pMon->getClientId();
@@ -1631,13 +1636,13 @@ caStatus casStrmClient::write()
//
// no puts via compound types (for now)
//
if (dbr_value_offset[pHdr->m_type]) {
if (dbr_value_offset[pHdr->m_dataType]) {
return S_cas_badType;
}
#ifdef CONVERSION_REQUIRED
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[pHdr->m_type])
(* cac_dbr_cvrt[pHdr->m_dataType])
( this->ctx.getData(),
this->ctx.getData(),
FALSE, /* net -> host format */
@@ -1704,7 +1709,7 @@ caStatus casStrmClient::writeScalarData()
caStatus status;
aitEnum type;
type = gddDbrToAit[pHdr->m_type].type;
type = gddDbrToAit[pHdr->m_dataType].type;
if (type == aitEnumInvalid) {
return S_cas_badType;
}
@@ -1765,7 +1770,7 @@ caStatus casStrmClient::writeArrayData()
char *pData;
size_t size;
type = gddDbrToAit[pHdr->m_type].type;
type = gddDbrToAit[pHdr->m_dataType].type;
if (type == aitEnumInvalid) {
return S_cas_badType;
}
@@ -1781,7 +1786,7 @@ caStatus casStrmClient::writeArrayData()
gddStat = pDD->unreference();
assert (!gddStat);
size = dbr_size_n (pHdr->m_type, pHdr->m_count);
size = dbr_size_n (pHdr->m_dataType, pHdr->m_count);
pData = new char [size];
if (!pData) {
return S_cas_noMemory;
@@ -1832,7 +1837,7 @@ caStatus casStrmClient::read(smartGDDPointer &pDescRet)
caStatus status;
pDescRet = NULL;
status = createDBRDD (pHdr->m_type, pHdr->m_count, pDescRet);
status = createDBRDD (pHdr->m_dataType, pHdr->m_count, pDescRet);
if (status) {
return status;
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.7 1998/04/10 23:11:10 jhill
* cosmetic
*
* Revision 1.6 1996/12/06 22:36:29 jhill
* use destroyInProgress flag now functional nativeCount()
*
@@ -180,7 +183,7 @@ void outBuf::commitMsg ()
"CAS Response => cmd=%d id=%x typ=%d cnt=%d psz=%d avail=%x outBuf ptr=%lx\n",
mp->m_cmmd,
mp->m_cid,
mp->m_type,
mp->m_dataType,
mp->m_count,
mp->m_postsize,
mp->m_available,
@@ -193,7 +196,7 @@ void outBuf::commitMsg ()
*/
mp->m_cmmd = htons (mp->m_cmmd);
mp->m_postsize = htons (mp->m_postsize);
mp->m_type = htons (mp->m_type);
mp->m_dataType = htons (mp->m_dataType);
mp->m_count = htons (mp->m_count);
mp->m_cid = htonl (mp->m_cid);
mp->m_available = htonl (mp->m_available);

View File

@@ -227,7 +227,7 @@ const char *pformat,
*/
reply[1].m_postsize = htons (curp->m_postsize);
reply[1].m_cmmd = htons (curp->m_cmmd);
reply[1].m_type = htons (curp->m_type);
reply[1].m_dataType = htons (curp->m_dataType);
reply[1].m_count = htons (curp->m_count);
reply[1].m_cid = curp->m_cid;
reply[1].m_available = curp->m_available;
@@ -275,14 +275,14 @@ LOCAL void log_header (
epicsPrintf (
"CAS: Request from %s => cmmd=%d cid=0x%x type=%d count=%d postsize=%u\n",
hostName, mp->m_cmmd, mp->m_cid, mp->m_type, mp->m_count, mp->m_postsize);
hostName, mp->m_cmmd, mp->m_cid, mp->m_dataType, mp->m_count, mp->m_postsize);
epicsPrintf (
"CAS: Request from %s => available=0x%x \tN=%d paddr=%x\n",
hostName, mp->m_available, mnum, (pciu?&pciu->addr:NULL));
if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_type==DBF_STRING) {
if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_dataType==DBF_STRING) {
epicsPrintf (
"CAS: Request from %s => \tThe string written: %s \n",
hostName, (mp+1));
@@ -538,7 +538,7 @@ db_field_log *pfl
}
status = db_get_field(
paddr,
pevext->msg.m_type,
pevext->msg.m_dataType,
reply + 1,
pevext->msg.m_count,
pfl);
@@ -594,10 +594,10 @@ db_field_log *pfl
* assert() is safe here because the type was
* checked by db_get_field()
*/
assert (pevext->msg.m_type < NELEMENTS(cac_dbr_cvrt));
assert (pevext->msg.m_dataType < NELEMENTS(cac_dbr_cvrt));
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[pevext->msg.m_type])
(* cac_dbr_cvrt[pevext->msg.m_dataType])
( reply + 1,
reply + 1,
TRUE, /* host -> net format */
@@ -607,7 +607,7 @@ db_field_log *pfl
* force string message size to be the true size rounded to even
* boundary
*/
if (pevext->msg.m_type == DBR_STRING
if (pevext->msg.m_dataType == DBR_STRING
&& pevext->msg.m_count == 1) {
/* add 1 so that the string terminator will be shipped */
strcnt = strlen((char *)(reply + 1)) + 1;
@@ -651,7 +651,7 @@ struct client *client
evext.pciu = pciu;
evext.send_lock = TRUE;
evext.pdbev = NULL;
evext.size = dbr_size_n(mp->m_type, mp->m_count);
evext.size = dbr_size_n(mp->m_dataType, mp->m_count);
/*
* Arguments to this routine organized in
@@ -706,7 +706,7 @@ struct client *client
}
#ifdef CONVERSION_REQUIRED
if (mp->m_type >= NELEMENTS(cac_dbr_cvrt)) {
if (mp->m_dataType >= NELEMENTS(cac_dbr_cvrt)) {
SEND_LOCK(client);
send_err(
mp,
@@ -718,7 +718,7 @@ struct client *client
}
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[mp->m_type])
(* cac_dbr_cvrt[mp->m_dataType])
( mp + 1,
mp + 1,
FALSE, /* net -> host format */
@@ -727,7 +727,7 @@ struct client *client
status = db_put_field(
&pciu->addr,
mp->m_type,
mp->m_dataType,
mp + 1,
mp->m_count);
if (status < 0) {
@@ -1258,7 +1258,7 @@ struct client *client
*claim_reply = nill_msg;
claim_reply->m_cmmd = CA_PROTO_CLAIM_CIU;
claim_reply->m_type = pciu->addr.dbr_field_type;
claim_reply->m_dataType = pciu->addr.dbr_field_type;
claim_reply->m_count = pciu->addr.no_elements;
claim_reply->m_cid = pciu->cid;
claim_reply->m_available = pciu->sid;
@@ -1467,7 +1467,7 @@ struct client *client
return ERROR;
}
if (mp->m_type > LAST_BUFFER_TYPE) {
if (mp->m_dataType > LAST_BUFFER_TYPE) {
putNotifyErrorReply(client, mp, ECA_BADTYPE);
return ERROR;
}
@@ -1477,7 +1477,7 @@ struct client *client
return OK;
}
size = dbr_size_n(mp->m_type, mp->m_count);
size = dbr_size_n(mp->m_dataType, mp->m_count);
if(pciu->pPutNotify){
/*
@@ -1532,7 +1532,7 @@ struct client *client
pciu->pPutNotify->dbPutNotify.nRequest = mp->m_count;
#ifdef CONVERSION_REQUIRED
/* use type as index into conversion jumptable */
(* cac_dbr_cvrt[mp->m_type])
(* cac_dbr_cvrt[mp->m_dataType])
( mp + 1,
pciu->pPutNotify->dbPutNotify.pbuffer,
FALSE, /* net -> host format */
@@ -1540,7 +1540,7 @@ struct client *client
#else
memcpy(pciu->pPutNotify->dbPutNotify.pbuffer, (char *)(mp+1), size);
#endif
status = dbPutNotifyMapType(&pciu->pPutNotify->dbPutNotify, mp->m_type);
status = dbPutNotifyMapType(&pciu->pPutNotify->dbPutNotify, mp->m_dataType);
if(status){
putNotifyErrorReply(client, mp, ECA_PUTFAIL);
pciu->pPutNotify->busy = FALSE;
@@ -1610,7 +1610,7 @@ struct client *client
pevext->msg = *mp;
pevext->pciu = pciu;
pevext->send_lock = TRUE;
pevext->size = dbr_size_n(mp->m_type, mp->m_count);
pevext->size = dbr_size_n(mp->m_dataType, mp->m_count);
pevext->mask = pmo->m_info.m_mask;
FASTLOCK(&client->eventqLock);
@@ -1953,7 +1953,7 @@ LOCAL int search_reply(
NULL,
NULL,
NULL);
if (mp->m_type == DOREPLY)
if (mp->m_dataType == DOREPLY)
search_fail_reply(mp, client);
return OK;
}
@@ -2023,7 +2023,7 @@ LOCAL int search_reply(
search_reply->m_postsize = sizeof(*pMinorVersion);
/* this field for rmt machines where paddr invalid */
search_reply->m_type = type;
search_reply->m_dataType = type;
search_reply->m_count = count;
search_reply->m_cid = sid;
@@ -2192,7 +2192,7 @@ int camessage(
*/
mp->m_cmmd = ntohs (mp->m_cmmd);
mp->m_postsize = tmp_postsize;
mp->m_type = ntohs (mp->m_type);
mp->m_dataType = ntohs (mp->m_dataType);
mp->m_count = ntohs (mp->m_count);
mp->m_cid = ntohl (mp->m_cid);
mp->m_available = ntohl (mp->m_available);

View File

@@ -126,7 +126,7 @@ int lock_needed;
/* convert the complete header into host format */
mp->m_cmmd = htons (mp->m_cmmd);
mp->m_postsize = htons (mp->m_postsize);
mp->m_type = htons (mp->m_type);
mp->m_dataType = htons (mp->m_dataType);
mp->m_count = htons (mp->m_count);
mp->m_cid = htonl (mp->m_cid);
mp->m_available = htonl (mp->m_available);