function prototype changes
This commit is contained in:
+35
-29
@@ -46,7 +46,10 @@
|
||||
/* 021794 joh turn on SO_REUSEADDR only after the test for */
|
||||
/* address in use so that test works on UNIX */
|
||||
/* kernels that support multicast */
|
||||
/* $Log$ */
|
||||
/* $Log$
|
||||
* Revision 1.60 1995/11/29 19:26:01 jhill
|
||||
* cleaned up interface to recv() and send()
|
||||
* */
|
||||
/* */
|
||||
/*_begin */
|
||||
/************************************************************************/
|
||||
@@ -84,6 +87,7 @@ LOCAL void ca_process_tcp(struct ioc_in_use *piiu);
|
||||
LOCAL void ca_process_udp(struct ioc_in_use *piiu);
|
||||
LOCAL void cacRingBufferInit(struct ca_buffer *pBuf, unsigned long size);
|
||||
LOCAL char *getToken(char **ppString);
|
||||
LOCAL void close_ioc (IIU *piiu);
|
||||
|
||||
|
||||
|
||||
@@ -158,7 +162,9 @@ int net_proto
|
||||
int status;
|
||||
SOCKET sock;
|
||||
int true = TRUE;
|
||||
#if 0
|
||||
struct sockaddr_in saddr;
|
||||
#endif
|
||||
caAddrNode *pNode;
|
||||
|
||||
LOCK;
|
||||
@@ -193,9 +199,9 @@ int net_proto
|
||||
return ECA_ALLOCMEM;
|
||||
}
|
||||
memset((char *)&pNode->destAddr,0,sizeof(pNode->destAddr));
|
||||
pNode->destAddr.inetAddr.sin_family = AF_INET;
|
||||
pNode->destAddr.inetAddr.sin_addr = *pnet_addr;
|
||||
pNode->destAddr.inetAddr.sin_port = htons (port);
|
||||
pNode->destAddr.in.sin_family = AF_INET;
|
||||
pNode->destAddr.in.sin_addr = *pnet_addr;
|
||||
pNode->destAddr.in.sin_port = htons (port);
|
||||
ellAdd(&piiu->destAddr, &pNode->node);
|
||||
piiu->recvBytes = tcp_recv_msg;
|
||||
piiu->sendBytes = cac_tcp_send_msg_piiu;
|
||||
@@ -326,8 +332,8 @@ int net_proto
|
||||
/* connect */
|
||||
status = connect(
|
||||
sock,
|
||||
&pNode->destAddr.sockAddr,
|
||||
sizeof(pNode->destAddr.sockAddr));
|
||||
&pNode->destAddr.sa,
|
||||
sizeof(pNode->destAddr.sa));
|
||||
if(status < 0){
|
||||
ca_printf("CAC: no conn err=\"%s\"\n", strerror(MYERRNO));
|
||||
status = socket_close(sock);
|
||||
@@ -396,6 +402,7 @@ int net_proto
|
||||
return ECA_CONN;
|
||||
}
|
||||
|
||||
#if 0
|
||||
memset((char *)&saddr,0,sizeof(saddr));
|
||||
saddr.sin_family = AF_INET;
|
||||
/*
|
||||
@@ -411,6 +418,7 @@ int net_proto
|
||||
ca_printf("CAC: bind (err=%s)\n",strerror(MYERRNO));
|
||||
ca_signal(ECA_INTERNAL,"bind failed");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* load user and auto configured
|
||||
@@ -672,8 +680,8 @@ LOCAL void cac_udp_send_msg_piiu(struct ioc_in_use *piiu)
|
||||
&piiu->send.buf[piiu->send.rdix],
|
||||
(int) sendCnt,
|
||||
0,
|
||||
&pNode->destAddr.sockAddr,
|
||||
sizeof(pNode->destAddr.sockAddr));
|
||||
&pNode->destAddr.sa,
|
||||
sizeof(pNode->destAddr.sa));
|
||||
if(status>=0){
|
||||
actualSendCnt = (unsigned long) status;
|
||||
assert (actualSendCnt == sendCnt);
|
||||
@@ -985,7 +993,7 @@ LOCAL void ca_process_tcp(struct ioc_in_use *piiu)
|
||||
/* post message to the user */
|
||||
status = post_msg(
|
||||
piiu,
|
||||
&pNode->destAddr.inetAddr.sin_addr,
|
||||
&pNode->destAddr.in.sin_addr,
|
||||
&piiu->recv.buf[piiu->recv.rdix],
|
||||
bytesToProcess);
|
||||
if(status != OK){
|
||||
@@ -1184,7 +1192,7 @@ LOCAL void ca_process_udp(struct ioc_in_use *piiu)
|
||||
*
|
||||
*
|
||||
*/
|
||||
void close_ioc (struct ioc_in_use *piiu)
|
||||
LOCAL void close_ioc (IIU *piiu)
|
||||
{
|
||||
caAddrNode *pNode;
|
||||
chid chix;
|
||||
@@ -1216,7 +1224,7 @@ void close_ioc (struct ioc_in_use *piiu)
|
||||
*/
|
||||
pNode = (caAddrNode *) piiu->destAddr.node.next;
|
||||
assert (pNode);
|
||||
removeBeaconInetAddr (&pNode->destAddr.inetAddr.sin_addr);
|
||||
removeBeaconInetAddr (&pNode->destAddr.in.sin_addr);
|
||||
|
||||
/*
|
||||
* Mark all of their channels disconnected
|
||||
@@ -1618,13 +1626,13 @@ char *localHostName()
|
||||
void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
|
||||
SOCKET socket, int port)
|
||||
{
|
||||
caAddrNode *pNode;
|
||||
ENV_PARAM list;
|
||||
char *pStr;
|
||||
char *pToken;
|
||||
union caAddr addr;
|
||||
union caAddr localAddr;
|
||||
int status;
|
||||
caAddrNode *pNode;
|
||||
ENV_PARAM list;
|
||||
char *pStr;
|
||||
char *pToken;
|
||||
caAddr addr;
|
||||
caAddr localAddr;
|
||||
int status;
|
||||
|
||||
pStr = envGetConfigParam(
|
||||
pEnv,
|
||||
@@ -1637,17 +1645,17 @@ void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
|
||||
/*
|
||||
* obtain a local address
|
||||
*/
|
||||
status = local_addr(socket, &localAddr.inetAddr);
|
||||
status = local_addr(socket, &localAddr.in);
|
||||
if(status){
|
||||
return;
|
||||
}
|
||||
|
||||
while(pToken = getToken(&pStr)){
|
||||
memset((char *)&addr,0,sizeof(addr));
|
||||
addr.inetAddr.sin_family = AF_INET;
|
||||
addr.inetAddr.sin_port = htons(port);
|
||||
addr.inetAddr.sin_addr.s_addr = inet_addr(pToken);
|
||||
if(addr.inetAddr.sin_addr.s_addr == -1){
|
||||
addr.in.sin_family = AF_INET;
|
||||
addr.in.sin_port = htons(port);
|
||||
addr.in.sin_addr.s_addr = inet_addr(pToken);
|
||||
if(addr.in.sin_addr.s_addr == -1){
|
||||
ca_printf(
|
||||
"%s: Parsing '%s'\n",
|
||||
__FILE__,
|
||||
@@ -1660,11 +1668,9 @@ void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
|
||||
|
||||
pNode = (caAddrNode *) calloc(1,sizeof(*pNode));
|
||||
if(pNode){
|
||||
pNode->destAddr.inetAddr = addr.inetAddr;
|
||||
pNode->srcAddr.inetAddr = localAddr.inetAddr;
|
||||
LOCK;
|
||||
pNode->destAddr.in = addr.in;
|
||||
pNode->srcAddr.in = localAddr.in;
|
||||
ellAdd(pList, &pNode->node);
|
||||
UNLOCK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1719,12 +1725,12 @@ void caPrintAddrList(ELLLIST *pList)
|
||||
printf("Channel Access Address List\n");
|
||||
pNode = (caAddrNode *) ellFirst(pList);
|
||||
while(pNode){
|
||||
if(pNode->destAddr.sockAddr.sa_family != AF_INET){
|
||||
if(pNode->destAddr.sa.sa_family != AF_INET){
|
||||
printf("<addr entry not in internet format>");
|
||||
continue;
|
||||
}
|
||||
printf( "%s\n",
|
||||
inet_ntoa(pNode->destAddr.inetAddr.sin_addr));
|
||||
inet_ntoa(pNode->destAddr.in.sin_addr));
|
||||
|
||||
pNode = (caAddrNode *) ellNext(&pNode->node);
|
||||
}
|
||||
|
||||
+3
-1
@@ -32,6 +32,9 @@
|
||||
/************************************************************************/
|
||||
|
||||
/* $Log$
|
||||
* Revision 1.50 1995/10/18 16:45:40 jhill
|
||||
* Use recast delay greater than one vxWorks tick
|
||||
*
|
||||
* Revision 1.49 1995/10/12 01:33:12 jhill
|
||||
* Initial delay between search frames went from .1 to .01 sec,
|
||||
* Added flush pending flag, Make all usage of port be unsigned short.
|
||||
@@ -603,7 +606,6 @@ void freeBeaconHash(struct ca_static *ca_temp);
|
||||
void removeBeaconInetAddr(const struct in_addr *pnet_addr);
|
||||
bhe *lookupBeaconInetAddr(const struct in_addr *pnet_addr);
|
||||
bhe *createBeaconHashEntry(const struct in_addr *pnet_addr);
|
||||
void close_ioc(IIU *piiu);
|
||||
void notify_ca_repeater(void);
|
||||
void cac_clean_iiu_list(void);
|
||||
|
||||
|
||||
+1
-1
@@ -795,7 +795,7 @@ const struct in_addr *pnet_addr
|
||||
|
||||
pNode = (caAddrNode *) chpiiu->destAddr.node.next;
|
||||
assert(pNode);
|
||||
if (pNode->destAddr.inetAddr.sin_addr.s_addr !=
|
||||
if (pNode->destAddr.in.sin_addr.s_addr !=
|
||||
pnet_addr->s_addr) {
|
||||
|
||||
caHostFromInetAddr(pnet_addr,rej,sizeof(rej));
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.19 1995/11/29 19:15:42 jhill
|
||||
* added $Log$ to the header
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -279,10 +282,10 @@ void caDiscoverInterfaces(ELLLIST *pList, SOCKET socket, int port)
|
||||
return;
|
||||
}
|
||||
broadcast_addr(&bcast_addr);
|
||||
pNode->destAddr.inetAddr.sin_addr.s_addr = bcast_addr.s_addr; //broadcast addr
|
||||
pNode->destAddr.inetAddr.sin_port = htons(port);
|
||||
pNode->destAddr.inetAddr.sin_family = AF_INET;
|
||||
//pNode->srcAddr.inetAddr = 0 ;//localAddr;
|
||||
pNode->destAddr.in.sin_addr.s_addr = bcast_addr.s_addr; //broadcast addr
|
||||
pNode->destAddr.in.sin_port = htons(port);
|
||||
pNode->destAddr.in.sin_family = AF_INET;
|
||||
//pNode->srcAddr.in = 0 ;//localAddr;
|
||||
|
||||
/*
|
||||
* LOCK applied externally
|
||||
|
||||
Reference in New Issue
Block a user