use ipAddrToA

This commit is contained in:
Jeff Hill
1998-06-18 00:15:03 +00:00
parent be88672134
commit c5cd953aba
9 changed files with 63 additions and 35 deletions

View File

@@ -47,6 +47,9 @@
/* address in use so that test works on UNIX */
/* kernels that support multicast */
/* $Log$
* Revision 1.79 1998/06/17 00:39:05 jhill
* fixed problem where beta 12 briefly didnt communicate with old CA repeaters
*
* Revision 1.78 1998/06/16 01:16:09 jhill
* allow saturated clients to poll/use new consolodated IP address routines in libCom/clean up when a server and client delete the PV simultaneously
*
@@ -1360,11 +1363,12 @@ LOCAL void ca_process_udp(struct ioc_in_use *piiu)
(char *)(pmsglog+1),
pmsglog->nbytes);
if(status != OK || piiu->curMsgBytes){
ca_printf(
"%s: bad UDP msg from port=%d addr=%s\n",
__FILE__,
ntohs(pmsglog->addr.sin_port),
inet_ntoa(pmsglog->addr.sin_addr));
char buf[64];
ipAddrToA (&pmsglog->addr, buf, sizeof(buf));
ca_printf("%s: bad UDP msg from %s\n", __FILE__, buf);
/*
* resync the ring buffer
* (discard existing messages)
@@ -1954,12 +1958,13 @@ void caPrintAddrList(ELLLIST *pList)
printf("Channel Access Address List\n");
pNode = (caAddrNode *) ellFirst(pList);
while(pNode){
char buf[64];
if(pNode->destAddr.sa.sa_family != AF_INET){
printf("<addr entry not in internet format>");
continue;
}
printf( "%s\n",
inet_ntoa(pNode->destAddr.in.sin_addr));
ipAddrToA (&pNode->destAddr.in, buf, sizeof(buf));
printf( "%s\n", buf);
pNode = (caAddrNode *) ellNext(&pNode->node);
}

View File

@@ -181,9 +181,12 @@ caStatus casDGIntfIO::init(const caNetAddr &addr, unsigned connectWithThisPortIn
(struct sockaddr *)&serverAddr,
sizeof (serverAddr));
if (status<0) {
char buf[64];
ipAddrToA (&serverAddr, buf, sizeof(buf));
errPrintf(S_cas_bindFail,
__FILE__, __LINE__, "- bind UDP IP addr=%s port=%u failed because %s",
inet_ntoa(serverAddr.sin_addr), (unsigned) this->dgPort, SOCKERRSTR);
__FILE__, __LINE__, "- bind UDP IP addr=%s failed because %s",
buf, SOCKERRSTR);
return S_cas_bindFail;
}

View File

@@ -6,6 +6,9 @@
//
//
// $Log$
// Revision 1.6 1998/06/16 02:35:51 jhill
// use aToIPAddr and auto attach to winsock if its a static build
//
// Revision 1.5 1998/05/29 20:08:21 jhill
// use new sock ioctl() typedef
//
@@ -99,12 +102,12 @@ caStatus casIntfIO::init(const caNetAddr &addrIn, casDGClient &dgClientIn,
sizeof(this->addr));
}
if (status<0) {
char buf[64];
ipAddrToA (&this->addr, buf, sizeof(buf));
errPrintf(S_cas_bindFail,
__FILE__, __LINE__,
"- bind TCP IP addr=%s port=%u failed because %s",
inet_ntoa(this->addr.sin_addr),
ntohs(this->addr.sin_port),
SOCKERRSTR);
"- bind TCP IP addr=%s failed because %s",
buf, SOCKERRSTR);
return S_cas_bindFail;
}
}

View File

@@ -12,6 +12,9 @@ of this distribution.
**********************************************************************/
/*
* $Log$
* Revision 1.25 1998/06/16 03:20:35 jhill
* use aToIPAddr()
*
* Revision 1.24 1998/06/04 19:21:14 wlupton
* changed to use symFindByNameEPICS
*
@@ -331,6 +334,8 @@ unsigned long TSepochEpicsToUnix(struct timespec* ts)
*/
long TSreport()
{
char buf[64];
switch(TSdata.type)
{
case TS_direct_master: TSprintf("Direct timing master\n"); break;
@@ -362,10 +367,10 @@ long TSreport()
TSprintf("Total events supported = %d\n",TSdata.total_events);
TSprintf("Request Time Out = %lu milliseconds\n",TSdata.time_out);
TSprintf("Broadcast address: %s\n",
inet_ntoa(((struct sockaddr_in*)&TSdata.hunt)->sin_addr));
TSprintf("Master address: %s\n",
inet_ntoa(((struct sockaddr_in*)&TSdata.master)->sin_addr));
ipAddrToA ((struct sockaddr_in*)&TSdata.hunt, buf, sizeof(buf));
TSprintf("Broadcast address: %s\n", buf);
ipAddrToA ((struct sockaddr_in*)&TSdata.master, buf, sizeof(buf));
TSprintf("Master address: %s\n", buf);
if(TSdata.UserRequestedType)
TSprintf("\nForced to not use the event system\n");

View File

@@ -33,6 +33,9 @@
* .01 joh 081591 Added epics env config
* .02 joh 011995 Allow stdio also
* $Log$
* Revision 1.18 1998/02/06 00:51:42 jhill
* deleted extra include of assert.h
*
* Revision 1.17 1998/01/20 21:29:13 mrk
* Change for new errlog implementation
*
@@ -73,6 +76,7 @@
#include "errlog.h"
#include "envDefs.h"
#include "task_params.h"
#include "bsdSocketResource.h"
#ifndef LOCAL
#define LOCAL static
@@ -224,11 +228,11 @@ LOCAL int iocLogAttach(void)
if (iocLogTries==0U && iocLogFD==ERROR) {
char name[INET_ADDR_LEN];
inet_ntoa_b(addr.sin_addr, name);
ipAddrToA (&addr, name, sizeof(name));
printf(
"iocLogClient: unable to connect to %s port %d because \"%s\"\n",
"iocLogClient: unable to connect to %s because \"%s\"\n",
name,
addr.sin_port,
strerror(errno));
}
iocLogTries++;

View File

@@ -64,6 +64,7 @@ static char *sccsId = "@(#) $Id$";
#include "task_params.h"
#include "db_access.h"
#include "server.h"
#include "bsdSocketResource.h"
/*
@@ -204,6 +205,7 @@ FAST int sock;
}
if(CASDEBUG>0){
char buf[64];
logMsg( "CAS: Recieved connection request\n",
NULL,
NULL,
@@ -211,9 +213,10 @@ FAST int sock;
NULL,
NULL,
NULL);
logMsg( "from addr %s, port %d \n",
(int) inet_ntoa (client->addr.sin_addr),
ntohs (client->addr.sin_port),
ipAddrToA (&client->addr, buf, sizeof(buf));
logMsg( "from addr %s\n",
(int) /* sic */ buf,
NULL,
NULL,
NULL,
NULL,

View File

@@ -55,7 +55,7 @@ static char *sccsId = "@(#) $Id$";
#include <inetLib.h>
#include "server.h"
#include "bsdSocketResource.h"
/*
@@ -149,8 +149,7 @@ int lock_needed;
int anerrno;
char buf[64];
buf[0u] = '\0';
inet_ntoa_b(pclient->addr.sin_addr, buf);
ipAddrToA (&pclient->addr, buf, sizeof(buf));
anerrno = errnoGet();

View File

@@ -82,6 +82,7 @@ static char *sccsId = "@(#) $Id$";
#include "envDefs.h"
#include "freeList.h"
#include "server.h"
#include "bsdSocketResource.h"
LOCAL void clean_addrq();
@@ -202,7 +203,7 @@ int cast_server(void)
NULL);
if(status==ERROR){
logMsg("CAS: couldnt start up online notify task because \"%s\"\n",
strerror(errnoGet()),
(int) /* sic */ strerror(errnoGet()),
NULL,
NULL,
NULL,
@@ -277,11 +278,11 @@ int cast_server(void)
NULL,
NULL,
NULL);
inet_ntoa_b (prsrv_cast_client->addr.sin_addr,
buf);
logMsg( "CAS: from addr %s, port %d \n",
ipAddrToA (&prsrv_cast_client->addr, buf, sizeof(buf));
logMsg( "CAS: from addr %s \n",
(int)buf,
ntohs(prsrv_cast_client->addr.sin_port),
NULL,
NULL,
NULL,
NULL,

View File

@@ -12,6 +12,9 @@ of this distribution.
**********************************************************************/
/*
* $Log$
* Revision 1.25 1998/06/16 03:20:35 jhill
* use aToIPAddr()
*
* Revision 1.24 1998/06/04 19:21:14 wlupton
* changed to use symFindByNameEPICS
*
@@ -331,6 +334,8 @@ unsigned long TSepochEpicsToUnix(struct timespec* ts)
*/
long TSreport()
{
char buf[64];
switch(TSdata.type)
{
case TS_direct_master: TSprintf("Direct timing master\n"); break;
@@ -362,10 +367,10 @@ long TSreport()
TSprintf("Total events supported = %d\n",TSdata.total_events);
TSprintf("Request Time Out = %lu milliseconds\n",TSdata.time_out);
TSprintf("Broadcast address: %s\n",
inet_ntoa(((struct sockaddr_in*)&TSdata.hunt)->sin_addr));
TSprintf("Master address: %s\n",
inet_ntoa(((struct sockaddr_in*)&TSdata.master)->sin_addr));
ipAddrToA ((struct sockaddr_in*)&TSdata.hunt, buf, sizeof(buf));
TSprintf("Broadcast address: %s\n", buf);
ipAddrToA ((struct sockaddr_in*)&TSdata.master, buf, sizeof(buf));
TSprintf("Master address: %s\n", buf);
if(TSdata.UserRequestedType)
TSprintf("\nForced to not use the event system\n");