This is Unofficial EPICS BASE Doxygen Site
nciu.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 /*
10  *
11  * L O S A L A M O S
12  * Los Alamos National Laboratory
13  * Los Alamos, New Mexico 87545
14  *
15  * Copyright, 1986, The Regents of the University of California.
16  *
17  * Author: Jeff Hill
18  *
19  */
20 
21 #include <new>
22 #include <string>
23 #include <stdexcept>
24 
25 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
26 
27 #include "epicsAlgorithm.h"
28 
29 #include "errlog.h"
30 
31 #include "iocinf.h"
32 #include "cac.h"
33 #include "osiWireFormat.h"
34 #include "udpiiu.h"
35 #include "virtualCircuit.h"
36 #include "cadef.h"
37 #include "db_access.h" // for INVALID_DB_REQ
38 #include "noopiiu.h"
39 
40 nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
41  const char *pNameIn, cacChannel::priLev pri ) :
42  cacChannel ( chanIn ),
43  cacCtx ( cacIn ),
44  piiu ( & iiuIn ),
45  sid ( UINT_MAX ),
46  count ( 0 ),
47  retry ( 0u ),
48  nameLength ( 0u ),
49  typeCode ( USHRT_MAX ),
50  priority ( static_cast <ca_uint8_t> ( pri ) )
51 {
52  size_t nameLengthTmp = strlen ( pNameIn ) + 1;
53 
54  // second constraint is imposed by size field in protocol header
55  if ( nameLengthTmp > MAX_UDP_SEND - sizeof ( caHdr ) || nameLengthTmp > USHRT_MAX ) {
56  throw cacChannel::badString ();
57  }
58 
59  if ( pri > 0xff ) {
60  throw cacChannel::badPriority ();
61  }
62 
63  this->nameLength = static_cast <unsigned short> ( nameLengthTmp );
64 
65  this->pNameStr = new char [ this->nameLength ];
66  strcpy ( this->pNameStr, pNameIn );
67 }
68 
70 {
71  delete [] this->pNameStr;
72 }
73 
74 // channels are created by the user, and only destroyed by the user
75 // using this routine
76 void nciu::destroy (
77  CallbackGuard & callbackGuard,
78  epicsGuard < epicsMutex > & mutualExcusionGuard )
79 {
80  while ( baseNMIU * pNetIO = this->eventq.first () ) {
81  bool success = this->cacCtx.destroyIO ( callbackGuard, mutualExcusionGuard,
82  pNetIO->getId (), *this );
83  assert ( success );
84  }
85 
86  // if the claim reply has not returned yet then we will issue
87  // the clear channel request to the server when the claim reply
88  // arrives and there is no matching nciu in the client
89  if ( this->channelNode::isInstalledInServer ( mutualExcusionGuard ) ) {
90  this->getPIIU(mutualExcusionGuard)->clearChannelRequest (
91  mutualExcusionGuard, this->sid, this->id );
92  }
93  this->piiu->uninstallChan ( mutualExcusionGuard, *this );
94  this->cacCtx.destroyChannel ( mutualExcusionGuard, *this );
95 }
96 
97 void nciu::operator delete ( void * )
98 {
99  // Visual C++ .net appears to require operator delete if
100  // placement operator delete is defined? I smell a ms rat
101  // because if I declare placement new and delete, but
102  // comment out the placement delete definition there are
103  // no undefined symbols.
104  errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
105  __FILE__, __LINE__ );
106 }
107 
108 void nciu::initiateConnect (
109  epicsGuard < epicsMutex > & guard )
110 {
111  this->cacCtx.initiateConnect ( guard, *this, this->piiu );
112 }
113 
114 void nciu::connect ( unsigned nativeType,
115  unsigned nativeCount, unsigned sidIn,
116  epicsGuard < epicsMutex > & /* cbGuard */,
117  epicsGuard < epicsMutex > & guard )
118 {
119  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
120  if ( ! dbf_type_is_valid ( nativeType ) ) {
121  throw std::logic_error ( "Ignored conn resp with bad native data type" );
122  }
123 
124  this->typeCode = static_cast < unsigned short > ( nativeType );
125  this->count = nativeCount;
126  this->sid = sidIn;
127 
128  /*
129  * if less than v4.1 then the server will never
130  * send access rights and there will always be access
131  */
132  bool v41Ok = this->piiu->ca_v41_ok ( guard );
133  if ( ! v41Ok ) {
134  this->accessRightState.setReadPermit();
135  this->accessRightState.setWritePermit();
136  }
137 
138  /*
139  * if less than v4.1 then the server will never
140  * send access rights and we know that there
141  * will always be access and also need to call
142  * their call back here
143  */
144  if ( ! v41Ok ) {
145  this->notify().accessRightsNotify (
146  guard, this->accessRightState );
147  }
148 
149  // channel uninstal routine grabs the callback lock so
150  // a channel will not be deleted while a call back is
151  // in progress
152  //
153  // the callback lock is also taken when a channel
154  // disconnects to prevent a race condition with the
155  // code below - ie we hold the callback lock here
156  // so a chanel cant be destroyed out from under us.
157  this->notify().connectNotify ( guard );
158 }
159 
161  epicsGuard < epicsMutex > & cbGuard,
162  epicsGuard < epicsMutex > & guard )
163 {
164  ioid tmpId = this->getId ();
165  cac & caRefTmp = this->cacCtx;
166  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
167  this->cacCtx.disconnectAllIO ( cbGuard, guard,
168  *this, this->eventq );
169  this->notify().disconnectNotify ( guard );
170  // if they destroy the channel in their disconnect
171  // handler then we have to be very careful to not
172  // touch this object if it has been destroyed
173  nciu * pChan = caRefTmp.lookupChannel ( guard, tmpId );
174  if ( pChan ) {
175  caAccessRights noRights;
176  pChan->notify().accessRightsNotify ( guard, noRights );
177  // likewise, they might destroy the channel in their access rights
178  // handler so we have to be very careful to not touch this
179  // object from here on down
180  }
181 }
182 
184  epicsGuard < epicsMutex > & guard )
185 {
186  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
187  this->piiu = & newiiu;
188  this->retry = 0;
189  this->typeCode = USHRT_MAX;
190  this->count = 0u;
191  this->sid = UINT_MAX;
192  this->accessRightState.clrReadPermit();
193  this->accessRightState.clrWritePermit();
194 }
195 
197  const caAccessRights & arIn, epicsGuard < epicsMutex > & /* cbGuard */,
198  epicsGuard < epicsMutex > & guard )
199 {
200  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
201  this->accessRightState = arIn;
202 
203  //
204  // the channel delete routine takes the call back lock so
205  // that this will not be called when the channel is being
206  // deleted.
207  //
208  this->notify().accessRightsNotify ( guard, this->accessRightState );
209 }
210 
211 /*
212  * nciu::searchMsg ()
213  */
215 {
216  bool success = this->piiu->searchMsg (
217  guard, this->getId (), this->pNameStr, this->nameLength );
218  if ( success ) {
219  if ( this->retry < UINT_MAX ) {
220  this->retry++;
221  }
222  }
223  return success;
224 }
225 
226 const char *nciu::pName (
227  epicsGuard < epicsMutex > & guard ) const throw ()
228 {
229  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
230  return this->pNameStr;
231 }
232 
233 unsigned nciu::getName (
235  char * pBuf, unsigned bufLen ) const throw ()
236 {
237  if ( bufLen == 0u ) {
238  return 0u;
239  }
240  if ( this->nameLength < bufLen ) {
241  strcpy ( pBuf, this->pNameStr );
242  return this->nameLength;
243  }
244  else {
245  unsigned reducedSize = bufLen - 1u;
246  strncpy ( pBuf, this->pNameStr, bufLen );
247  pBuf[reducedSize] = '\0';
248  return reducedSize;
249  }
250 }
251 
252 unsigned nciu::nameLen (
253  epicsGuard < epicsMutex > & guard ) const
254 {
255  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
256  return this->nameLength;
257 }
258 
259 unsigned nciu::requestMessageBytesPending (
260  epicsGuard < epicsMutex > & guard )
261 {
262  return piiu->requestMessageBytesPending ( guard );
263 }
264 
265 void nciu::flush (
266  epicsGuard < epicsMutex > & guard )
267 {
268  piiu->flush ( guard );
269 }
270 
271 cacChannel::ioStatus nciu::read (
273  unsigned type, arrayElementCount countIn,
274  cacReadNotify &notify, ioid *pId )
275 {
276  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
277 
278  if ( ! this->connected ( guard ) ) {
279  throw cacChannel::notConnected ();
280  }
281  if ( ! this->accessRightState.readPermit () ) {
282  throw cacChannel::noReadAccess ();
283  }
284  if ( countIn > this->count ) {
285  throw cacChannel::outOfBounds ();
286  }
287 
288  //
289  // fail out if their arguments are invalid
290  //
291  if ( INVALID_DB_REQ ( type ) ) {
292  throw cacChannel::badType ();
293  }
294 
295  netReadNotifyIO & io = this->cacCtx.readNotifyRequest (
296  guard, *this, *this, type, countIn, notify );
297  if ( pId ) {
298  *pId = io.getId ();
299  }
300  this->eventq.add ( io );
301  return cacChannel::iosAsynch;
302 }
303 
304 void nciu::stringVerify ( const char *pStr, const unsigned count )
305 {
306  for ( unsigned i = 0; i < count; i++ ) {
307  unsigned int strsize = 0;
308  while ( pStr[strsize++] != '\0' ) {
309  if ( strsize >= MAX_STRING_SIZE ) {
310  throw badString();
311  }
312  }
313  pStr += MAX_STRING_SIZE;
314  }
315 }
316 
317 void nciu::write (
319  unsigned type, arrayElementCount countIn, const void * pValue )
320 {
321  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
322 
323  // make sure that they get this and not "no write access"
324  // if disconnected
325  if ( ! this->connected ( guard ) ) {
326  throw cacChannel::notConnected();
327  }
328  if ( ! this->accessRightState.writePermit() ) {
330  }
331  if ( countIn > this->count || countIn == 0 ) {
332  throw cacChannel::outOfBounds();
333  }
334  if ( type == DBR_STRING ) {
335  nciu::stringVerify ( (char *) pValue, countIn );
336  }
337  this->piiu->writeRequest ( guard, *this, type, countIn, pValue );
338 }
339 
340 cacChannel::ioStatus nciu::write (
341  epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount countIn,
342  const void * pValue, cacWriteNotify & notify, ioid * pId )
343 {
344  // make sure that they get this and not "no write access"
345  // if disconnected
346  if ( ! this->connected ( guard ) ) {
347  throw cacChannel::notConnected();
348  }
349  if ( ! this->accessRightState.writePermit() ) {
351  }
352  if ( countIn > this->count || countIn == 0 ) {
353  throw cacChannel::outOfBounds();
354  }
355  if ( type == DBR_STRING ) {
356  nciu::stringVerify ( (char *) pValue, countIn );
357  }
358 
359  netWriteNotifyIO & io = this->cacCtx.writeNotifyRequest (
360  guard, *this, *this, type, countIn, pValue, notify );
361  if ( pId ) {
362  *pId = io.getId ();
363  }
364  this->eventq.add ( io );
365  return cacChannel::iosAsynch;
366 }
367 
368 void nciu::subscribe (
369  epicsGuard < epicsMutex > & guard, unsigned type,
370  arrayElementCount nElem, unsigned mask,
371  cacStateNotify & notify, ioid *pId )
372 {
373  netSubscription & io = this->cacCtx.subscriptionRequest (
374  guard, *this, *this, type, nElem, mask, notify,
375  this->channelNode::isInstalledInServer ( guard ) );
376  this->eventq.add ( io );
377  if ( pId ) {
378  *pId = io.getId ();
379  }
380 }
381 
382 void nciu::ioCancel (
383  CallbackGuard & callbackGuard,
384  epicsGuard < epicsMutex > & mutualExclusionGuard,
385  const ioid & idIn )
386 {
387  this->cacCtx.destroyIO ( callbackGuard,
388  mutualExclusionGuard, idIn, *this );
389 }
390 
391 void nciu::ioShow (
393  const ioid &idIn, unsigned level ) const
394 {
395  this->cacCtx.ioShow ( guard, idIn, level );
396 }
397 
400  char *pBuf, unsigned bufLength ) const throw ()
401 {
402  return this->piiu->getHostName (
403  guard, pBuf, bufLength );
404 }
405 
406 const char * nciu::pHostName (
407  epicsGuard < epicsMutex > & guard ) const throw ()
408 {
409  return this->piiu->pHostName ( guard );
410 }
411 
412 bool nciu::ca_v42_ok (
413  epicsGuard < epicsMutex > & guard ) const
414 {
415  return this->piiu->ca_v42_ok ( guard );
416 }
417 
418 short nciu::nativeType (
419  epicsGuard < epicsMutex > & guard ) const
420 {
421  short type = TYPENOTCONN;
422  if ( this->connected ( guard ) ) {
423  if ( this->typeCode < SHRT_MAX ) {
424  type = static_cast <short> ( this->typeCode );
425  }
426  }
427  return type;
428 }
429 
430 arrayElementCount nciu::nativeElementCount (
431  epicsGuard < epicsMutex > & guard ) const
432 {
433  arrayElementCount countOut = 0ul;
434  if ( this->connected ( guard ) ) {
435  countOut = this->count;
436  }
437  return countOut;
438 }
439 
440 caAccessRights nciu::accessRights (
441  epicsGuard < epicsMutex > & guard ) const
442 {
443  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
444  return this->accessRightState;
445 }
446 
447 unsigned nciu::searchAttempts (
448  epicsGuard < epicsMutex > & guard ) const
449 {
450  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
451  return this->retry;
452 }
453 
454 double nciu::beaconPeriod (
455  epicsGuard < epicsMutex > & guard ) const
456 {
457  return this->cacCtx.beaconPeriod ( guard, *this );
458 }
459 
460 double nciu::receiveWatchdogDelay (
461  epicsGuard < epicsMutex > & guard ) const
462 {
463  return this->piiu->receiveWatchdogDelay ( guard );
464 }
465 
467 {
468  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
469  return this->channelNode::isConnected ( guard );
470 }
471 
472 void nciu::show ( unsigned level ) const
473 {
474  epicsGuard < epicsMutex > guard ( this->cacCtx.mutexRef() );
475  this->show ( guard, level );
476 }
477 
479  epicsGuard < epicsMutex > & guard, unsigned level ) const
480 {
481  if ( this->connected ( guard ) ) {
482  char hostNameTmp [256];
483  this->getHostName ( guard, hostNameTmp, sizeof ( hostNameTmp ) );
484  ::printf ( "Channel \"%s\", connected to server %s",
485  this->pNameStr, hostNameTmp );
486  if ( level > 1u ) {
487  int tmpTypeCode = static_cast < int > ( this->typeCode );
488  ::printf ( ", native type %s, native element count %u",
489  dbf_type_to_text ( tmpTypeCode ), this->count );
490  ::printf ( ", %sread access, %swrite access",
491  this->accessRightState.readPermit() ? "" : "no ",
492  this->accessRightState.writePermit() ? "" : "no ");
493  }
494  ::printf ( "\n" );
495  }
496  else {
497  ::printf ( "Channel \"%s\" is disconnected\n", this->pNameStr );
498  }
499 
500  if ( level > 2u ) {
501  ::printf ( "\tnetwork IO pointer = %p\n",
502  static_cast <void *> ( this->piiu ) );
503  ::printf ( "\tserver identifier %u\n", this->sid );
504  ::printf ( "\tsearch retry number=%u\n", this->retry );
505  ::printf ( "\tname length=%u\n", this->nameLength );
506  }
507 }
508 
509 void nciu::ioCompletionNotify (
510  epicsGuard < epicsMutex > &, class baseNMIU & io )
511 {
512  this->eventq.remove ( io );
513 }
514 
515 void nciu::resubscribe ( epicsGuard < epicsMutex > & guard )
516 {
517  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
518  tsDLIter < baseNMIU > pNetIO = this->eventq.firstIter ();
519  while ( pNetIO.valid () ) {
520  tsDLIter < baseNMIU > next = pNetIO;
521  next++;
522  class netSubscription * pSubscr = pNetIO->isSubscription ();
523  // Its normal for other types of IO to exist after the channel connects,
524  // but before all of the resubscription requests go out. We must ignore
525  // them here.
526  if ( pSubscr ) {
527  try {
528  pSubscr->subscribeIfRequired ( guard, *this );
529  }
530  catch ( ... ) {
531  errlogPrintf ( "CAC: failed to send subscription request "
532  "during channel connect\n" );
533  }
534  }
535  pNetIO = next;
536  }
537 }
538 
540 {
541  guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
542  tsDLIter < baseNMIU > pNetIO = this->eventq.firstIter ();
543  while ( pNetIO.valid () ) {
544  tsDLIter < baseNMIU > next = pNetIO;
545  next++;
546  try {
547  pNetIO->forceSubscriptionUpdate ( guard, *this );
548  }
549  catch ( ... ) {
550  errlogPrintf (
551  "CAC: failed to send subscription update request "
552  "during channel connect\n" );
553  }
554  pNetIO = next;
555  }
556 }
557 
559  epicsGuard < epicsMutex > & cbGuard,
560  epicsGuard < epicsMutex > & guard )
561 {
562  this->cacCtx.disconnectAllIO ( cbGuard, guard,
563  *this, this->eventq );
564 }
565 
567  epicsGuard < epicsMutex > & callbackControlGuard,
568  epicsGuard < epicsMutex > & mutualExclusionGuard )
569 {
570  this->setServerAddressUnknown ( noopIIU, mutualExclusionGuard );
571  this->notify().serviceShutdownNotify ( mutualExclusionGuard );
572 }
573 
574 void channelNode::setRespPendingState (
575  epicsGuard < epicsMutex > &, unsigned index )
576 {
577  this->listMember =
578  static_cast < channelNode::channelState >
579  ( channelNode::cs_searchRespPending0 + index );
580  if ( this->listMember > cs_searchRespPending17 ) {
581  throw std::runtime_error (
582  "resp search timer index out of bounds" );
583  }
584 }
585 
586 void channelNode::setReqPendingState (
587  epicsGuard < epicsMutex > &, unsigned index )
588 {
589  this->listMember =
590  static_cast < channelNode::channelState >
591  ( channelNode::cs_searchReqPending0 + index );
592  if ( this->listMember > cs_searchReqPending17 ) {
593  throw std::runtime_error (
594  "req search timer index out of bounds" );
595  }
596 }
597 
599 {
600  return epicsMin (
601  cs_searchReqPending17 - cs_searchReqPending0,
602  cs_searchRespPending17 - cs_searchRespPending0 ) + 1u;
603 }
604 
605 unsigned channelNode::getSearchTimerIndex (
607 {
608  channelNode::channelState chanState = this->listMember;
609  unsigned index = 0u;
610  if ( chanState >= cs_searchReqPending0 &&
611  chanState <= cs_searchReqPending17 ) {
612  index = chanState - cs_searchReqPending0;
613  }
614  else if ( chanState >= cs_searchRespPending0 &&
615  chanState <= cs_searchRespPending17 ) {
616  index = chanState - cs_searchRespPending0;
617  }
618  else {
619  throw std::runtime_error (
620  "channel was expected to be in a search timer, but wasnt" );;
621  }
622  return index;
623 }
624 
virtual void connectNotify(epicsGuard< epicsMutex > &)=0
virtual bool ca_v42_ok(epicsGuard< epicsMutex > &) const =0
Definition: netiiu.cpp:37
#define DBR_STRING
Definition: db_access.h:69
void sendSubscriptionUpdateRequests(epicsGuard< epicsMutex > &)
Definition: nciu.cpp:539
Definition: cac.h:97
bool searchMsg(epicsGuard< epicsMutex > &)
Definition: nciu.cpp:214
void setReadPermit()
Definition: cacIO.h:338
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
unsigned nameLen(epicsGuard< epicsMutex > &) const
Definition: nciu.cpp:252
void add(T &item)
Definition: tsDLList.h:313
#define dbf_type_to_text(type)
Definition: db_access.h:677
void setServerAddressUnknown(netiiu &newiiu, epicsGuard< epicsMutex > &guard)
Definition: nciu.cpp:183
bool connected(epicsGuard< epicsMutex > &) const
Definition: nciu.cpp:466
int i
Definition: scan.c:967
void subscribeIfRequired(epicsGuard< epicsMutex > &guard, nciu &chan)
virtual void disconnectNotify(epicsGuard< epicsMutex > &)=0
unsigned getHostName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const
Definition: nciu.cpp:398
Definition: netIO.h:44
void connect(unsigned nativeType, unsigned nativeCount, unsigned sid, epicsGuard< epicsMutex > &cbGuard, epicsGuard< epicsMutex > &guard)
Definition: nciu.cpp:114
tsDLIterConst< T > firstIter() const
Definition: tsDLList.h:459
virtual void accessRightsNotify(epicsGuard< epicsMutex > &, const caAccessRights &)=0
void unresponsiveCircuitNotify(epicsGuard< epicsMutex > &cbGuard, epicsGuard< epicsMutex > &guard)
Definition: nciu.cpp:160
const char * pName(epicsGuard< epicsMutex > &) const
Definition: nciu.cpp:226
#define printf
Definition: epicsStdio.h:41
bool writePermit() const
Definition: cacIO.h:373
void ioShow(epicsGuard< epicsMutex > &guard, const cacChannel::ioid &id, unsigned level) const
Definition: cac.cpp:756
pvd::StructureConstPtr type
~nciu()
Definition: nciu.cpp:69
#define INVALID_DB_REQ(x)
Definition: db_access.h:115
void serviceShutdownNotify(epicsGuard< epicsMutex > &callbackControlGuard, epicsGuard< epicsMutex > &mutualExclusionGuard)
Definition: nciu.cpp:566
void assertIdenticalMutex(const T &) const
Definition: epicsGuard.h:80
nciu(cac &, netiiu &, cacChannelNotify &, const char *pNameIn, cacChannel::priLev)
Definition: nciu.cpp:40
unsigned priLev
Definition: cacIO.h:165
bool valid() const
Definition: tsDLList.h:607
virtual void flush(epicsGuard< epicsMutex > &mutualExclusionGuard)=0
Definition: netiiu.cpp:137
virtual unsigned getHostName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLength) const =0
Definition: netiiu.cpp:93
virtual bool ca_v41_ok(epicsGuard< epicsMutex > &) const =0
Definition: netiiu.cpp:43
virtual void forceSubscriptionUpdate(epicsGuard< epicsMutex > &guard, nciu &chan)=0
Definition: baseNMIU.cpp:31
static unsigned getMaxSearchTimerCount()
Definition: nciu.cpp:598
nciu * lookupChannel(epicsGuard< epicsMutex > &, const cacChannel::ioid &)
Definition: cac.h:400
unsigned ioid
Definition: cacIO.h:173
void setWritePermit()
Definition: cacIO.h:343
netiiu * getPIIU(epicsGuard< epicsMutex > &)
Definition: nciu.h:321
unsigned getName(epicsGuard< epicsMutex > &, char *pBuf, unsigned bufLen) const
Definition: nciu.cpp:233
const T & epicsMin(const T &a, const T &b)
void initiateConnect(epicsGuard< epicsMutex > &, nciu &, netiiu *&)
Definition: cac.cpp:1291
virtual void uninstallChan(epicsGuard< epicsMutex > &, nciu &)=0
Definition: netiiu.cpp:147
bool destroyIO(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const cacChannel::ioid &idIn, nciu &chan)
Definition: cac.cpp:734
void destroyChannel(epicsGuard< epicsMutex > &, nciu &)
Definition: cac.cpp:659
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
virtual const char * pHostName(epicsGuard< epicsMutex > &) const =0
Definition: netiiu.cpp:112
double beaconPeriod(epicsGuard< epicsMutex > &, const nciu &chan) const
Definition: cac.cpp:1273
bool readPermit() const
Definition: cacIO.h:368
virtual class netSubscription * isSubscription()=0
unsigned long arrayElementCount
Definition: cacIO.h:57
virtual void serviceShutdownNotify(epicsGuard< epicsMutex > &mutualExclusionGuard)=0
#define TYPENOTCONN
Definition: cadef.h:149
#define MAX_STRING_SIZE
Definition: epicsTypes.h:65
virtual bool searchMsg(epicsGuard< epicsMutex > &, ca_uint32_t id, const char *pName, unsigned nameLength)=0
Definition: netiiu.cpp:166
void disconnectAllIO(epicsGuard< epicsMutex > &, epicsGuard< epicsMutex > &)
Definition: nciu.cpp:558
void clrWritePermit()
Definition: cacIO.h:358
netSubscription & subscriptionRequest(epicsGuard< epicsMutex > &, nciu &, privateInterfaceForIO &, unsigned type, arrayElementCount nElem, unsigned mask, cacStateNotify &, bool channelIsInstalled)
Definition: cac.cpp:809
Contains a few templates out of the C++ standard header algorithm.
virtual void writeRequest(epicsGuard< epicsMutex > &, nciu &, unsigned type, arrayElementCount nElem, const void *pValue)=0
Definition: netiiu.cpp:49
void show(unsigned level) const
Definition: nciu.cpp:472
virtual unsigned requestMessageBytesPending(epicsGuard< epicsMutex > &mutualExclusionGuard)=0
Definition: netiiu.cpp:131
void remove(T &item)
Definition: tsDLList.h:219
#define dbf_type_is_valid(type)
Definition: db_access.h:643
bool isInstalledInServer(epicsGuard< epicsMutex > &) const
Definition: nciu.h:367
bool isConnected(epicsGuard< epicsMutex > &) const
Definition: nciu.h:359
unsigned char ca_uint8_t
Definition: caProto.h:74
void disconnectAllIO(epicsGuard< epicsMutex > &cbGuard, epicsGuard< epicsMutex > &guard, nciu &, tsDLList< baseNMIU > &ioList)
Definition: cac.cpp:674
void clrReadPermit()
Definition: cacIO.h:353
Definition: netiiu.h:37
virtual void clearChannelRequest(epicsGuard< epicsMutex > &, ca_uint32_t sid, ca_uint32_t cid)=0
Definition: netiiu.cpp:71
virtual double receiveWatchdogDelay(epicsGuard< epicsMutex > &) const =0
Definition: netiiu.cpp:153
netReadNotifyIO & readNotifyRequest(epicsGuard< epicsMutex > &, nciu &, privateInterfaceForIO &, unsigned type, arrayElementCount nElem, cacReadNotify &)
Definition: cac.cpp:721
T * first(void) const
Definition: tsDLList.h:190
epicsMutex & mutexRef()
Definition: cac.h:358
noopiiu noopIIU
Definition: noopiiu.cpp:28
Definition: nciu.h:127
#define MAX_UDP_SEND
Definition: caProto.h:62
void accessRightsStateChange(const caAccessRights &, epicsGuard< epicsMutex > &cbGuard, epicsGuard< epicsMutex > &guard)
Definition: nciu.cpp:196
netWriteNotifyIO & writeNotifyRequest(epicsGuard< epicsMutex > &, nciu &, privateInterfaceForIO &, unsigned type, arrayElementCount nElem, const void *pValue, cacWriteNotify &)
Definition: cac.cpp:707
cacChannelNotify & notify() const
Definition: cacIO.h:328