27 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 33 dnsTransaction ( engine.createTransaction() ), nameLength ( 0 )
36 hostNameBuf[
sizeof ( hostNameBuf ) - 1 ] =
'\0';
37 nameLength = strlen ( hostNameBuf );
48 this->dnsTransaction.
release ();
58 size_t newNameLen = strlen ( pHostNameIn );
59 if ( newNameLen >
sizeof ( this->hostNameBuf ) - 1u ) {
60 newNameLen =
sizeof ( this->hostNameBuf ) - 1u;
62 strncpy ( this->hostNameBuf,
"",
sizeof ( this->hostNameBuf ) );
63 strncpy ( this->hostNameBuf, pHostNameIn,
sizeof ( this->hostNameBuf ) - 1 );
64 this->nameLength = newNameLen;
68 char * pBuf,
unsigned bufSize )
const 70 if ( bufSize == 0u ) {
74 if ( this->nameLength > 0u ) {
75 if ( this->nameLength < bufSize ) {
76 strcpy ( pBuf, this->hostNameBuf );
77 return this->nameLength;
80 unsigned reducedSize = bufSize - 1u;
81 strncpy ( pBuf, this->hostNameBuf, reducedSize );
82 pBuf [ reducedSize ] =
'\0';
unsigned epicsStdCall sockAddrToDottedIP(const struct sockaddr *paddr, char *pBuf, unsigned bufSize)
virtual void ipAddrToAscii(const osiSockAddr &, ipAddrToAsciiCallBack &)=0
virtual osiSockAddr address() const =0
hostNameCache(const osiSockAddr &addr, ipAddrToAsciiEngine &engine)
void transactionComplete(const char *pHostName)
unsigned getName(char *pBuf, unsigned bufLength) const